Using the same ops for both [en|dis]able and set_suspend_[en|dis]able
callbacks is actively broken. This patch removes .set_suspend_disable and
.set_suspend_enable callback setting.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Using the same ops for both .disable and .set_suspend_disable callbacks is
actively broken. This patch removes .set_suspend_disable callback setting.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Now of_regulator_match() returns without finding the match if match->of_node
is not NULL.
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
There is multiple voltage input pins on device which
takes the voltage input for different voltage regulator.
Support to configure the voltage input supplied by
different regulator for each regulators.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Add support for input supply in DT parsing of node.
The input supply will be provided by the property
"vin-supply" in the regulator node.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch device tree support for regulator driver. It uses the parent
(mfd's) DT node to parse the regulator data for max77686.
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Add the policy for regulator DT such that if device have multiple
regulator and its binding contains a child node that describes each
regulator then each regulator child node must have the property
"regulator-compatible" which matches with regulator name of their
hardware counterparts.
Modify the DT documentation of regulator devices to reflect this
policy.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It is ok to request current limit with min_uA < chip->min_uA and
max_uA > chip->max_uA.
We need to set min_uA = chip->min_uA if (min_uA < chip->min_uA),
this ensures the equation to calcuate selator does not return negative number.
Also set max_uA = chip->max_uA if (max_uA > chip->max_uA), as suggested by
Sonic.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This is essentially the code that was factored out into the core when the
feature was implemented.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It is very common for regulators to support having their enable signal
controlled by a GPIO. Since there are a bunch of fiddly things to get
right like handling the operations when the enable signal is tied to
a rail and it's just replicated code add support for this to the core.
Drivers should set ena_gpio in their config if they have a GPIO control,
using ena_gpio_flags to specify any flags (including GPIOF_OUT_INIT_ for
the initial state) and ena_gpio_invert if the GPIO is active low. The
core will then override any enable and disable operations the driver has
and instead control the specified GPIO.
This will in the future also allow us to further extend the core by
identifying when several enable signals have been tied together and
handling this properly.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Create new _regulator_do_enable() and _regulator_do_disable() operations
which deal with the mechanics of performing the enable and disable, partly
to cut down on the levels of indentation and partly to support some future
work.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Many regulators have a fixed specification for their enable time. Allow
this to be set in the regulator_desc as a number to save them having to
implement an explicit operation.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Match the device's regulators with the property of
"regulator-compatible" of each regulator node.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Device's regulator matches their hardware counterparts with the
property "regulator-compatible" of each child regulator node in
place of the child node name.
Add the property "regulator-compatible" for each regulator with
their hardware counterpart's name.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It is ok to request voltage with min_uV < tps->info[rid]->min_uV and
max_uV > tps->info[rid]->max_uV.
The equation we used in uv_to_vsel() does not allow
min_uV < tps->info[rid]->min_uV, otherwise it returns negative selector.
So we need to set min_uV = tps->info[rid]->min_uV if
min_uV < tps->info[rid]->min_uV.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: AnilKumar Ch <anilkumar@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This permits the setting of bogus values because the invalidity check is
itself invalid.
Reported-by: dcb314@hotmail.com
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch refactors the code to get rid of the fixed_ilimsel and FIXED_ILIMSEL
flag usage, and convert all the fixed ilimsel to table based (with one entry in
the table).
We can differentiate fixed ilimsel by checking info->n_ilimsels == 1,
thus FIXED_ILIMSEL flag can be removed.
This change makes the logic of the code simpler as all the ilimsels are table
based now.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds fixed_5000000_voltage table for fixed voltage,
so we can convert regulator_ops to regulator_list_voltage_table.
We can differentiate fixed voltage by checking rdev->desc->n_voltages == 1,
thus remove the FIXED_VOLTAGE flag usage.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
of_get_named_gpio() needs the driver hosting the GPIO that the DT
property references to have been probed. Detect this specific failure,
and defer the probe of the whole regulator until this API can complete.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Convert tps65217_pmic_ldo1_ops to use regulator_list_voltage_table.
We have n_voltages and volt_table settings in regulator_desc,
so we don't need the table and table_len fields in struct tps_info.
Thus remove them from struct tps_info.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Another week, another batch of fixes.
All are small, contained, targeted fixes for explicit problems -- mostly
build and boot failures across i.MX, OMAP, Renesas/Shmobile and Samsung.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJP74D0AAoJEIwa5zzehBx3MbwQAIyRtHYjodf1Jl4TTRTtd4A7
rOyOYxhSnick8gOMciGcfOigl0lqdZ77P//aFsXKSY+T84tHvDMS537qR3B7aNQF
QiUV3a/KMCSU/qyQmhEWEQjnEesvbI3uC55q5hOLCLXIgXGFbvCN2wdfwo6BvafD
LvfmI0J0wVr+i0QyMHGmAgPbwNkjzeCxtBS58bGqVqX63bGp2mqxIDwc1y+BfxZg
ZW/9aZBgnsS/4B9lARI2bInLGr0DTJPzIyExVJhIrcikPer1b17GZEcE+IneC5GK
oSEZzgpX+2LkSF0qs13bLIMfH/ID0piToMx2kY+DxALTEAK/9XGnqLHVI2ZjWDrK
xaGQa+OvZ+ed9xN3jUazgzaWautAI0wJ3XWOu9cqCWo5QjKF0EGD6WEgQCFtIVI3
r7pU4/NK/H3LUOnUcX+jMYgie29wmDhnb2sX2E1U5/utOKlG/uGFmeSJHfF4VM6o
rmUmFS+rvtgNlud0wBiuhoKIh8XPOPIWbmXKGajaRPmCrXfP/AYCBzXYoMWzg7sE
TxrhNUItgzjfc6h/oQZ7fIEmnrWjgcpuiJwPTDm+JYIXCNU9uW91finFwAzBJZmV
bmT9xEaaaBluF7PV6Vj1WHvKnlFfCzLOHLb2pQ+FfeUx0SC70a1TccW3b6Vp4Eer
TmSuQwPFSzO/XsGNH6+K
=C8+9
-----END PGP SIGNATURE-----
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC fixes from Olof Johansson:
"Another week, another batch of fixes.
All are small, contained, targeted fixes for explicit problems --
mostly build and boot failures across i.MX, OMAP, Renesas/Shmobile and
Samsung."
* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
ARM: imx6q: fix suspend regression caused by common clk migration
ARM: OMAP4470: Fix OMAP4470 boot failure
ARM: EXYNOS: Fix EXYNOS_DEV_DMA Kconfig entry
ARM: OMAP2+: nand: fix build error when CONFIG_MTD_ONENAND_OMAP2=n
ARM: shmobile: r8a7779: Route all interrupts to ARM
ARM: shmobile: kzm9d: use late init machine hook
ARM: shmobile: kzm9g: use late init machine hook
ARM: mach-shmobile: armadillo800eva: Use late init machine hook
ARM: SAMSUNG: Fix for S3C2412 EBI memory mapping
ARM: mach-shmobile: add missing GPIO IRQ configuration on mackerel
ARM: mach-shmobile: Fix build when SMP is enabled and EMEV2 is not enabled
ARM: shmobile: sh7372: bugfix: chclr_offset base
ARM: shmobile: sh73a0: bugfix: SY-DMAC number
ARM: SAMSUNG: Should check for IS_ERR(clk) instead of NULL
Fix kernel-doc warnings in printk.c: use correct parameter name.
Warning(kernel/printk.c:2429): No description found for parameter 'buf'
Warning(kernel/printk.c:2429): Excess function parameter 'line' description in 'kmsg_dump_get_buffer'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fix kernel-doc warning. This struct member was removed in commit
875682648b ("irq: Remove irq_chip->release()") so remove its
associated kernel-doc entry also.
Warning(include/linux/irq.h:338): Excess struct/union/enum/typedef member 'release' description in 'irq_chip'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Richard Weinberger <richard@nod.at>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
When moving to common clk framework, the imx6q clks rom and mmdc_ch1_axi
get different on/off states than old clk driver, which breaks suspend
function. There might be a better way to manage these clocks, but let's
takes the old clk driver approach to fix the regression first.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
trivial fix to get omap4470 booting.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJP7AB3AAoJEBvUPslcq6VzlkQQAN93IkOfd2OdkKk/RNe4Dzs/
RsbZyNB2FsaLwriyMSgRhIxYbjlaLufhB9LKy53ZNeJkSssg45NqEZRvxdSCl/WH
oZwm9ns/wg4UDNSXDNMOJ5Kw3rZor6XQOwPDvgPKt9TQgTbaICwpM7sd/LeUMpan
AF4dOQG3wNcCuw/xpEnJ/dYkY/+tWalLrZh/Jj/7BIYAIkWv0e8ByPMczQ2KoLEv
5VR3sJfxRgVFb84ws5kXUuit2Db8FzOBcoQSaqXWo7qj5GgHlKZhu0zvJEbREGxj
e040VeC236MZbcbrrbecZWA172dPfpBlLyrgj3dxaEzNXsnZ6kCX2EZvvdI+x5Rd
CNYjbj2TyNt5Feqlo+XE0eBNiOnaYCwg3TY8ONGaCWSRRRQoL7QFitd2tbV6HT55
m7+RkAflpd7OkCirkiFTKUjRZl55SHWzq5XoMscV9MrvNv2Uf/GN3zgWQ1wclTXN
wj6EvVR/CLg1bqpvRQvmUkBoNQEYCf4VGSwa9KywEkivgf6x0hsxI6LJi0zlYYT8
u48VMINt7pjWQNFkfdid87TyXCvTW9TqACD9zBgU3Au6mCg+gJi+Z6WRP+cIPnQG
dij9LWltYKjI9tvwZY7j5bDCxhTIfXBZDK/P9gie7+AoME2x/4dFgYEIK8/3JPdy
9DmGa6PckDRgfu5l2bVg
=EieC
-----END PGP SIGNATURE-----
Merge tag 'omap-fixes-for-v3.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
From Tony Lindgren:
"Here's one more regression fix that I missed earlier, and a
trivial fix to get omap4470 booting."
* tag 'omap-fixes-for-v3.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP4470: Fix OMAP4470 boot failure
ARM: OMAP2+: nand: fix build error when CONFIG_MTD_ONENAND_OMAP2=n
Pull ACPI & Power Management patches from Len Brown.
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
acpi_pad: fix power_saving thread deadlock
ACPI video: Still use ACPI backlight control if _DOS doesn't exist
ACPI, APEI, Avoid too much error reporting in runtime
ACPI: Add a quirk for "AMILO PRO V2030" to ignore the timer overriding
ACPI: Remove one board specific WARN when ignoring timer overriding
ACPI: Make acpi_skip_timer_override cover all source_irq==0 cases
ACPI, x86: fix Dell M6600 ACPI reboot regression via DMI
ACPI sysfs.c strlen fix
Here is a number of printk() fixes, specifically a few reported by the
crazy blog program that ships in SUSE releases (that's "boot log" and
not "web log", it predates the general "blog" terminology by many
years), and the restoration of the continuation line functionality
reported by Stephen and others. Yes, the changes seem a bit big this
late in the cycle, but I've been beating on them for a while now, and
Stephen has even optimized it a bit, so all looks good to me.
The other change in here is a Documentation update for the stable kernel
rules describing how some distro patches should be backported, to
hopefully drive a bit more response from the distros to the stable
kernel releases.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
iEYEABECAAYFAk/uhJEACgkQMUfUDdst+ymL0QCfTjWJrdf+ooJ6Bx/NNgOGxYip
Ss0AnRrCNkfgmMcdNMn/7CIbHlaTj+S+
=M5Rg
-----END PGP SIGNATURE-----
Merge tag 'driver-core-3.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver Core fixes from Greg Kroah-Hartman:
"Here is a number of printk() fixes, specifically a few reported by the
crazy blog program that ships in SUSE releases (that's "boot log" and
not "web log", it predates the general "blog" terminology by many
years), and the restoration of the continuation line functionality
reported by Stephen and others. Yes, the changes seem a bit big this
late in the cycle, but I've been beating on them for a while now, and
Stephen has even optimized it a bit, so all looks good to me.
The other change in here is a Documentation update for the stable
kernel rules describing how some distro patches should be backported,
to hopefully drive a bit more response from the distros to the stable
kernel releases.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'driver-core-3.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
printk: Optimize if statement logic where newline exists
printk: flush continuation lines immediately to console
syslog: fill buffer with more than a single message for SYSLOG_ACTION_READ
Revert "printk: return -EINVAL if the message len is bigger than the buf size"
printk: fix regression in SYSLOG_ACTION_CLEAR
stable: Allow merging of backports for serious user-visible performance issues
The acpi_pad driver can get stuck in destroy_power_saving_task()
waiting for kthread_stop() to stop a power_saving thread. The problem
is that the isolated_cpus_lock mutex is owned when
destroy_power_saving_task() calls kthread_stop(), which waits for a
power_saving thread to end, and the power_saving thread tries to
acquire the isolated_cpus_lock when it calls round_robin_cpu(). This
patch fixes the issue by making round_robin_cpu() use its own mutex.
https://bugzilla.kernel.org/show_bug.cgi?id=42981
Cc: stable@vger.kernel.org
Signed-off-by: Stuart Hayes <Stuart_Hayes@Dell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This fixes a regression in 3.4-rc1 caused by commit
ea9f8856bd
(ACPI video: Harden video bus adding.)
Some platforms don't have _DOS control method, but the ACPI
backlight still works.
We should not invoke _DOS for these platforms.
https://bugzilla.kernel.org/show_bug.cgi?id=43168
Cc: Igor Murzov <intergalactic.anonymous@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
* Fix for a bug in async suspend error code path causing parents to wait
forever for their children in case of a suspend error from Mandeep Singh
Baines (-stable metarial).
* Fix for a suspend regression related to earlier changes in the ACPI
cpuidle driver from Deepthi Dharwar.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
iQIcBAABAgAGBQJP7hyOAAoJEKhOf7ml8uNs00IP/iOjS+oV+fuz6w76axgj2uye
Jb5nnmV4xDd00F8vL3OUGUJBnHT1uM1lOs8I97ebGmTP5R8gGJLDg+8M5oIgJwkN
kO04w/vAbOoP6+jiLHyJ9eQ1PVTW/UL23LOg6Ik4VHmqwcJVGNRUzYnR1p7gaReH
Q9ZZf5+qw72ZWx8rTsxpUnc1dZZqJh9v3cKG+9uhFMLteiuzpw/xSbwkdob1zQyr
NrR5r6/eEwOrkqiUWSWjRC0EsUiXazkYQPkKXEfHQUqpqbS1uMwj9EwcCOW5s+rD
zlyZRQ0cVod1jlDJCiM7juEsUhfbsB/QmiRDC6Ln7dhfale5wuMMHoTZTu6pIeb4
/TGYrL7LKrd8zoHBcimeMwXu9ragpF37jX1AvDLL7zQNVvWLT/qsHfl/FUzxMyaq
H5ouEfXwQ2G3cLSHWjbQYsNnLvoyONYsSkXP9asc/L+H7Mv9ujOG256ItG/9wNC+
8f/azSPS0a4GMrgkMwivGDzyt8iKLBUBQUFsSt9p6A/PiIZdXHFOIm/JzGIFCkVZ
vHjmWihhn7osC0rMY2Pnvm1urzjJBh2uKygkrFFwDG8J1Yg53ggVVahvZef7Inma
6ONxUEqKANHF/yRUtTJye9yxz6ITAdCrK87ioNF7//UNh2dgHxKsXeiDb1sP0bgv
qricvgZ27o9gqASxBIbQ
=a9hl
-----END PGP SIGNATURE-----
Merge tag 'pm-for-3.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael J. Wysocki:
* Fix for a bug in async suspend error code path causing parents to
wait forever for their children in case of a suspend error from
Mandeep Singh Baines (-stable metarial).
* Fix for a suspend regression related to earlier changes in the ACPI
cpuidle driver from Deepthi Dharwar.
* tag 'pm-for-3.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PM / ACPI: Fix suspend/resume regression caused by cpuidle cleanup.
PM / Sleep: Prevent waiting forever on asynchronous suspend after abort
In reviewing Kay's fix up patch: "printk: Have printk() never buffer its
data", I found two if statements that could be combined and optimized.
Put together the two 'cont.len && cont.owner == current' if statements
into a single one, and check if we need to call cont_add(). This also
removes the unneeded double cont_flush() calls.
Link: http://lkml.kernel.org/r/1340869133.876.10.camel@mop
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>