The commit [39f802d6b6: '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: 39f802d6b6 ('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>
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
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>
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>
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>
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>
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>
"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>
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>
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>
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>
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>
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>
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>
A common simplified DT parsing code for regulators was introduced in
commit a0c7b164ad ("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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAABAgAGBQJUoX7vAAoJECTWi3JdVIfQtcEH/junzpSCOwIrI8NG9/ZF0xt5
rLB1SlDxtiSPv6eFA+KXYYmO8VNjZ1g+NN1PoeSNgAK08YzG9IUHIqI1L1iDe2qG
2vpPY++Rg5eWPY79Sa9oy/+2zmFmUh3t+Shv7p3WC1Q8GES4bD6dm/QVxykh16nW
nDGYZN981THIHS9xPKsmvCbHMp6PknDZkqO9Umzflt7cYgzgFP8xTaTlb4vkwTza
3ZjGnEMIe1ldkLGFEJmdsSMro07hKzVYk8e3auOK+gAMpO+QjpY8WxuarmpQBPLx
GddKhfkox5HNUxm9jRp0jivgi8YXD4a1lXzwXpxSihax1Q/Q/v00yoJ6selRQXg=
=/mpj
-----END PGP SIGNATURE-----
Merge tag 'regulator-v3.19-rc2' of 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
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>
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>
"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>
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>
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.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
53kAoLeteByQ3iVwWurwwseRPiWa8+MI
=OVRS
-----END PGP SIGNATURE-----
Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
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
...
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: 5a867cf288 ("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>
Fixes the following sparse warnings:
drivers/regulator/rk808-regulator.c💯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>
The main thing this time around is support for suspend mode
configuration from DT which will enable some very useful power savings
on systems where we can't rely on the bootloader configuration. We
still don't really support dynamic configuration of this at runtime,
that may come later if there is any demand.
- Support for specifying the target regulation mode and voltage during
system suspend via DT, enabling power savings in that mode.
- Reduce the default verbosity of the logging on boot, improving boot
times especially for systems with very large numbers of regulators.
- Lots of cleanups and fixes for Maxim PMIC drivers.
- New driver for Richtek RT5033.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAABAgAGBQJUhaLEAAoJECTWi3JdVIfQMIEH/0n/0TJngSaoifV72PCkICdx
GbNs2bUkjuNAbYw6S6xmbA6MYPEllGiFnmJPRjV41qf0a1TTG/vam3fjeaBao7En
DxEBsz22iuBM4wmOSEKTsDtTRuiX170cqKKWZ4ugFo/uaDinueW2tz0Uzvz05or5
bSxT8hbeYerNksb13mn7OjW8r0rCE24w1K669MZgwp0uuIY+NKUTnwT4TqMzDo5c
OT4RQ2XZAQOhOfqS4VTR07Ab8PzGQd4zzmTYljqd2MKL7ubKz41vNSnGHwPdrTH1
FeQ9Q/JZl0W6zwUjltGfZLjDewD1Kcb+3gdgCiD+V8wQQ1xg8H15nql4WpK6P8s=
=bMvT
-----END PGP SIGNATURE-----
Merge tag 'regulator-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
"The main thing this time around is support for suspend mode
configuration from DT which will enable some very useful power savings
on systems where we can't rely on the bootloader configuration. We
still don't really support dynamic configuration of this at runtime,
that may come later if there is any demand.
Summary:
- Support for specifying the target regulation mode and voltage
during system suspend via DT, enabling power savings in that mode.
- Reduce the default verbosity of the logging on boot, improving boot
times especially for systems with very large numbers of regulators.
- Lots of cleanups and fixes for Maxim PMIC drivers.
- New driver for Richtek RT5033"
* tag 'regulator-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (62 commits)
regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
regulator: sky81452: Modify Device Tree structure
regulator: sky81452: Modify Device Tree structure
dt-bindings: Update documentation for "system-power-controller" and fix misspellings
of: Rename "poweroff-source" property to "system-power-controller"
regulator: max77686: Remove support for board files
regulator: max77802: Remove support for board files
regulator: max77802: Fill regulator modes translation callback
regulator: max77802: Document binding for regulator operating modes
regulator: of: Add support for parsing initial and suspend modes
regulator: of: Pass the regulator description in the match table
regulator: of: Add regulator desc param to of_get_regulator_init_data()
regulator: Add mode mapping function to struct regulator_desc
regulator: Document binding for initial and suspend modes
regulator: core: Add PRE_DISABLE notification
regulator: gpio: fix parsing of gpio list
regulator: rpm: add support for RPM-controller SMB208
regulator: da9063: Do not transform local IRQ to virtual
regulator: sky81452: Modify dependent Kconfig symbol
regulator: rt5033: Add RT5033 Regulator device driver
...