summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/palmas-regulator.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * regulator: palmas: Change the DT node property names to follow the conventionJ Keerthy2013-03-041-4/+4
| | | | | | | | | | | | | | DT node properties should not have "_". Replacing them by "-". Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: fix number of SMPS voltagesGraeme Gregory2013-03-011-1/+2
|/ | | | | | | | | Number of voltages for SMPS regulators was off by one. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Ian Lartey <ian@slimlogic.co.uk> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge remote-tracking branch 'regulator/topic/palmas' into regulator-nextMark Brown2013-02-191-5/+0
|\
| * regulator: palmas: Remove a redundant setting for warm_resetAxel Lin2013-02-041-5/+0
| | | | | | | | | | | | | | | | Current code read "ti,warm_reset" of property twice, and set pdata->reg_init[idx]->warm_reset twice. Read and set it once is enough. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: Add missing of_node_put()Axel Lin2013-01-301-0/+2
|/ | | | | | | | | | | | of_find_node_by_name() returns a node pointer with refcount incremented, use of_node_put() on it when done. of_find_node_by_name() will call of_node_put() against from parameter, thus we also need to call of_node_get(from) before calling of_find_node_by_name(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Drivers: regulator: remove __dev* attributes.Greg Kroah-Hartman2013-01-031-1/+1
| | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Liam Girdwood <lrg@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge remote-tracking branch 'regulator/topic/palmas' into regulator-nextMark Brown2012-12-101-83/+38
|\
| * regulator: palmas: Convert palmas_ops_smps to ↵Axel Lin2012-12-061-61/+26
| | | | | | | | | | | | | | regulator_[get|set]_voltage_sel_regmap Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * regulator: palmas: Return raw register values as the selectors in ↵Axel Lin2012-12-061-24/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [get|set]_voltage_sel Don't adjust the selector in [get|set]_voltage_sel, fix it in list_voltage() instead. For smps*(except smps10), the vsel reg-value and voltage mapping as below: reg-value volt (uV) ( Assume RANGE is x1 ) 0 0 1 500000 2 500000 3 500000 4 500000 5 500000 6 500000 (0.49V + 1 * 0.01V) * RANGE 7 510000 (0.49V + 2 * 0.01V) * RANGE 8 520000 (0.49V + 3 * 0.01V) * RANGE 9 530000 (0.49V + 4 * 0.01V) * RANGE .... The linear mapping is start from selector 6. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | Merge remote-tracking branch 'regulator/topic/min' into regulator-nextMark Brown2012-12-101-32/+5
|\ \
| * | regulator: palmas: Use linear_min_sel and regulator_[map|list]_voltage_linearAxel Lin2012-11-271-32/+5
| |/ | | | | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: remove use of __devexitBill Pemberton2012-11-201-1/+1
| | | | | | | | | | | | | | | | 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-1/+1
|/ | | | | | | | 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>
* Merge tag 'mfd-3.7-1' of ↵Linus Torvalds2012-10-051-8/+119
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull MFD changes from Samuel Ortiz: "MFD bits for the 3.7 merge window. As usual we have a few new drivers: - TI LP8788 - TI OMAP USB TLL - Maxim MAX8907 - SMSC ECE1099 - Dialog Semiconductor DA9055 - A simpler syscon driver that allow us to get rid of the anatop one. Drivers are also gradually getting Device Tree and IRQ domain support. The following drivers got DT support: - palmas, 88pm860x, tc3589x and twl4030-audio And those ones now use the IRQ domain APIs: - 88pm860x, tc3589x, db8500_prcmu Also some other interesting changes: - Intel's ICH LPC now supports Lynx Point - TI's twl4030-audio added a GPO child - tps6527 enabled its backlight subdevice - The twl6030 pwm driver moved to the new PWM subsystem And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x, palmas, ab8500, wm8994, wm5110, max8907 and the tps65xxx family." Fix up various annoying conflicts: the DT and IRQ domain support came in twice and was already in 3.6. And then it was apparently rebased. Guys, DON'T REBASE! * tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (89 commits) ARM: dts: Enable 88pm860x pmic mfd: 88pm860x: Move gpadc init into touch mfd: 88pm860x: Device tree support mfd: 88pm860x: Use irqdomain mfd: smsc: Add support for smsc gpio io/keypad driver backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe mfd: DA9055 core driver mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device list mfd: wm5110: Add register patches for revision B mfd: wm5110: Disable control interface error report for WM5110 rev B mfd: max8907: Remove regulator-compatible from DT docs backlight: Add TPS65217 WLED driver mfd: Add backlight as subdevice to the tps65217 mfd: Provide the PRCMU with its own IRQ domain mfd: Fix max8907 sparse warning mfd: Add lp8788 mfd driver mfd: dbx500: Provide a more accurate smp_twd clock mfd: rc5t583: Fix warning messages regulator: palmas: Add DT support mfd: palmas: Change regulator defns to better suite DT ...
| * regulator: palmas: Add DT supportGraeme Gregory2012-09-231-8/+119
| | | | | | | | | | | | | | | | | | | | Add DT support to palmas regulator. This involved a little change to the platform data structure. Regulator information can now come from platform data or DT. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | regulator: palmas: Convert palmas_ops_ldo to [get|set]_voltage_sel_regmapAxel Lin2012-08-281-40/+5
| | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: Fix palmas_probe error handlingAxel Lin2012-08-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Fix below error handling cases: 1. If reading PALMAS_SMPS_CTRL fails, simply returns ret rather than goto err_unregister_regulator because we have not call regulator_register(). 2. If palmas_ldo_init() fails, we need to call regulator_unregister() for the regulator we just successfully registered in this for loop iteration. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: Call palmas_ldo_[read|write] in palmas_ldo_initAxel Lin2012-08-071-2/+2
| | | | | | | | | | | | | | | | Current code uses wrong calls palmas_smps_[read|write] in palmas_ldo_init(), should be palmas_ldo_[read|write] instead. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: Fix regmap offsets for PALMAS_REG_SMPS10 vsel_regAxel Lin2012-08-071-1/+3
| | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: Fix calculating selector in palmas_map_voltage_ldoAxel Lin2012-08-071-3/+6
|/ | | | | | | | | | | | | | | This patch fixes below issues when choosing selector: 1. Current code returns negative selector if min_uV < 900000 which is wrong. For example, it is possible to satisfy the request with selector = 1 if the requested min_uV is 850000. 2. Current code may select a voltage lower than requested min_uV. For example, if the requested min_uV is 945000, current code chooses selector = 1 which is lower than requested min_uV. DIV_ROUND_UP to avoid this case. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: palmas: Fix calcuating selector in palmas_map_voltage_smpsAxel Lin2012-07-171-3/+14
| | | | | | | | | | | | | | | | The logic of calculating selector in palmas_map_voltage_smps() does not match the logic to list voltage in palmas_list_voltage_smps(). We use below equation to calculate voltage when selector > 0: voltage = (0.49V + (selector * 0.01V)) * RANGE RANGE is either x1 or x2 So we need to take into account with the multiplier set in VSEL register when calculating selector in palmas_map_voltage_smps() Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge tag 'v3.5-rc5' into regulator-driversMark Brown2012-07-021-2/+5
|\ | | | | | | | | | | | | Linux 3.5-rc5 collides with further development. Conflicts: drivers/regulator/tps65023-regulator.c
| * regulator: palmas: fix regmap offsets for enable/disableGraeme Gregory2012-06-231-2/+5
| | | | | | | | | | | | | | | | | | | | I forgot to apply the offsets for the regmap helper functions for enable/disable on SMPS10 and the LDO regulators. This means regulators will not enable/disable correctly. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Tested-by: Sebastien Guiriec <s-guiriec@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | Merge tag 'v3.5-rc4' into regulator-driversMark Brown2012-06-251-7/+0
|\ \ | |/ | | | | | | Linux 3.5-rc4 contains patches which conflict with some of the development work.
| * regulator: palmas: Fix wrong kfree callsAxel Lin2012-06-041-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_kzalloc function eliminates the need for manual resource releasing and simplify error handling. Resources allocated by devm_* are freed automatically on driver detach. Thus adding kfree calls here will introduce double free bug. The memory of desc array and the pointers to the rdev[] are allocated by devm_kzalloc call for struct palmas_pmic. struct palmas_pmic { struct palmas *palmas; struct device *dev; struct regulator_desc desc[PALMAS_NUM_REGS]; struct regulator_dev *rdev[PALMAS_NUM_REGS]; struct mutex mutex; int smps123; int smps457; int range[PALMAS_REG_SMPS10]; }; Which means we should not call kfree for pmic->rdev and pmic->desc. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: Slightly code change for better readabilityAxel Lin2012-06-081-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a little bit hard to read that the "else" case means id == PALMAS_REG_SMPS10. if (id != PALMAS_REG_SMPS10){ do something for the cases id != PALMAS_REG_SMPS10; } else { do something for the case id == PALMAS_REG_SMPS10; } This patch changes above syntax to switch statement. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: Clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits in ↵Axel Lin2012-06-081-2/+1
| | | | | | | | | | | | | | | | | | | | palmas_set_mode_smps Current code actually clears more bits than PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: palmas: Use regulator_[list|map]_voltage_linear() for ↵Axel Lin2012-06-031-7/+4
|/ | | | | | | | palmas_ops_smps10 Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: regulator driver for Palmas series chipsGraeme Gregory2012-05-191-0/+822
Palmas has both Switched Mode (SMPS) and Linear (LDO) regulators in it. This regulator driver allows software control of these regulators. The regulators available on Palmas series chips vary depending on the muxing. This is handled automatically in the driver by reading the mux info from OTP. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud