From patchwork Wed Sep 26 14:59:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Parsons X-Patchwork-Id: 1509771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 87F0CDF238 for ; Wed, 26 Sep 2012 15:02:16 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TGt5i-0001AQ-Bp; Wed, 26 Sep 2012 14:59:58 +0000 Received: from nm25-vm7.bullet.mail.ird.yahoo.com ([212.82.109.208]) by merlin.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1TGt5e-0001A0-Sx for linux-arm-kernel@lists.infradead.org; Wed, 26 Sep 2012 14:59:55 +0000 Received: from [77.238.189.54] by nm25.bullet.mail.ird.yahoo.com with NNFMP; 26 Sep 2012 14:59:53 -0000 Received: from [217.146.189.97] by tm7.bullet.mail.ird.yahoo.com with NNFMP; 26 Sep 2012 14:59:53 -0000 Received: from [127.0.0.1] by smtp113.mail.ird.yahoo.com with NNFMP; 26 Sep 2012 14:59:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1348671593; bh=Ft5eeoS4AO2zaq8feqZNGuxufsidJ71ez+puIxShN+k=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:Content-Transfer-Encoding; b=wXoLVH8Dz5fL0JCXJ0MyInwMWAADgTP3G2QU4bMn124yaFE6I54JIpxzA7QF5oNdAWPMOUWUfyVRFcuwhN252aKCBXC+LRL3Ez+ZzZU6PWkPeXJ0I8w3iMh3SDTGqliZ4VmKmPbXiv+IrXHSxN5dmPLTDf7HMZYP7Su2iD/1A40= X-Yahoo-Newman-Id: 637156.1933.bm@smtp113.mail.ird.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: WO7WzFwVM1llBQr7NECBIVt0j3xBXr9BiEXWdUK2tybfC9Q 5fZ5NOEGJl1j20M7Wrrbz1tLNHUZK6cB2jcicnzWSoLD8iopFErs42Mo8Jyq unn0H5kUDlw_tSDiJbrtXWqXlW_u0e3Cw6zT4UJX864rFFnyDuCT0iinjnMp Xz5ye73Yhhk.eNRj0giesQlQpeK3VECKPS7lit6yH6YfRK1gJ8xXn0dX0d55 rz3h7lsNFEU6AAHmdlHTEyU.7BvCp6wUyHirNu4vavBXJRjNfPHCtoXRhHJ9 Kyd_RJsVzifFRGUFSYIx0.eopXNa7teZV.1B6GZWliVMYBbf5Ke4Fk6nnc8G rPHrnZjwQmcrblnYPIVJf6AuwVsEscJiRzDaJe_G0x4t4TRbtpDmyySQJLh9 UeS2gHDw3wyESzdv_3A-- X-Yahoo-SMTP: 5Vuzu2WswBCxMnJ0hjKohBcp6M6Es6bt5AQ- Received: from [192.168.0.2] (lost.distance@46.208.58.7 with plain) by smtp113.mail.ird.yahoo.com with SMTP; 26 Sep 2012 07:59:53 -0700 PDT Message-ID: <50631868.3000205@yahoo.com> Date: Wed, 26 Sep 2012 15:59:52 +0100 From: Paul Parsons User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: haojian.zhuang@gmail.com Subject: [PATCH v2] ARM: pxa: hx4700: Fix backlight PWM device number X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.8 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lost.distance[at]yahoo.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.82.109.208 listed in list.dnswl.org] -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -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: eric.y.miao@gmail.com, thierry.reding@avionic-design.de, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, philipp.zabel@gmail.com 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: , 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. The linux-3.5 PXA PWM driver followed the hardware numbering scheme for the 4 PWMs, while the linux-3.6-rc1 PXA PWM driver has adopted a linear numbering scheme: Address Hardware 3.5 pwm_id 3.6-rc1 pwm_id 0x40b00000 PWM0 0 0 0x40b00010 PWM2 2 1 0x40c00000 PWM1 1 2 0x40c00010 PWM3 3 3 The hx4700 backlight uses PWM1 at 0x40c00000. Consequently the pwm_id must be changed from 1 to 2. This patch fixes the backlight PWM device number and at the same time moves from the legacy PWM API (pwm_id) to the new PWM API (pwm_lookup). Signed-off-by: Paul Parsons Cc: Thierry Reding Reviewed-by: Thierry Reding --- V2: Switch from legacy PWM API to new PWM API. arch/arm/mach-pxa/hx4700.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index e631198..d66f9f9 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -556,7 +557,7 @@ static struct platform_device hx4700_lcd = { */ static struct platform_pwm_backlight_data backlight_data = { - .pwm_id = 1, + .pwm_id = -1, /* Superseded by pwm_lookup */ .max_brightness = 200, .dft_brightness = 100, .pwm_period_ns = 30923, @@ -571,6 +572,10 @@ static struct platform_device backlight = { }, }; +static struct pwm_lookup hx4700_pwm_lookup[] = { + PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL), +}; + /* * USB "Transceiver" */ @@ -872,6 +877,7 @@ static void __init hx4700_init(void) pxa_set_stuart_info(NULL); platform_add_devices(devices, ARRAY_SIZE(devices)); + pwm_add_table(hx4700_pwm_lookup, ARRAY_SIZE(hx4700_pwm_lookup)); pxa_set_ficp_info(&ficp_info); pxa27x_set_i2c_power_info(NULL);