Remove unnecessary parentheses in order to fix the following
checkpatch error.
ERROR: return is not a function, parentheses are not required
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
pbias register controls internal power supply to sd card i/o pads
in most OMAPs (OMAP2-5, DRA7).
Control bits for selecting voltage level and
enabling/disabling are in the same PBIAS register.
Signed-off-by: Balaji T K <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Acked-by: Mark Brown <[email protected]>
Tested-by: Florian Vaussard <[email protected]>
Tested-by: Stefan Roese <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
Pull regulator fixes from Mark Brown:
"A couple of fixes here which ensure that regulators using the core
support for GPIO enables work in all cases by ensuring that helpers
are used consistently rather than open coding in places and hence not
having GPIO support in some of them"
* tag 'regulator-v3.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: core: Replace direct ops->disable usage
regulator: core: Replace direct ops->enable usage
Also remove PFUZE_NUM to avoid below build warnings:
CC [M] drivers/regulator/pfuze100-regulator.o
drivers/regulator/pfuze100-regulator.c:86:2: warning: excess elements in array initializer [enabled by default]
drivers/regulator/pfuze100-regulator.c:86:2: warning: (near initialization for 'pfuze_device_id') [enabled by default]
drivers/regulator/pfuze100-regulator.c:93:2: warning: excess elements in array initializer [enabled by default]
drivers/regulator/pfuze100-regulator.c:93:2: warning: (near initialization for 'pfuze_dt_ids') [enabled by default]
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
support pfuze200 chip which remove SW1C and SW4 based on pfuze100.
Signed-off-by: Robin Gong <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Remove __initconst from regulator_desc array because this array is used
during probe and s2mps11_pmic_probe() is not in __init section. However
still select the number of supported regulators according to device ID
so the driver will be ready for adding support for S2MPS14 device.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The regulator core supports this to allow the configuration to be inspected
at runtime even if no software management is enabled.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add __initconst to 'regulator_desc' array with supported regulators.
During probe choose how many and which regulators will be supported
according to device ID. Then copy the 'regulator_desc' array to
allocated memory so the regulator core can use it.
Additionally allocate array of of_regulator_match() dynamically (based
on number of regulators) instead of allocation on the stack.
This is needed for supporting different devices in s2mps11
driver and actually prepares the regulator driver for supporting the
S2MPS14 device.
Code for supporting the S2MPS14 device will add its own array of
'regulator_desc' (also marked as __initconst). This way memory footprint
of the driver will be reduced (approximately 'regulators_desc' array for
S2MPS11 occupies 5 kB on 32-bit ARM, for S2MPS14 will occupy 3 kB).
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Cc: Yadwinder Singh Brar <[email protected]>
Reviewed-by: Yadwinder Singh Brar <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Regulators registered by devm_regulator_register() do not have to be
stored in state container because they are never dereferenced later.
The array of regulator_dev can be safely removed from state container.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The nodes of regulators should be retrieved from parent device.
Bug was be introduced by commit (regulator: mc13xxx: Fix NULL
pointer error in non-DT mode) in conjuction with (mfd: Revert
"mfd: Always assign of_node in mfd_add_device()").
Signed-off-by: Alexander Shiyan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Fix indent code style in order to fix the following checkpatch
issues.
ERROR: code indent should use tabs where possible
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line
Signed-off-by: Jingoo Han <[email protected]>
Acked-by: Haojian Zhuang <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Regulator dummy does not have any enable operations. So it is always_on.
Signed-off-by: Markus Pargmann <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add a check to avoid NULL pointer dereference error when
booted in non-DT mode. While at it also remove the additional
of_node_get which is no longer needed for of_get_child_by_name
and fix the node pointer.
Signed-off-by: Sachin Kamat <[email protected]>
Reported-by: Philippe Rétornaz <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
There are many places where ops->disable is called directly. Instead we
should use _regulator_do_disable() which also handles gpio regulators.
To be able to use the wrapper function from _regulator_force_disable(),
I moved the _notifier_call_chain() call from _regulator_do_disable() to
_regulator_disable(). This way, _regulator_force_disable() can use
different flags for _notifier_call_chain() without calling it twice.
Cc: <[email protected]> # 3.10+
Signed-off-by: Markus Pargmann <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
There are some direct ops->enable in the regulator core driver. This is
a potential issue as the function _regulator_do_enable() handles gpio
regulators and the normal ops->enable calls. These gpio regulators are
simply ignored when ops->enable is called directly.
One possible bug is that boot-on and always-on gpio regulators are not
enabled on registration.
This patch replaces all ops->enable calls by _regulator_do_enable.
[Handle missing enable operations -- broonie]
Cc: <[email protected]> # 3.10+
Signed-off-by: Markus Pargmann <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
regulator: Handle invalid enable operation for always/boot on regulators
Signed-off-by: Mark Brown <[email protected]>
This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
of_node_put). The DTS parsing function returned number of matched
regulators as success status which then was compared against 0 in probe.
Result was a probe fail after successful parsing the DTS:
max14577-regulator: probe of max14577-regulator failed with error 2
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviwed-by: Sachin Kamat <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Change "dummy supplies not allowed" error message to warning instead, as this
is a just warning message with no change to the behavior.
[Added a CC to stable since some other bug fixes cause this to come up
more frequently on PCs which is how it was noticed -- broonie]
Signed-off-by: Shuah Khan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]