aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2013-04-25regulator: tps6507x: Use regulator_map_voltage_ascendAxel Lin
All regulators have ascendant voltage list in this driver. Use regulator_map_voltage_ascend for them. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-24regulator: ab3100: device tree supportLinus Walleij
This implements device tree support for the AB3100 regulators driver. The initial settings are moved out of platform data and into the driver for the device tree case, as it appears that there is no way to supply this as AUXDATA for an I2C device. The style and bindings are heavily inspired by Lee Jones' style for AB8500. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-24regulator: ab3100: refactor probe to use IDsLinus Walleij
This refactors the AB3100 regulator probe to use regulator IDs and pass this to a separate registration function. This works much smoother when migrating to device tree, as we can use a match table with this regulator ID encoded in the .driver_data. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-24regulator: max8973: Don't override control1 variable when set ramp delay bitsAxel Lin
Current code overrides control1 variable when setting ramp delay bits. Fix it by just setting ramp_delay bits. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: tps80031: Convert tps80031_dcdc_ops to [get|set]_voltage_sel_regmapAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: tps80031: Fix LDO2 track mode for TPS80031 or TPS80032-ES1.0Axel Lin
Currently we have a special code in tps80031_ldo_set_voltage_sel() to handle LDO2 track mode for TPS80031 or TPS80032-ES1.0. The purpose is to address below issues: Issue description: - LDO2 traking mode is enabled - LDO2 tracks SMPS2 voltage. - LDO2 automatically switch-off when LDO2_CFG_VOLTAGE is changed to some discrete values (non exhaustive list): 00011001, 00011010, 00011011, 00011100, . - LDO2 switch-on again when LDO2_CFG_VOLTAGE is changed to other values (non exhaustive list): 00011000, 00010111, . LDOs have reserved codes. For these codes, LDO is switch-off. In tracking, LDO2 ref comes from SMPS2. However LDO2 enable is still gated by LDO2 VSEL decoding. As a result, in tracking mode LDO2 will be disabled for following code (SMPS VSEL format): 000000 & 100000 (MSB not decoded) 011001 & 111001 (MSB not decoded) 011010 & 111010 (MSB not decoded) 011100 & 111100 (MSB not decoded) 011101 & 111101 (MSB not decoded) 011110 & 111110 (MSB not decoded) However, current code has below bugs: 1. It uses regulator_list_voltage_linear, so list_voltage() still shows above invalid selectors have supported voltage. 2. Current code may return -EINVAL in tps80031_ldo_set_voltage_sel() for supported voltage. This is because when we use regulator_list_voltage_linear as list_voltage callback, regulator core will default use regulator_map_voltage_linear(). regulator_map_voltage_linear() has an assumption that the voltages are linear which is not true for this case. For example, when request voltage range is: min_uV=950000 uV && max_uV=1200000 uV regulator_map_voltage_linear() returns the selector is 29 (0x1D), set_voltage_sel() returns -EINVAL. (The selector is in invalid range, 0x19 ~ 0x1f). In above case, map_voltage() should find the lowest valid voltage within specific range (selector = 0x20) and set_voltage_sel() should successfully set the voltage to 987500 uV. This patch fixes these issues by: 1. Add checking valid setting for LDO2 track mode of TPS80031 or TPS80032-ES1.0 in list_voltage. So it returns -EINVAL for invalid selectors. 2. Implement tps80031_ldo_map_voltage, use regulator_map_voltage_iterate() to find the lowest voltage within specific range for TPS80031 or TPS80032-ES1.0. This is required when the voltage map is no longer linear. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: tps6586x: Convert to use regulator_map_voltage_ascendAxel Lin
All regulators have ascendant voltage list in this driver. Thus use regulator_map_voltage_ascend is more efficient than the default regulator_map_voltage_iterate. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: tps65910: Convert to use regulator_map_voltage_ascendAxel Lin
All regulators have ascendant voltage list in this driver. Some regulators have more than 200 supported voltages. e.g. For TPS65910_REG_VDD1 and TPS65910_REG_VDD2: n_voltages = VDD1_2_NUM_VOLT_FINE * VDD1_2_NUM_VOLT_COARSE = 73 * 3 = 219 Thus it worth converting to regulator_map_voltage_ascend rather than use default regulator_map_voltage_iterate. For consistent, convert all regulators to regulator_map_voltage_ascend. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: lp3972: Convert to use regulator_map_voltage_ascendAxel Lin
All regulators have ascendant voltage list in this driver. Thus use regulator_map_voltage_ascend is more efficient than the default regulator_map_voltage_iterate. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: lp3971: Convert to use regulator_map_voltage_ascendAxel Lin
All regulators have ascendant voltage list in this driver. Thus use regulator_map_voltage_ascend is more efficient than the default regulator_map_voltage_iterate. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: tps65023: Use [set|get]_voltage_sel_regmap instead of open codedAxel Lin
Simply the [get|set]_voltage_sel implementation by using regulator_[set|get]_voltage_sel_regmap instead of open coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-23regulator: tps62360: Fix off-by-one shift for ramp_ctrlAxel Lin
According to the datasheet[1] Register 0x06h Description: RmpCtrl (REGISTER ADDRESS: 0x06h Read/Write) BIT[5..7]: RMP[2:0] Output voltage ramp timing D7-D5 Slope 000 32mV/us 001 16mV/us 010 8mV/us ... 110 0.5mV/us 111 0.25mV/us Thus to get correct ramp_ctrl value, we need to right-shift 5 bits. [1] http://www.ti.com/lit/ds/symlink/tps62360.pdf Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-22regulator: palmas: Fix off-by-one for ramp_delay and register value mappingAxel Lin
Datasheet says: Time Step (TSTEP) selection, when changing the output voltage, the new value is reached through successive voltage steps (if not bypassed). The equivalent programmable slew rate of the output voltage is: TSTEP[1:0]: 00 Jump (no slope control) TSTEP[1:0]: 01 10mV/us TSTEP[1:0]: 10 5mV/us (default) TSTEP[1:0]: 11 2.5mV/us Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-22regulator: palmas: Add missing ctrl_addr setting for SMPS10Axel Lin
The ctrl_addr setting for SMPS10 is missed, thus palmas_smps_init() read/write wrong register for SMPS10 in current code. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-19regulator: palmas: Don't update tstep register for SMPS3 and SMPS7Axel Lin
SMPS3 and SMPS7 do not have tstep_addr setting, so current code actually writes 0 to smps12_ctl (offset is 0) register when set_ramp_delay callback is called for SMPS3 and SMPS7. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18regulator: palmas: Fix min_uV for LDO8 tracking modeAxel Lin
When SMPS45 is set to off and LDO8 tracking is enabled, the output voltage can be set from 0.45 to 1.65 V. Thus set min_uV to be 450000. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18regulator: ab8500: Get rid of voltage_shift field from struct ↵Axel Lin
ab8500_regulator_info The voltage_shift can be calculated from voltage_mask. Let's remove voltage_shift fied from struct ab8500_regulator_info, this change can prevent missing voltage_shift setting issue. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18regulator: ab8500: Remove unused voltage_shift field from struct expand_registerAxel Lin
The voltage_shift field of struct expand_register is not used now, remove it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18regulator: palmas: preserve modes of rails during enable/disableLaxman Dewangan
The Palma device like TPS65913 have the mode mask which is also used for enable/disable the rails. The mode bits are defined as 00: OFF 01: AUTO 10: ECO 11: Forced PWM and modes are set accordingly as REGULATOR_MODE_NORMAL: AUTO REGULATOR_MODE_IDLE: ECO REGULATOR_MODE_FAST: PWM Two issue observed: 1. If client calls following sequence: regulator_enable(), regulator_set_mode(FAST), regulator_disable() and again the regulator_enable() then the mode is reset to NORMAL inplace of keeping the mode as FAST. Fixing this by storing the current mode configured by client and restoring modes when enable() is called after disable(). 2. In following sequence, the regulator get enabled: regulator_disable() regulator_set_mode(FAST), Fixing this by updating new mode in register only if it is enabled. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18regulator: palma: add ramp delay support through regulator constraintsLaxman Dewangan
Currently Palma regulator driver support the ramp delay through rail specific platform data. As regulator framework support the configuration of ramp delay through regulator constraint, using the framework method and removing the platform specific data approach. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-18regulator: core: Add regulator_map_voltage_ascend() APIAxel Lin
A lot of regulator hardware has ascendant voltage list. This patch adds regulator_map_voltage_ascend() and export it. Drivers that have ascendant voltage list can use this as their map_voltage() operation, this is more efficient than default regulator_map_voltage_iterate() function. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: ab8500: Fix set voltage for AB8540_LDO_AUX3Axel Lin
When setting voltage for AB8540_LDO_AUX3, current code only updates one of info->voltage_reg and info->expand_register registers which is wrong. To ensure we set to correct voltage, it always needs to clear or set expand_register.voltage_mask bit of expand_register. The function of the expand register bit is the following (from the user manual): 0: VAUX3 output voltage is determined by Vaux3Sel bit settings in register VldoCVaux3Sel 1: VAUX3 output voltage is set to 3.05V regardless of Vaux3Sel settings in register VldoCVaux3Sel (VldoCVaux3Sel is the register at 0x0421) So when going to 3.05V, set the expand register bit. When leaving 3.05V for another voltage, set the target voltage before clearing the expand register bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: ab8500-ext: Remove enable() and disable() functionsAxel Lin
Both enable() and disable() functions have only one caller, thus remove them. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: ab8500-ext: Don't update info->update_val if set_mode() failsAxel Lin
This ensures info->update_val status is still correct if set_mode() call fails. Otherwise, get_mode() may return wrong status if a set_mode() call fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: ab8500: Don't update lp_mode_req flag in set_mode() error pathsAxel Lin
Currently, set invalid mode setting for shared mode regulators may change sm->lp_mode_req flag. This patch ensures we don't set lp_mode_req flag to wrong status if set_mode() fails. This patch includes some clean up, and these changes makes this patch looks like code refactor. The clean up is mainly to avoid adding ugly code to handle failure paths. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: ab8500: Don't update info->update_val if write to register failsAxel Lin
This patch ensures info->update_val is consistent with current register value. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: palmas: add support for LDO8 tracking modeLaxman Dewangan
LDO8 of Palma device like tps65913 support the tracking mode on which LDO8 track the SMPS45 voltage when SMPS45 is ON and use the LDO8.VOLTAGE_SEL register when SMPS45 is OFF. On track mode, the steps of voltage change for LDO8 is 25mV where in non-tracking mode it is 50mV. Set the steps accordingly. Number of voltage count is still same for both the cases. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: palmas: support for external regulator through control outputsLaxman Dewangan
Palmas device have control outputs like REGEN1, REGEN2, REGEN3, SYSEN1 and SYSEN2. These control outputs can be used for controlling external voltage switches to enabled/disable voltage outputs. Add support of these control outputs through regulator framework. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: palmas: clear sleep bits if not selectedLaxman Dewangan
Clear the sleep/warm reset bits when it is not selected through regulator platform data. This will make sure that configuration is inline with the platform data regardless of boot/POR configuration. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: core: return err value for regulator_get if there is no DT bindingNishanth Menon
commit 6d191a5fc7a969d972f1681e1c23781aecb06a61 (regulator: core: Don't defer probe if there's no DT binding for a supply) Attempted to differentiate between regulator_get() with an actual DT binding for the supply and when there is none to avoid unnecessary deferal. However, ret value supplied by regulator_dev_lookup() is being ignored by regulator_get(). So, exit with the appropriate return value. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-17regulator: as3711: Use a static of_regulator_match table for of_regulator_matchAxel Lin
The same table can be used for multiple instance of pdev, so we don't need to allocate memory for of_regulator_match table per pdev. match->driver_data points to the corresponding entry of as3711_reg_info, however it is not used in current code, thus this patch does not set driver_data in the of_regulator_match table. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-16regulator: ab8500: Optimize ab8540_aux3_regulator_get_voltage_selAxel Lin
We can save a register read operation in some case if read expand_register first. If info->expand_register.voltage_mask bit is set, no need to read voltage_reg. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-16regulator: rc5t583: Remove unused fields from struct rc5t583_regulator_infoAxel Lin
The *dev and *mfd of struct rc5t583_regulator_info are not used after convert to use regmap, remove them. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-16Convert selectors of GENERIC_GPIO to GPIOLIBAlexandre Courbot
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca>
2013-04-15regulator: max8997: Test pdata by NULL checking instead of IS_ERR_OR_NULLAxel Lin
pdata is either a valid pointer or NULL, use NULL checking rather than IS_ERR_OR_NULL macro. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-15regulator: ab8500: Fix voltage_shift setting for AB8540_LDO_DMICAxel Lin
The voltage_mask is 0xc0, thus we need to set voltage_shift = 6 to get correct selector in get_voltage_sel and set_voltage_sel. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-12regulator: ab8500: Fix voltage_mask for AB8505_LDO_AUDIOAxel Lin
The voltage_mask and voltage_shift settings of AB8505_LDO_AUDIO are not matched. It looks like a typo in the voltage_mask settings. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-11regulator: wm8994: Use GPIO parsed from DT when registering regulatorsSylwester Nawrocki
Ensure the regulators are registered with a GPIO parsed from the device tree when available. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-11regulator: ab8500: Unregister ab8500-ext regulators in probe() failure pathAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-11regulator: ab8500-ext: Make the return type of ab8500_ext_regulator_exit() voidAxel Lin
ab8500_ext_regulator_exit() never fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-08regulator: ab8500-ext: Remove get_voltage to avoid duplicate implementationAxel Lin
The implementation of ab8500_ext_fixed_get_voltage is identical to ab8500_ext_list_voltage. We can avoid the duplicate implementation by just remove get_voltage. For fixed regulator, regulator core will call list_voltage(rdev, 0) to get voltage if both get_voltage get_voltage_sel are not implemented. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-08regulator: ab8500-ext: Remove unnecessary checking for ab9540 and ab8540Axel Lin
This code was added by commit 0fe17e20a6 "regulator: ab8500-ext: Add support for AB9540 regulators" and commit bd44e2cb "regulator: ab8500: Also check for AB8505 based platforms" The original patch[1] is to set info->desc.ops = &ab9540_ext_regulator_ops. However, ab9540_ext_regulator_ops is identical to ab8500_ext_regulator_ops[2]. Thus we can complete remove the unnecessary checking for ab9540 and ab8540. [1] https://lkml.org/lkml/2013/3/28/333 [2] https://lkml.org/lkml/2013/4/1/178 Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-08regulator: ab8500-ext: Get rid of is_enabled from struct ↵Axel Lin
ab8500_ext_regulator_info The intention of this patch is to simplify the code. Maintain the is_enabled flag is not trivial, it not only needs to set/clear the flag in disable()/enable() but also needs to set the flag in is_enable() to get initial status. The only benefit of keeping is_enabled flag is just save a register read when set_mode(). Remove is_enabled flag makes the code simpler. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-08regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_infoAxel Lin
The intention of this patch is to simplify the code. Maintain the is_enabled flag is not trivial, it not only needs to set/clear the flag in disable()/enable() but also needs to set the flag in is_enable() to get initial status. The only benefit of keeping is_enabled flag is just save a register read when set_mode(). Remove is_enabled flag makes the code simpler. This patch also moves ab8500_regulator_is_enabled() close to ab8500_regulator_[en|dis]able functions. This is required to avoid a forward declaration because now we call ab8500_regulator_is_enabled() in ab8500_regulator_set_mode(). This change also makes the code better in readability by moving similar functions to one place. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-07regulator: wm8994: Provide default init dataMark Brown
Almost all systems use the regulators on the WM8994 series devices to provide DCVDD and AVDD1 so if no init data is supplied then set up the supplies for the user. This simplifies integration of the device into systems, especially when device tree is supported. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05regulator: ab8500: Remove ab8500_regulator_set_voltage_time_selAxel Lin
All users of ab8500_regulator_volt_mode_ops and ab8500_regulator_volt_ops do not set info->desc.enable_time, thus set_voltage_time_sel() always returns 0. Remove it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05regulator: max8952: Add Device Tree supportTomasz Figa
This patch adds Device Tree support to max8952 regulator driver. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05regulator: max8952: Separate constraints from platform data structTomasz Figa
This patch modifies platform data structure of max8952 driver to use pointer to regulator_init_data struct instead of embedding it. This is a prerequisite for adding Device Tree support for the driver. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05regulator: core: don't require a supply when supply_name is specifiedAndrew Bresticker
Regulator drivers may specify regulator_desc->supply_name which regulator_register() will use to find the supply node for a regulator. If no supply was specified in the device tree or the supply has yet to be registered regulator_register() will fail, deferring the probe of the regulator. In the case where no supply node was specified in the device tree, there is no supply and it is pointless to try and find one later, so go ahead and add the regulator without the supply. Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-05regulator: wm8994: Convert to module_platform_driver()Mark Brown
The regulators can only be used to supply the CODEC so we don't need to worry about users that still need fudges for init ordering issues. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>