Commit Graph

12 Commits (45e3cc7d9fe69844cd12d51c511e1e98d156bbe1)

Author SHA1 Message Date
Axel Lin cb44cdeacd regulator: max77686: Use array to save pointer to rdev
MAX77686_REGULATORS is known in compile time.
Use array to save pointer to rdev makes the code simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28 11:00:26 -07:00
Axel Lin 2c58e2669f regulator: max77686: initialize of_node param for regulator register
Initialize config.of_node for regulator before registering.
This is needed for DT based regulator support.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-28 11:00:25 -07: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
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
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
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 23ca6bf231 regulator: max77686: Fix the delay time for set_voltage_time_sel
rdev->desc->uV_step * abs(new_selector - old_selector) returns uV.
The unit of ramp_rate is mV/us.
Thus 1000 should be multiplied.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11 12:09:14 +08:00
Axel Lin ab0d1cbe55 regulator: max77686: Check pdata->num_regulators earlier
If this driver only works when pdata->num_regulators == MAX77686_REGULATORS,
let's check it earlier.

Also remove unused num_regulators from struct max77686_data.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11 12:01:42 +08:00
Axel Lin 74adfee53b regulator: max77686: Fix checkpatch warnings
Fix below checkpatch warnings:

$ scripts/checkpatch.pl -f drivers/regulator/max77686.c
ERROR: return is not a function, parentheses are not required
+       return (DIV_ROUND_UP(rdev->desc->uV_step

WARNING: line over 80 characters
+       .ops            = &max77686_buck_dvs_ops,                               \

total: 1 errors, 1 warnings, 339 lines checked

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-04 11:28:21 +01:00
Axel Lin 2e3f7f26e1 regulator: max77686: Use regulator_map_voltage_linear for simple linear mappings
Both max77686_ops and max77686_buck_dvs_ops use simple linear voltage maps.
Thus use regulator_map_voltage_linear is more efficient than using the defult
regulator_map_voltage_iterate.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 20:11:09 +01:00
Jonghwa Lee 133d4016f1 regulator: MAX77686: Add Maxim 77686 regulator driver
Add driver for support max77686 regulator.
MAX77686 provides LDOs[1~26] and BUCKs[1~9]. It support to set or get the
volatege of regulator on max77686 chip with using regmap.

Signed-off-by: Chiwoong Byun <woong.byun@samsung.com>
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:05 +01:00