summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/lp8788-ldo.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: lp8788: constify regulator_ops structuresJulia Lawall2015-12-231-2/+2
| | | | | | | | | | 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>
* regulator: lp8788-ldo: Use platform_register/unregister_drivers()Thierry Reding2015-12-021-9/+7Star
| | | | | | | | | These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: drop owner assignment from platform_driversWolfram Sang2014-10-201-2/+0Star
| | | | | | | 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>
* regulator: lp8788-ldo: use devm_regulator_register()Jingoo Han2013-09-301-22/+2Star
| | | | | | | | 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>
* regulator: Remove all platform_set_drvdata(pdev, NULL) in driversAxel Lin2013-05-121-2/+0Star
| | | | | | | | | 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>
* regulator: lp8788: Implement list_voltage for lp8788_ldo_voltage_fixed_opsAxel Lin2013-04-031-18/+9Star
| | | | | | | | | | | For fixed voltage, we can just set min_uV and use regulator_list_voltage_linear for list_voltage callback. Regulator core will call list_voltage(rdev, 0) if both get_voltage get_voltage_sel are not implemented. Thus we can also remove lp8788_ldo_fixed_get_voltage() function. 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>
* regulator: lp8788: Remove lp8788_dldo_id and lp8788_aldo_id arraysAxel Lin2013-04-031-30/+2Star
| | | | | | | | | | The id for DLDOx matches the entries in enum lp8788_ldo_id and it's easy to calculate the id for ALDOx. Thus remove lp8788_dldo_id and lp8788_aldo_id 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>
* regulator: lp8788-ldo: use ena_pin of regulator-core for external controlKim, Milo2013-03-041-81/+17Star
| | | | | | | | | | | Regulator core driver provides enable GPIO control for enabling/disabling a regulator. Now, enable GPIO is shared among regulators. Use this internal working, so unnecessary code are removed. GPIO enable pin configurations are added in digital LDO and analog LDO drivers. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: lp8788-ldo: Use ldo->en_pin to check if regulator is enabled by ↵Axel Lin2013-01-071-93/+14Star
| | | | | | | | | | | | | | | | | | external pin ldo->en_pin is set iff the regulator is enabled by external pin. This patch sets ldo->en_pin to NULL if lp8788_gpio_request_ldo_en() fails, then we can use it to determinate if the regulator is controlled by external pin or register. lp8788_get_ldo_enable_mode(), lp8788_ldo_ctrl_by_extern_pin() and lp8788_ldo_is_enabled_by_extern_pin() functions are not used now, remove them. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Milo Kim <milo.kim@ti.com> Tested-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* lp8788-ldo: fix a parent device on devm_gpio_request()Kim, Milo2013-01-031-6/+8
| | | | | | | | Use 'platform_device' rather than i2c client device node. Argument is added in lp8788_config_ldo_enable_mode(). Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* lp8788-ldo: fix a parent device in _probe()Kim, Milo2013-01-031-6/+6
| | | | | | | | | | | | | The lp8788-ldo 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 regulators and device kernel messages. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge remote-tracking branch 'regulator/topic/lp8788' into regulator-nextMark Brown2012-12-101-11/+2Star
|\
| * regulator: lp8788-ldo: Remove val array in lp8788_config_ldo_enable_modeAxel Lin2012-12-071-10/+1Star
| | | | | | | | | | | | | | | | | | To clear the mask bit, setting data argument to be 0 with proper mask setting for lp8788_update_bits. We don't need the var array here. 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>
| * regulator: lp8788-ldo: Staticise non-exported symbolMark Brown2012-10-151-1/+1
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: remove use of __devexitBill Pemberton2012-11-201-2/+2
| | | | | | | | | | | | | | | | 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>
* | regulator: remove use of __devinitBill Pemberton2012-11-201-2/+2
| | | | | | | | | | | | | | | | 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>
* | regulator: remove use of __devexit_pBill Pemberton2012-11-201-2/+2
|/ | | | | | | | 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>
* regulator: lp8788-ldo: Set n_voltages to 1 for fixed voltageAxel Lin2012-08-281-0/+8
| | | | | | | | For fixed voltage, the n_voltages should be 1 rather than 0. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: add new lp8788 regulator driverKim, Milo2012-07-201-0/+842
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>