summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2012-11-15Merge remote-tracking branches 'regulator/fix/gpio', 'regulator/fix/put' and ↵Mark Brown
'regulator/fix/supp-volt' into tmp
2012-11-15regulator: fix voltage check in regulator_is_supported_voltage()Marek Szyprowski
regulator_is_supported_voltage() should return true only if the voltage of fixed/constant regulator is between min_uV and max_uV. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-14regulator: core: Avoid deadlock when regulator_register failsCharles Keepax
When regulator_register fails and exits through the scrub path the regulator_put function was called whilst holding the regulator_list_mutex, causing deadlock. This patch adds a private version of the regulator_put function which can be safely called whilst holding the mutex, replacing the aforementioned call. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-28Regulator: core: Unregister when gpio request fails.Andrew Lunn
If the gpio_request_one() fails, or returns EPROBE_DEFER, the regulator must be device_unregister()ed. When this is not done, there are WARNING: from sysfs: WARNING: at fs/sysfs/file.c:343 sysfs_open_file+0x238/0x268() Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-05Merge tag 'mfd-3.7-1' of ↵Linus Torvalds
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 ...
2012-10-02Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wqLinus Torvalds
Pull workqueue changes from Tejun Heo: "This is workqueue updates for v3.7-rc1. A lot of activities this round including considerable API and behavior cleanups. * delayed_work combines a timer and a work item. The handling of the timer part has always been a bit clunky leading to confusing cancelation API with weird corner-case behaviors. delayed_work is updated to use new IRQ safe timer and cancelation now works as expected. * Another deficiency of delayed_work was lack of the counterpart of mod_timer() which led to cancel+queue combinations or open-coded timer+work usages. mod_delayed_work[_on]() are added. These two delayed_work changes make delayed_work provide interface and behave like timer which is executed with process context. * A work item could be executed concurrently on multiple CPUs, which is rather unintuitive and made flush_work() behavior confusing and half-broken under certain circumstances. This problem doesn't exist for non-reentrant workqueues. While non-reentrancy check isn't free, the overhead is incurred only when a work item bounces across different CPUs and even in simulated pathological scenario the overhead isn't too high. All workqueues are made non-reentrant. This removes the distinction between flush_[delayed_]work() and flush_[delayed_]_work_sync(). The former is now as strong as the latter and the specified work item is guaranteed to have finished execution of any previous queueing on return. * In addition to the various bug fixes, Lai redid and simplified CPU hotplug handling significantly. * Joonsoo introduced system_highpri_wq and used it during CPU hotplug. There are two merge commits - one to pull in IRQ safe timer from tip/timers/core and the other to pull in CPU hotplug fixes from wq/for-3.6-fixes as Lai's hotplug restructuring depended on them." Fixed a number of trivial conflicts, but the more interesting conflicts were silent ones where the deprecated interfaces had been used by new code in the merge window, and thus didn't cause any real data conflicts. Tejun pointed out a few of them, I fixed a couple more. * 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (46 commits) workqueue: remove spurious WARN_ON_ONCE(in_irq()) from try_to_grab_pending() workqueue: use cwq_set_max_active() helper for workqueue_set_max_active() workqueue: introduce cwq_set_max_active() helper for thaw_workqueues() workqueue: remove @delayed from cwq_dec_nr_in_flight() workqueue: fix possible stall on try_to_grab_pending() of a delayed work item workqueue: use hotcpu_notifier() for workqueue_cpu_down_callback() workqueue: use __cpuinit instead of __devinit for cpu callbacks workqueue: rename manager_mutex to assoc_mutex workqueue: WORKER_REBIND is no longer necessary for idle rebinding workqueue: WORKER_REBIND is no longer necessary for busy rebinding workqueue: reimplement idle worker rebinding workqueue: deprecate __cancel_delayed_work() workqueue: reimplement cancel_delayed_work() using try_to_grab_pending() workqueue: use mod_delayed_work() instead of __cancel + queue workqueue: use irqsafe timer for delayed_work workqueue: clean up delayed_work initializers and add missing one workqueue: make deferrable delayed_work initializer names consistent workqueue: cosmetic whitespace updates for macro definitions workqueue: deprecate system_nrt[_freezable]_wq workqueue: deprecate flush[_delayed]_work_sync() ...
2012-10-02mfd: 88pm860x: Device tree supportHaojian Zhuang
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-28Merge remote-tracking branches 'regulator/topic/core', ↵Mark Brown
'regulator/topic/bypass', 'regulator/topic/tol', 'regulator/topic/drivers' and 'regulator/topic/tps6586x' into regulator-next
2012-09-28regulator: arizona-ldo: Remove top voltageMark Brown
The highest voltage step is not supported. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-25regulator: deprecate regulator-compatible DT propertyStephen Warren
When the bindings for the TPS6586x regulator were being proposed, I asserted that DT node naming rules for bus child nodes should also be applied to nodes inside the TPS6586x regulator node itself. In other words, that each node providing regulator init data should be named after the type of object it represented ("regulator") and hence that some other property was required to indicate which regulator the node described ("regulator-compatible"). In turn this led to multiple nodes having the same name, thus requiring node names to use a unit address to make them unique, thus requiring reg properties within the nodes and However, subsequent discussion indicates that the rules I was asserting only applies to standardized bus nodes, and within a device's own node, the binding can basically do anything sane that it wants. Hence, this change deprecates the register-compatible property, and instead uses node names to replace this functionality. This greatly simplifies the device tree content, making them smaller and more legible. The code is changed such that old device trees continue to work. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-23regulator: palmas: Add DT supportGraeme Gregory
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>
2012-09-19mfd: 88pm860x: Avoid to check resource for preg regulatorHaojian Zhuang
Since PREG regulator is the only one regulator in 88PM8606, and other regulators are in 88PM8607. Checking resource as identifying regulator is not a good way. We can use NULL resource to indentify PREG regulator. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-19regulator: 88pm860x: Add pre-regulator support for 88pm860x regulatorJett.Zhou
Pre-regulator of 88pm8606 is mainly for support charging based on vbus, it needs to be enabled for charging battery, and will be disabled in some exception condition like over-temp. Add the pre-regulator support for 88pm860x regulator driver. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-19mfd: max8925: Remove array in regulator platform dataHaojian Zhuang
Remove array in parent's platform data. Use struct regulator_init_data as regulator device's platform data directly. So a lot of pdata are added into parent's platform data. And voltage out register offset is used as IORESOURCE_REG to distinguish different regualtor devices. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-17regulator: anatop-regulator: Convert to use syscon to access anatop registerDong Aisheng
Using syscon to access anatop register. Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-16Merge tag 'mfd-for-linus-3.6-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull mfd fixes from Samuel Ortiz: "This is the remaining MFD fixes for 3.6, with 5 pending fixes: - A tps65217 build error fix. - A lcp_ich regression fix caused by the MFD driver failing to initialize the watchdog sub device due to ACPI conflicts. - 2 MAX77693 interrupt handling bug fixes. - An MFD core fix, adding an IRQ domain argument to the MFD device addition API in order to prevent silent and potentially harmful remapping behaviour changes for drivers supporting non-DT platforms." * tag 'mfd-for-linus-3.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: mfd: MAX77693: Fix NULL pointer error when initializing irqs mfd: MAX77693: Fix interrupt handling bug mfd: core: Push irqdomain mapping out into devices mfd: lpc_ich: Fix a 3.5 kernel regression for iTCO_wdt driver mfd: Move tps65217 regulator plat data handling to regulator
2012-09-14mfd: ab3100: Split ab3100 headers out of abx500.hMarcus Cooper
The U8500 has its own set of separate header, so the abx500 becomes completely abstract. Do the same split for the AB3100 legacy ASIC. Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-11mfd: 88pm860x: Use REG resource in regulatorHaojian Zhuang
Since IORESOURCE_IO is changed to IORESOURCE_REG in 88pm860x driver, update self-defined IORESOURCE_IO resource to register offset that is IORESOURCE_REG in regulator driver. And split regulator platform data array into scattered platform data. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-11mfd: 88pm860x: Convert to IORESOURCE_REGMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-11mfd: wm831x: Convert to IORESOURCE_REGMark Brown
This was originally written by Russell King who unfortunately found himself unable to take the patch futher. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-10regulator: fan53555: remove vsel_max not usedYunfan Zhang
The max voltage will be bounded by min_uV, uV_step and n_voltages, so remove it to avoid confusing. Signed-off-by: Yunfan Zhang <yfzhang@marvell.com> Reviewed-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10regulator: aat2870: Don't explicitly initialise the first fieldMark Brown
Doing so generates a warning as the first field is a pointer but we use 0 to initalize it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10regulator: wm831x-ldo: Add bypass supportMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10regulator: arizona-micsupp: Support get/set bypassMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10regulator: arizona-ldo: Support get/set bypassMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10regulator: core: Provide regmap get/set bypass operationsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10regulator: core: Support bypass modeMark Brown
Many regulators support a bypass mode where they simply switch their input supply to the output. This is mainly used in low power retention states where power consumption is extremely low so higher voltage or less clean supplies can be used. Support this by providing ops for the drivers and a consumer API which allows the device to be put into bypass mode if all consumers enable it and the machine enables permission for this. This is not supported as a mode since the existing modes are rarely used due to fuzzy definition and mostly redundant with modern hardware which is able to respond promptly to load changes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Graeme Gregory <gg@slimlogic.co.uk>
2012-09-10regulator: Fairchild fan53555 supportYunfan Zhang
This driver supports Fairchild FAN53555 Digitally Programmable TinyBuck Regulator. The FAN53555 is a step-down switching voltage regulator that delivers a digitally programmable output from an input voltage supply of 2.5V to 5.5V. The output voltage is programmed through an I2C interface. Signed-off-by: Yunfan Zhang <yfzhang@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-09regulator: twl: Remove another unused variable warningMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-08regulator: core: Try using the parent device for the default regmapAnilKumar Ch
If the device doesn't have a regmap specified by the driver and we can't find one on the device itself try its parent, providing a useful defualt for many MFDs. [Rewrite commit message -- broonie] Signed-off-by: AnilKumar Ch <anilkumar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-08regulator: core: Fast path non-deferred disablesMark Brown
Users (especially framework code) may end up passing in a zero deferral time depending on runtime conditions or configuration. If they do then just call regulator_disable() directly to save scheduling. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-09-07regulator: core: Report microvolts in sysfs even with only list_voltage()Mark Brown
If a regulator only supports a single voltage list_voltage() can be used to report what that voltage is so add this as one of the criteria for creating the microvolts file in sysfs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-05regulator: tps6586x: add support for SYS railLaxman Dewangan
Device have SYS rail which is always ON. It is system power bus. LDO5 and LDO_RTC get powered through this rail internally. Add support for this rail and make the LDO5/LDO_RTC supply by it. Update document accordingly. [swarren: Instantiate the sys regulator from board-harmony-power.c to avoid regression.] Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-05regulator: lp872x: remove unnecessary functionKim, Milo
The lp872x_check_dvs_validity() is used for checking DVS platform data. If the DVS platform data is not defined, return as error code. Now, this is unnecessary because the default DVS mode is set in this case. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-05regulator: lp872x: fix NULL pointer access problemKim, Milo
The lp872x_set_dvs() is used for changing the DVS pin state. This function works only when the DVS platform data is defined. So don't assume that DVS data is always valid. In case the platform data is not defined, the DVS data is set to NULL for skipping the DVS pin control. DVS selection and GPIO pin number are used for the LP872x DVS pin control. For better readability, DVS selection argument is added in lp872x_set_dvs(). Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-05regulator: lp872x: initialize the DVS modeKim, Milo
The platform specific configuration(general_config) is optional. However, the DVS settings should be configured explicitly while loading the driver. This patch enables configuring the default DVS mode even though the platform data is not defined. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-05regulator: lp872x: set the default DVS modeKim, Milo
The lp872x driver has the DVS platform data which select the register address of the BUCK voltage. This patch enables updating the default DVS mode when the DVS platform data is not defined. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-05regulator: lp872x: remove regulator platform data dependencyKim, Milo
This patch enables registering the regulator driver even though the regulator_init_data is not defined in the platform side. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: mc13783: add regulators sw1x and sw2xGaëtan Carlier
Signed-off-by: Gaëtan Carlier <gcembed@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: max8907: Add MODULE_ALIASAxel Lin
This driver can be built as a module, add MODULE_ALIAS for it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: max8907: fix use of possibly NULL idataStephen Warren
If a regulator is not used by a board, it's quite legitimate not to provide platform data or a device tree node to configure it (i.e. regulator_init_data). In that case, during MAX8907 regulator's probe(), the idata variable will be NULL for that regulator. Prevent dereferincing it. If the MBATT regulator's init_data is not specified, or no name was specified in the constraints, the regulator will be named based on the regulator descriptor, so initialize mbatt_rail_name from there. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: fix kernel-doc warnings in drivers/regulator/core.cRandy Dunlap
Fix regulator kernel-doc warnings: Warning(drivers/regulator/core.c:2308): No description found for parameter 'rdev' Warning(drivers/regulator/core.c:2308): Excess function parameter 'regulator' description in 'regulator_set_voltage_time_sel' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Liam Girdwood <lrg@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: ab8500: provide per-regulator shiftLinus Walleij
This encodes the voltage shifts (the number of bits to shift the register to get to the selector) into the regulator info. We have several new variants of the AB8500 so this varies a lot. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: max8907: fix compile error when !CONFIG_OFStephen Warren
Fix the following: CC [M] drivers/regulator/max8907-regulator.o drivers/regulator/max8907-regulator.c: In function 'max8907_regulator_probe': drivers/regulator/max8907-regulator.c:297:12: error: 'max8907_matches' undeclared (first use in this function) by removing direct references to max8907_matches[], which only exists when CONFIG_OF is defined. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: max8907: Properly set pmic pointer in max8907_regulator_remove()Axel Lin
Add missing platform_get_drvdata() call in max8907_regulator_remove(), this fixes below build warning: CC [M] drivers/regulator/max8907-regulator.o drivers/regulator/max8907-regulator.c: In function 'max8907_regulator_remove': drivers/regulator/max8907-regulator.c:353:23: warning: 'pmic' is used uninitialized in this function [-Wuninitialized] Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: max8907: Fix n_voltages for MAX8907B SD1Axel Lin
For linear voltage mapping, the n_voltages is (max - min) / step + 1 Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: using kfree() requires including slab.hStephen Rothwell
Fixes this build error: drivers/regulator/twl-regulator.c: In function 'twlreg_probe': drivers/regulator/twl-regulator.c:1229:3: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration] Also added string.h for kmemdup(). Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: add MAX8907 driverGyungoh Yoo
The MAX8907 is an I2C-based power-management IC containing voltage regulators, a reset controller, a real-time clock, and a touch-screen controller. The original driver was written by: * Gyungoh Yoo <jack.yoo@maxim-ic.com> Various fixes and enhancements by: * Jin Park <jinyoungp@nvidia.com> * Tom Cherry <tcherry@nvidia.com> * Prashant Gaikwad <pgaikwad@nvidia.com> * Dan Willemsen <dwillemsen@nvidia.com> * Laxman Dewangan <ldewangan@nvidia.com> During upstreaming, I (swarren): * Converted to regmap. * Allowed probing from device tree. * Reworked the regulator driver to be represented as a single device that provides multiple regulators, rather than as a device per regulator. * Replaced many regulator ops with standard functions. * Added ability to specify supplies for each regulator. * Removed the WLED regulator. If/when we expose this in the driver, it should be a backlight object not a regulator object. * Renamed from max8907c->max8907, since the driver covers at least the C and B revisions. * General cleanup. Signed-off-by: Gyungoh Yoo <jack.yoo@maxim-ic.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: twl: make twl_info tables constArnd Bergmann
I currently carry the series to make of_device_id->data const in the arm-soc tree, which fixes a number of issues, but leaves one new compiler warning about the twl-regulator driver: drivers/regulator/twl-regulator.c: In function 'twlreg_probe': drivers/regulator/twl-regulator.c:1130:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] drivers/regulator/twl-regulator.c:1139:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] The warning indicates that the driver takes a static table with initialization data for each regulator, modifies the data in place and passes a pointer to that structure to the regulator_register function. This is probably ok because a system contains only one instance of each regulator, but it's still bad style because any driver should be written to support multiple instances of the same hardware. This patch changes the code to dynamically allocate the memory we pass to the regulator core so the table can be constant. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28regulator: twl: Remove get_voltage implementation for single voltage regulatorsAxel Lin
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>