From patchwork Fri Oct 19 12:15:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Parsons X-Patchwork-Id: 1618221 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 112C63FC1A for ; Fri, 19 Oct 2012 12:18:02 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TPBUM-0000qx-Ot; Fri, 19 Oct 2012 12:15:42 +0000 Received: from avasout08.plus.net ([212.159.14.20]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TPBUJ-0000qj-0C for linux-arm-kernel@lists.infradead.org; Fri, 19 Oct 2012 12:15:39 +0000 Received: from paul ([87.113.188.218]) by avasout08 with smtp id D0FW1k0014j9k7r010FXT7; Fri, 19 Oct 2012 13:15:33 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=WJH9rwQR c=1 sm=1 a=Fld7Jo976/J7nyRz06htuw==:17 a=C2abuDqCS_QA:10 a=f8_S3n9t2uQA:10 a=CjxXgO3LAAAA:8 a=rJACa29vwcMA:10 a=Q8UNuGrLYCI_CnT6HQ0A:9 a=rC2wZJ5BpNYA:10 a=EAYKlQqjMvwA:10 a=w_Zoo6L_GKQKVs2j:21 a=KEptymaQZjTjw-Hx:21 a=Fld7Jo976/J7nyRz06htuw==:117 Subject: [PATCH v2 RESEND] ARM: pxa: hx4700: Fix backlight PWM device number From: "Paul Parsons" To: Date: Fri, 19 Oct 2012 13:15:30 +0100 Mime-Version: 1.0 X-Mailer: Cleancode.email v3.1.3 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lost.distance[at]yahoo.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.159.14.20 listed in list.dnswl.org] 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 1.6 FORGED_YAHOO_RCVD 'From' yahoo.com does not match 'Received' headers -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.5 MISSING_MID Missing Message-Id: header 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: linux@arm.linux.org.uk, thierry.reding@avionic-design.de, eric.y.miao@gmail.com, 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 Message-ID: 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 --- 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);