From patchwork Tue Dec 17 09:57:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3360381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BCE559F314 for ; Tue, 17 Dec 2013 10:00:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 059752039F for ; Tue, 17 Dec 2013 10:00:01 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6419A203A9 for ; Tue, 17 Dec 2013 09:59:55 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsrQm-0004rO-1b; Tue, 17 Dec 2013 09:59:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsrQS-0007FJ-Jn; Tue, 17 Dec 2013 09:58:52 +0000 Received: from mail-bk0-x230.google.com ([2a00:1450:4008:c01::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsrQQ-0007EN-5P for linux-arm-kernel@lists.infradead.org; Tue, 17 Dec 2013 09:58:51 +0000 Received: by mail-bk0-f48.google.com with SMTP id r7so2716853bkg.21 for ; Tue, 17 Dec 2013 01:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=FWSNm4GJvHol90MPfKTgP5QpAQJmnfbDxNQqAkKaytY=; b=1FzWYxLgV7BF8vSMTfhVYMPihTjqSIz9TMKknae3OkskngKLHolBWIDlUZHt7gTMBJ uz5TPyoMLy9Ms6+A/L5AN2/OpgGLWWgHkVtzBgKS+SARZdB6jXrUd/ULh61TZsBEOI0e LbBCwQgUxgYm06+tbuXO5ng0tOeZLyeAg+Kv4XBzXXiIR2jMAlCbAw2AJlTvwkLLi5fi /Cbu/jVwKlEJvoDHJZOBbsPuDYrHzaluZXqHOxUpY291OF8rP/kVN0PxzfsqVWFGP+OZ uNpO0xLdDy1d5VsfS8f324WKcaRRB/oY7jZncCtglZh9lrtanTG7OhtsKjj2I+AK4eSt 17wg== X-Received: by 10.205.43.73 with SMTP id ub9mr324332bkb.91.1387274305306; Tue, 17 Dec 2013 01:58:25 -0800 (PST) Received: from localhost (port-6309.pppoe.wtnet.de. [84.46.24.189]) by mx.google.com with ESMTPSA id e3sm13036849bkk.13.2013.12.17.01.58.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2013 01:58:24 -0800 (PST) Date: Tue, 17 Dec 2013 10:57:00 +0100 From: Thierry Reding To: Robert Jarzmik Subject: Re: pwm-backlight: 3.13-rc1 regression for old arm machine Message-ID: <20131217095658.GD13823@ulmo.nvidia.com> References: <87r49c6bea.fsf@free.fr> MIME-Version: 1.0 In-Reply-To: <87r49c6bea.fsf@free.fr> User-Agent: Mutt/1.5.22 (2013-10-16) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131217_045850_370950_BBC5C2E8 X-CRM114-Status: GOOD ( 27.92 ) X-Spam-Score: -2.0 (--) Cc: linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 From 8c25d9b1465acd2dcd05644f2c984b54ae3dfc53 Mon Sep 17 00:00:00 2001 From: Thierry Reding 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 --- 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 #include #include +#include #include #include #include @@ -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