From patchwork Sun Oct 28 15:35:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 1657831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D144B3FD4E for ; Sun, 28 Oct 2012 15:38:51 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TSUvH-0004GR-VP; Sun, 28 Oct 2012 15:37:12 +0000 Received: from mail-lb0-f177.google.com ([209.85.217.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TSUuW-0004Aq-KU for linux-arm-kernel@lists.infradead.org; Sun, 28 Oct 2012 15:36:25 +0000 Received: by mail-lb0-f177.google.com with SMTP id gi11so2481296lbb.36 for ; Sun, 28 Oct 2012 08:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=NZXQPSY1MASwkjlExwdiDAIgBA9t7FL63V+LDcUJ+B8=; b=vF6UXMUYLZpjX7kati87cmvmsHuEeuARH+Xs2Z2RfqQJ2CGV4xCaT13h6lbXg3SbwV DhtYOBhd35DoShDdQDlk4XwKP3Ww5YpuGpp9NYU4e7IS+WIIpyxbKjd+DUrlw2LONnlz 1wb5LVA4aPC8/483ZQ7DfB/aFniDEdbTwTU/K1xB7KT+jDNyDAuR7dFfWBD5jusd3wIe WAF0uG+c/0WQgdHYZfRW3RtdhdJAWIDFcLkfUiETDwwpSnWVxVTBWu+XT8mdgk+Ov7VM qF4VLY/3bn2I5k/W/zAH+IeS1HdkjxYeOLe3mR0oBDCA8F6Tf0aKMqqf+aYOXWmlILKO qjKg== Received: by 10.112.54.40 with SMTP id g8mr11086616lbp.49.1351438584227; Sun, 28 Oct 2012 08:36:24 -0700 (PDT) Received: from localhost.localdomain ([80.249.90.60]) by mx.google.com with ESMTPS id ft3sm2276824lbb.1.2012.10.28.08.36.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 28 Oct 2012 08:36:23 -0700 (PDT) From: Vasily Khoruzhick To: Eric Miao , Russell King , Haojian Zhuang , Marek Vasut , linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/5] ARM: PXA: Zipit Z2: Fix backlight PWM device number Date: Sun, 28 Oct 2012 18:35:55 +0300 Message-Id: <1351438555-4668-5-git-send-email-anarsoul@gmail.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1351438555-4668-1-git-send-email-anarsoul@gmail.com> References: <1351438555-4668-1-git-send-email-anarsoul@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (anarsoul[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Vasily Khoruzhick X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Recent changes to PXA PWM support changed the PXA27X PWM device numbering scheme, so keyboard and LCD backlight is not working anymore on Z2. Fix it and move from legacy to new PWM API. Signed-off-by: Vasily Khoruzhick --- arch/arm/mach-pxa/z2.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index fac7cba..06b8078 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -206,17 +207,22 @@ static inline void z2_nor_init(void) {} * Backlight ******************************************************************************/ #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) +static struct pwm_lookup z2_pwm_lookup[] = { + PWM_LOOKUP("pxa27x-pwm.0", 1, "pwm-backlight.0", NULL), + PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight.1", NULL), +}; + static struct platform_pwm_backlight_data z2_backlight_data[] = { [0] = { /* Keypad Backlight */ - .pwm_id = 1, + .pwm_id = -1, .max_brightness = 1023, .dft_brightness = 0, .pwm_period_ns = 1260320, }, [1] = { /* LCD Backlight */ - .pwm_id = 2, + .pwm_id = -1, .max_brightness = 1023, .dft_brightness = 512, .pwm_period_ns = 1260320, @@ -243,6 +249,7 @@ static void __init z2_pwm_init(void) { platform_device_register(&z2_backlight_devices[0]); platform_device_register(&z2_backlight_devices[1]); + pwm_add_table(z2_pwm_lookup, ARRAY_SIZE(z2_pwm_lookup)); } #else static inline void z2_pwm_init(void) {}