aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/qcom_rpm-regulator.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-07-07regulator: qcom_rpm-regulator: add NULL check on of_match_device() return valueGustavo A. R. Silva1-0/+5
Check return value from call to of_match_device() in order to prevent a NULL pointer dereference. In case of NULL print error message and return. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-31regulator: qcom_rpm-regulator: Add support for pm8018 rpm regulatorNeil Armstrong1-0/+66
In order to support the Qualcomm MDM9615 SoC, add support for the PM8018 RPM regulator in the qcom_rpm-regulator driver. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-04-08regulator: qcom: Tidy up probe()Bjorn Andersson1-10/+11
Tidy up error reporting and move rpm reference retrieval out of the for loop for improved readability. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-08regulator: qcom: Rework to single platform deviceBjorn Andersson1-83/+161
Modeling the individual RPM resources as platform devices consumes at least 12-15kb of RAM, just to hold the platform_device structs. Rework this to instead have one device per pmic exposed by the RPM. With this representation we can more accurately define the input pins on the pmic and have the supply description match the data sheet. Suggested-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-08regulator: qcom: Refactor of-parsing codeBjorn Andersson1-60/+81
Refactor out all custom property parsing code from the probe function into a function suitable for regulator_desc->of_parse_cb usage. Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-08regulator: qcom: Don't enable DRMS in driverBjorn Andersson1-4/+0
The driver itself should not flag regulators as being DRMS compatible, this should come from board or dt files. Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-23regulator: qcom-rpm: Implement set_load and enable drmsBjorn Andersson1-0/+30
Pass the requested load directly to the rpm. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-18Merge tag 'mfd-for-linus-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfdLinus Torvalds1-0/+1
Pull MFD updates from Lee Jones: "Changes to existing drivers: - fixr platform device collision; da9052, wm8994-core - regmap configuration amendments; tps65218 - fix runtime PM deadlock; rtsx_usb - remove unused/superfluous code; db8500-prcmu, omap-usb-host - enable watchdog timer; lpc_sch - add start/stop RX URBs helpers; dln2 - remove platform device (DT only); max77686, max77802 - support suspend and resume; dln2 - add Device Tree support; da9063 - extra error checking; intel_soc_pmic - const'ify all the things; 88pm860x, hi6421-pmic, intel_soc_pmic, max77686, lm3533, retu, pcf50633, davinci_voicecodec, smsc-ece1099, tps65218, mc13xxx, tps65217, twl-core, twl6040 New drivers/supported devices: - new driver for Richtek RT5033 - new driver for DA9150 Charger and FuelGauge - new driver for Qualcomm Resource Power Manager (RPM) - add support for the ir-clk into sun6i-prcm - add support for FuelGauge into axp20x" * tag 'mfd-for-linus-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (32 commits) mfd: intel_soc_pmic: Add missing error check for devm_kzalloc mfd: rtsx_usb: Defer autosuspend while card exists mfd: devicetree: Add bindings for DA9063 mfd: da9063: Add device tree support regulator: qcom-rpm: Add missing state flag in call to RPM mfd: qcom-rpm: Driver for the Qualcomm RPM mfd: devicetree: bindings: Add Qualcomm RPM DT binding mfd: max77686/802: Remove support for board files mfd: omap-usb-host: Remove some unused functions mfd: twl6040: Constify struct regmap_config and reg_default array mfd: twl-core: Constify struct regmap_config and reg_default array mfd: tps65217: Constify struct regmap_config mfd: mc13xxx: i2c/spi: Constify struct regmap_config mfd: tps65218: Constify struct regmap_config mfd: smsc-ece1099: Constify struct regmap_config mfd: davinci_voicecodec: Constify struct regmap_config mfd: pcf50633: Constify struct regmap_config mfd: retu: Constify struct regmap_config mfd: lm3533: Constify struct regmap_config mfd: max77686: Constify struct regmap_config ...
2015-02-08Merge remote-tracking branches 'regulator/topic/rk808', 'regulator/topic/rpm', 'regulator/topic/rt5033' and 'regulator/topic/tps65023' into regulator-nextMark Brown1-4/+8
2015-02-08Merge remote-tracking branches 'regulator/topic/max8649', 'regulator/topic/mode', 'regulator/topic/mt6397', 'regulator/topic/pfuze100' and 'regulator/topic/qcom-rpm' into regulator-nextMark Brown1-0/+1
2015-01-30regulator: qcom-rpm: Make it possible to specify supplyBjorn Andersson1-0/+1
Make it possible to specify the supply of a regulator, through the vin-supply property in dt. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-28regulator: qcom-rpm: signedness bug in probe()Dan Carpenter1-1/+1
"force_mode" is a u32 so it is never "< 0", but because of type promotion then comparing "== -1" will do what we want. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-26regulator: qcom_rpm: Don't update vreg->uV/mV if rpm_reg_write failsAxel Lin1-4/+8
Ensure get_voltage return correct voltage if set_voltage fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-22regulator: qcom-rpm: Add missing state flag in call to RPMBjorn Andersson1-0/+1
This adds the missing state parameter to the call down to the RPM. This is currently hard coded to the active state, as that's all we're supporting at this moment. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-12-14Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-coreLinus Torvalds1-1/+0
Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-12-05Merge remote-tracking branches 'regulator/topic/rn5t618', 'regulator/topic/rpm', 'regulator/topic/rt5033', 'regulator/topic/s2mpa01' and 'regulator/topic/s2mps11' into regulator-nextMark Brown1-0/+19
2014-11-26regulator: of: Add regulator desc param to of_get_regulator_init_data()Javier Martinez Canillas1-4/+5
The of_get_regulator_init_data() function is used to extract the regulator init_data but information on how to extract certain data is defined in the static regulator descriptor (e.g: how to map the hardware operating modes). Add a const struct regulator_desc * parameter to the function signature so the parsing logic could use the information in the struct regulator_desc. of_get_regulator_init_data() relies on of_get_regulation_constraints() to actually extract the init_data so it has to pass the struct regulator_desc but that is modified on a later patch. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-21regulator: rpm: add support for RPM-controller SMB208Josh Cartwright1-0/+19
The IPQ8064 reference boards make use of SMB208 regulators which are controlled by RPM. Implement support for these regulators in the RPM regulator driver. Signed-off-by: Josh Cartwright <joshc@codeaurora.org> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20regulator: drop owner assignment from platform_driversWolfram Sang1-1/+0
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-09-26regulator: qcom_rpm: Fix FORCE_MODE_IS_2_BITS macroAxel Lin1-1/+1
Current code does not take the macro parameter, fix it. This is not a problem at this moment because the only user actually passes vreg to FORCE_MODE_IS_2_BITS(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-26regulator: qcom_rpm: Don't explicitly initialise the first field of configAxel Lin1-1/+1
Doing so generates a warning as the first field is a pointer but we use 0 to initialize it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-24regulator: qcom-rpm: Regulator driver for the Qualcomm RPMBjorn Andersson1-0/+798
Driver for regulators exposed by the Resource Power Manager (RPM) found in Qualcomm 8660, 8960 and 8064 based devices. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>