Commit Graph

1035 Commits

Author SHA1 Message Date
Axel Lin
aa851193bd regulator: max8998: Remove wrong set_suspend_[en|dis]able callback settings
Using the same ops for both [en|dis]able and set_suspend_[en|dis]able
callbacks is actively broken. This patch removes .set_suspend_disable and
.set_suspend_enable callback setting.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-09 19:45:12 +01:00
Axel Lin
b1a397dc1a regulator: max8952: Remove wrong set_suspend_disable callback setting
Using the same ops for both .disable and .set_suspend_disable callbacks is
actively broken. This patch removes .set_suspend_disable callback setting.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-09 19:45:11 +01:00
Axel Lin
b86bbddd6f regulator: da9052: Use for_each_child_of_node() macro
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-09 19:38:58 +01:00
Yadwinder Singh Brar
d1ef065d43 regulator: max77686: Initialise rmatch.of_node to NULL.
Now of_regulator_match() returns without finding the match if match->of_node
is not NULL.

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-06 19:17:29 +01:00
Laxman Dewangan
19228a6a59 regulator: tps65910: add support for input supply
There is multiple voltage input pins on device which
takes the voltage input for different voltage regulator.
Support to configure the voltage input supplied by
different regulator for each regulators.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-06 19:11:05 +01:00
Laxman Dewangan
6be5bfc3bf regulator: fixed: dt: support for input supply
Add support for input supply in DT parsing of node.
The input supply will be provided by the property
"vin-supply" in the regulator node.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-05 13:49:35 +01:00
Yadwinder Singh Brar
4706fcab9b regulator: max77686: Add device tree support.
This patch device tree support for regulator driver. It uses the parent
(mfd's) DT node to parse the regulator data for max77686.

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-05 13:42:06 +01:00
Axel Lin
6c3b956b94 regulator: ab3100: Use rdev_get_drvdata() rather than use reg->reg_data driectly
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-05 13:34:39 +01:00
Axel Lin
f8568cbd94 regulator: ab3100: Set enable enable_time in regulator_desc
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-05 13:34:00 +01:00
Mark Brown
6dc027c977 regulator: arizona-micsupp: Force regulated mode until we have API support
It's almost certainly what the user would expect.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-04 16:22:39 +01:00
Axel Lin
9c6a74c5e0 regulator: ad5398: Fix min/max current limit boundary checking
It is ok to request current limit with min_uA < chip->min_uA and
max_uA > chip->max_uA.

We need to set min_uA = chip->min_uA if (min_uA < chip->min_uA),
this ensures the equation to calcuate selator does not return negative number.

Also set max_uA = chip->max_uA if (max_uA > chip->max_uA), as suggested by
Sonic.

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-07-04 12:39:38 +01:00
Axel Lin
fca53d862d regulator: twl: Set enable enable_time in regulator_desc
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-04 12:38:37 +01:00
Axel Lin
4b7c948f55 regulator: gpio-regulator: Use core GPIO enable support
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-04 12:38:36 +01:00
Axel Lin
a2a8222be8 regulator: gpio-regulator: Set enable enable_time in regulator_desc
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-04 12:38:35 +01:00
Axel Lin
94f48ab32b regulator: tps65910: Set enable enable_time in regulator_desc
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-07-04 12:37:54 +01:00
Mark Brown
a9905b1d6f regulator: arizona-ldo1: Implement GPIO enable support
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:29:30 +01:00
Mark Brown
495fd8c8fd regulator: wm8994: Use core GPIO enable support
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:29:29 +01:00
Mark Brown
25a53dfbfb regulator: fixed: Use core GPIO enable support
This is essentially the code that was factored out into the core when the
feature was implemented.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:29:28 +01:00
Mark Brown
65f735082d regulator: core: Add core support for GPIO controlled enable lines
It is very common for regulators to support having their enable signal
controlled by a GPIO. Since there are a bunch of fiddly things to get
right like handling the operations when the enable signal is tied to
a rail and it's just replicated code add support for this to the core.

Drivers should set ena_gpio in their config if they have a GPIO control,
using ena_gpio_flags to specify any flags (including GPIOF_OUT_INIT_ for
the initial state) and ena_gpio_invert if the GPIO is active low. The
core will then override any enable and disable operations the driver has
and instead control the specified GPIO.

This will in the future also allow us to further extend the core by
identifying when several enable signals have been tied together and
handling this properly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:29:27 +01:00
Mark Brown
5c5659d0a2 regulator: core: Factor out enable and disable operations some more
Create new _regulator_do_enable() and _regulator_do_disable() operations
which deal with the mechanics of performing the enable and disable, partly
to cut down on the levels of indentation and partly to support some future
work.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:29:26 +01:00
Mark Brown
eefaa3c628 regulator: wm831x-ldo: Specify enable time for alive LDO
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:29:25 +01:00
Mark Brown
00581b30ae regulator: wm8994: Set enable_time in descriptor
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:29:24 +01:00
Mark Brown
3d0f267fcd regulator: fixed: Set enable enable_time in regulator_desc
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:28:41 +01:00
Mark Brown
79511ed322 regulator: core: Allow fixed enable_time to be set in the regulator_desc
Many regulators have a fixed specification for their enable time. Allow
this to be set in the regulator_desc as a number to save them having to
implement an explicit operation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:28:33 +01:00
Laxman Dewangan
5260cd2bc9 regulator: dt: regulator match by regulator-compatible
Match the device's regulators with the property of
"regulator-compatible" of each regulator node.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:19:41 +01:00
Axel Lin
844e6901df regulator: tps65217: Fix voltage boundary checking in tps65217_pmic_map_voltage
It is ok to request voltage with min_uV < tps->info[rid]->min_uV and
max_uV > tps->info[rid]->max_uV.

The equation we used in uv_to_vsel() does not allow
min_uV < tps->info[rid]->min_uV, otherwise it returns negative selector.
So we need to set min_uV = tps->info[rid]->min_uV if
min_uV < tps->info[rid]->min_uV.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: AnilKumar Ch <anilkumar@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03 20:18:34 +01:00
Axel Lin
0072f0a82c regulator: tps62360: Convert to regulator_set_voltage_time_sel()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-02 18:27:10 +01:00
Alan Cox
1a5d39d064 regulator: tps65217: invalid if check
This permits the setting of bogus values because the invalidity check is
itself invalid.

Reported-by: dcb314@hotmail.com
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-02 18:26:04 +01:00
Axel Lin
1e12dfc968 regulator: tps6524x: Convert fixed ilimsel to table based
This patch refactors the code to get rid of the fixed_ilimsel and FIXED_ILIMSEL
flag usage, and convert all the fixed ilimsel to table based (with one entry in
the table).

We can differentiate fixed ilimsel by checking info->n_ilimsels == 1,
thus FIXED_ILIMSEL flag can be removed.

This change makes the logic of the code simpler as all the ilimsels are table
based now.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-02 18:26:03 +01:00
Axel Lin
cac87fd34e regulator: tps6524x: Convert to regulator_list_voltage_table()
This patch adds fixed_5000000_voltage table for fixed voltage,
so we can convert regulator_ops to regulator_list_voltage_table.

We can differentiate fixed voltage by checking rdev->desc->n_voltages == 1,
thus remove the FIXED_VOLTAGE flag usage.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-02 18:26:02 +01:00
Mark Brown
744c62eb65 Linux 3.5-rc5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJP74cgAAoJEHm+PkMAQRiG1mMH/A1uPaF6CZhyaDHRYAdlxzIl
 OQ5FJNlX1vzPZg6VLiNi4KxcbfgVrVSU6oghD6ASmoWje7PkhbzzoJVeUu9DYbbQ
 oz/IXJi/SqYMhbZvqZ4DsCY25sZNWsWfeabs38hil9BEaxj6xOqF1iR0RUrvcRoP
 K6kyYUNk2C7q8w/ouco5kmIcEWf6xD4bJWInyL5r/VGpRnNeZewFfsHoZ8tUWxwA
 ndsD45njKqnSHfBTipkVMXanHZQC0rpwLi+Rxv/+yBlQdDFVxD+RFrjLmV98XKLb
 dFZzV9WiuiMM1qnwiolQYMNUT8ZJYLzy04duG8wGqwzh5rWo3tv+01wAbAtTFvg=
 =4UfY
 -----END PGP SIGNATURE-----

Merge tag 'v3.5-rc5' into regulator-drivers

Linux 3.5-rc5 collides with further development.

Conflicts:
	drivers/regulator/tps65023-regulator.c
2012-07-02 18:24:59 +01:00
Stephen Warren
f141822b15 regulator: fixed: support deferred probe for DT GPIOs
of_get_named_gpio() needs the driver hosting the GPIO that the DT
property references to have been probed. Detect this specific failure,
and defer the probe of the whole regulator until this API can complete.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-01 19:12:59 +01:00
Axel Lin
d172f319c1 regulator: tps65217: Convert LDO1 to use regulator_list_voltage_table
Convert tps65217_pmic_ldo1_ops to use regulator_list_voltage_table.

We have n_voltages and volt_table settings in regulator_desc,
so we don't need the table and table_len fields in struct tps_info.
Thus remove them from struct tps_info.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-01 19:12:58 +01:00
Axel Lin
e2eb169b1b regulator: s5m8767: Convert to regulator_list_voltage_linear
In current code, .list_voltage and .set_voltage_sel callbacks for BUCK7 and
BUCK8 return -EINVAL.

This patch adds s5m8767_buck78_ops for BUCK7 and BUCK8 which does not set
.list_voltage, .get_voltage_sel and .set_voltage_sel. ( This has the same
effect of returning -EINVAL in the callbacks)

Then for all the users of s5m8767_list_voltage, we don't need to worry about
the case reg_voltage_map[reg_id] is NULL.
So we can convert s5m8767_list_voltage to regulator_list_voltage_linear.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-26 11:50:33 +01:00
Axel Lin
7f217d36dc regulator: arizona-micsupp: Fix choosing selector in arizona_micsupp_map_voltage
If min_uV is in the range of: 3250001~3269999,
current code uses the equation:
        selector = DIV_ROUND_UP(min_uV - 1700000, 50000);
Then selector will be 32.
Then arizona_micsupp_list_voltage returns -EINVAL for this case which is wrong.

This patch fixes this issue:
If min_uV > 3200000, selector should be ARIZONA_MICSUPP_MAX_SELECTOR.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-26 11:48:05 +01:00
Mark Brown
1910efa1d0 regulator: Add driver for Arizona LDO1
Arizona class devices feature an integrated LDO which is intended to
supply the digital core for the device. Provide a driver offering
minimal control of this regulator.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25 10:32:51 +01:00
Sangbeom Kim
1af142c6f9 regulator: Modify ramp_delay value for s5m8767a
As s5m8767a is revisioned, ramp_delay register is changed.
5mV/uS, 10mV/uS, 25mV/uS, 50mV/uS, 100mV/uS ramp delay can be selected.

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25 10:12:30 +01:00
Mark Brown
85e63343f4 Linux 3.5-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJP53AxAAoJEHm+PkMAQRiGs2QH/RaqkXz96fwjhDcyiKpDqA3c
 kGuS5mz5cOhnqKSmR88HFm6pwuhLux/qSJzeAmoQy1MC8a0ACx7AnANW0lfN3/qe
 /HGYz8h60yCL/fhn8/bUYtdt9xsoDqoDcq/ooFl9mcsJGWbC6WeMSZU5dAUYqviE
 qFrp5zjY07FG53CRGT0hFpezQNwNL+VLH30CF9LD+fJLPVEYum2zBNGXWM42rcw5
 fxzGL/6SO8YqA/Upic1ht6HAd6s5LOrlST7qvnyXUMvRXN5z/Y92ueYJZefkS1Om
 ohuLIKM2bv9/dJS67H8N2baSKGCzBdfSe5/5WaHdLYW9MiVju0wRl6HPJtAMrkk=
 =H8t8
 -----END PGP SIGNATURE-----

Merge tag 'v3.5-rc4' into regulator-drivers

Linux 3.5-rc4 contains patches which conflict with some of the
development work.
2012-06-25 10:11:40 +01:00
Axel Lin
2f6ae6ef63 regulator: rc5t583: Use regulator_set_voltage_time_sel()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-24 12:13:38 +01:00
Axel Lin
f11d08c3d6 regulator: Use list_voltage() to get voltage in regulator_set_voltage_time_sel
With this change, regulator_set_voltage_time_sel() can be more generic and not
limited to linear and table based mapping now.
One side-effect of this change is that list_voltage() must be implemented.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-23 12:28:12 +01:00
Axel Lin
baae019efe regulator: max8998: Convert to set_voltage_sel and regulator_map_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-23 12:18:08 +01:00
Axel Lin
9a0fbb627c regulator: max8998: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-23 12:16:42 +01:00
Axel Lin
b515241522 regulator: tps62360: Remove chip_id and voltage_base from struct tps62360_chip
The chip_id is not used.
The voltage_base is not necessary, set base voltage to tps->desc.min_uV instead.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-23 12:16:42 +01:00
Graeme Gregory
a68de07461 regulator: palmas: fix regmap offsets for enable/disable
I forgot to apply the offsets for the regmap helper functions for
enable/disable on SMPS10 and the LDO regulators. This means regulators
will not enable/disable correctly.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Tested-by: Sebastien Guiriec <s-guiriec@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-23 11:37:28 +01:00
Mark Brown
b19dbf711e regulator: core: Add export of regulator_set_voltage_time_sel()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-23 11:34:20 +01:00
Axel Lin
d9fe28f962 regulator: tps65910: Convert to regulator_list_voltage_table
Convert tps65910_ops and tps65910_ops_vdd3 to regulator_list_voltage_table.

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-06-22 10:13:31 +01:00
Axel Lin
f6442aa0b5 regulator: tps65910: Remove unused min_uV and max_uV from struct tps_info
The min_uV and max_uV fields of struct tps_info are not used in the code.
For the case voltage_table is provided, the min_uV and max_uV are the same
values as volt_table[0] and volt_table[n_voltages -1].
For the case voltage_table is not available, having the min_uV and max_uV seems
misleading. Current code uses equations to get the voltage value in this case,
but these equations do not use the min_uV and max_uV fields of struct tps_info.

Thus this patch removes the min_uV and max_uV fields from struct tps_info.

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-06-22 10:13:22 +01:00
Kim, Milo
b222a817b4 regulator: change message level on probing lp872x driver
Use err log rather than warning message when the platform data is NULL

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-21 11:04:06 +01:00
Mark Brown
dc2060cfe2 regulator: lp872x: Depend on I2C=y
Kconfig doesn't do the right thing for us here.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-21 10:38:37 +01:00
Axel Lin
01bc3a1400 regulator: tps65910: Convert to regulator_set_voltage_time_sel()
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-06-21 10:35:10 +01:00