aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator/da9210-regulator.c
AgeCommit message (Collapse)AuthorFilesLines
2023-03-20regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14Gravatar Douglas Anderson 1-0/+1
Probing of regulators can be a slow operation and can contribute to slower boot times. This is especially true if a regulator is turned on at probe time (with regulator-boot-on or regulator-always-on) and the regulator requires delays (off-on-time, ramp time, etc). While the overall kernel is not ready to switch to async probe by default, as per the discussion on the mailing lists [1] it is believed that the regulator subsystem is in good shape and we can move regulator drivers over wholesale. There is no way to just magically opt in all regulators (regulators are just normal drivers like platform_driver), so we set PROBE_PREFER_ASYNCHRONOUS for all regulators found in 'drivers/regulator' individually. Given the number of drivers touched and the impossibility to test this ahead of time, it wouldn't be shocking at all if this caused a regression for someone. If there is a regression caused by this patch, it's likely to be one of the cases talked about in [1]. As a "quick fix", drivers involved in the regression could be fixed by changing them to PROBE_FORCE_SYNCHRONOUS. That being said, the correct fix would be to directly fix the problem that caused the issue with async probe. The approach here follows a similar approach that was used for the mmc subsystem several years ago [2]. In fact, I ran nearly the same python script to auto-generate the changes. The only thing I changed was to search for "i2c_driver", "spmi_driver", and "spi_driver" in addition to "platform_driver". [1] https://lore.kernel.org/r/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk [2] https://lore.kernel.org/r/20200903232441.2694866-1-dianders@chromium.org/ Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20230316125351.1.I2a4677392a38db5758dee0788b2cea5872562a82@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07regulator: remove locking around regulator_notifier_call_chain()Gravatar Michał Mirosław 1-4/+0
regulator_notifier_call_chain() doesn't need rdev lock and rdev's existence is assumed in the code anyway. Remove the locks from drivers. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/42393f66dcc4d80dcd9797be45216b4035aa96cb.1597032945.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21regulator: da9210: Fix W=1 build warning when CONFIG_OF=nGravatar Jisheng Zhang 1-1/+1
Fix below warning when CONFIG_OF=n: drivers/regulator/da9210-regulator.c:128:34: warning: ‘da9210_dt_ids’ defined but not used [-Wunused-const-variable=] 128 | static const struct of_device_id da9210_dt_ids[] = { | ^~~~~~~~~~~~~ Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/20200821111235.14473a88@xhacker.debian Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-13regulator: Convert i2c drivers to use .probe_newGravatar Axel Lin 1-3/+2
Use the new .probe_new for i2c drivers. These drivers do not use const struct i2c_device_id * argument, so convert them to utilise the simplified i2c driver registration. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20200109155808.22003-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03regulator: da9xxx: Switch to SPDX identifierGravatar Axel Lin 1-19/+4
Convert Dialog Semiconductor DA9xxx regulator drivers to SPDX identifier. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-03regulator: da9210: Convert to use regulator_set/get_current_limit_regmapGravatar Axel Lin 1-46/+7
Use regulator_set/get_current_limit_regmap helpers to save some code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-19regulator: core: Use ww_mutex for regulators lockingGravatar Dmitry Osipenko 1-2/+2
Wait/wound mutex shall be used in order to avoid lockups on locking of coupled regulators. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Suggested-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-15regulator: da9210: addition of device tree supportGravatar Steve Twiss 1-2/+19
Addition of device tree support for DA9210. Two files are modified, the driver source file and the binding document. Updates for the regulator source file include an .of_match_table entry and node match checking in the probe() function for a compatible da9210 string. Minor binding documentation changes have been made to the title and the example. Tested-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-13Merge remote-tracking branches 'regulator/fix/ad5398', ↵Gravatar Mark Brown 1-0/+5
'regulator/fix/da9210', 'regulator/fix/max77802' and 'regulator/fix/pv88090' into regulator-linus
2016-01-15regulator: da9210: fix lockdep warningGravatar Wolfram Sang 1-0/+5
Commit 70cfef26267474 ("regulator: Add lockdep asserts to help detecting locking misuse") successfully created this WARN, let's fix it: [ 1.218660] WARNING: CPU: 0 PID: 553 at drivers/regulator/core.c:3646 regulator_notifier_call_chain+0x5c/0x88() ... [ 1.220278] [<c0246c20>] (regulator_notifier_call_chain) from [<c02498b4>] (da9210_irq_handler+0x74/0x10c) [ 1.220412] r7:c0080cac r6:eb1daa00 r5:e64bbf10 r4:00000002 [ 1.220547] [<c0249840>] (da9210_irq_handler) from [<c0080cd8>] (irq_thread_fn+0x2c/0x44) ... Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-22regulator: da9*: constify regulator_ops structuresGravatar Julia Lawall 1-1/+1
The regulator_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'regulator/topic/mt6311', ↵Gravatar Mark Brown 1-1/+0
'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next
2015-07-14regulator: drivers: Drop owner assignment from i2c_driverGravatar Krzysztof Kozlowski 1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-13regulator: da9210: Add optional interrupt supportGravatar Geert Uytterhoeven 1-0/+75
Add optional interrupt support to the da9210 regulator driver, to handle over-current, under- and over-voltage, and over-temperature events. Only the interrupt sources for which we handle events are unmasked, to avoid interrupts we cannot handle. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-17regulator: da9210: Mask all interrupt sources to deassert interrupt lineGravatar Geert Uytterhoeven 1-0/+9
After boot-up, some events may be set, and cause the da9210 interrupt line to be asserted. As the da9210 driver doesn't have interrupt support yet, this causes havoc on systems where the interrupt line is shared among multiple devices. This is the case on e.g. r8a7791/koelsch, where the interrupt line is shared with a da9063 regulator, and the following events are set: EVENT_A = 0x00000011 (GPI0 | GPI4) EVENT_B = 0x00000002 (NPWRGOOD) Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-26regulator: of: Add regulator desc param to of_get_regulator_init_data()Gravatar Javier Martinez Canillas 1-1/+1
The of_get_regulator_init_data() function is used to extract the regulator init_data but information on how to extract certain data is defined in the static regulator descriptor (e.g: how to map the hardware operating modes). Add a const struct regulator_desc * parameter to the function signature so the parsing logic could use the information in the struct regulator_desc. of_get_regulator_init_data() relies on of_get_regulation_constraints() to actually extract the init_data so it has to pass the struct regulator_desc but that is modified on a later patch. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-02-20regulator: da9210: Remove redundant error messageGravatar Sachin Kamat 1-4/+1
kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-30regulator: da9210: use devm_regulator_register()Gravatar Jingoo Han 1-9/+1
Use devm_regulator_register() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-26regulator: da9210: add Device Tree supportGravatar Guennadi Liakhovetski 1-3/+6
This patch adds basic Device Tree support to the da9210 regulator driver - with no special properties, since also driver's platform data only contains standard regulator initialisation parameters. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-13regulator: da9210: Remove redundant MODULE_ALIASGravatar Axel Lin 1-1/+0
The modalias is set by the MODULE_DEVICE_TABLE, thus remove redundant MODULE_ALIAS. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06regulator: da9210: New driverGravatar Steve Twiss 1-0/+197
I2C driver for the Dialog DA9210 Multi-phase 12A DC-DC Buck. Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: David Dajun Chen <david.chen@diasemi.com> Signed-off-by: Mark Brown <broonie@linaro.org>