Commit graph

1006 commits

Author SHA1 Message Date
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
Mark Brown b667a45d9f regulator: arizona: Add support for microphone supplies on Arizona devices
The Wolfson Arizona platform is used for a range of low power audio hub
CODECs. Many of these devices feature an integrated power supply for the
microphone which is supported by this driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-20 11:46:19 +01:00
Axel Lin 8386a00f14 regulator: tps6524x: Fix get_voltage_sel for fixed voltage
get_voltage_sel() should return selector rather than voltage.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-20 11:20:24 +01:00
Axel Lin baf73e2c4e regulator: lp872x: Return -EINVAL if pdata is NULL
Return -EINVAL if pdata is NULL, otherwise we have NULL dereference bug.
This patch also moves the code checking pdata earlier in lp872x_probe.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-20 11:18:38 +01:00
Yadwinder Singh Brar f503071b03 regulator: max77686: Implement .set_ramp_delay() callback
This patch implements the .set_ramp_delay callback to set the ramp_delay on
hardware for BUCK2/3/4 if ramp_delay is set in regulator constraints.

This patch also do some cleaning work for unrequired members of
struct max77686_data.

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-20 11:15:13 +01:00
Axel Lin c59d2a6b20 regulator: max77686: Initialize regulator_config
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-20 11:13:55 +01:00
Mark Brown 809d310c7e regulator: lp872x: Don't allow modular build
Fixes link failure due to devm_gpio_request_one()

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-20 11:08:43 +01:00
Kim, Milo af8b5fc310 regulator: add new regulator driver for lp872x
This driver supports TI/National LP8720, LP8725 PMIC.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Reviewed-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19 23:14:29 +01:00
Axel Lin e90a84473e regulator: tps65023: Convert tps65023_ldo_ops to regulator_[get|set]_voltage_sel_regmap
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19 12:14:11 +01:00
Sangbeom Kim c848bc8538 regulator: s5m8767a: Support AP watchdog reset operation
The S5M8767A can't know status of ap reset.
So, After AP watchdog reset, AP can't boot normally.

Problem can be happened like below condition.
- AP Bootable lowest voltage(vdd_arm): 0.9v
- AP DVFS voltage table: 0.8v, 0.9v, 1.0v
- During AP works on lowest voltage(0.8V), watchdog reset is asserted
- AP can't boot, because vdd arm is still 0.8v

Solution
- Basic concept:
  After ap watchdog reset, GPIO configuration is changed by default value
- S5M8767A has function of voltage control with gpio (8 levels with 3 gpios)
- Set bootable voltage on level 0 -> can work with default gpio configuration
- In the probing, Change voltage control level from level 0 to level 1
- Execute normal dvfs operation on level 1
- After watchdog reset, ap gpio is set by default value
- PMIC operation mode is changed by ap reset (level1 -> level0)
- Regardless of previous vdd_arm voltage, AP always can be booted.

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19 12:06:32 +01:00
Yadwinder Singh Brar 852abad238 regulator: max77686: Convert driver to use regulator_set_voltage_time_sel.
This patch converts the driver to use regulator_set_voltage_time_sel() as
.set_voltage_time_sel() callback. It also sets ramp_delay as 100000 uV/us for
LDOs & normal BUCKs and 27500 uV/us(default/reset value) for BUCKs[2/3/4] in
regulator_desc[].

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19 12:06:32 +01:00
Axel Lin a133829e66 regulator: tps65023: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19 12:06:26 +01:00
Axel Lin ba3bd8a301 regulator: tps65023: Convert to regulator_list_voltage_table
In current mapping table settings, min_uV/max_uV are always
equal to volt_table[0] and volt_table[table_len -1].
Thus remove min_uV and max_uV from struct tps_info.

The table based mapping with table_len == 1 means fixed voltage.
So we don't need fixed flag to differentiate if it is fixed or not.

This patch adds DCDC_FIXED_3300000_VSEL_table and DCDC_FIXED_1800000_VSEL_table
for fixed voltage cases. So we can convert tps65023_dcdc_ops to
regulator_list_voltage_table. This makes the code simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19 12:06:26 +01:00
Axel Lin 2c19ad43d1 regulator: mc13xxx: Remove mc13xxx_sw_regulator_is_enabled function
If .is_enabled callback is not implemented, regulator core assumes that the
regulator is always on. Thus we don't need mc13xxx_sw_regulator_is_enabled
function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-19 12:06:25 +01:00
Mark Brown 0e8e5c34cf regulator: twl: Remove references to 32kHz clock from DT bindings
Due to the lack of a generic clock API we'd had the 32kHz clock in the
regulator driver but this is definitely a Linux-specific thing and now
we have a clock API hopefully the code can be moved elsewhere. Try to
avoid getting DTs deployed relying on the 32kHz clock by removing it
from the bindings, grep seems to tell me it's not currently used anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-18 13:40:14 +01:00
Mark Brown 74ea0e5992 regulator: tps65910: Don't use 0 as NULL
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-18 11:12:21 +01:00
Axel Lin ea38d13fd1 regulator: core: Change the unit of ramp_delay from mV/uS to uV/uS
This change makes it possible to set ramp_delay with 0.xxx mV/uS without
truncation issue.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-18 10:56:58 +01:00
Axel Lin 398715ab94 regulator: core: Support table based mapping in regulator_set_voltage_time_sel
For table based mapping, we can calculate voltage difference by below equation:
abs(rdev->desc->volt_table[new_selector] - rdev->desc->volt_table[old_selector])

Thus we can make regulator_set_voltage_time_sel work for table based mapping.

regulator_set_voltage_time_sel() only supports linear or table based mapping.
In case it is misused, also warn if neither linear nor table based mapping
is used with 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-18 10:56:51 +01:00
Axel Lin 086ccd4379 regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-18 10:46:57 +01:00
Yadwinder Singh Brar 6f0b2c696c regulator: Add ramp_delay configuration to constraints
For some hardwares ramp_delay for BUCKs is a configurable parameter which can
be configured through DT or board file.This patch adds ramp_delay to regulator
constraints and allow user to configure it for regulators which supports this
feature, through DT or board file. It will provide two ways of setting the
ramp_delay for a regulator:
	First, by setting it as constraints in board file(for configurable
regulators) and set_machine_constraints() will take care of setting it on
hardware by calling(the provided) .set_ramp_delay() operation(callback).
	Second, by setting it as data in regulator_desc(as fixed/default
ramp_delay rate) for a regulator in driver.

regulator_set_voltage_time_sel() will give preference to
constraints->ramp_delay while reading ramp_delay rate for regulator. Similarly
users should also take care accordingly while refering ramp_delay rate(in case
of implementing their private .set_voltage_time_sel() callbacks for different
regulators).

[Rewrote subject for 80 columns -- broonie]

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:08:52 +01:00
Axel Lin b5fb77e018 regulator: wm831x-dcdc: Convert wm831x_buckv_ops to set_voltage_sel and map_voltage
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:07:19 +01:00
Axel Lin d580cb5e78 regulator: wm831x-dcdc: Convert wm831x_buckp_ops to regulator_set_voltage_sel_regmap
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:07:19 +01:00
Axel Lin 0a4796896b regulator: wm831x-ldo: Convert to regulator_set_voltage_sel_regmap and map_voltage
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:07:19 +01:00
Axel Lin 1bd1955a1f regulator: ab3100: Convert fixed voltage to use regulator_list_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:05:28 +01:00
Axel Lin 368a788769 regulator: pcf50633: Convert to regulator_set_voltage_sel_regmap and map_voltage
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:05:28 +01:00
Axel Lin 07b9e329f9 regulator: ab8500: Remove min_uV and max_uV from struct ab8500_regulator_info
The min_uV and max_uV are not really used in the code and misleading because
the min_uV and max_uV settings does not match the value in the voltage table.

For example, we have
static const unsigned int ldo_vaux3_voltages[] = {
        1200000,
        1500000,
        1800000,
        2100000,
        2500000,
        2750000,
        2790000,
        2910000,
};

With below min_uV/max_uV settings for AB8500_LDO_AUX3.
.min_uV                 = 1100000,
.max_uV                 = 3300000,

The min_uV/max_uV for AB8500_LDO_AUX3 seems copy-paste from AB8500_LDO_AUX2
and is wrong.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:04:45 +01:00
Axel Lin 7142e2138b regulator: ab8500: Use regulator_list_voltage_linear for ab8500_regulator_fixed_ops
Also removes set_voltage_time_sel callback from ab8500_regulator_fixed_ops
because the voltage won't change. ( And ab8500_regulator_fixed_ops does not
implement get_voltage_sel so set_voltage_time_sel won't be called )

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:04:45 +01:00
Axel Lin 34e74f39fa regulator: mc13xxx: Convert to regulator_list_voltage_table
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:01:21 +01:00
Axel Lin ee5e6253ac regulator: mc13xxx: Fix voltage checking for mc13xxx_fixed_regulator_set_voltage
The voltage range checking should be to ensure mc13xxx_regulators[id].voltages[0]
falls with min_uV and max_uV.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:01:21 +01:00
Axel Lin e08ef739fe regulator: tps62360: Simplify tps62360_set_voltage_time_sel implementation
For linear mappings, we can use below equation to get the voltage difference
between new_selector and old_selector:

abs(new_selector - old_selector) * rdev->desc->uV_step

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17 21:01:21 +01:00