aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-09-21Merge remote-tracking branches 'regulator/fix/anatop', 'regulator/fix/gpio', 'regulator/fix/pbias', 'regulator/fix/tpx65218' and 'regulator/fix/vexpress' into regulator-linusMark Brown5-7/+54
2015-09-21Merge remote-tracking branch 'regulator/fix/core' into regulator-linusMark Brown1-11/+10
2015-09-19regulator: vexpress: Fix module autoload for OF platform driverLuis de Bethencourt1-0/+1
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 Bethencourt1-0/+1
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 Bethencourt1-0/+1
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 Keepax1-8/+8
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. Davis1-1/+1
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 git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmapLinus Torvalds1-1/+1
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 'regmap/topic/force-update' into regmap-nextMark Brown1-1/+1
2015-09-03regulator: pbias: program pbias register offset in pbias driverKishon Vijay Abraham I1-6/+50
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 Mukherjee1-3/+2
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 Brown1-2/+2
2015-08-30Merge remote-tracking branches 'regulator/topic/qcom-smd', 'regulator/topic/qcom-spmi', 'regulator/topic/rk808', 'regulator/topic/stub' and 'regulator/topic/tol' into regulator-nextMark Brown5-19/+759
2015-08-30Merge remote-tracking branches 'regulator/topic/mt6311', 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-nextMark Brown23-53/+390
2015-08-30Merge remote-tracking branches 'regulator/topic/lp872x', 'regulator/topic/ltc3589', 'regulator/topic/max77693' and 'regulator/topic/max8973' into regulator-nextMark Brown7-244/+246
2015-08-30Merge remote-tracking branches 'regulator/topic/da9210', 'regulator/topic/da9211', 'regulator/topic/fan53555', 'regulator/topic/isl9305' and 'regulator/topic/list' into regulator-nextMark Brown7-78/+179
2015-08-30Merge remote-tracking branches 'regulator/topic/88pm800', 'regulator/topic/ad5398', 'regulator/topic/axp20x' and 'regulator/topic/da9062' into regulator-nextMark Brown4-155/+84
2015-08-30Merge remote-tracking branch 'regulator/topic/core' into regulator-nextMark Brown1-4/+18
2015-08-30Merge remote-tracking branch 'regulator/fix/pbias' into regulator-linusMark Brown1-0/+5
2015-08-30regulator: mt6311: fix platform_no_drv_owner.cocci warningskbuild test robot1-1/+0
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 Canillas1-1/+0
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 Canillas1-1/+0
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 Canillas1-1/+0
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 Taneja1-1/+1
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 Kim1-4/+7
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 platform dataMilo Kim1-2/+5
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 Canillas1-0/+1
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 Szyprowski1-1/+11
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 Lin1-0/+1
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 Kumar1-1/+1
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 Andersson3-0/+362
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 Boyd1-1/+1
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 I1-0/+5
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 Kumar1-1/+1
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 Brown1-51/+55
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 Brown1-2/+3
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 Brown1-2/+3
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 Brown1-1/+1
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 Campbell1-0/+1
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 Lin1-7/+7
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 Chen1-1/+1
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 Canillas1-0/+1
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 Perttunen1-0/+9
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 Boyd1-5/+195
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 git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-qcom-spmiMark Brown2-0/+12
2015-07-24regulator: Add over current protection (OCP) supportStephen Boyd2-0/+12
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', 'regulator/fix/max8973', 'regulator/fix/s2mps11' and 'regulator/fix/supply' into regulator-linusMark Brown4-7/+20
2015-07-24regulator: mt6311: Add support for mt6311 regulatorHenry Chen4-0/+255
Add regulator support for mt6311. It has 2 regulaotrs - Buck and LDO, provide the related buck/ldo voltage data to the driver, and creates the regulator_desc table. Supported operations for Buck are enabled/disabled and voltage change, only enabled/disabled for LDO. Signed-off-by: Henry Chen <henryc.chen@mediatek.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-23regulator: tps6586x: silence pointer-to-int-castDaniel Kurtz1-2/+2
of_regulator_match.driver_data is (void *). tps6586x uses it to store an anonymous enum value (those TPS6586X_ID_ values). Later, it tries to extract the ID by casting directly to an int, which is a no-no ([-Wpointer-to-int-cast]): drivers/regulator/tps6586x-regulator.c: In function 'tps6586x_parse_regulator_dt': drivers/regulator/tps6586x-regulator.c:430:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] id = (int)tps6586x_matches[i].driver_data; ^ Instead of casting to int, uintptr_t is better suited for receiving and comparing integers extracted from void *. This is especially true on 64-bit systems where sizeof(void *) != sizeof(int). Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-21regulator: rk808: make better use of the gpiod APIUwe Kleine-König1-20/+12
The gpiod functions include variants for managed gpiod resources. Use it to simplify the remove function. As the driver handles a device node without a specification of dvs gpios just fine, additionally use the variant of gpiod_get exactly for this use case. This makes error checking more strict. As a third benefit this patch makes the driver use the flags parameter of gpiod_get* which will not be optional any more after 4.2 and so prevents a build failure when the respective gpiod commit is merged. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>