devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] ARM: dts: sun8i-q8-common: Do not set constraints on dc1sw
@ 2016-03-09 19:38 Hans de Goede
       [not found] ` <1457552339-400-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2016-03-09 19:38 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai
  Cc: Mark Brown, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree

Hi Maxime, Chen-yu,

As I mailed you about a week ago, I was having problems getting
linux-sunxi/sunxi-next to boot on sun8i q8 tablets because of
the new axp223 regulator support. This patch fixes things for me.

I'm not 100% sure this is the right solution, but I could not find
another way, and the fix is harmless since we also constrain dcdc1
itself to the same values as the constrains we are now removing
from dc1sw.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ARM: dts: sun8i-q8-common: Do not set constraints on dc1sw regulator
       [not found] ` <1457552339-400-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2016-03-09 19:38   ` Hans de Goede
       [not found]     ` <1457552339-400-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2016-03-09 19:38 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai
  Cc: Mark Brown, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree, Hans de Goede

dc1sw is an on/off only regulator and as such it cannot have constraints.

This is a limitation of the kernel regulator implementation which resolves
supplies on the first regulator_get(), which is done after applying
constraints, and applying the constrains will fail because it calls
_regulator_get_voltage() and _regulator_do_set_voltage() both of which
will fail on a switch regulator when there is no supply (yet).

This causes registering of all axp22x regulators to fail with the
following errors:

[    1.395249] vcc-lcd: failed to get the current voltage(-22)
[    1.405131] axp20x-regulator axp20x-regulator: Failed to register dc1sw
[    1.412436] axp20x-regulator: probe of axp20x-regulator failed with error -22

This commit removes the constrains on dc1sw / vcc-lcd fixing this problem
note that dcdc1 itself is contrained to the exact same values, so this
does not change anything.

Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/boot/dts/sun8i-q8-common.dtsi | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-q8-common.dtsi b/arch/arm/boot/dts/sun8i-q8-common.dtsi
index fce6aa3..982c8ef 100644
--- a/arch/arm/boot/dts/sun8i-q8-common.dtsi
+++ b/arch/arm/boot/dts/sun8i-q8-common.dtsi
@@ -144,8 +144,6 @@
 };
 
 &reg_dc1sw {
-	regulator-min-microvolt = <3000000>;
-	regulator-max-microvolt = <3000000>;
 	regulator-name = "vcc-lcd";
 };
 
-- 
2.7.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: dts: sun8i-q8-common: Do not set constraints on dc1sw regulator
       [not found]     ` <1457552339-400-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2016-03-15 18:29       ` Maxime Ripard
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2016-03-15 18:29 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Chen-Yu Tsai, Mark Brown,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

On Wed, Mar 09, 2016 at 08:38:59PM +0100, Hans de Goede wrote:
> dc1sw is an on/off only regulator and as such it cannot have constraints.
> 
> This is a limitation of the kernel regulator implementation which resolves
> supplies on the first regulator_get(), which is done after applying
> constraints, and applying the constrains will fail because it calls
> _regulator_get_voltage() and _regulator_do_set_voltage() both of which
> will fail on a switch regulator when there is no supply (yet).
> 
> This causes registering of all axp22x regulators to fail with the
> following errors:
> 
> [    1.395249] vcc-lcd: failed to get the current voltage(-22)
> [    1.405131] axp20x-regulator axp20x-regulator: Failed to register dc1sw
> [    1.412436] axp20x-regulator: probe of axp20x-regulator failed with error -22
> 
> This commit removes the constrains on dc1sw / vcc-lcd fixing this problem
> note that dcdc1 itself is contrained to the exact same values, so this
> does not change anything.
> 
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Queued this as fixes for 4.6.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-15 18:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-09 19:38 [PATCH 0/1] ARM: dts: sun8i-q8-common: Do not set constraints on dc1sw Hans de Goede
     [not found] ` <1457552339-400-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-03-09 19:38   ` [PATCH] ARM: dts: sun8i-q8-common: Do not set constraints on dc1sw regulator Hans de Goede
     [not found]     ` <1457552339-400-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-03-15 18:29       ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).