summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* regulator: Add generic DT parsing for regulatorsThierry Reding2012-05-042-0/+65
| | | | | | | | | | | | | Looking up init data for regulators found on chips is a common operation that can be handled in a generic way. The new helper function introduced by this patch looks up the children of a given node by names specified in a match table and fills that match table with information parsed from the DT. This is based on work by Rhyland Klein <rklein@nvidia.com>. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: wm831x-dcdc: Specify supply namesMark Brown2012-04-231-1/+12
| | | | | | Allows hookup via normal consumer mechanisms. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: wm831x-ldo: Set up supply namesMark Brown2012-04-231-1/+17
| | | | | | Allows hookup via normal consumer mechanisms. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: tps65912: Convert to get_voltage_selAxel Lin2012-04-231-4/+4
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8998: Convert ot use devm_kzallocAxel Lin2012-04-231-28/+17
| | | | | | | | | | | Also simplify the error handling to start unwind from the place regulator_register fails. No need to check rdev[i] is NULL or not before calling regulator_unregister. regulator_unregister is safe if rdev is NULL, Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8997: Convert ot use devm_kzallocAxel Lin2012-04-231-25/+15
| | | | | | | | | | | Also simplify the error handling to start unwind from the place regulator_register fails. No need to check rdev[i] is NULL or not before calling regulator_unregister. regulator_unregister is safe if rdev is NULL, Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Remove unneeded include of linux/delay.h from regulator driversAxel Lin2012-04-2316-16/+0
| | | | | | | | | | | | | All the drivers that need delay for the regulator voltage output voltage to stabilize after being enabled or after being set to a new value has been converted to implement enable_time and set_voltage_time_sel callbacks. Then regulator core will take care of the necessary delay. For the drivers that don't need the delay, don't need to include linux/delay.h. This patch removes the unneeded include of linux/delay.h in regulator drivers. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8997: Remove empty set_suspend_enable callback implementationAxel Lin2012-04-231-9/+0
| | | | | | | | | Since commit 8ac0e95 "regulator: core: Support setting suspend_[mode|voltage] if set_suspend_[en|dis]able is NULL", now the regulator core can properly handle the case set_suspend_enable callback is NULL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8997: Remove is_enabled callback implementation for ↵Axel Lin2012-04-231-4/+1
| | | | | | | | | | | | | max8997_charger_fixedstate_ops If is_enabled callback is not implemented, the core assumes that the regulator is on. This is simpler than having a hack to retrun 1 in max8997_reg_is_enabled() if max8997_get_enable_register() returns -EINVAL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: s5m8767: Use DIV_ROUND_UP to calculate selectorAxel Lin2012-04-231-1/+4
| | | | | | | | | | | Integer division may truncate the result. Use DIV_ROUND_UP to ensure new voltage setting falls within specified range. Also properly handle the case min_vol < desc->min to ensure we don't return negative value for selector. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8952: Convert to get_voltage_selAxel Lin2012-04-201-9/+4
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: tps6507x: Convert to get_voltage_selAxel Lin2012-04-201-3/+3
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: virtual: Replace strict_strtol with kstrtolAxel Lin2012-04-191-4/+4
| | | | | | | | strict_strtol is deprecated and results in a checkpatch warning. Replace it with kstrtol. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: 88pm8607: Fix writting value to vol_reg in pm8607_set_voltage_selAxel Lin2012-04-191-1/+1
| | | | | | | | | commit 4ca1e1d "regulator: Convert 88pm8607 to set_voltage_sel" accidentally changed the value writing to vol_reg. What we want is to write val instead of selector to vol_reg. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: virtual: Convert to use devm_* APIsAxel Lin2012-04-181-13/+5
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: userspace-consumer: Convert to use devm_* APIsAxel Lin2012-04-181-13/+7
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert max8997 to set_voltage_time_selAxel Lin2012-04-171-13/+42
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert max8997 to get_voltage_selAxel Lin2012-04-171-21/+32
| | | | | | | | | Also rename get_current_limit and set_current_limit callbacks to max8997_get_current_limit and max8997_set_current_limit for better readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* mfd: Revert "mfd: add irq domain support for max8997 interrupts"Mark Brown2012-04-176-39/+33
| | | | | | | | This reverts commit 98d8618af37728f6e18e84110ddb99987b47dd12 as it breaks the build of the muic driver. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8660: Fix a memory leak due to missing devm_kzalloc conversionAxel Lin2012-04-171-1/+1
| | | | | | | | commit 4d26f7 "regulator: max8660: Use devm_kzalloc()" missed to replace kzalloc by devm_kzalloc. Fix it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* mfd: add irq domain support for max8997 interruptsThomas Abraham2012-04-166-33/+39
| | | | | | | | | | | | | | Add irq domain support for max8997 interrupts. The reverse mapping method used is linear mapping since the sub-drivers of max8997 such as regulator and charger drivers can use the max8997 irq_domain to get the linux irq number for max8997 interrupts. All uses of irq_base in platform data and max8997 driver private data are removed. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: Directly include of.hMark Brown2012-04-161-0/+1
| | | | | Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: wm8994: Convert to set_voltage_sel()Mark Brown2012-04-151-35/+6
| | | | | | | | There's no need to implement set_voltage() as there is only a very small range of selectors for the regulators in the WM8994 and the voltages are not expected to vary frequently at runtime. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: da9052: add device tree supportYing-Chun Liu (PaulLiu)2012-04-131-1/+28
| | | | | | | | | | | | This patch adds device tree support for dialog regulators Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@ti.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Ashish Jangam <ashish.jangam@kpitcummins.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8660: Use devm_kzalloc()Axel Lin2012-04-131-13/+7
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max1586: Use devm_kzalloc()Axel Lin2012-04-131-11/+5
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: isl6271a-regulator: Use devm_kzalloc()Axel Lin2012-04-131-6/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert max8998 to set_voltage_time_selAxel Lin2012-04-131-7/+28
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert max8998 to get_voltage_selAxel Lin2012-04-131-9/+10
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: twl-regulator: Use twlreg_grp helper functionAxel Lin2012-04-131-11/+10
| | | | | | | Since the twlreg_grp helper function is there, use it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: twl-regulator: Implement enable_time callbackAxel Lin2012-04-131-4/+19
| | | | | | | Let regulator core do the necessary delay for us. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Update regulator_register() API signature in DocumentationAxel Lin2012-04-131-2/+1
| | | | | | | | | | | commit c172708 "regulator: core: Use a struct to pass in regulator runtime configuration" changed the regulator_register() API signature. Update the Documentation accordingly to reflect the change in the function signature. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Appease smatch in regulator_register()Mark Brown2012-04-111-1/+3
| | | | | | | We don't support missing configs at all so segfaulting isn't that bad but since we've got checks in the code move the dereference after them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert tps65xxx regulator drivers to use devm_kzallocAxel Lin2012-04-114-19/+6
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert anatop to use a struct to pass in regulator runtime ↵Axel Lin2012-04-101-2/+7
| | | | | | | configuration Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: twl-regulator: Fix off-by-one vsel setting in twl6030smps_set_voltageAxel Lin2012-04-101-4/+10
| | | | | | | | | | | | | | commit 268a1 "regulator: twl-regulator: Use DIV_ROUND_UP at appropriate places" introduced an off-by-one bug for setting vsel. The linear calculation code in twl6030smps_list_voltage() does subtract index by 1 so we need the vsel++ after DIV_ROUND_UP. The original code use this trick to differentiate if we are going to set the voltage to 0 or the voltage falls within the linear calculation range. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: tps65023: Use devm_* APIsAxel Lin2012-04-101-11/+3
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: tps62360: Convert to devm_regmap_init_i2c()Axel Lin2012-04-101-3/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8649: Use devm_* APIsAxel Lin2012-04-101-13/+6
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: twl-regulator: Use DIV_ROUND_UP at appropriate placesAxel Lin2012-04-101-24/+6
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: twl-regulator: Simplify the code matching regulator idAxel Lin2012-04-101-3/+5
| | | | | | | | | | | | This patch makes the code easier to read. Also add checking the case when no desc id is matched. This is required because if no desc id is matched, the poiner info is pointed to twl_of_match[i].data which may be not NULL. Checking info is NULL or not latter does not catch the error. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8998: Use simple equation to get selectorAxel Lin2012-04-101-9/+10
| | | | | | | It's more efficient to get the best selector by simple equation. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8997: Use simple equation to get selectorAxel Lin2012-04-101-4/+5
| | | | | | | It's more efficient to get the best selector by simple equation. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8997: Remove n_bits from struct voltage_map_descAxel Lin2012-04-101-9/+5
| | | | | | | | | | | | | | | The n_bits is only used in max8997_get_voltage_proper_val to check the valid range for variable i. Current code already ensures min_vol never greater than desc->max, which means the variable i always in the valid range: 0 .. (desc->max - desc->min)/desc->step. Thus we can remove the checking (i >= (1 << desc->n_bits) and then remove n_bits from struct voltage_map_desc. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macroAxel Lin2012-04-101-48/+41
| | | | | | 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>
* regulator: Use one s5m8767_ops for both LDOs and BUCKsAxel Lin2012-04-101-13/+3
| | | | | | | | | All the callback function implementation are the same for both LDOs and BUCKs. Merge them to one s5m8767_ops. 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>
* regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKsAxel Lin2012-04-101-94/+49
| | | | | | | | | | | | | | | | | | | | s5m8767_set_voltage not only implement set_voltage callbacks for LDOs, but also for BUCKs when s5m8767->buck_gpioindex is not set. s5m8767_set_voltage_buck actually only for buck[2|3|4] when s5m8767->buck_gpioindex is set. Conditionally calling s5m8767_set_voltage in s5m8767_set_voltage_buck makes the code hard to read. I think merging s5m8767_set_voltage_buck and s5m8767_set_voltage actually simplifies things. It's easy to use buck234_vol pointer to differentiate if we need to control voltage for buck[2|3|4] by DVS GPIOs. This patch reworks s5m8767_set_voltage to support both LDOx and BUCKx in all cases. 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>
* Merge tag 'v3.4-rc2' into regulator-driversMark Brown2012-04-10611-3667/+8690
|\ | | | | | | Linux 3.4-rc2 contains some fixes that further patches depend upon.
| * Linux 3.4-rc2v3.4-rc2Linus Torvalds2012-04-071-1/+1
| |
| * Merge tag 'regmap-3.4-fixes' of ↵Linus Torvalds2012-04-072-1/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull two more small regmap fixes from Mark Brown: - Now we have users for it that aren't running Android it turns out that regcache_sync_region() is much more useful to drivers if it's exported for use by modules. Who knew? - Make sure we don't divide by zero when doing debugfs dumps of rbtrees, not visible up until now because everything was providing at least some cache on startup. * tag 'regmap-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: prevent division by zero in rbtree_show regmap: Export regcache_sync_region()
OpenPOWER on IntegriCloud