linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: pwm-backlight: 3.13-rc1 regression for old arm machine
       [not found] <87r49c6bea.fsf@free.fr>
@ 2013-12-17  9:57 ` Thierry Reding
  2013-12-17 18:31   ` Robert Jarzmik
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2013-12-17  9:57 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: Haojian Zhuang, linux-arm-kernel, linux-pwm


[-- Attachment #1.1: Type: text/plain, Size: 1438 bytes --]

On Mon, Dec 16, 2013 at 04:52:45PM +0100, Robert Jarzmik wrote:
> Hi Thierry,

Hi Robert,

Please always Cc the linux-pwm mailing list for PWM related questions.
I've done that now.

> Since recently, and probable since last Linus's merge of PWM tree (Merge tag
> 'pwm/for-3.13-rc1' of
> git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm), my
> platform has its backlight broken.
> 
> The particularity of my platform:
>  - arch/arm/mach-pxa/mioa701.c
>  - no device tree
>  - no power supply regulator for backlight
>  - backlight controlled by a PWM
>  - kernel message :
> [    1.495480] platform pwm-backlight: Driver pwm-backlight requests probe deferral
> 
> I think other "old" platforms will suffer from this. Do you have a
> recommendation ?

I hadn't anticipated that =(. In fact I had been holding this patch back
for a release cycle because I was waiting for a specific regulator patch
to land which provides a dummy regulator if one wasn't specified. It
seems that that patch only works when booting from DT, though.

The correct way to fix this would be to provide a lookup table with the
dummy regulator in the board file. I've attached a patch (compile-tested
only) that might work.

If it does, please let me know and, if nobody else volunteers, I'll see
if I can come up with a set of patches to fix this for any other boards
that have the same issue.

Thierry

[-- Attachment #1.2: 0001-ARM-pxa-Add-dummy-power-supply-for-backlight-for-Mit.patch --]
[-- Type: text/x-diff, Size: 1869 bytes --]

From 8c25d9b1465acd2dcd05644f2c984b54ae3dfc53 Mon Sep 17 00:00:00 2001
From: Thierry Reding <thierry.reding@gmail.com>
Date: Tue, 17 Dec 2013 10:52:36 +0100
Subject: [PATCH] ARM: pxa: Add dummy power supply for backlight for Mitac Mio
 A701

Recent changes to the pwm-backlight driver have made the power supply
mandatory. There is code in the regulator core to deal with situations
where no regulator is specified and provide a dummy, but that works on
DT-based boards only.

The situation can be remedied by adding a dummy regulator during board
initialization.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
---
 arch/arm/mach-pxa/mioa701.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index f70583fee59f..5cb3a3b33772 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -38,6 +38,7 @@
 #include <linux/mtd/physmap.h>
 #include <linux/usb/gpio_vbus.h>
 #include <linux/reboot.h>
+#include <linux/regulator/fixed.h>
 #include <linux/regulator/max1586.h>
 #include <linux/slab.h>
 #include <linux/i2c/pxa-i2c.h>
@@ -714,6 +715,10 @@ static struct gpio global_gpios[] = {
 	{ GPIO56_MT9M111_nOE, GPIOF_OUT_INIT_LOW, "Camera nOE" },
 };
 
+static struct regulator_consumer_supply fixed_5v0_consumers[] = {
+	REGULATOR_SUPPLY("power", "pwm-backlight.0"),
+};
+
 static void __init mioa701_machine_init(void)
 {
 	int rc;
@@ -753,6 +758,10 @@ static void __init mioa701_machine_init(void)
 	pxa_set_i2c_info(&i2c_pdata);
 	pxa27x_set_i2c_power_info(NULL);
 	pxa_set_camera_info(&mioa701_pxacamera_platform_data);
+
+	regulator_register_always_on(0, "fixed-5.0V", fixed_5v0_consumers,
+				     ARRAY_SIZE(fixed_5v0_consumers),
+				     5000000);
 }
 
 static void mioa701_machine_exit(void)
-- 
1.8.4.2


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

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

* Re: pwm-backlight: 3.13-rc1 regression for old arm machine
  2013-12-17  9:57 ` pwm-backlight: 3.13-rc1 regression for old arm machine Thierry Reding
@ 2013-12-17 18:31   ` Robert Jarzmik
  2013-12-20  9:47     ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Jarzmik @ 2013-12-17 18:31 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Haojian Zhuang, linux-arm-kernel, linux-pwm

Thierry Reding <thierry.reding@gmail.com> writes:

> I hadn't anticipated that =(. In fact I had been holding this patch back
> for a release cycle because I was waiting for a specific regulator patch
> to land which provides a dummy regulator if one wasn't specified. It
> seems that that patch only works when booting from DT, though.
>
> The correct way to fix this would be to provide a lookup table with the
> dummy regulator in the board file. I've attached a patch (compile-tested
> only) that might work.
>
> If it does, please let me know and, if nobody else volunteers, I'll see
> if I can come up with a set of patches to fix this for any other boards
> that have the same issue.
Actually, it needs a very small "tweak" to work :
-	REGULATOR_SUPPLY("power", "pwm-backlight.0"),
+	REGULATOR_SUPPLY("power", "pwm-backlight"),

Without it regulator_dev_lookup() won't match the device.

Moreover, it requires a config option, CONFIG_REGULATOR_FIXED_VOLTAGE=y. That's
not a problem for my specific platform, but I haven't seen *any* PXA platform
with it activated, which means all defconfigs have to be patched, which is
unfortunate.

As for my specific mioa701, your change with the tweak is perfectly fine and
tested.

Cheers.

--
Robert

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

* Re: pwm-backlight: 3.13-rc1 regression for old arm machine
  2013-12-17 18:31   ` Robert Jarzmik
@ 2013-12-20  9:47     ` Thierry Reding
  0 siblings, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2013-12-20  9:47 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: Haojian Zhuang, linux-arm-kernel, linux-pwm

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

On Tue, Dec 17, 2013 at 07:31:21PM +0100, Robert Jarzmik wrote:
> Thierry Reding <thierry.reding@gmail.com> writes:
> 
> > I hadn't anticipated that =(. In fact I had been holding this patch back
> > for a release cycle because I was waiting for a specific regulator patch
> > to land which provides a dummy regulator if one wasn't specified. It
> > seems that that patch only works when booting from DT, though.
> >
> > The correct way to fix this would be to provide a lookup table with the
> > dummy regulator in the board file. I've attached a patch (compile-tested
> > only) that might work.
> >
> > If it does, please let me know and, if nobody else volunteers, I'll see
> > if I can come up with a set of patches to fix this for any other boards
> > that have the same issue.
> Actually, it needs a very small "tweak" to work :
> -	REGULATOR_SUPPLY("power", "pwm-backlight.0"),
> +	REGULATOR_SUPPLY("power", "pwm-backlight"),
> 
> Without it regulator_dev_lookup() won't match the device.
> 
> Moreover, it requires a config option, CONFIG_REGULATOR_FIXED_VOLTAGE=y. That's
> not a problem for my specific platform,

Okay. I'll submit a patch with that tweak of yours rolled in and Haojian
can merge that via the PXA tree.

> but I haven't seen *any* PXA platform
> with it activated, which means all defconfigs have to be patched, which is
> unfortunate.

Unfortunate indeed!

> As for my specific mioa701, your change with the tweak is perfectly fine and
> tested.

Great, I'll add your Tested-by.

Thanks,
Thierry

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

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

end of thread, other threads:[~2013-12-20  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87r49c6bea.fsf@free.fr>
2013-12-17  9:57 ` pwm-backlight: 3.13-rc1 regression for old arm machine Thierry Reding
2013-12-17 18:31   ` Robert Jarzmik
2013-12-20  9:47     ` Thierry Reding

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).