aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-03-21Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulatorLinus Torvalds35-1033/+3412
Pull regulator updates for 3.4 from Mark Brown: "This has been a fairly quiet release from a regulator point of view, the only real framework features added were devm support and a convenience helper for setting up fixed voltage regulators. We also added a couple of drivers (but will drop the BQ240022 driver via the arm-soc tree as it's been replaced by the more generic gpio-regulator driver) and Axel Lin continued his relentless and generally awesome stream of fixes and cleanups." * tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (93 commits) regulator: Fix up a confusing dev_warn when DT lookup fails regulator: Convert tps6507x to set_voltage_sel regulator: Refactor tps6507x to use one tps6507x_pmic_ops for all LDOs and DCDCs regulator: Make s5m8767_get_voltage_register always return correct register regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier regulator: tps65910: Provide settling time for DCDC voltage change regulator: Add Anatop regulator driver regulator: Simplify implementation of tps65912_get_voltage_dcdc regulator: Use tps65912_set_voltage_sel for both DCDCx and LDOx regulator: tps65910: Provide settling time for enabling rails regulator: max8925: Use DIV_ROUND_UP macro regulator: tps65912: Use simple equations to get register address regulator: Fix the logic of tps65910_get_mode regulator: Merge tps65217_pmic_ldo234_ops and tps65217_pmic_dcdc_ops to tps65217_pmic_ops regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_current regulator: Use array to store dcdc_range settings for tps65912 regulator: Rename s5m8767_convert_voltage to s5m8767_convert_voltage_to_sel regulator: tps6524x: Remove unneeded comment for N_REGULATORS regulator: Rename set_voltage_sel callback function name to *_sel regulator: Fix s5m8767_set_voltage_time_sel calculation value ...
2012-03-20Merge tag 'driver-core-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-coreLinus Torvalds1-2/+2
Pull driver core patches for 3.4-rc1 from Greg KH: "Here's the big driver core merge for 3.4-rc1. Lots of various things here, sysfs fixes/tweaks (with the nlink breakage reverted), dynamic debugging updates, w1 drivers, hyperv driver updates, and a variety of other bits and pieces, full information in the shortlog." * tag 'driver-core-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (78 commits) Tools: hv: Support enumeration from all the pools Tools: hv: Fully support the new KVP verbs in the user level daemon Drivers: hv: Support the newly introduced KVP messages in the driver Drivers: hv: Add new message types to enhance KVP regulator: Support driver probe deferral Revert "sysfs: Kill nlink counting." uevent: send events in correct order according to seqnum (v3) driver core: minor comment formatting cleanups driver core: move the deferred probe pointer into the private area drivercore: Add driver probe deferral mechanism DS2781 Maxim Stand-Alone Fuel Gauge battery and w1 slave drivers w1_bq27000: Only one thread can access the bq27000 at a time. w1_bq27000 - remove w1_bq27000_write w1_bq27000: remove unnecessary NULL test. sysfs: Fix memory leak in sysfs_sd_setsecdata(). intel_idle: Revert change of auto_demotion_disable_flags for Nehalem w1: Fix w1_bq27000 driver-core: documentation: fix up Greg's email address powernow-k6: Really enable auto-loading powernow-k7: Fix CPU family number ...
2012-03-19Merge tag 'topic/twl' into regulator-nextMark Brown1-81/+246
TWL specific changes, cross-merged with OMAP due to arch/arm wanting to use the new ability to override the voltage set and get operations to support the in-CPU voltage management. The other changes are minor fixes, the addition of a few new regulators and device tree support.
2012-03-18Merge remote-tracking branch 'regulator/topic/supply' into regulator-nextMark Brown1-17/+8
2012-03-18Merge remote-tracking branches 'regulator/topic/devm' and 'regulator/topic/stub' into regulator-nextMark Brown1-0/+108
2012-03-18Merge remote-tracking branch 'regulator/topic/stub' into regulator-nextMark Brown5-3/+58
2012-03-18Merge remote-tracking branch 'regulator/topic/drivers' into regulator-nextMark Brown33-894/+2971
2012-03-16regulator: Fix up a confusing dev_warn when DT lookup failsRajendra Nayak1-1/+1
of_parse_phandle() returns NULL either if the property name itself does not exist or if it (exists and) does not reference a valid phandle. Giving out a warn like the one below (that the property references an invalid phandle) can be confusing when the property itself does not exist in the node. Fix it with a more sensible message and make it a dev_dbg instead of a dev_warn. Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: Convert tps6507x to set_voltage_selAxel Lin1-26/+5
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: Refactor tps6507x to use one tps6507x_pmic_ops for all LDOs and DCDCsAxel Lin1-201/+67
All the callback functions implementation for DCDCx and LDOx are very similar, I think it is ok to use one tps6507x_pmic_ops for all LDOs and DCDCs. This refactor removes a couple of duplicated code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: Make s5m8767_get_voltage_register always return correct registerAxel Lin1-18/+9
Check s5m8767->buck[2|3|4]_gpiodvs status in s5m8767_get_voltage_register and return correct register accordingly. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlierAxel Lin1-24/+21
If we need to ensure only one of the buck[2|3|4]_gpiodvs can be specificed, check them earlier. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: tps65910: Provide settling time for DCDC voltage changeLaxman Dewangan1-13/+32
Settling time is require when there is dcdc rail's voltage change. Returning proper delay time for dcdc voltage change to settle down the output voltage to new value. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: Add Anatop regulator driverYing-Chun Liu (PaulLiu)3-0/+250
Anatop is an integrated regulator inside i.MX6 SoC. There are 3 digital regulators which controls PU, CORE (ARM), and SOC. And 3 analog regulators which controls 1P1, 2P5, 3P0 (USB). This patch adds the Anatop regulator driver. Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com> Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Acked-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: Simplify implementation of tps65912_get_voltage_dcdcAxel Lin1-26/+5
Call tps65912_get_sel_register instead of duplicating the same code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14regulator: Use tps65912_set_voltage_sel for both DCDCx and LDOxAxel Lin1-16/+3
commit 42b5ef "regulator: tps65912: Use simple equations to get register address" uses tps65912_get_sel_register to replace tps65912_get_dcdc_sel_register and tps65912_get_ldo_sel_register. Now tps65912_set_voltage_dcdc_sel and tps65912_set_voltage_ldo_sel has exactly the same implementation. Merge them to tps65912_set_voltage_sel function. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-13regulator: tps65910: Provide settling time for enabling railsLaxman Dewangan1-0/+37
There is settling time for each rails when it is switched to ON. Implementing enable time for returning proper settling time of regulator rails when it is enabled. Filling the on-time for each rail as per tps65910/tps65911 datasheets. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-13regulator: max8925: Use DIV_ROUND_UP macroAxel Lin1-2/+2
Use DIV_ROUND_UP macro for better readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-13regulator: tps65912: Use simple equations to get register addressAxel Lin1-144/+18
The address of ctrl and sel registers can be calculated by simple equations. This patch simplifies the implementation in tps65912_get_ctrl_register and implements tps65912_get_sel_register to replace tps65912_get_dcdc_sel_register and tps65912_get_ldo_sel_register. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-13regulator: Fix the logic of tps65910_get_modeAxel Lin1-1/+1
We actually clear LDO_ST_ON_BIT for standby mode in tps65910_set_mode. Fix the logic in tps65910_get_mode. Supply state (EEPROM bits): ST[1:0] = 00 : Off ST[1:0] = 01 : On high power (ACTIVE) ST[1:0] = 10 : Off ST[1:0] = 11 : On low power (SLEEP) Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-12regulator: Support driver probe deferralMark Brown1-2/+2
If we fail to locate a requested regulator return -EPROBE_DEFER. If drivers pass this error code through to their caller (which they really should) then this will ensure that the probe is retried later when further devices become available. In the unusual case where a driver doesn't want this it can override the default behaviour. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-12regulator: Merge tps65217_pmic_ldo234_ops and tps65217_pmic_dcdc_ops to tps65217_pmic_opsAxel Lin1-187/+72
Most callback functions implementation for tps65217_pmic_ldo234_ops and tps65217_pmic_dcdc_ops are the same except the rid range checking. This patch uses tps65217_pmic_ops for all DCDCx, LDO2, LDO3, and LDO4. And rework tps65217_pmic_set_voltage to make it can be called for DCDCx, LDO2, LDO3, and LDO4. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-12regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_currentAxel Lin1-1/+1
DIV_ROUND_CLOSEST performs the computation (x + d/2)/d with better readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Use array to store dcdc_range settings for tps65912Axel Lin1-50/+20
Then we can use the regulator id as array index to access the array. This change makes the code simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Rename s5m8767_convert_voltage to s5m8767_convert_voltage_to_selAxel Lin1-12/+10
This function finds the smallest voltage that falls within the specified range, and then returns the selector. This rename makes the intention more clear. Also remove unneeded local variables min_vol and max_vol in s5m8767_set_voltage and s5m8767_set_voltage_buck. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: tps6524x: Remove unneeded comment for N_REGULATORSAxel Lin1-3/+1
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Rename set_voltage_sel callback function name to *_selAxel Lin2-13/+15
This change improves readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Fix s5m8767_set_voltage_time_sel calculation valueSangbeom Kim1-1/+1
In the s5m8767_set_voltage_time_sel function, divisor unit is wrong. ramp_delay is usec unit. So 1000 should be multiplied. Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: tps6586x: fix typo in debug messageThierry Reding1-1/+1
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: tps65910: Sleep off rails when ext sleep configuredLaxman Dewangan1-4/+13
Keep the rails OFF in sleep mode only when the rails are controlled by external sleep control. The devices tps65910 and tps65911, both has the sleep input. The tps65911's sleep input is not same as tps65910's EN3 and hence taking care of SLEEP input as separate external sleep control input. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Simplify the implementation of tps65912_get_voltage_dcdcAxel Lin1-67/+45
Call tps65912_list_voltage_dcdc instead of duplicating the same code. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: max8649: Use DIV_ROUND_UP macro to calculate selectorAxel Lin1-2/+1
Use DIV_ROUND_UP macro for better readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Silence error message in max8998_pmic_probeAxel Lin1-1/+0
This looks like a mistakenly committed debug logging. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Remove unused i2c variable in s5m8767_pmic_probeAxel Lin1-2/+0
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: tps65217: Use DIV_ROUND_UP macro to calculate selectorAxel Lin1-6/+6
Use DIV_ROUND_UP macro for better readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: da903x: Use DIV_ROUND_UP macro to calculate selectorAxel Lin1-6/+6
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: wm8400: Use DIV_ROUND_UP macro to calculate selectorAxel Lin1-3/+3
Use DIV_ROUND_UP macro for better readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator fixed: Do not report enumaratable voltages if there are noneSascha Hauer1-1/+3
If used as a dummy voltage provider the fixed regulator should not set n_voltages to make the core accept the device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: max8660: Use DIV_ROUND_UP macro to calculate selectorAxel Lin1-7/+9
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: max1586: Use DIV_ROUND_UP macro to calculate selectorAxel Lin1-2/+2
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: ad5398: Use DIV_ROUND_UP macro to calculate selectorAxel Lin1-2/+2
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Add a pointer to aat2870_data in struct aat2870_regulatorAxel Lin1-7/+7
The reason we add *pdev in struct aat2870_regulator is to use it to get a pointer to struct aat2870_data. Save a pointer to struct aat2870_data instead of pdev in struct aat2870_regulator, this change makes the intention more clear. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Jin Park <jinyoungp@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Simplify the code to get selector in isl6271a_set_voltageAxel Lin1-11/+3
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Kill max8998_get_ldo functionAxel Lin1-10/+5
Use rdev_get_id() directly. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Kill max8997_get_rid functionAxel Lin1-17/+12
Use rdev_get_id() directly. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Fix n_voltage settings for pcf50633 regulatorAxel Lin1-14/+13
Current code has off-by-one n_voltage settings for AUTO/DOWN*/LDO* regulators. Take ldo1 as example: n_voltage should be (3.6 - 0.9) / 0.1 + 1 = 28 Table 76. LDO1OUT - LDO1 output voltage select register (address 2Dh) bit description[1] Bit Symbol Access Description 4:0 ldo1_out R/W VO(prog) = 0.9 + ldo1_out × 0.1 V (max 3.6V); e.g. 00000 : 0.9 V 00001 : 1.0 V 11000 : 3.3 V 11011 : 3.6 V 11111 : 3.6 V The n_voltage settings for HCLDO and MEMLDO are also wrong. n_voltage for HCLDO and MEMLDO should be (3.6 - 0.9) / 0.1 + 1 = 28 Table 88. HCLDOOUT - HCLDO output voltage select register (addr. 39h) bit description[1] Bit Symbol Access Description 4:0 hcldo_out R/W VO(prog) = 0.9 + hcldo_out × 0.1 V (max 3.6 V); e.g. 00000 : 0.9 V 00001 : 1.0 V 11011 : 3.6 V 11111 : 3.6 V Table 62. MEMLDOOUT - MEMLDO o/p voltage select reg. (address 26h) bit description[1] Bit Symbol Access Description 4:0 memldo_out R/W VO(prog) = 0.9 + memldo_out × 0.1 V; e.g. 00000: 0.9 V 00001: 1.0 V 11000 : 3.3 V 11011 : 3.6 V 11111 : 3.6 V Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Fix the logic of s5m8767_set_voltage_time_selAxel Lin1-28/+2
This patch includes below fixes: 1. The mask variable is not used at all here, remove it. 2. We already have the new_sel and old_sel, simply returns the delay by: DIV_ROUND_UP(desc->step * (new_sel - old_sel), s5m8767->ramp_delay); Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: mc13783: bail out without platform dataSascha Hauer1-0/+3
the platform data pointer is used without checking it. Bail out in the driver instead of crashing the kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Convert ab8499 to use get_voltage_sel()Axel Lin1-6/+4
This change is required to make ab8500_regulator_get_voltage_sel work. The regulator core will call set_voltage_time_sel only when get_voltage_sel is implemented. Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-11regulator: Sort Kconfig and Makefile entriesAxel Lin2-174/+174
Sort Kconfig entries by company name/driver in alphabetical order. Sort Makefile entries by alphabetical order. In order to group all the Kconfig entries by company name, this patch also adds company name to some Kconfig entries. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>