summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* regulator: Add support for RICOH PMIC RC5T583 regulatorLaxman Dewangan2012-04-044-0/+407
| | | | | | | | | | | | The RC5T583 PMIC from RICOH consists of 4 DCDC and 10 LDOs. This driver supports the control of different regulator output through regulator interface. This driver depends on MFD driver of RC5T583 and uses mfd rc5t583 apis to communicate to device for accessing different device's registers. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: tps6524x: Use module_spi_driver()Mark Brown2012-04-041-11/+1
| | | | | | | Unusual to see a regulator driver not using subsys_initcall() but the deferred probe support should make this viable. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8860: Remove announcement on probeMark Brown2012-04-041-1/+0
| | | | | | | The core already announces constraints and we're not adding any new information such as the chip revision. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8649: Remove contentless announcement log messageMark Brown2012-04-041-1/+0
| | | | | | | | The core already logs the regulator constraints as it is registered and we're not adding any extra content about the device such as the chip revision. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: lp3971: Convert to module_i2c_driver()Mark Brown2012-04-041-17/+1
| | | | | | | Unusual to see a regulator driver not using subsys_initcall() but with the probe deferral support should be becoming more and more viable. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: isl6271a: Allow missing init_data for diagnosticsMark Brown2012-04-041-5/+0
| | | | | | | | The regulator core supports this to allow the configuration to be inspected at runtime even if no software mangement is enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Marek Vasut <marek.vasut@gmail.com>
* regulator: gpio-regulator: Basic devm_kzalloc() conversionMark Brown2012-04-041-3/+2
| | | | | | | There's some other allocations but they're not so trivial as they use kmemdup() and kstrdup(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: gpio-regulator: Sort in MakefileMark Brown2012-04-041-1/+1
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert mc13xxx regulator drivers to set_voltage_selAxel Lin2012-04-033-64/+9
| | | | | | | | Convert mc13892_sw_regulator_ops and mc13xxx_regulator_ops to set_voltage_sel. mc13xxx_get_best_voltage_index function is not used now, remove it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: fixed: Support for open drain gpio pinLaxman Dewangan2012-04-032-12/+18
| | | | | | | | | | | | | | | | | Adding flag on fixed regulator board configuration structure to specify whether gpio is open drain type or not. Passing this information to gpio library when requesting gpio so that gpio driver can set the pin state accordingly, for open drain type: - Pin can be set HIGH as setting as input, PULL UP on pin make this as HIGH. - Pin can be set LOW as setting it as output and drive to LOW. The non-open drain pin can be set HIGH/LOW by setting it to output and driving it to HIGH/LOW. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Add support for tps62362 and tps62363 in tps62360-regulator driverAxel Lin2012-04-032-10/+24
| | | | | | | | | | | | According to the datasheet[1], tps62360 is register compatible with tps62362. tps62361B is register compatible with tps62363. Thus this patch adds support for tps62362 and tps62363. [1] http://www.ti.com/litv/pdf/slvsau9b 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>
* regulator: Add missing n_voltages setting for max8925Axel Lin2012-04-031-10/+5
| | | | | | | | | | The n_voltages are the same for all regulators: (max - min / step) + 1 == 64. The vol_shift is always 0, and the vol_nbits is always the same as n_voltages setting. Thus we can remove vol_shitf and vol_nbits fields from struct max8925_regulator_info. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Set list_voltage callback for max8925Axel Lin2012-04-031-0/+2
| | | | | | | | Current code implements max8925_list_voltage but does not set the list_voltage callback function in max8925_regulator_[ldo|sdv]_ops. Fix it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert 88pm8607 to get_voltage_selAxel Lin2012-04-011-3/+3
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert 88pm8607 to set_voltage_selAxel Lin2012-04-011-39/+4
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Add missing n_voltages setting for 88pm8607Axel Lin2012-04-011-26/+25
| | | | | | | | Then we can remove the vol_nbits field from struct pm8607_regulator_info. Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Set list_voltage callback for 88pm8607Axel Lin2012-04-011-0/+1
| | | | | | | | | Current code implements pm8607_list_voltage but does not set the list_voltage callback function in pm8607_regulator_ops. Fix it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Jett Zhou <jtzhou@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Trivial comment fix for wm831x-ldo driverAxel Lin2012-04-011-2/+2
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert tps6524x to get_voltage_selAxel Lin2012-04-011-3/+3
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert tps6524x to set_voltage_selAxel Lin2012-04-011-15/+3
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: ad5398: Use devm_kzallocAxel Lin2012-04-011-4/+1
| | | | | | 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>
* regulator: ad5398: show changing current in uAAxel Lin2012-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | Integer division may truncate the result. Current code shows changing current is 0mA when selector is 1 ... 8. For example: selector = 1 ad5398_calc_current returns 117, debug message shows 117/1000 = 0mA selector = 2 ad5398_calc_current returns 234, debug message shows 234/1000 = 0mA selector = 3 ad5398_calc_current returns 351, debug message shows 351/1000 = 0mA ............ selector = 8 ad5398_calc_current returns 937, debug message shows 937/1000 = 0mA Show the changing current in uA makes it easier for debugging. 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>
* regulator: tps65023: Remove unused client field from struct tps_pmicAxel Lin2012-04-011-2/+0
| | | | | | | The client field of struct tps_pmic is not used after converting to regmap API. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Remove unused name and client fields from struct tps62360_chipAxel Lin2012-04-011-4/+0
| | | | | | | | The client field of struct tps62360_chip is not used after converting to regmap. The name field of struct tps62360_chip is not used in this driver. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Refactor to use one da9052_ldo_ops/da9052_dcdc_ops for all LDOs/DCDCsAxel Lin2012-04-011-186/+44
| | | | | | | | | | | | | | | | | | In current implementation, da9052_ldo_ops and da9052_ldo5_6_ops are very similar, only the set_voltage is slightly different. da9052_buckperi_ops and da9052_dcdc_ops are also similar. This patch adds da9052_regulator_set_voltage for the set_voltage callback used by all LDOs and DCDCs. Rework da9052_get_regulator_voltage_sel and da9052_set_dcdc_voltage to make it possible to be shared by all DCDCs. Rework da9052_list_voltage to make it to be shared by all DCDCs and LDOs. Then we can remove da9052_ldo5_6_ops and da9052_buckperi_ops. We can also remove DA9052_LDO5_6 and DA9052_BUCKPERI macros which is not used now. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Fix da9052 ldo regulator namesAxel Lin2012-04-011-40/+52
| | | | | | | | The regulator name for LDOs are LDO4 ... LDO13 in current implementation. The correct regulator name for LDOs should be LDO1 ... LDO10. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert tps65023 to set_voltage_selAxel Lin2012-04-011-86/+21
| | | | | | | | | | | | This patch also changes the define for TPS65023_LDO_CTRL_LDOx_MASK, because regmap_update_bits actually does: (orig & ~mask) | (val & mask) This change makes the code consists for all regmap_update_bits calls. Also removes some uninformative comments. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Add MAX8997_VOLTAGE_REGULATOR and MAX8997_CURRENT_REGULATOR macrosAxel Lin2012-04-011-90/+45
| | | | | | | | | | | | MAX8997_VOLTAGE_REGULATOR macro has _name and _ops parameters so we can use it for all regulators with REGULATOR_VOLTAGE type. The MAX8997_VOLTAGE_REGULATOR now replaces regulator_desc_ldo and regulator_desc_buck macros. MAX8997_CURRENT_REGULATOR is for CHARGER and CHARGER_TOPOFF. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Make max8997_get_voltage_register always return correct registerAxel Lin2012-04-011-6/+7
| | | | | | | | Check max8997->buck[1|2|5]_gpiodvs status in max8997_get_voltage_register and return correct register accordingly. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert max8952 to set_voltage_selAxel Lin2012-04-011-21/+7
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Remove _en_reg, _en_bit and _ops parameters from tps65090_REG macroAxel Lin2012-04-011-14/+14
| | | | | | | | | | | Both _en_bit and _ops parameters for all DCDCs and FETs are the same, so we can hardcode it in tps65090_REG macro. _en_reg can be calculated by _id + 12, so we can also remove it. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked by: Venu Byravarasu <vbyravarasu@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: tps65090: Use IS_ERR to check return value of regulator_registerAxel Lin2012-04-011-1/+1
| | | | | | | | regulator_register never returns NULL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked by: Venu Byravarasu <vbyravarasu@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Merge tps6586x_regulator_ldo_ops and tps6586x_regulator_dvm_opsAxel Lin2012-04-011-18/+7
| | | | | | | | | | Now all the callback implementation are the same for both ldo and dvm regulator_ops, merge them to tps6586x_regulator_ops. Also rename tps6586x_ldo_list_voltage to tps6586x_list_voltage. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert tps6586x to set_voltage_selAxel Lin2012-04-011-49/+21
| | | | | | | Convert both tps6586x_[ldo|dvm]_set_voltage to one set_voltage_sel callback. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert tps6586x to get_voltage_selAxel Lin2012-04-011-4/+4
| | | | | | | This also fixes a bug, LDO0 has minimal voltage 1.2V rather than 1.25V. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: wm831x-dcdc: Use devm_kzallocAxel Lin2012-04-011-7/+2
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert pcap-regulator to get_voltage_selAxel Lin2012-04-011-7/+4
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert pcap-regulator to set_voltage_selAxel Lin2012-04-011-27/+6
| | | | | | | | | After converting to set_voltage_sel, we can remove the workaroud of getting the best match voltage for V1. The core will iterate through the whole voltage table and find the best match for us. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert lp3972 to set_voltage_selAxel Lin2012-04-011-45/+18
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-By: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert lp3971 to set_voltage_selAxel Lin2012-04-011-43/+15
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-By: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Add TPS65090 regulator driverVenu Byravarasu2012-04-014-0/+255
| | | | | | | | | | | | Add TPS65090 regulator driver TPS65090 PMIC from TI consists of 3 step down converters, 2 always on LDOs and 7 current limited load switches. The output voltages are ON/OFF controllable and are meant to supply power to the components on target board. Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: gpio-regulator: Set the smallest voltage/current in the specified ↵Axel Lin2012-04-011-4/+4
| | | | | | | | | | | | range Do not assume the gpio regulator states map is sorted in any order. This patch ensures we always set the smallest voltage/current that falls within the specified range. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: fixed: Don't supply voltage change ops when no GPIO is givenMark Brown2012-04-011-14/+13
| | | | | | | | | | Rather than replicating the core support for always on regulators use a different set of ops with none of the enable related operations provided when we don't have any ops. This ensures that we automatically pick up any enhanced support for such regulators that the core has such as the warnings about regulation constraints that can't be used. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: fixed: Use devm_kzalloc()Mark Brown2012-04-011-3/+2
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Use tps65912_get_voltage for both DCDCs and LDOsAxel Lin2012-04-011-18/+3
| | | | | | | | Now tps65912_get_voltage_dcdc and tps65912_get_voltage_ldo has exactly the same implementation. We can merge them to tps65912_get_voltage function. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Implement tps65912_list_voltage to be shared by both DCDCs and LDOsAxel Lin2012-04-011-16/+7
| | | | | | | | | Merge tps65912_list_voltage_dcdc and tps65912_list_voltage_ldo to tps65912_list_voltage. This change does not add too much complexity in tps65912_list_voltage function. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: max8952: Simplify the logic to get vid[0|1] statusAxel Lin2012-04-011-6/+6
| | | | | | | | The syntax "(((vid >> 1) % 2) == 1)" is inefficient and also hard to read. Use bitwidse AND operator instead. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Convert ab3100 to set_voltage_selAxel Lin2012-04-011-13/+5
| | | | | | 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>
* regulator: Convert ab8500 to set_voltage_selAxel Lin2012-04-011-31/+4
| | | | | | | | | Convert ab8500 to set_voltage_sel and then we can remove ab8500_get_best_voltage_index function. 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>
* regulator: Convert pcf50633 to get_voltage_selAxel Lin2012-04-011-35/+27
| | | | | | | | | | Convert pcf50633 to get_voltage_sel and then we can remove pcf50633_regulator_voltage_value function and move its implementation to pcf50633_regulator_list_voltage. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>