aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/mc13892-regulator.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-08-28regulator: mc13xxx: Remove get_voltage implementation for single voltage regulatorsAxel Lin1-1/+0
This is not required after commit f7df20ec "regulator: core: Use list_voltage() to read single voltage regulators" Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: mc13892: Convert mc13892_sw_regulator_ops to get_voltage_selAxel Lin1-9/+3
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: mc13892: Simplify implementation of mc13892_sw_regulator_set_voltage_sel()Axel Lin1-27/+15
Use mc13xxx_reg_rmw rather than a mc13xxx_reg_read and a mc13xxx_reg_write calls. This logic to set MC13892_SWITCHERS0_SWxHI bit is pretty simple: if (volt > 1375000) set MC13892_SWITCHERS0_SWxHI bit else if (volt < 1100000) clear MC13892_SWITCHERS0_SWxHI bit else leave MC13892_SWITCHERS0_SWxHI bit untouched We already know the selector, so we don't need to calculate the selector again. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: mc13892: Make mc13892_powermisc_rmw() lock protectedAxel Lin1-14/+8
Then we can remove lock/unlock around the caller. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19regulator: mc13xxx: Remove mc13xxx_sw_regulator_is_enabled functionAxel Lin1-1/+0
If .is_enabled callback is not implemented, regulator core assumes that the regulator is always on. Thus we don't need mc13xxx_sw_regulator_is_enabled function. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17regulator: mc13xxx: Convert to regulator_list_voltage_tableAxel Lin1-21/+21
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-10Merge tag 'v3.4-rc2' into regulator-driversMark Brown1-5/+5
Linux 3.4-rc2 contains some fixes that further patches depend upon.
2012-04-10regulator: Fix build error for mc13783 and mc13892Axel Lin1-2/+6
Convert mc13783 and mc13892 to use a struct to pass in regulator runtime configuration. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-02regulator: Convert mc13xxx regulator drivers to set_voltage_selAxel Lin1-13/+4
Convert mc13892_sw_regulator_ops and mc13xxx_regulator_ops to set_voltage_sel. mc13xxx_get_best_voltage_index function is not used now, remove it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-26regulator: Fix unbalanced lock/unlock in mc13892_regulator_probe error pathAxel Lin1-5/+5
We do not hold a lock while registering regulator, thus should not call unlock if regulator_register fails. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-30regulator: mc13892: Convert to devm_kzalloc()Fabio Estevam1-3/+1
Convert mc13892-regulator driver to use devm_kzalloc(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-22regulator: mc13892: add device tree probe supportShawn Guo1-11/+32
It adds device tree probe support for mc13892-regulator driver. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23regulator: pass additional of_node to regulator_register()Rajendra Nayak1-1/+1
With device tree support for regulators, its needed that the regulator_dev->dev device has the right of_node attached. To be able to do this add an additional parameter to the regulator_register() api, wherein the dt-adapted driver can then pass this additional info onto the regulator core. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31regulator: Add module.h to drivers/regulator users as requiredPaul Gortmaker1-0/+1
Another group of drivers that are taking advantage of the implicit presence of module.h -- and will break when we pull the carpet out from under them during a cleanup. Fix 'em now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-05-27regulator: mc13892: Fix voltage unit in test case.Fabio Estevam1-2/+2
Voltage values should be expressed in microvolts, not in milivolts. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27Revert "regulator: Move VCOINCELL to be the last element of mc13892_regulators array"Axel Lin1-1/+1
I check this patch again and found this actually is not a bug because MC13xxx_DEFINE explictly defines the order of each entry in the array. Thus revert the patch. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Use mc13xxx_reg_write instead of mc13xxx_reg_rmw in mc13892_sw_regulator_set_voltageAxel Lin1-6/+10
Currently, we call mc13xxx_reg_read and mc13xxx_reg_rmw for the same register. This can be converted to simply a mc13xxx_reg_read and a mc13xxx_reg_write, thus save a redundant register read. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Move VCOINCELL to be the last element of mc13892_regulators arrayAxel Lin1-1/+1
In include/linux/mfd/mc13892.h, we define MC13892_VCOINCELL as 23. Thus VCOINCELL should be defined as 23th element in mc13892_regulators array, not the first one. This actually fixes an off-by-one bug while accessing mc13892_regulators array. For example, In mc13892_regulator_probe, we use MC13892_VCAM as array index of mc13892_regulators array. mc13892_regulators[MC13892_VCAM].desc.ops->set_mode = mc13892_vcam_set_mode; Currently, it access mc13892_regulators[12] ,which is VAUDIO not VCAM. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-26mfd: Use mfd cell platform_data for mc13xxx cells platform bitsSamuel Ortiz1-3/+4
With the addition of a platform device mfd_cell pointer, MFD drivers can go back to passing platform data back to their sub drivers. This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers MFD agnostic. This is mostly needed for non MFD aware sub drivers. Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-23mfd: mfd_cell is now implicitly available to mc13xxx driversAndres Salomon1-4/+3
The cell's platform_data is now accessed with a helper function; change clients to use that, and remove the now-unused data_size. Note that mfd-core no longer makes a copy of platform_data, but the mc13xxx-core driver creates the pdata structures on the stack. In order to get around that, the various ARM mach types that set the pdata have been changed to hold the variable in static (global) memory. Also note that __initdata references in aforementioned pdata structs have been dropped. Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-12regulator: Assign return value of mc13xxx_reg_rmw to retAxel Lin1-1/+1
Otherwise, we will not return error if write to MC13892_SWITCHERS5 failed. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Yong Shen <yong.shen@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-12regulator: Staticise non-exported functions in mc13892Mark Brown1-3/+3
No point exposing functions that aren't used elsewhere to the global namespace and sparse warns about doing so. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-12regulator: support PMIC mc13892Yong Shen1-0/+635
add support for mc13892, tested on mx51 babbage board Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Yong Shen <yong.shen@linaro.org> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>