aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/lp8788-buck.c
AgeCommit message (Collapse)Author
2024-03-06regulator: lp8788-buck: fix copy and paste bug in lp8788_dvs_gpio_request()Dan Carpenter
"gpio2" as intended here, not "gpio1". Fixes: 95daa868f22b ("regulator: lp8788-buck: Fully convert to GPIO descriptors") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://msgid.link/r/19f62cc2-bdcf-46f7-a5c5-971ef05e1ea7@moroto.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
2024-02-26regulator: lp8788-buck: Fully convert to GPIO descriptorsLinus Walleij
This converts the LP8788 BUCK regulator driver to use GPIO descriptors. BUCK1 can use one DVS GPIO and BUCK2 can use two DVS GPIOS, and no more so just hardcode two GPIO descriptors into the per-DVS state containers. Obtain the descriptors from each regulators subdevice. As there are no in-tree users, board files need to populate descriptor tables for the buck regulator devices when they want to use this driver. BUCK1 need a GPIO descriptor at index 0 and BUCK2 needs two GPIO descriptors at indices 0 and 1. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://msgid.link/r/20240220-descriptors-regulators-v1-3-097f608694be@linaro.org Acked-by: Lee Jones <lee@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14Douglas Anderson
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-05-08regulator: use linear_ranges helperMatti Vaittinen
Change the regulator helpers to use common linear_ranges code. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
Based on 2 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 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 # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-11regulator: lp8788-buck: Convert to linear rangeAxel Lin
linear range is suitable for this driver, let's convert it to linear range. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-28regulator: lp8788-buck: Constify lp8788_buck_descAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23regulator: lp8788: constify regulator_ops structuresJulia Lawall
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> Acked-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20regulator: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-09-30regulator: lp8788-buck: use devm_regulator_register()Jingoo Han
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-05-12regulator: Remove all platform_set_drvdata(pdev, NULL) in driversAxel Lin
Since 0998d06310 "device-core: Ensure drvdata = NULL when no driver is bound", this is done by driver core after device_release or on probe failure. Thus we can remove all platform_set_drvdata(pdev, NULL) in drivers. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-25regulator: lp8788-buck: Use regulator_map_voltage_ascendAxel Lin
All regulators have ascendant voltage list in this driver. Use regulator_map_voltage_ascend for them. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-17regulator: lp8788-buck: Remove buck[1|2]_vout_addr arrayAxel Lin
The vout address for buck[1|2] can be easily calculated, thus remote these arrays. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-10regulator: lp8788-buck: Silence build warningAxel Lin
This driver use id as array index, thus add bounder checking for id. This patch fixes below build warning: drivers/regulator/lp8788-buck.c: In function 'lp8788_buck_probe': drivers/regulator/lp8788-buck.c:490:8: warning: array subscript is above array bounds [-Warray-bounds] drivers/regulator/lp8788-buck.c:489:63: warning: array subscript is above array bounds [-Warray-bounds] Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-03lp8788-buck: fix a for-loop coding styleKim, Milo
Remove space before semicolon in for-loop. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-03lp8788-buck: fix a parent device on devm_gpio_request()Kim, Milo
Use 'platform_device' rather than i2c client device node. Arguments are added in lp8788_init_dvs() and lp8788_dvs_gpio_request(). Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-03lp8788-buck: fix a parent deivce in _probe()Kim, Milo
The lp8788-buck is a platform driver of lp8788-mfd. The platform device is allocated when mfd_add_devices() is called in lp8788-mfd. On the other hand, 'lp->dev' is the i2c client device. Therefore, this 'platform_device' is a proper parent device in case of resource managed mem alloc, registering a regulator and device kernel message. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10Merge remote-tracking branch 'regulator/topic/lp8788' into regulator-nextMark Brown
2012-12-10regulator: lp8788-buck: Kill _gpio_request functionAxel Lin
Simply use devm_gpio_request_one() instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20regulator: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20regulator: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-20regulator: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: Use BUCK_FPWM_[MASK|SHIFT] macros to replace buck_pmap tableAxel Lin
Below is the buck_pmap mapping table: BUCK1: mask = 1 << 0, shift = 0 BUCK2: mask = 1 << 1, shift = 1 BUCK3: mask = 1 << 2, shift = 2 BUCK4: mask = 1 << 3, shift = 3 The mask and shift can be easily calculated by: mask = 1 << BUCK_ID shift = BUCK_ID This patch defines BUCK_FPWM_MASK and BUCK_FPWM_SHIFT macros to replace buck_pmap mapping table. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode functionAxel Lin
We already know the mask in lp8788_init_dvs() function, and we can update the corresponding bit for default_dvs_mode in lp8788_init_dvs() function. This function looks not necessary to me. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-20regulator: add new lp8788 regulator driverKim, Milo
TI LP8788 PMU has 4 BUCKS and 22 LDOs. The voltage of BUCK1 and BUCK2 can be controlled by external gpios. And some LDOs also can be enabled by external gpios. The regmap interface is used for regulator operations. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>