summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/ltc3676.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: ltc3676: Use maple tree register cacheMark Brown2023-06-191-1/+1
| | | | | | | | | | | The ltc3676 can only support single register read and write operations so does not benefit from block writes. This means it gets no benefit from using the rbtree register cache over the maple tree register cache so convert it to use maple trees instead, it is more modern. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230609-regulator-ltc-maple-v1-2-08c15181f8b2@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-05-081-1/+1
| | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de Link: https://lore.kernel.org/r/20230505220218.1239542-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org
* regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14Douglas Anderson2023-03-201-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>
* regulator: remove locking around regulator_notifier_call_chain()Michał Mirosław2020-09-071-8/+2
| | | | | | | | | | | 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>
* regulator: ltc3676: Fix W=1 build warning when CONFIG_OF=nJisheng Zhang2020-08-211-1/+1
| | | | | | | | | | | | Fix below warning when CONFIG_OF=n: drivers/regulator/ltc3676.c:371:34: warning: ‘ltc3676_of_match’ defined but not used [-Wunused-const-variable=] 371 | static const struct of_device_id ltc3676_of_match[] = { | ^~~~~~~~~~~~~~~~ Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Link: https://lore.kernel.org/r/20200821111517.59d7b8c8@xhacker.debian Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: ltc3676: Constify ltc3676_regulatorsRikard Falkeborn2020-06-181-1/+1
| | | | | | | | | | | | | | | | | ltc3676_regulators is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 4361 2064 8 6433 1921 drivers/regulator/ltc3676.o After: text data bss dec hex filename 6121 304 8 6433 1921 drivers/regulator/ltc3676.o Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20200617223247.25566-4-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: Convert i2c drivers to use .probe_newAxel Lin2020-01-131-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>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174Thomas Gleixner2019-05-301-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* regulator: ltc3676: Fix notifier mutex lock warningSteve Twiss2019-03-131-2/+8
| | | | | | | | | | | | | | | | The mutex for the regulator_dev must be controlled by the caller of the regulator_notifier_call_chain(), as described in the comment for that function. Failure to mutex lock and unlock surrounding the notifier call results in a kernel WARN_ON_ONCE() which will dump a backtrace for the regulator_notifier_call_chain() when that function call is first made. The mutex can be controlled using the regulator_lock/unlock() API. Fixes: 37b918a034fe ("regulator: Add LTC3676 support") Suggested-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: ltc3676: Fix module descriptionAxel Lin2019-02-151-1/+1
| | | | | | | | This driver is for LTC3676 rather than LTC1376. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: ltc3676: Simplify .readable_reg and .writable_reg callbacksAxel Lin2019-02-151-58/+5
| | | | | | | | | | Use case range for continuous range to make the code shorter. The .readable_reg and .writable_reg implementation are exactly the same, so use a common ltc3676_readable_writeable_reg function instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regmap: split up regmap_config.use_single_rwDavid Frey2018-09-071-1/+2
| | | | | | | | | | | | | | | | Split regmap_config.use_single_rw into use_single_read and use_single_write. This change enables drivers of devices which only support bulk operations in one direction to use the regmap_bulk_*() functions for both directions and have their bulk operation split into single operations only when necessary. Update all struct regmap_config instances where use_single_rw==true to instead set both use_single_read and use_single_write. No attempt was made to evaluate whether it is possible to set only one of use_single_read or use_single_write. Signed-off-by: David Frey <dpfrey@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: ltc3676: Assure PGOOD mask is set before changing voltageMarek Vasut2018-05-021-1/+19
| | | | | | | | | | | | | | Make sure the DVBxB bit 5, PGOOD mask, is set before changing voltage on the buck converters. If the PGOOD mask bit is not set, the PMIC may deassert the PGOOD signal during the voltage transition. On systems that use the PGOOD signal as a power OK indication for the board or SoC, which should be the case on correct designs, deasserting the PGOOD signal will lead to system reset or shutdown, which is not the expected behavior when changing PMIC buck converter voltage. Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: ltc3676: Add OF device ID tableJavier Martinez Canillas2017-02-211-0/+7
| | | | | | | | | | | | | The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: ltc3676: constify regulator_ops structureBhumika Goyal2017-01-311-3/+3
| | | | | | | | | | | | | | | | | Declare regulator_ops structure as const as it is only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too. File size before: drivers/regulator/ltc3676.o text data bss dec hex filename 2369 2808 288 5465 1559 drivers/regulator/ltc3676.o File size after: drivers/regulator/ltc3676.o text data bss dec hex filename 3145 2296 8 5449 1549 drivers/regulator/ltc3676.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: Add LTC3676 supportTim Harvey2016-08-161-0/+420
This patch adds support for the Linear Technology LTC3676 8-output I2C voltage regulator IC. Cc: Jaffer Kapasi <jkapasi@linear.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Mark Brown <broonie@kernel.org>