summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds2011-11-0619-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
| * regulator: Add module.h to drivers/regulator users as requiredPaul Gortmaker2011-10-3119-0/+19
| | | | | | | | | | | | | | | | 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>
| * regulator: Add export.h for THIS_MODULE to dummy.cPaul Gortmaker2011-10-311-0/+1
| | | | | | | | | | | | | | So that THIS_MODULE is still in scope once we clean up the presence of module.h being everywhere. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* | Merge branch 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6Linus Torvalds2011-11-032-4/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6: (80 commits) mfd: Fix missing abx500 header file updates mfd: Add missing <linux/io.h> include to intel_msic x86, mrst: add platform support for MSIC MFD driver mfd: Expose TurnOnStatus in ab8500 sysfs mfd: Remove support for early drop ab8500 chip mfd: Add support for ab8500 v3.3 mfd: Add ab8500 interrupt disable hook mfd: Convert db8500-prcmu panic() into pr_crit() mfd: Refactor db8500-prcmu request_clock() function mfd: Rename db8500-prcmu init function mfd: Fix db5500-prcmu defines mfd: db8500-prcmu voltage domain consumers additions mfd: db8500-prcmu reset code retrieval mfd: db8500-prcmu tweak for modem wakeup mfd: Add db8500-pcmu watchdog accessor functions for watchdog mfd: hwacc power state db8500-prcmu accessor mfd: Add db8500-prcmu accessors for PLL and SGA clock mfd: Move to the new db500 PRCMU API mfd: Create a common interface for dbx500 PRCMU drivers mfd: Initialize DB8500 PRCMU regs ... Fix up trivial conflicts in arch/arm/mach-imx/mach-mx31moboard.c arch/arm/mach-omap2/board-omap3beagle.c arch/arm/mach-u300/include/mach/irqs.h drivers/mfd/wm831x-spi.c
| * | mfd: Move to the new db500 PRCMU APIMattias Nilsson2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have a shared API between the DB8500 and DB5500 PRCMU's, switch to using this neutral API instead. We delete the parts of db8500-prcmu.h that is now PRCMU-neutral, and calls will be diverted to respective driver. Common registers are in dbx500-prcmu-regs.h and common accessors and defines in <linux/mfd/dbx500-prcmu.h> This way we get a a lot more abstraction and code reuse. Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * | regulator: Finish mc13783 conversion to the mc13xxx APISamuel Ortiz2011-10-241-3/+3
| | | | | | | | | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | | Merge branch 'for-linus' of git://opensource.wolfsonmicro.com/regulatorLinus Torvalds2011-11-0112-41/+604
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://opensource.wolfsonmicro.com/regulator: (22 commits) regulator: Constify constraints name regulator: Fix possible nullpointer dereference in regulator_enable() regulator: gpio-regulator add dependency on GENERIC_GPIO regulator: Add module.h include to gpio-regulator regulator: Add driver for gpio-controlled regulators regulator: remove duplicate REG_CTRL2 defines in tps65023 regulator: Clarify documentation for regulator-regulator supplies regulator: Fix some bitrot in the machine driver documentation regulator: tps65023: Added support for the similiar TPS65020 chip regulator: tps65023: Setting correct core regulator for tps65021 regulator: tps65023: Set missing bit for update core-voltage regulator: tps65023: Fixes i2c configuration issues regulator: Add debugfs file showing the supply map table regulator: tps6586x: add SMx slew rate setting regulator: tps65023: Fixes i2c configuration issues regulator: tps6507x: Remove num_voltages array regulator: max8952: removed unused mutex. regulator: fix regulator/consumer.h kernel-doc warning regulator: Ensure enough enable time for max8649 regulator: 88pm8607: Fix off-by-one value range checking in the case of no id is matched ...
| * | regulator: Fix possible nullpointer dereference in regulator_enable()Heiko Stübner2011-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where _regulator_enable returns an error it was not checked if a supplying regulator exists before trying to disable it, leading to a null pointer-dereference if no supplying regulator existed. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | regulator: gpio-regulator add dependency on GENERIC_GPIOHeiko Stübner2011-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without GENERIC_GPIO "struct gpio" is undefined leading to errors. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | regulator: Add module.h include to gpio-regulatorMark Brown2011-10-111-0/+1
| | | | | | | | | | | | | | | Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | regulator: Add driver for gpio-controlled regulatorsHeiko Stübner2011-10-093-0/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for regulators that can be controlled via gpios. Examples for such regulators are the TI-tps65024x voltage regulators with 4 fixed and 1 runtime-switchable voltage regulators or the TI-bq240XX charger regulators. The number of controlling gpios is not limited, the mapping between voltage/current and target gpio state is done via the states map and the driver can be used for either voltage or current regulators. A mapping for a regulator with two GPIOs could look like: gpios = { { .gpio = GPIO1, .flags = GPIOF_OUT_INIT_HIGH, .label = "gpio name 1" }, { .gpio = GPIO2, .flags = GPIOF_OUT_INIT_LOW, .label = "gpio name 2" }, } The flags element of the gpios array determines the initial state of the gpio, set during probe. The initial state of the regulator is also calculated from these values states = { { .value = volt_or_cur1, .gpios = (0 << 1) | (0 << 0) }, { .value = volt_or_cur2, .gpios = (0 << 1) | (1 << 0) }, { .value = volt_or_cur3, .gpios = (1 << 1) | (0 << 0) }, { .value = volt_or_cur4, .gpios = (1 << 1) | (1 << 0) }, } The target-state for the n-th gpio is determined by the n-th bit in the bitfield of the target-value. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | regulator: remove duplicate REG_CTRL2 defines in tps65023H Hartley Sweeten2011-10-091-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two sets of defines for the REG_CTRL2 bitfields and one of them has TPS65023_REG_CTRL2_DCDC1 defined incorrectly. Remove the duplicates and leave the correct one for TPS65023_REG_CTRL2_DCDC1. This fixes the following sparse warnings: drivers/regulator/tps65023-regulator.c:77:9: warning: preprocessor token TPS65023_REG_CTRL2_DCDC1 redefined drivers/regulator/tps65023-regulator.c:70:9: this was the original definition Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | regulator: tps65023: Added support for the similiar TPS65020 chipMarcus Folkesson2011-08-281-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | Defines a new voltage-table and allows registering of the tps65020 device. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| * | regulator: tps65023: Setting correct core regulator for tps65021Marcus Folkesson2011-08-281-21/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TPS65023 is using VDCDC1 as core regulator and TPS65021 is using VDCDC3. Core-regulator and voltage-tables may differ between different regulators. These two is now passed as driver data. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| * | regulator: tps65023: Set missing bit for update core-voltageMarcus Folkesson2011-08-281-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | Setting the GO bit in CTRL2 for updating the core voltage Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| * | regulator: tps65023: Fixes i2c configuration issuesMarcus Folkesson2011-08-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Allow i2c core voltage adjustments by clearing CORE ADJ Allowed bit in CTRL2 Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| * | regulator: Add debugfs file showing the supply map tableMark Brown2011-08-281-0/+41
| | | | | | | | | | | | | | | | | | | | | Useful for working out why things aren't getting plugged together properly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| * | regulator: tps6586x: add SMx slew rate settingXin Xie2011-08-281-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add output vlotage slew rate setting for SM0/SM1 Signed-off-by: Xin Xie <xxie@nvidia.com> Signed-off-by: Danny Huang <dahuang@nvidia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| * | regulator: tps65023: Fixes i2c configuration issuesMarcus Folkesson2011-08-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Allow i2c core voltage adjustments by clearing CORE ADJ Allowed bit in CTRL2 Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| * | regulator: tps6507x: Remove num_voltages arrayAxel Lin2011-08-081-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | We can get n_voltages for each regulator from table_len of struct tps_info. 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>
| * | regulator: max8952: removed unused mutex.MyungJoo Ham2011-08-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes a mutex that is never used in the driver. Reported-by: Axel Lin 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>
| * | regulator: Ensure enough enable time for max8649Axel Lin2011-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Integer division may truncate the result, thus max8649_enable_time() may return slightly shorter enable time. This patch fixes it. 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>
| * | regulator: 88pm8607: Fix off-by-one value range checking in the case of no ↵Axel Lin2011-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id is matched In the case of no id is matched, the variable i is equal to ARRAY_SIZE(pm8607_regulator_info). 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>
| * | regulator: tps65912: Remove unused define of TPS65912_MAX_REG_IDAxel Lin2011-08-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we define TPS65912_MAX_REG_ID as TPS65912_REG_LDO_10, but TPS65912_REG_LDO_10 is not defined at all. ( It looks like a typo of TPS65912_REG_LDO10 ) Currently, TPS65912_MAX_REG_ID is not used in this driver, it is safe to just remove it. 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>
| * | regulator: aat2870-regulator.c needs module.hRandy Dunlap2011-08-081-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | aat2870-regulator.c needs to include linux/module.h to fix multiple build errors. drivers/regulator/aat2870-regulator.c:145: error: 'THIS_MODULE' undeclared here (not in a function) drivers/regulator/aat2870-regulator.c:230: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION' drivers/regulator/aat2870-regulator.c:231: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE' drivers/regulator/aat2870-regulator.c:232: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* | regulator: Add WM1811 supportMark Brown2011-10-071-0/+13
| | | | | | | | | | | | | | The WM1811 has a slightly different range on LDO2 to other WM8994 class devices. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: Fix return code from regulator_disable_deferred()Mark Brown2011-10-041-2/+7
| | | | | | | | | | | | | | schedule_delayed_work() returns a bool indicating if the work was already queued when it succeeds so we need to squash a true down to zero. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: Implement deferred disable supportMark Brown2011-09-141-0/+59
|/ | | | | | | | | | | | | | | | It is a reasonably common pattern for hardware to require some delay after being quiesced before the disable has finalised, especially in mixed signal devices. For example, an active discharge may be required to ensure that the circuit starts up again in a known state. Avoid having to implement such delays in the regulator API by providing regulator_deferred_disable() which will do a regulator_disable() a specified number of milliseconds after it is called. Due to the reference counting done on regulators a deferred disable can be cancelled by doing another regulator_enable(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
* Merge branch 'for-linus' of ↵Linus Torvalds2011-08-017-199/+307
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (23 commits) regulator: Improve WM831x DVS VSEL selection algorithm regulator: Bootstrap wm831x DVS VSEL value from ON VSEL if not already set regulator: Set up GPIO for WM831x VSEL before enabling VSEL mode regulator: Add EPEs to the MODULE_ALIAS() for wm831x-dcdc regulator: Fix WM831x DCDC DVS VSEL bootstrapping regulator: Fix WM831x regulator ID lookups for multiple WM831xs regulator: Fix argument format type errors in error prints regulator: Fix memory leak in set_machine_constraints() error paths regulator: Make core more chatty about some errors regulator: tps65910: Fix array access out of bounds bug regulator: tps65910: Add missing breaks in switch/case regulator: tps65910: Fix a memory leak in tps65910_probe error path regulator: TWL: Remove entry of RES_ID for 6030 macros ASoC: tlv320aic3x: Add correct hw registers to Line1 cross connect muxes regulator: Add basic per consumer debugfs regulator: Add rdev_crit() macro regulator: Refactor supply implementation to work as regular consumers regulator: Include the device name in the microamps_requested_ file regulator: Increase the limit on sysfs file names regulator: Properly register dummy regulator driver ...
| * Merge branch 'for-next' into for-linusLiam Girdwood2011-08-017-199/+307
| |\
| | * regulator: Improve WM831x DVS VSEL selection algorithmMark Brown2011-07-281-37/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than using the maximum voltage we get passed to select the DVS voltage to use remember the highest voltage we've ever seen. This improves how the driver works when the consumer permits higher voltages than it will ever selects in order to support the widest possible voltage range. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Bootstrap wm831x DVS VSEL value from ON VSEL if not already setMark Brown2011-07-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | If we don't have a DVS VSEL value already set when we start up then start it off with the value currently being used for ON. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Set up GPIO for WM831x VSEL before enabling VSEL modeMark Brown2011-07-281-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the VSEL is not in use prior to us starting up then we need to make sure we initialise the GPIO before we push the DVS control to being done by the GPIO. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Add EPEs to the MODULE_ALIAS() for wm831x-dcdcMark Brown2011-07-281-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Fix WM831x DCDC DVS VSEL bootstrappingMark Brown2011-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Read our initial VSEL from the correct register. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Fix WM831x regulator ID lookups for multiple WM831xsMark Brown2011-07-282-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | With multiple wm831x devices the device IDs used for the regulators will not always be contiguous so simply taking the modulus is not sufficient to look up the ID, we need to reverse the way the ID is generated. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Fix argument format type errors in error printsMark Brown2011-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | We need to dereference the pointers to print their values. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Fix memory leak in set_machine_constraints() error pathsAxel Lin2011-07-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Properly kfree rdev->constraints in all set_machine_constraints() error paths. Also properly kfree rdev->constraints in regulator_register() error paths. 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>
| | * regulator: Make core more chatty about some errorsMark Brown2011-07-221-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | Prevent some head scratching by making the core log about some rare but possible errors with invalid voltage ranges and modes being set. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: tps65910: Fix array access out of bounds bugAxel Lin2011-07-221-12/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For tps65910, the number of regulator is 13. ( ARRAY_SIZE(tps65910_regs) is 13) For tps65911, the number of regulator is 12. ( ARRAY_SIZE(tps65911_regs) is 12) If we are using this driver for tps65911, we hit array access out of bounds bug in tps65910_probe() because current implementation always assume the number of regulator is 13 and thus it will access tps65911_regs[12]. Fix it by setting correct num_regulators for both chips in tps65910_probe(), and allocated neccessay memory accordingly. 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>
| | * regulator: tps65910: Add missing breaks in switch/caseAxel Lin2011-07-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * regulator: tps65910: Fix a memory leak in tps65910_probe error pathAxel Lin2011-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix a memory leak if chip id is not matched. 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>
| | * regulator: TWL: Remove entry of RES_ID for 6030 macrosAmbresh K2011-07-221-34/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RES_ID is only used in 4030, to send PBM singular message to control the state of dedicated resources. In 6030, we don't have concept of PBM, hence removing the definition of RES_ID (num) from macros. Signed-off-by: Ambresh K <ambresh@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Add basic per consumer debugfsMark Brown2011-07-041-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | Report the requested load and voltage for each consumer in debugfs when it is enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Add rdev_crit() macroMark Brown2011-06-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | No actual users but provide the macro so there's less surprise when it's not there. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Refactor supply implementation to work as regular consumersMark Brown2011-06-091-65/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the regulator supply implementation is somewhat complex and fragile as it doesn't look like standard consumers but is instead a parallel implementation. This causes issues with locking and reference counting. Move the implementation over to using standard consumers to address this. Rather than only notifying the supply on the first enable/disable we do so every time the regulator is enabled or disabled, simplifying locking as we don't need to hold a lock on the consumer we are about to enable. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Include the device name in the microamps_requested_ fileMark Brown2011-06-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | We may have multiple devices requesting a supply with the same name so include the device name in the generated filename for microamps_requested to avoid duplicate files. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Increase the limit on sysfs file namesMark Brown2011-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | With verbose filenames we can easily hit 32 characters. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: Properly register dummy regulator driverMark Brown2011-06-081-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes in the driver core appear to mean that the data structures for the driver core are not fully initialised unless the driver is bound. Make sure the driver core knows the dummy driver is in use by binding it to a driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
| | * regulator: twl-regulator: fix n_voltages for twl6030 variable LDOsColin Cross2011-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The n_voltages initializer for the TWL6030_ADJUSTABLE_LDO macro is off by one, causing the the highest supported voltage to be unreachable. Setting the machine constraints to only allow the highest voltage causes errors: machine_constraints_voltage: VAUX3_6030: unsupportable voltage constraints twl_reg twl_reg.39: can't register VAUX3_6030, -22 twl_reg: probe of twl_reg.39 failed with error -22 This patch fixes the off by one error. Tested by setting VAUX3_6030 to 3.3V. Signed-off-by: Colin Cross <ccross@android.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
OpenPOWER on IntegriCloud