summaryrefslogtreecommitdiff
path: root/drivers/regulator
AgeCommit message (Collapse)Author
2015-10-06Merge remote-tracking branch 'regulator/fix/axp20x' into regulator-linusMark Brown
2015-10-01regulator: core: Handle probe deferral from DT when resolving suppliesMark Brown
When resolving regulator-regulator supplies we ignore probe deferral returns from regulator_dev_lookup() (such as are generated for DT when we can see a supply is registered) and just fall back to the dummy regulator if there are full constraints (as is the case for DT). This means that probe deferral is broken for DT systems, fix that by paying attention to -EPROBE_DEFER return codes like we do -ENODEV. A further patch will simplify this further, this is a minimal fix for the specific issue. Fixes: 9f7e25edb1575a6d2 (regulator: core: Handle full constraints systems when resolving supplies) Reported-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonnie@kernel.org> Cc: stable@vger.kernel.org
2015-09-29regulator: axp20x: Fix enable bit indexes for DCDC4 and DCDC5Chen-Yu Tsai
The enable bit indexes for DCDC4 and DCDC5 regulators are off by 1. We haven't run into any problems with this since either the regulators aren't defined in the DT and aren't used, or all the DCDC regulators have the "always-on" property set, as they are almost always used for system critical loads. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-09-21Merge remote-tracking branches 'regulator/fix/anatop', 'regulator/fix/gpio', ↵Mark Brown
'regulator/fix/pbias', 'regulator/fix/tpx65218' and 'regulator/fix/vexpress' into regulator-linus
2015-09-21Merge remote-tracking branch 'regulator/fix/core' into regulator-linusMark Brown
2015-09-19regulator: vexpress: Fix module autoload for OF platform driverLuis de Bethencourt
This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19regulator: gpio: Fix module autoload for OF platform driverLuis de Bethencourt
This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-19regulator: anatop: Fix module autoload for OF platform driverLuis de Bethencourt
This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17regulator: core: Correct return value check in regulator_resolve_supplyCharles Keepax
The ret pointer passed to regulator_dev_lookup is only filled with a valid error code if regulator_dev_lookup returned NULL. Currently regulator_resolve_supply checks this ret value before it checks if a regulator was returned, this can result in valid regulator lookups being ignored. Fixes: 6261b06de565 ("regulator: Defer lookup of supply to regulator_get") Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-09-16regulator: tps65218: Fix missing zero typoAndrew F. Davis
Add missing zero to value. This will be needed when range checking is implemented. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-08Merge tag 'regmap-v4.3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "This has been a busy release for regmap. By far the biggest set of changes here are those from Markus Pargmann which implement support for block transfers in smbus devices. This required quite a bit of refactoring but leaves us better able to handle odd restrictions that controllers may have and with better performance on smbus. Other new features include: - Fix interactions with lockdep for nested regmaps (eg, when a device using regmap is connected to a bus where the bus controller has a separate regmap). Lockdep's default class identification is too crude to work without help. - Support for must write bitfield operations, useful for operations which require writing a bit to trigger them from Kuniori Morimoto. - Support for delaying during register patch application from Nariman Poushin. - Support for overriding cache state via the debugfs implementation from Richard Fitzgerald" * tag 'regmap-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: (25 commits) regmap: fix a NULL pointer dereference in __regmap_init regmap: Support bulk reads for devices without raw formatting regmap-i2c: Add smbus i2c block support regmap: Add raw_write/read checks for max_raw_write/read sizes regmap: regmap max_raw_read/write getter functions regmap: Introduce max_raw_read/write for regmap_bulk_read/write regmap: Add missing comments about struct regmap_bus regmap: No multi_write support if bus->write does not exist regmap: Split use_single_rw internally into use_single_read/write regmap: Fix regmap_bulk_write for bus writes regmap: regmap_raw_read return error on !bus->read regulator: core: Print at debug level on debugfs creation failure regmap: Fix regmap_can_raw_write check regmap: fix typos in regmap.c regmap: Fix integertypes for register address and value regmap: Move documentation to regmap.h regmap: Use different lockdep class for each regmap init call thermal: sti: Add parentheses around bridge->ops->regmap_init call mfd: vexpress: Add parentheses around bridge->ops->regmap_init call regmap: debugfs: Fix misuse of IS_ENABLED ...
2015-09-04Merge remote-tracking branches 'regmap/topic/debugfs' and ↵Mark Brown
'regmap/topic/force-update' into regmap-next
2015-09-03regulator: pbias: program pbias register offset in pbias driverKishon Vijay Abraham I
Add separate compatible strings for every platform and populate the pbias register offset in the driver data. This helps avoid depending on the dt for pbias register offset. Also update the dt binding documentation for the new compatible strings. Suggested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-02regulator: core: fix possible NULL dereferenceSudip Mukherjee
We were checking rdev->supply for NULL after dereferencing it. Lets check for rdev->supply along with _regulator_is_enabled() and call regulator_enable() only if rdev->supply is not NULL. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branch 'regulator/topic/tps6586x' into regulator-nextMark Brown
2015-08-30Merge remote-tracking branches 'regulator/topic/qcom-smd', ↵Mark Brown
'regulator/topic/qcom-spmi', 'regulator/topic/rk808', 'regulator/topic/stub' and 'regulator/topic/tol' into regulator-next
2015-08-30Merge remote-tracking branches 'regulator/topic/mt6311', ↵Mark Brown
'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next
2015-08-30Merge remote-tracking branches 'regulator/topic/lp872x', ↵Mark Brown
'regulator/topic/ltc3589', 'regulator/topic/max77693' and 'regulator/topic/max8973' into regulator-next
2015-08-30Merge remote-tracking branches 'regulator/topic/da9210', ↵Mark Brown
'regulator/topic/da9211', 'regulator/topic/fan53555', 'regulator/topic/isl9305' and 'regulator/topic/list' into regulator-next
2015-08-30Merge remote-tracking branches 'regulator/topic/88pm800', ↵Mark Brown
'regulator/topic/ad5398', 'regulator/topic/axp20x' and 'regulator/topic/da9062' into regulator-next
2015-08-30Merge remote-tracking branch 'regulator/topic/core' into regulator-nextMark Brown
2015-08-30Merge remote-tracking branch 'regulator/fix/pbias' into regulator-linusMark Brown
2015-08-30regulator: mt6311: fix platform_no_drv_owner.cocci warningskbuild test robot
drivers/regulator/mt6311-regulator.c:169:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30regulator: ltc3589: Remove unnecessary MODULE_ALIAS()Javier Martinez Canillas
The driver has a I2C device id table that is used to create the modaliases and already contains a "ltc3589" device id. So the modalias is unnecessary. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30regulator: ad5398: Remove unnecessary MODULE_ALIAS()Javier Martinez Canillas
The driver has a I2C device id table that is used to create the modaliases and also "ad5398-regulator" is not a supported I2C id, so it's never used. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-29regulator: pfuze100: Remove unnecessary MODULE_ALIAS()Javier Martinez Canillas
The driver has a I2C device id table that is used to create the modaliases and also "pfuze100-regulator" is not a supported I2C id, so is never used. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-28regulator: core: use debug level print in regulator_check_drmsArchit Taneja
When calling regulator_set_load, regulator_check_drms prints and returns an error if the regulator device's flag REGULATOR_CHANGE_DRMS isn't set. drms_uA_update, however, bails out without reporting an error. Replace the error print with a debug level print so that we don't get such prints when the underlying regulator doesn't support DRMS. Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25regulator: lp872x: handle error caseMilo Kim
If memory allocation gets failed on parsing the DT, then it returns error '-ENOMEM' explicitly. Then, the driver exists from the _probe(). Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25regulator: lp872x: use the private data instead of updating I2C device ↵Milo Kim
platform data Currently, lp872x driver parses the DT and copies values into the 'cl->dev.platform_data' if 'of_node' exists. This may have architectural issue. Platform data is configurable through the DT or I2C board info inside the platform area. However, lp872x driver changes this configuration when it is loaded. The lp872x driver should get data from the platform side and use the private data, 'lp872x->pdata' instead of changing the original platform data. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25regulator: isl9305: Export OF module alias informationJavier Martinez Canillas
The I2C core always reports the MODALIAS uevent as "i2c:<modalias>" regardless of the mechanism that was used to register the device (i.e: OF or board code) and the table that is used later to match the driver with the device (i.e: I2C id table or OF match table). So drivers needs to export the I2C id table and this be built into the module or udev won't have the necessary information to autoload the needed driver module when the device is added. But this means that OF-only drivers needs to have both OF and I2C id tables that have to be kept in sync and also the dev node compatible manufacturer prefix is stripped when reporting the MODALIAS. Which can lead to issues if two vendors use the same I2C device name for example. To avoid the above, the I2C core behavior may be changed in the future to not require an SPI device table for OF-only drivers and report the OF module alias. So, it's better to also export the OF table even when is unused now to prevent breaking module loading when the core changes. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-21regulators: max77693: register driver earlier to avoid deferred probeMarek Szyprowski
MAX77693 based regulators are used by USB gadget subsystem, which doesn't support deferred probe, so the driver should be registered before USB gadget drivers get probed. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-19regulator: qcom_smd: Set n_voltages for pm8941_lnldoAxel Lin
Just setting fixed_uV is not enough, the regulator core will also check n_voltages setting. The fixed_uV only works when n_voltages is 1. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-17regulator: core: Use IS_ERR_OR_NULL()Viresh Kumar
Use IS_ERR_OR_NULL() rather than open coding it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-17regulator: Regulator driver for the Qualcomm RPMBjorn Andersson
Driver for regulators exposed by the Resource Power Manager (RPM) found in devices based on Qualcomm 8974 and newer platforms. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Acked-by: Andy Gross <agross@codeaurora.org> Tested-by: Tim Bird <tim.bird@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-14regulator: core: Print at debug level on debugfs creation failureStephen Boyd
Failure to create a debugfs node is not an error, but we print a warning upon failure to create the node. Downgrade this to a debug printk so that we're quiet here. This allows multiple drivers to request a CPU's regulator so that CPUfreq and AVSish drivers can coexist. The downside of this approach is that whoever gets to debugfs first the others who come later to not have any debugfs attributes associated with them. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-14regulator: pbias: Fix broken pbias disable functionalityKishon Vijay Abraham I
regulator_disable of pbias always writes '0' to the enable_reg. However actual disable value of pbias regulator is not always '0'. Fix it by populating the disable_val in pbias_reg_info for the various platforms and assign it to the disable_val of pbias regulator descriptor. This will be used by regulator_disable_regmap while disabling pbias regulator. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2015-08-13regulator: core: Spelling fixViresh Kumar
Trivial spell fix, s/succesfully/successfully. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-12regulator: core: Use class device list for regulator_list in late initMark Brown
The regulator_list has exactly the same contents as the list that the driver core maintains of regulator_class members so is redundant. As a first step in converting over to use the class device list convert our iteration in late_initcall() to use the class device iterator. Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-12regulator: core: Move more deallocation into class unregisterMark Brown
We really ought to be using the class dvice lifetime management features more than we are rather than open coding them so take a step towards that by moving some of the simplest deallocations to the dev_release() function. Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-12regulator: core: Reduce rdev locking region when releasing regulatorMark Brown
When we release a regulator we need to remove references to it from the rdev which means locking the rdev. Currently we also free resources associated with the regulator inside the rdev lock but there is no need to do this, we can reduce the region the lock is held by restricting it to just actions that affect the rdev. Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-07regulator: core: Drop regulator_list_mutex when we're done with it on removeMark Brown
When removing a regulator we hold regulator_list_mutex in order to ensure the regualtor doesn't become removed again. However we only need to protect the list until we remove the regulator from the list so move the unlock earlier to reduce the locked region. Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-04regulator: axp20x: Add module aliasIan Campbell
This allows the module to be autoloaded. Together with 07949bf9c63c ("cpufreq: dt: allow driver to boot automatically") this is sufficient to allow a modular kernel (such as Debian's) to enable cpufreq on a Cubietruck. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-03regulator: mt6311: Trivial clean upAxel Lin
Make mt6311_buck_ops, mt6311_ldo_ops and mt6311_regulators const and remove unneeded error variable in mt6311_i2c_probe(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-03regulator: mt6311: Modify the maximum voltage of buck.Henry Chen
The maximum voltage of buck should be 1.39375V. 1.39375V = 0.6V + 0.00625V * 127, 127 is the max_sel of linear range. Reported-by: Axel Lin <axel.lin@ingics.com> signed-off-by: Henry Chen <henryc.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-31regulator: fan53555: Export I2C module alias informationJavier Martinez Canillas
The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So the driver needs to export the I2C table and this be built into the module or udev won't have the necessary information to auto load the correct module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-29regulator: max8973: Set VSEL regmap ops if DVS GPIO is not setMikko Perttunen
Use regmap helpers for get_voltage_sel and set_voltage_sel ops if the DVS GPIO is not set. The DVS GPIO allows on the fly selection of the VSEL register from two choices. However, if it is not set, the VSEL register will stay fixed and we can use the regmap ops. This allows use of the *hardware_vsel* regulator APIs. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24regulator: qcom-spmi: Add vendor specific configurationStephen Boyd
Add support for over current protection (OCP), pin control selection, soft start strength, and auto-mode. Cc: <devicetree@vger.kernel.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24Merge branch 'topic/ocp' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-qcom-spmi
2015-07-24regulator: Add over current protection (OCP) supportStephen Boyd
Some regulators can automatically shut down when they detect an over current event. Add an op (set_over_current_protection) and a DT property + constraint to support this capability. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24Merge remote-tracking branches 'regulator/fix/88pm800', ↵Mark Brown
'regulator/fix/max8973', 'regulator/fix/s2mps11' and 'regulator/fix/supply' into regulator-linus