summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'regulator/fix/gpio-enable' and ↵Mark Brown2015-03-162-17/+18
|\ \ | | | | | | | | | 'regulator/fix/tps65910' into regulator-linus
| | * regulator: tps65910: Add missing #include <linux/of.h>Geert Uytterhoeven2015-03-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/regulator/tps65910-regulator.c: In function ‘tps65910_parse_dt_reg_data’: drivers/regulator/tps65910-regulator.c:1018: error: implicit declaration of function ‘of_get_child_by_name’ drivers/regulator/tps65910-regulator.c:1018: warning: assignment makes pointer from integer without a cast drivers/regulator/tps65910-regulator.c:1034: error: implicit declaration of function ‘of_node_put’ drivers/regulator/tps65910-regulator.c:1056: error: implicit declaration of function ‘of_property_read_u32’ Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | regulator: core: Fix enable GPIO reference countingDoug Anderson2015-03-081-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally _regulator_do_enable() isn't called on an already-enabled rdev. That's because the main caller, _regulator_enable() always calls _regulator_is_enabled() and only calls _regulator_do_enable() if the rdev was not already enabled. However, there is one caller of _regulator_do_enable() that doesn't check: regulator_suspend_finish(). While we might want to make regulator_suspend_finish() behave more like _regulator_enable(), it's probably also a good idea to make _regulator_do_enable() robust if it is called on an already enabled rdev. At the moment, _regulator_do_enable() is _not_ robust for already enabled rdevs if we're using an ena_pin. Each time _regulator_do_enable() is called for an rdev using an ena_pin the reference count of the ena_pin is incremented even if the rdev was already enabled. This is not as intended because the ena_pin is for something else: for keeping track of how many active rdevs there are sharing the same ena_pin. Here's how the reference counting works here: * Each time _regulator_enable() is called we increment rdev->use_count, so _regulator_enable() calls need to be balanced with _regulator_disable() calls. * There is no explicit reference counting in _regulator_do_enable() which is normally just a warapper around rdev->desc->ops->enable() with code for supporting delays. It's not expected that the "ops->enable()" call do reference counting. * Since regulator_ena_gpio_ctrl() does have reference counting (handling the sharing of the pin amongst multiple rdevs), we shouldn't call it if the current rdev is already enabled. Note that as part of this we cleanup (remove) the initting of ena_gpio_state in regulator_register(). In _regulator_do_enable(), _regulator_do_disable() and _regulator_is_enabled() is is clear that ena_gpio_state should be the state of whether this particular rdev has requested the GPIO be enabled. regulator_register() was initting it as the actual state of the pin. Fixes: 967cfb18c0e3 ("regulator: core: manage enable GPIO list") Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
| * | regulator: Only enable disabled regulators on resumeJavier Martinez Canillas2015-03-081-3/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The _regulator_do_enable() call ought to be a no-op when called on an already-enabled regulator. However, as an optimization _regulator_enable() doesn't call _regulator_do_enable() on an already enabled regulator. That means we never test the case of calling _regulator_do_enable() during normal usage and there may be hidden bugs or warnings. We have seen warnings issued by the tps65090 driver and bugs when using the GPIO enable pin. Let's match the same optimization that _regulator_enable() in regulator_suspend_finish(). That may speed up suspend/resume and also avoids exposing hidden bugs. [Use much clearer commit message from Doug Anderson] Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
| |
| \
*-. \ Merge remote-tracking branches 'regulator/fix/da9210' and ↵Mark Brown2015-03-062-0/+17
|\ \ \ | | | | | | | | | | | | 'regulator/fix/rk808' into regulator-linus
| | * | regulator: rk808: Set the enable time for LDOsDoug Anderson2015-02-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LDOs are documented in the rk808 datasheet to have a soft start time of 400us. Add that to the driver. If this time takes longer on a certain board the device tree should be able to override with "regulator-enable-ramp-delay". This fixes some dw_mmc probing problems (together with other patches posted to the mmc maiing lists) on rk3288. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
| * | | regulator: da9210: Mask all interrupt sources to deassert interrupt lineGeert Uytterhoeven2015-02-171-0/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After boot-up, some events may be set, and cause the da9210 interrupt line to be asserted. As the da9210 driver doesn't have interrupt support yet, this causes havoc on systems where the interrupt line is shared among multiple devices. This is the case on e.g. r8a7791/koelsch, where the interrupt line is shared with a da9063 regulator, and the following events are set: EVENT_A = 0x00000011 (GPI0 | GPI4) EVENT_B = 0x00000002 (NPWRGOOD) Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
* | / regulator: Fix regression due to NULL constraints checkTakashi Iwai2015-03-041-7/+0
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit [39f802d6b6d9: 'regulator: Build sysfs entries with static attribute groups'] converted the sysfs entry creation to static attribute groups, but this resulted in a regression due to the NULL check of rdev->constraints. At the point where the device is registered, rdev->constraints isn't set, so the attributes depending on it are missing. We may fix it by shuffling the code order in regulator_register(), but a quicker fix is to just remove this NULL check. rdev->constraints is in anyway always set to non-NULL in set_machine_constraints(), thus the check there is basically superfluous. Fixes: 39f802d6b6d9 ('regulator: Build sysfs entries with static attribute groups') Signed-off-by: Takashi Iwai <tiwai@suse.de> Reportded-by: Steve Twiss <stwiss.opensource@diasemi.com> Tested-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge tag 'mfd-for-linus-3.20' of ↵Linus Torvalds2015-02-181-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd 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 ...
| * | regulator: qcom-rpm: Add missing state flag in call to RPMBjorn Andersson2015-01-221-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>
| | |
| \ \
| \ \
| \ \
| \ \
| \ \
*-----. \ \ Merge remote-tracking branches 'regulator/topic/rk808', ↵Mark Brown2015-02-084-11/+21
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | 'regulator/topic/rpm', 'regulator/topic/rt5033' and 'regulator/topic/tps65023' into regulator-next
| | | | * | | regulator: tps65023: Constify struct regmap_config and regulator_opsKrzysztof Kozlowski2015-01-051-3/+3
| | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Make struct regulator_ops const as well. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * / / regulator: rt5033-regulator: Use regulator_nodes/of_match in the descriptorBeomho Seo2014-12-241-1/+7
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is add regulator_nodes/of_match in the regulator descriptor for using information from DT instead of sppecific codes. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * / / regulator: qcom_rpm: Don't update vreg->uV/mV if rpm_reg_write failsAxel Lin2015-01-261-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>
| * | | regulator: rk808: Fix sparse non static symbol warningsWei Yongjun2014-12-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following sparse warnings: drivers/regulator/rk808-regulator.c:100:5: warning: symbol 'rk808_set_suspend_voltage' was not declared. Should it be static? drivers/regulator/rk808-regulator.c:115:5: warning: symbol 'rk808_set_suspend_enable' was not declared. Should it be static? drivers/regulator/rk808-regulator.c:126:5: warning: symbol 'rk808_set_suspend_disable' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | |
| \ \ \
| \ \ \
| \ \ \
| \ \ \
| \ \ \
| \ \ \
| \ \ \
*-------. \ \ \ Merge remote-tracking branches 'regulator/topic/max8649', ↵Mark Brown2015-02-087-88/+505
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 'regulator/topic/mode', 'regulator/topic/mt6397', 'regulator/topic/pfuze100' and 'regulator/topic/qcom-rpm' into regulator-next
| | | | | * | | | regulator: qcom-rpm: Make it possible to specify supplyBjorn Andersson2015-01-301-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>
| | | | * / | | regulator: pfuze100-regulator: add pfuze3000 supportRobin Gong2015-01-091-9/+125
| | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pfuze3000 chip support. Signed-off-by: Robin Gong <b38343@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * / / / regulator: mt6397: Add support for MT6397 regulatorFlora Fu2014-12-243-0/+342
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add MT6397 regulator driver. Signed-off-by: Flora Fu <flora.fu@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * / / / regulator: core: Consolidate drms update handlingBjorn Andersson2015-01-281-77/+35
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor drms_uA_update() slightly to allow regulator_set_optimum_mode() to utilize the same logic instead of duplicating it. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * / / / regulator: max8649: Constify struct regmap_config and regulator_opsKrzysztof Kozlowski2015-01-051-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Make struct regulator_ops const as well. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | |
| \ \ \
| \ \ \
| \ \ \
| \ \ \
| \ \ \
| \ \ \
| \ \ \
*-------. \ \ \ Merge remote-tracking branches 'regulator/topic/isl9305', ↵Mark Brown2015-02-087-74/+324
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 'regulator/topic/lp872x', 'regulator/topic/max14577', 'regulator/topic/max7686' and 'regulator/topic/max77843' into regulator-next
| | | | | * | | | regulator: max77843: Add max77843 regulator driverJaewon Kim2015-02-053-0/+236
| | | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds new regulator driver to support max77843 MFD(Multi Function Device) chip`s regulators. The Max77843 has two voltage regulators for USB safeout. Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com> Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | * | | | regulator: max77686: Add GPIO controlKrzysztof Kozlowski2015-01-081-5/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add enable control over GPIO for regulators supporting this: LDO20, LDO21, LDO22, buck8 and buck9. This is needed for proper (and full) configuration of the Maxim 77686 PMIC without creating redundant 'regulator-fixed' entries. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | | | | regulator: max14577: Use regulator_nodes/of_match in the descriptorBeomho Seo2014-12-221-48/+14
| | | | |/ / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is add regulator_nodes/ofmatch in the regulator descriptor for using information from DT instead of specific codes. That will be used regulation_of_get_init_data function for get regulator property on device tree. Using that make driver simpler. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * / | | | regulator: lp872x: Remove **regulators from struct lp872xAxel Lin2015-01-261-19/+5
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code is using devm_regulator_register(), so we don't need to store *rdev in struct lp872x for clean up. Also clean up lp872x_probe() a bit to remove unnecessary goto and num_regulators variable. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * / / / / regulator: isl9305: deprecate use of isl in compatible string for isilArnaud Ebalard2014-12-221-2/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "isil" and "isl" prefixes are used at various locations inside the kernel to reference Intersil corporation. This patch is part of a series fixing those locations were "isl" is used in compatible strings to use the now expected "isil" prefix instead (NASDAQ symbol for Intersil and most used version). The old compatible string is kept for backward compatibility. Signed-off-by: Arnaud Ebalard <arno@natisbad.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | |
| \ \ \ \
| \ \ \ \
| \ \ \ \
*---. \ \ \ \ Merge remote-tracking branches 'regulator/topic/axp20x', ↵Mark Brown2015-02-083-60/+53
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 'regulator/topic/da9211' and 'regulator/topic/fan53555' into regulator-next
| | | * | | | | regulator: fan53555: Constify struct regmap_config and slew_rates arrayKrzysztof Kozlowski2015-01-051-2/+2
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Make const also slew_rates array. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | | | regulator: da9211: Add gpio control for enable/disable of buckJames Ban2015-01-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a patch for adding gpio control about enable/disable of buck. Signed-off-by: James Ban <james.ban.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | | | regulator: da9211: fix unmatched of_nodeJames Ban2015-01-161-2/+2
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a patch for fixing unmatched of_node. Signed-off-by: James Ban <james.ban.opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | | regulator: axp20x: Migrate to regulator core's simplified DT parsing codeChen-Yu Tsai2015-01-091-36/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common simplified DT parsing code for regulators was introduced in commit a0c7b164ad11 ("regulator: of: Provide simplified DT parsing method"). This is very similar to our own code, so get rid of ours and use the common code. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | | regulator: axp20x: Fill regulators_node and of_match descriptor fieldsChen-Yu Tsai2015-01-091-20/+29
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fills the DT related fields in the regulator descriptors, which can then be used by the regulator core's simplified DT code. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | | | Merge remote-tracking branch 'regulator/topic/dt-cb' into regulator-nextMark Brown2015-02-083-5/+30
|\ \ \ \ \
| * | | | | regulator: Update documentation after renaming function argumentKrzysztof Kozlowski2015-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update documentation for regulator_register() function after renaming its argument. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | | Merge branch 'topic/core' of ↵Mark Brown2015-01-091-3/+3
| |\ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-dt-cb Conflicts: drivers/regulator/core.c
| * | | | | regulator: Allow parsing custom properties when using simplified DT parsingKrzysztof Kozlowski2015-01-083-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When drivers use simplified DT parsing method (they provide 'regulator_desc.of_match') they still may want to parse custom properties for some of the regulators. For example some of the regulators support GPIO enable control. Add a driver-supplied callback for such case. This way the regulator core parses common bindings offloading a lot of code from drivers and still custom properties may be used. The callback, called for each parsed regulator, may modify the 'regulator_config' initially passed to regulator_register(). Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | | regulator: Copy config passed during registrationKrzysztof Kozlowski2015-01-081-3/+15
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy the 'regulator_config' structure passed to regulator_register() function so the driver could safely modify it after parsing init data. The driver may want to change the config as a result of specific init data parsed by regulator core (e.g. when core handled parsing device tree). Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | | | Merge remote-tracking branch 'regulator/topic/core' into regulator-nextMark Brown2015-02-081-130/+111
|\ \ \ \ \
| * | | | | regulator: Build sysfs entries with static attribute groupsTakashi Iwai2015-02-021-127/+108
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calling device_create_file() manually after the device registration, put all in attribute groups and filter the unwanted ones via is_visible callback. This not only simplifies the code but also avoids the possible race between the device registration and sysfs registration. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | regulator: core: Fix format specifier warningAniroop Mathur2014-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Aniroop Mathur <a.mathur@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | regulator: core: Avoid negative regulator no & initialize it to -1Aniroop Mathur2014-12-291-3/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch initializes regulator_no to -1 to avoid extra subtraction operation performed every time we register a regulator and avoid negative regulator no in its name. Signed-off-by: Aniroop Mathur <a.mathur@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | | Merge remote-tracking branch 'regulator/fix/qcom-rpm' into regulator-linusMark Brown2015-02-081-1/+1
|\ \ \ \ | |_|_|/ |/| | |
| * | | regulator: qcom-rpm: signedness bug in probe()Dan Carpenter2015-01-281-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>
* | | Merge remote-tracking branch 'regulator/fix/s2mps11' into regulator-linusMark Brown2015-01-161-4/+38
|\ \ \
| * | | regulator: s2mps11: Fix wrong calculation of register offsetJonghwa Lee2015-01-081-4/+38
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing registers('BUCK7_SW' & 'LDO29_CTRL'). Since BUCK7 has 1 more register (BUCK7_SW) than others, register offset should be added one more for which has bigger address than BUCK7 registers. Fixes: 76b9840b24ae04(regulator: s2mps11: Add support S2MPS13 regulator device) Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
* | | Merge remote-tracking branch 'regulator/fix/core' into regulator-linusMark Brown2015-01-161-1/+3
|\ \ \
| * | | regulator: core: fix race condition in regulator_put()Ashay Jaiswal2015-01-081-1/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regulator framework maintains a list of consumer regulators for a regulator device and protects it from concurrent access using the regulator device's mutex lock. In the case of regulator_put() the consumer is removed and regulator device's parameters are updated without holding the regulator device's mutex. This would lead to a race condition between the regulator_put() and any function which traverses the consumer list or modifies regulator device's parameters. Fix this race condition by holding the regulator device's mutex in case of regulator_put. Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* | | Merge tag 'regulator-v3.19-rc2' of ↵Linus Torvalds2014-12-291-7/+12
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull one regulator fix from Mark Brown: "One fix here, a fix for the voltage mapping on one of the s2mps11 regulators which broke systems using it including apparently the Gear 2 smartwatches" * tag 'regulator-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: s2mps11: Fix dw_mmc failure on Gear 2
| * | regulator: s2mps11: Fix dw_mmc failure on Gear 2Krzysztof Kozlowski2014-12-121-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invalid buck4 configuration for linear mapping of voltage in S2MPS14 regulators caused boot failure on Gear 2 (dw_mmc-exynos): [ 3.569137] EXT4-fs (mmcblk0p15): mounted filesystem with ordered data mode. Opts: (null) [ 3.571716] VFS: Mounted root (ext4 filesystem) readonly on device 179:15. [ 3.629842] mmcblk0: error -110 sending status command, retrying [ 3.630244] mmcblk0: error -110 sending status command, retrying [ 3.636292] mmcblk0: error -110 sending status command, aborting Buck4 voltage regulator has different minimal voltage value than other bucks. Commit merging multiple regulator description macros caused to use linear_min_sel from buck[1235] regulators as value for buck4. This lead to lower voltage of buck4 than required. Output of the buck4 is used internally as power source for LDO{3,4,7,11,19,20,21,23}. On Gear 2 board LDO11 is used as MMC regulator (V_EMMC_1.8V). Fixes: 5a867cf28893 ("regulator: s2mps11: Optimize the regulator description macro") Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>