summaryrefslogtreecommitdiff
path: root/drivers/regulator/88pm800.c
AgeCommit message (Collapse)Author
2017-01-31regulator: 88pm800: constify regulator_ops structuresBhumika Goyal
Declare regulator_ops structures as const as they are only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too. File size before: drivers/regulator/88pm800.o text data bss dec hex filename 1001 6288 0 7289 1c79 drivers/regulator/88pm800.o File size after: drivers/regulator/88pm800.o text data bss dec hex filename 1513 5776 0 7289 1c79 drivers/regulator/88pm800.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17Merge branch 'fix/88pm800' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-88pm800 Conflicts: drivers/regulator/88pm800.c
2015-07-16regulator: 88pm800: Use regulator_nodes/of_match in the descriptorVaibhav Hiremath
This patch is add regulator_nodes/of_match in the regulator descriptor for using information from DT instead of specific codes. With this patch, driver gets simplified, - No need to maintain "struct of_regulator_match" table and call of_regulator_match() fn. - No need for pm800_regulator_dt_init() fn, as it was only used for of_regulator_match(). - probe() fn got simplified around regulator_config and regulator_desc initialization. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16regulator: 88pm800: Update driver to use devm_regulator_register fnVaibhav Hiremath
This patch replaces standard regulator_register with devm_regulator_register() fn, as using devm_regulator_register() fn simplifies the driver return/exit path. As part of this update, patch also cleanups up all unnecessary changes which is result of this patch - - Remove _remove() fn, as devm_ variant takes care of it. - Remove pm800_regulators.regulators[] field, as it was only needed during cleanup, so we no longer need this. This also saved some amount of memory. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16regulator: 88pm800: Fix indentation of assignments of data structuresVaibhav Hiremath
This patch makes code more clean from readability point of view, make all assignments of LDO, BUCk and regulator_ops structure at the same indentation. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-09regulator: 88pm800: fix LDO vsel_mask valueYi Zhang
As per datasheet, Except LDO2, all other LDO's use bit [3:0] for VOUT select. Current code uses wrong mask value of 0x1f, So this patch fixes it to use 0xf. Signed-off-by: Yi Zhang <yizhang@marvell.com> [vaibhav.hiremath@linaro.org: Updated changelog with more detailed description] Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20regulator: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-06-09regulator: 88pm800: remove duplicate PM800_BUCK3 defineDan Carpenter
The PM800_BUCK3 define is cut and pasted twice so we can remove the second instance. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20regulator: 88pm800: Remove redundant error messageSachin Kamat
kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-11regulator: Add REGULATOR_LINEAR_RANGE macroAxel Lin
Add REGULATOR_LINEAR_RANGE macro and convert regulator drivers to use it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-11regulator: Remove max_uV from struct regulator_linear_rangeAxel Lin
linear ranges means each range has linear voltage settings. So we can calculate max_uV for each linear range in regulator core rather than set the max_uV field in drivers. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-01Merge remote-tracking branch 'regulator/topic/max8660' into regulator-nextMark Brown
2013-08-14regulator: 88pm800: forever loop in pm800_regulator_probe()Dan Carpenter
This is supposed to be testing "i < ARRAY_SIZE()" instead of just "ARRAY_SIZE()". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-13regulator: 88pm800: Fix checking whether num_regulator is validAxel Lin
The code to check whether num_regulator is valid is wrong because it should iterate all array entries rather than break from the for loop if pdata->regulators[i] is NULL. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-30regulator: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-19regulator: 88pm800: Add missing n_voltages setting for bucksAxel Lin
Some regulator APIs are broken if n_voltages setting is not set. e.g. regulator_count_voltages(), regulator_list_voltage(), and regulator_can_change_voltage() do not work if n_voltages setting is missing. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-19regulator: 88pm800: Add missing config.of_node setting for regulator registerAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-19regulator: 88pm800: add regulator driver for 88pm800Chao Xie
Add the regulator driver for PMIC 88pm800 including device tree support. 88pm800 is an I2C-based power-management IC containing voltage regulators, a real-time clock, and some general purpose ADC devices, Signed-off-by: Yi Zhang <yizhang@marvell.com> Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Mark Brown <broonie@linaro.org>