summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2012-01-25ENGR00172752-2 Remove usless code in pfuze100 regulator driverNancy Chen
Remove usless code in pfuze100 regulator driver Signed-off-by: Robin Gong <b38343@freescale.com> Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com>
2012-01-09ENGR00170788 MX6Q PFUZE100:configure VDDARM and VDDSOC voltage in standbyRobin Gong
Configure register 33&40&47 to set standby voltage of SW1A/1B/1C Signed-off-by: Robin Gong <B38343@freescale.com>
2012-01-09ENGR00170255-3 MX6Q PFUZE100: add regulator driver of pfuze100Robin Gong
add new regulator driver for pfuze100 based on mfd structure Signed-off-by: Robin Gong <B38343@freescale.com>
2012-01-09build fix and driver fixJason Liu
Signed-off-by: Jason Liu <jason.hui@linaro.org>
2012-01-09ENGR00143921-1 - EPDC/MAX17135: Add controls for V3P3 regulatorDanny Nold
- Added V3P3 regulator to max17135 - Added calls to enable/disable V3P3 regulator from EPDC driver - Improved Kconfig detail for max17135 MFD and HWMON entries Signed-off-by: Danny Nold <dannynold@freescale.com>
2012-01-09ENGR00161292 [mx6q] Fix incompatible pointer warningsNancy Chen
Fix build warnings regarding initialization from incompatible pointer type. Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com>
2012-01-09ENGR00160797-2 Add Anatop regulator driverNancy Chen
Add Anatop regulator driver. Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com>
2012-01-09ENGR00159530-3 mc34708:add new regulator driverRobin Gong
1.add new regulator driver for new pmic core driver 2.add Kconfig and Makefile Signed-off-by: Robin Gong <B38343@freescale.com>
2012-01-09ENGR00143294-1: Fix bug in MC13892 driverRanjani Vaidyanathan
In set_voltage function, all voltages are not in microvolts. Hence set_voltage function was failing. Change all voltages in the function to be in microvolts. Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
2012-01-09ENGR00142950-2 - MAX17135 EPD PMIC: Ported to 2.6.38 kernelDanny Nold
- Ported MAX17135 MFD core driver to 2.6.38 - Ported MAX17135 HWMON temperature sensor driver to 2.6.38 - Ported MAX17135 regulator driver to 2.6.38 Signed-off-by: Danny Nold <dannynold@freescale.com>
2012-01-09ENGR00141391-2 PMIC: porting da9053 to i.mx platformZhou Jingyu
Fix da9053 backlight Kconfig error porting da9052 regulator driver Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com> Acked-by: Lily Zhang <r58066@freescale.com>
2012-01-09ENGR00141391-1 PMIC: Add DA9053 source code from DialogZhou Jingyu
Add DA9053 original source code Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com> Acked-by: Lily Zhang <r58066@freescale.com>
2011-10-03regulator: tps65910: Add missing breaks in switch/caseAxel Lin
commit d04156bca629740a661fd0738cd69ba1f08b2b20 upstream. Also add a default case in tps65910_list_voltage_dcdc to silence 'volt' may be used uninitialized in this function warning. 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> Cc: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08regulator: max8997: Fix setting inappropriate value for ramp_delay variableDonggeun Kim
The ramp_delay variable can be set lower than the desired value. This patch fixes it. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: KyungMin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-07-08regulator: db8500-prcmu: small fixesAxel Lin
Small cleanups for better readability. 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-07-08regulator: max8997: remove dependency on platform_data pointerMyungJoo Ham
The platform_data (pdata) may be pointing to __initdata section, which may be free'd from the memory. The dependency on pdata in non-init functions is removed in this patch to allow platform to declare __initdata for platform data. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-07-08regulator: MAX8997: Fix for divide by zero errorTushar Behera
Currently, ramp_delay variable is used uninitialzed in max8997_set_voltage_ldobuck which gets called through regulator_register calls. To fix the problem, in max8997_pmic_probe, ramp_delay initialization code is moved before calls to regulator_register. Cc: Liam Girdwood <lrg@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-07-08regulator: max8952 - fix wrong gpio valid checkJonghwan Choi
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Fix _regulator_get_voltage if get_voltage callback is NULLAxel Lin
In the case of get_voltage callback is NULL, current implementation in _regulator_get_voltage will return -EINVAL. Also returns proper error if ret is negative value. 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: TWL6025: add support to twl-regulatorGraeme Gregory
Adding support for the twl6025. Major difference in the twl6025 is the group functionality has been removed from the chip so this affects how regulators are enabled and disabled. The names of the regulators also changed. The DCDCs of the 6025 are software controllable as well. Since V1 Use the features variable passed via platform data instead of calling global function. Change the very switch like if statements to be a more readable switch statement. Since V2 twl6025 doesn't use remap so remove it from the macros. Since V3 enable/disable functions for 4030/6030 were seperated upstream so rebase on top of this. Change DCDC reference to SMPS as this is used in TRM. Change list_voltage slightly to have less code. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: twl6030: do not write to _GRP for regulator disableBalaji T K
TWL6030: regulator is disabled via VREG_STATE TWL4030: regulator is disabled via VREG_GRP Since there is nothing common, split twlreg_enable similar to other regulator_ops Signed-off-by: Balaji T K <balajitk@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: twl6030: do not write to _GRP for regulator enableBalaji T K
TWL6030: regulator is enabled via VREG_STATE TWL4030: regulator is enabled via VREG_GRP Since there is nothing common, split twlreg_enable similar to other regulator_ops Signed-off-by: Balaji T K <balajitk@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: tps65911: Add new chip versionJorge Eduardo Candelaria
The tps65911 chip introduces new features, including changes in the regulator module. - VDD1 and VDD2 remain unchanged. - VDD3 is now named VDDCTRL and has a wider voltage range. - LDOs are now named LDO1...8 and voltage ranges are sequential, making LDOs easier to handle. Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Fix off-by-one value range checking for mc13xxx_regulator_get_voltageAxel Lin
We use val as array index, thus the valid value rangae for val should be 0 .. n_voltages-1. 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: mc13892: Fix voltage unit in test case.Fabio Estevam
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-27regulator: Remove ↵Axel Lin
MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros In current implementation, the original macro implementation assumes the caller pass the parameter starting from 1 (to match the register names in datasheet). Thus we have unneeded plus one then minus one operations when using MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros. This patch removes these macros to avoid unneeded plus one then minus one operations without reducing readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Only apply voltage constraints from consumers that set themMark Brown
When applying the set_voltage() requests from consumers skip over those consumers that haven't set anything, otherwise we'll come out with a maximum voltage of zero. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: If we can't configure optimum mode we're always in the best oneMark Brown
If either a regulator driver can't tell us what the optimum mode is (or doesn't have modes in the first place) or the system doesn't allow DRMS changes then it's more helpful for users to just say that we're in the optimal mode, even if it's from a selection of one. Still report errors if the process of picking and setting a mode changes as this may indicate that we're stuck in a low power mode and unable to deliver a higher current that the consumer just asked for. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: max8997: remove useless codeJonghwan Choi
fix unreachable code. Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Fix memory leak in max8998_pmic_probe failure pathAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Fix desc_id for tps65023/6507x/65910Axel Lin
The desc_id variable should not be a static variable. The rest of the code assumes the desc_id must less than TPSxxxxx_NUM_REGULATOR. If we set desc_id to be a static variable, checking the return value of rdev_get_id() may return error. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Anuj Aggarwal <anuj.aggarwal@ti.com> Cc: Graeme Gregory <gg@slimlogic.co.uk> 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 ↵Axel Lin
mc13892_regulators array" 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: Remove some unused variables from wm831x DCDCsMark Brown
These became unused with the IRQ removal patch, I'm fairly sure that a patch was sent earlier by someone else but it doesn't seem to have been applied and I don't have a copy sitting around any more. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27TPS65910: Add tps65910 regulator driverGraeme Gregory
The regulator module consists of 3 DCDCs and 8 LDOs. The output voltages are configurable and are meant to supply power to the main processor and other components Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk> 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 ↵Axel Lin
mc13892_sw_regulator_set_voltage 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: Support voltage offsets to compensate for drops in systemMark Brown
Some systems, particularly physically large systems used for early prototyping, may experience substantial voltage drops between the regulator and the consumers as a result of long traces in the system. With these systems voltages may need to be set higher than requested in order to ensure reliable system operation. Allow systems to work around such hardware issues by allowing constraints to supply an offset to be applied to any requested and reported voltages. This is not ideal, especially since the voltage drop may be load dependant, but is sufficient for most affected systems, it is not expected to be used in production hardware. The offset is applied after all constraint processing so constraints should be specified in terms of consumer values not physically configured values. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Remove supply_regulator_dev from machine configurationMark Brown
supply_regulator_dev (using a struct pointer) has been deprecated in favour of supply_regulator (using a regulator name) for quite a few releases now with a warning generated if it is used and there are no current in tree users so just remove the code. Signed-off-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 Lin
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-27regulator: Factor out references to rdev in regulator_force_disable()Mark Brown
Don't go looking up the rdev pointer every time, just use a local variable like everything else. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Convert WM8400 to get_voltage_sel()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-27regulator: Fix the argument of calling regulator_mode_constrainAxel Lin
The second parameter of regulator_mode_constrain takes a pointer. This patch fixes below warning: drivers/regulator/core.c: In function 'regulator_set_mode': drivers/regulator/core.c:2014: warning: passing argument 2 of 'regulator_mode_constrain' makes pointer from integer without a cast drivers/regulator/core.c:200: note: expected 'int *' but argument is of type 'unsigned int' Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
2011-05-27regulator: twl: add twl6030 set_modeSaquib Herman
Current set_mode logic does not support 6030. The logic for 4030 is not reusable for 6030 as the mode setting for 6030 now uses the new CFG_STATE register. We hence rename the old get_status as being specific to 4030. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Saquib Herman <saquib@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
2011-05-27regulator: twl: add twl6030 get_statusSaquib Herman
Current get_status logic does not support 6030 get_status. The logic for 4030 is not reusable for 6030 as the status check for 6030 now depends on the new CFG_STATE register. We hence rename the old get_status as being specific to 4030 and remove the redundant check for the same. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Saquib Herman <saquib@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
2011-05-27regulator: twl: fix twl6030 regulator is_enabledSaquib Herman
With TWL6030, it is not enough to ensure that the regulator is the group of P1 group (CPU/Linux), but we need to check the state as far as APP is concerned as well. Split the current is_enabled to 6030 and 4030 specific ones. This split impacts few macros and variables as well, but sets up the stage for further fixes to set_mode and get_status in subsequent patches. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Saquib Herman <saquib@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
2011-05-27regulator: twl: remap has no meaning for 6030Saquib Herman
TWL6030 does not have remap register. The current implementation causes value of remap to be written to state register, accidentally causing the regulators which are probed to be switched on as well. This is wrong as regulators should be controllable based on calls to enable/disable for TWL regulator framework. Further, the values initialized make no sense as well. We hence remove this from the initalizers and also write to remap register only if the TWL is 4030. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Saquib Herman <saquib@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
2011-05-27regulator: twl: fix twl6030 enable/disableSaquib Herman
TWL6030 requires an additional register write to CFG_STATE register to explicitly state that the regulator is in a certain state. Merely associating the regulator with the group is not enough. Add the required register field definitions and fix the handling for TWL6030 enable/disable. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Saquib Herman <saquib@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
2011-05-27regulator: Add missing platform_set_drvdata in tps6105x_regulator_probeAxel Lin
Otherwise, calling platform_get_drvdata in tps6105x_regulator_remove returns NULL. 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: When constraining modes fall back to higher power modesMark Brown
If a mode requested by a consumer is not allowed by constraints automatically fall back to a higher power mode if possible. This ensures that consumers get at least the output they requested while allowing machine drivers to transparently limit lower power modes if required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-05-26regulator: Fix 88pm8607.c printk format warningRandy Dunlap
Fix printk format warning (seen on x86_64) and change to unsigned output format: drivers/regulator/88pm8607.c:417: warning: format '%d' expects type 'int', but argument 3 has type 'resource_size_t' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Avoid to use constraint name in 88pm860x regulator driverHaojian Zhuang
Avoid to use constraint name in regulator driver. So use regulator id is used instead in platform driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>