summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/s5m8767.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: Staticise non-exported symbol s5m8767_opmode_regMark Brown2012-05-121-1/+1
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Remove unneeded include of linux/delay.h from regulator driversAxel Lin2012-04-231-1/+0Star
| | | | | | | | | | | | | All the drivers that need delay for the regulator voltage output voltage to stabilize after being enabled or after being set to a new value has been converted to implement enable_time and set_voltage_time_sel callbacks. Then regulator core will take care of the necessary delay. For the drivers that don't need the delay, don't need to include linux/delay.h. This patch removes the unneeded include of linux/delay.h in regulator drivers. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: s5m8767: Use DIV_ROUND_UP to calculate selectorAxel Lin2012-04-231-1/+4
| | | | | | | | | | | Integer division may truncate the result. Use DIV_ROUND_UP to ensure new voltage setting falls within specified range. Also properly handle the case min_vol < desc->min to ensure we don't return negative value for selector. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macroAxel Lin2012-04-101-48/+41Star
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Use one s5m8767_ops for both LDOs and BUCKsAxel Lin2012-04-101-13/+3Star
| | | | | | | | | All the callback function implementation are the same for both LDOs and BUCKs. Merge them to one s5m8767_ops. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKsAxel Lin2012-04-101-94/+49Star
| | | | | | | | | | | | | | | | | | | | s5m8767_set_voltage not only implement set_voltage callbacks for LDOs, but also for BUCKs when s5m8767->buck_gpioindex is not set. s5m8767_set_voltage_buck actually only for buck[2|3|4] when s5m8767->buck_gpioindex is set. Conditionally calling s5m8767_set_voltage in s5m8767_set_voltage_buck makes the code hard to read. I think merging s5m8767_set_voltage_buck and s5m8767_set_voltage actually simplifies things. It's easy to use buck234_vol pointer to differentiate if we need to control voltage for buck[2|3|4] by DVS GPIOs. This patch reworks s5m8767_set_voltage to support both LDOx and BUCKx in all cases. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge tag 'v3.4-rc2' into regulator-driversMark Brown2012-04-101-7/+7
|\ | | | | | | Linux 3.4-rc2 contains some fixes that further patches depend upon.
| * regulator: Fix setting new voltage in s5m8767_set_voltageAxel Lin2012-03-311-7/+7
| | | | | | | | | | | | | | | | | | Current code does not really update the register with new value, fix it. I rename the variable i to sel for better readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: core: Use a struct to pass in regulator runtime configurationMark Brown2012-04-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than adding new arguments to regulator_register() every time we want to add a new bit of dynamic information at runtime change the function to take these via a struct. By doing this we avoid needing to do further changes like the recent addition of device tree support which required each regulator driver to be updated to take an additional parameter. The regulator_desc which should (mostly) be static data is still passed separately as most drivers are able to configure this statically at build time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | regulator: Add support s5m8767 opmode operationSangbeom Kim2012-04-011-10/+61
|/ | | | | | | | S5M8767A has 4 operation mode for BUCK/LDOs. This patch can handle opmode for s5m8767a. Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Make s5m8767_get_voltage_register always return correct registerAxel Lin2012-03-141-18/+9Star
| | | | | | | | | Check s5m8767->buck[2|3|4]_gpiodvs status in s5m8767_get_voltage_register and return correct register accordingly. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlierAxel Lin2012-03-141-24/+21Star
| | | | | | | | | If we need to ensure only one of the buck[2|3|4]_gpiodvs can be specificed, check them earlier. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Rename s5m8767_convert_voltage to s5m8767_convert_voltage_to_selAxel Lin2012-03-111-12/+10Star
| | | | | | | | | | | | This function finds the smallest voltage that falls within the specified range, and then returns the selector. This rename makes the intention more clear. Also remove unneeded local variables min_vol and max_vol in s5m8767_set_voltage and s5m8767_set_voltage_buck. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Fix s5m8767_set_voltage_time_sel calculation valueSangbeom Kim2012-03-111-1/+1
| | | | | | | | In the s5m8767_set_voltage_time_sel function, divisor unit is wrong. ramp_delay is usec unit. So 1000 should be multiplied. Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Remove unused i2c variable in s5m8767_pmic_probeAxel Lin2012-03-111-2/+0Star
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Fix the logic of s5m8767_set_voltage_time_selAxel Lin2012-03-111-28/+2Star
| | | | | | | | | | This patch includes below fixes: 1. The mask variable is not used at all here, remove it. 2. We already have the new_sel and old_sel, simply returns the delay by: DIV_ROUND_UP(desc->step * (new_sel - old_sel), s5m8767->ramp_delay); Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: s5m8767: Fix unused variable warning in probe()Mark Brown2012-03-111-1/+1
| | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com>
* regulator: Kill s5m8767_get_reg_id functionAxel Lin2012-02-021-12/+7Star
| | | | | | | | | Calling s5m8767_get_reg_id() is exactly the same as calling rdev_get_id(). It is pointless to add s5m8767_get_reg_id() function. Use rdev_get_id() directly and remove s5m8767_get_reg_id() function. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Update s5m8767 for device tree API changesMark Brown2012-01-201-1/+1
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: s5m8767: Remove redundant MODULE_ALIASAxel Lin2012-01-201-1/+0Star
| | | | | | | | | The MODULE_DEVICE_TABLE will setup the modalias, thus adding a MODULE_ALIAS for an entry already in s5m8767_pmic_id is redundant. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: s5m8767: Add missing breaksAxel Lin2012-01-201-0/+4
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Add S5M8767A regulator driverSangbeom Kim2012-01-201-0/+834
S5M8767A is a cost-effective PMIC which is designed for mobile applications. It includes high efficient 9 Buck converters, 28 LDOs. Especially, S5M8767A is optimized for Multi-core SOCs. And during DVFS operation, S5M8767A output stable voltage. This patch implement regulator driver for S5M8767A. Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>