summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)AuthorFilesLines
2013-01-15Merge remote-tracking branch 'regulator/fix/s5m8767' into tmpMark Brown1-2/+2
2013-01-15Merge remote-tracking branch 'regulator/fix/max8998' into tmpMark Brown1-22/+22
2013-01-15Merge remote-tracking branch 'regulator/fix/max8997' into tmpMark Brown1-19/+17
2013-01-15Merge remote-tracking branch 'regulator/fix/core' into tmpMark Brown1-4/+11
2013-01-10regulator: max8998: Ensure enough delay time for ↵Axel Lin1-1/+1
max8998_set_voltage_buck_time_sel Use DIV_ROUND_UP to prevent truncation by integer division issue. This ensures we return enough delay time. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-01-08regulator: max8998: Use uV in voltage_map_descAxel Lin1-21/+21
Integer division may truncate. This happens when pdata->buckx_voltagex setting is not align with 1000 uV. Thus use uV in voltage_map_desc, this ensures the selected voltage won't less than pdata buckx_voltagex settings. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-01-08regulator: max8997: Use uV in voltage_map_descAxel Lin1-19/+17
Current code does integer division (min_vol = min_uV / 1000) before pass min_vol to max8997_get_voltage_proper_val(). So it is possible min_vol is truncated to a smaller value. For example, if the request min_uV is 800900 for ldo. min_vol = 800900 / 1000 = 800 (mV) Then max8997_get_voltage_proper_val returns 800 mV for this case which is lower than the requested voltage. Use uV rather than mV in voltage_map_desc to prevent truncation by integer division. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-01-03Drivers: regulator: remove __dev* attributes.Greg Kroah-Hartman7-17/+17
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Liam Girdwood <lrg@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03regulator: core: Fix comment for regulator_register()Axel Lin1-1/+2
regulator_register() does not return 0 on success, fix the comment. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24regulator: core: Fix continuous_voltage_range case in ↵Axel Lin1-3/+9
regulator_can_change_voltage Regulator drivers with continuous_voltage_range flag set allows not setting n_voltages. Thus if continuous_voltage_range is set, check the constraint range instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24regulator: s5m8767: Fix probe failure due to stack corruptionInderpal Singh1-2/+2
The function sec_reg_read invokes regmap_read which expects unsigned int * as the destination address. The existing driver is passing address of local variable "val" which is u8. This causes the stack corruption and following dump is observed during probe. Hence change "val" from u8 to unsigned int. Unable to handle kernel paging request at virtual address 02410020 pgd = c0004000 [02410020] *pgd=00000000 Internal error: Oops: 80000005 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 Not tainted (3.6.0-00696-g98a28b18-dirty #27) PC is at 0x2410020 LR is at _regulator_get_voltage+0x3c/0x70 pc : [<02410020>] lr : [<c02395d4>] psr: 20000013 sp : cf839b68 ip : 00000000 fp : cf92d410 r10: 0000cfd0 r9 : c06d9878 r8 : 0000f0a0 r7 : cf839b70 r6 : cf92d400 r5 : 00000011 r4 : cf000000 r3 : 02410020 r2 : 00000000 r1 : 00000048 r0 : cf000000 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel ........................... ................................. [<c02395d4>] (_regulator_get_voltage+0x3c/0x70) from [<c023ad80>] (print_constraints+0x50/0x36c) [<c023ad80>] (print_constraints+0x50/0x36c) from [<c023e504>] (set_machine_constraints+0xe8/0x2b0) [<c023e504>] (set_machine_constraints+0xe8/0x2b0) from [<c023e9c8>] (regulator_register+0x2fc/0x604) [<c023e9c8>] (regulator_register+0x2fc/0x604) from [<c049d628>] (s5m8767_pmic_probe+0x688/0x718) [<c049d628>] (s5m8767_pmic_probe+0x688/0x718) from [<c029915c>] (platform_drv_probe+0x18/0x1c) [<c029915c>] (platform_drv_probe+0x18/0x1c) from [<c0297dd0>] (really_probe+0x68/0x1f4) [<c0297dd0>] (really_probe+0x68/0x1f4) from [<c0298070>] (driver_probe_device+0x30/0x48) Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-11Merge remote-tracking branch 'regulator/topic/sm8767' into regulator-nextMark Brown1-14/+26
2012-12-11Merge remote-tracking branch 'regulator/topic/change' into regulator-nextMark Brown1-1/+1
2012-12-11regulator: core: Fix logic to determinate if regulator can change voltageAxel Lin1-1/+1
Having a linear_min_sel setting means the first linear_min_sel selectors are invalid. We need to subtract linear_min_sel when use n_voltages to determinate if regulator can change voltage. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-11Merge branch 'topic/min' of ↵Mark Brown8-199/+1042
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-change
2012-12-11regulator: s5m8767: Fix to work even if no DVS gpio presentAmit Daniel Kachhap1-7/+10
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-11regulator: s5m8767: Fix to read the first DVS register.Amit Daniel Kachhap1-3/+3
This patch modifies the DVS register read function to select correct DVS1 register. This change is required because the GPIO select pin is 000 in unintialized state and hence selects the DVS1 register. Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-11regulator: s5m8767: Fix to work when platform registers less regulatorsAmit Daniel Kachhap1-4/+13
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10Merge remote-tracking branch 'regulator/topic/gpio' into regulator-nextMark Brown1-3/+3
2012-12-10regulator: gpio-regulator: gpio_set_value should use cansleepLee Jones1-2/+2
If it's possible for gpio_set_value to sleep, we should be using the *_cansleep call instead. This patch fixes multiple warnings from gpiolib. Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10regulator: gpio-regulator: Fix logical error in for() loopLee Jones1-1/+1
The cond-statement of this particular for() loop will always be true as long as at least one voltage-shifting GPIO is present. If it wasn't for the break below, we'd be stuck in a forever loop. This patch inserts the correct cond-statement into the statement. Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10Merge remote-tracking branch 'regulator/topic/wm831x' into regulator-nextMark Brown1-1/+2
2012-12-10Merge remote-tracking branch 'regulator/topic/tps80031' into regulator-nextMark Brown1-16/+11
2012-12-10Merge remote-tracking branch 'regulator/topic/tps65910' into regulator-nextMark Brown1-0/+7
2012-12-10Merge remote-tracking branch 'regulator/topic/tps6586x' into regulator-nextMark Brown1-1/+1
2012-12-10Merge remote-tracking branch 'regulator/topic/tps65090' into regulator-nextMark Brown1-0/+1
2012-12-10Merge remote-tracking branch 'regulator/topic/tps516312' into regulator-nextMark Brown1-0/+15
2012-12-10Merge remote-tracking branch 'regulator/topic/s2mps11' into regulator-nextMark Brown1-5/+5
2012-12-10Merge remote-tracking branch 'regulator/topic/palmas' into regulator-nextMark Brown1-83/+38
2012-12-10Merge remote-tracking branch 'regulator/topic/min' into regulator-nextMark Brown6-256/+61
2012-12-10Merge remote-tracking branch 'regulator/topic/max8997' into regulator-nextMark Brown1-17/+164
2012-12-10Merge remote-tracking branch 'regulator/topic/max8973' into regulator-nextMark Brown3-0/+516
2012-12-10Merge remote-tracking branch 'regulator/topic/max77686' into regulator-nextMark Brown1-9/+155
2012-12-10Merge remote-tracking branch 'regulator/topic/max1586' into regulator-nextMark Brown1-3/+41
2012-12-10Merge remote-tracking branch 'regulator/topic/lp8788' into regulator-nextMark Brown2-25/+6
2012-12-10Merge remote-tracking branch 'regulator/topic/log' into regulator-nextMark Brown1-2/+7
2012-12-10Merge remote-tracking branch 'regulator/topic/hotplug' into regulator-nextMark Brown63-282/+1905
2012-12-10Merge remote-tracking branch 'regulator/topic/gpio' into regulator-nextMark Brown1-0/+102
2012-12-10Merge remote-tracking branch 'regulator/topic/da9055' into regulator-nextMark Brown3-0/+691
2012-12-10Merge remote-tracking branch 'regulator/topic/da9052' into regulator-nextMark Brown1-5/+5
2012-12-10Merge remote-tracking branch 'regulator/topic/change' into regulator-nextMark Brown1-0/+22
2012-12-10Merge remote-tracking branch 'regulator/topic/as3711' into regulator-nextMark Brown3-0/+377
2012-12-10Merge remote-tracking branch 'regulator/topic/arizona' into regulator-nextMark Brown2-3/+129
2012-12-10regulator: anatop: Use regulator_[get|set]_voltage_sel_regmapAxel Lin1-15/+6
Call regulator_[get|set]_voltage_sel_regmap instead of open code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Ying-Chun Liu <paulliu@debian.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10regulator: anatop: Use linear_min_sel with linear mappingAxel Lin1-8/+7
By setting linear_min_sel to anatop_reg->min_bit_val, we can avoid adjust the anatop_reg->min_bit_val offset in [set|get]_voltage_sel. With this chance we can refactor this driver to use regulator_[get|set]_voltage_sel_regmap. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Ying-Chun Liu <paulliu@debian.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10regulator: max1586: Implement get_voltage_sel callbackAxel Lin1-3/+41
This is required since commit f7df20ec32 "regulator: core: Use list_voltage() to read single voltage regulators", otherwise _regulator_get_voltage returns rdev->desc->ops->list_voltage(rdev, 0). The Maxim 1586 controls V3 and V6 voltages, but offers no way of reading back the set up value. Thus this patch caches the setting when setting new voltage. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10regulator: lp8788-buck: Kill _gpio_request functionAxel Lin1-14/+4
Simply use devm_gpio_request_one() instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07regulator: tps80031: Convert tps80031_ldo_ops to linear_min_sel and ↵Axel Lin1-9/+2
list_voltage_linear Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-07regulator: lp8788-ldo: Remove val array in lp8788_config_ldo_enable_modeAxel Lin1-10/+1
To clear the mask bit, setting data argument to be 0 with proper mask setting for lp8788_update_bits. We don't need the var array here. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-06regulator: gpio-regulator: Add ifdef CONFIG_OF guard for regulator_gpio_of_matchAxel Lin1-1/+3
Use of_match_ptr and add ifdef CONFIG_OF guard for regulator_gpio_of_match. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>