From patchwork Mon Oct 5 08:49:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 7325621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 07B1ABEEA4 for ; Mon, 5 Oct 2015 08:55:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2904B2060E for ; Mon, 5 Oct 2015 08:55:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34E4A20607 for ; Mon, 5 Oct 2015 08:55:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zj1WK-0000nA-B5; Mon, 05 Oct 2015 08:53:20 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zj1Tl-0006S3-U7 for linux-arm-kernel@lists.infradead.org; Mon, 05 Oct 2015 08:50:43 +0000 Received: by wicgb1 with SMTP id gb1so108800395wic.1 for ; Mon, 05 Oct 2015 01:50:20 -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:in-reply-to:references; bh=SSp0B3uKmpFQZNnbTTHnyq2t8GGS93mz++6VTZwjzKE=; b=KatMBo/Mqd/0uo8OTAswFAJbA9YDM0i9PyV5yZ5mP7Jz54V2ZfDna5f8UeDAMAOI0P Hu9/7yQkpla+p3bK077LmXwlBMQbMILjFBg5pfVmEvnVk63C0G0k6JvuWsQ4JmdhHPT/ v0ukKxibu+xUSfA26qUWiTXpMyH77T5yr2F9jtlM2AX++kc5hREQ3RGQKM3Z6sKj2aQZ 2c0uJfvuySru9B3gzfNnKpZb1XMwlnHFJ8MLCfju3MUQ58P6g2PtZM4OzOq6mYMji9Mw /fi/9GlmcMtkQW8VVTyLZMFA7g94wU2kyVaPhxEPWHvcagus3M+oL/g3HWHYz8Tg1tcn IPfA== X-Received: by 10.180.89.41 with SMTP id bl9mr9634327wib.85.1444035020093; Mon, 05 Oct 2015 01:50:20 -0700 (PDT) Received: from localhost (port-1848.pppoe.wtnet.de. [84.46.7.63]) by smtp.gmail.com with ESMTPSA id pk7sm25767864wjb.2.2015.10.05.01.50.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 01:50:19 -0700 (PDT) From: Thierry Reding To: Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: [PATCH 17/17] ARM: pxa: zylonite: Use PWM lookup table Date: Mon, 5 Oct 2015 10:49:57 +0200 Message-Id: <1444034997-9805-18-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1444034997-9805-1-git-send-email-thierry.reding@gmail.com> References: <1444034997-9805-1-git-send-email-thierry.reding@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151005_015042_182009_5E8D5FF2 X-CRM114-Status: GOOD ( 16.06 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Schmidt , openezx-devel@lists.openezx.org, Marek Vasut , Daniel Ribeiro , Philipp Zabel , Paul Parsons , Harald Welte , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Use a PWM lookup table to provide the PWM to the pwm-backlight device. The driver has a legacy code path that is required only because boards still use the legacy method of requesting PWMs by global ID. Replacing these usages allows that legacy fallback to be removed. Cc: Daniel Mack Cc: Haojian Zhuang Cc: Robert Jarzmik Signed-off-by: Thierry Reding --- arch/arm/mach-pxa/zylonite.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 77daea478e88..e20359a7433c 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -120,11 +121,14 @@ static inline void zylonite_init_leds(void) {} #endif #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) +static struct pwm_lookup zylonite_pwm_lookup[] = { + PWM_LOOKUP("pxa27x-pwm.1", 1, "pwm-backlight.0", NULL, 10000, + PWM_POLARITY_NORMAL), +}; + static struct platform_pwm_backlight_data zylonite_backlight_data = { - .pwm_id = 3, .max_brightness = 100, .dft_brightness = 100, - .pwm_period_ns = 10000, .enable_gpio = -1, }; @@ -206,6 +210,7 @@ static struct pxafb_mach_info zylonite_sharp_lcd_info = { static void __init zylonite_init_lcd(void) { + pwm_add_table(zylonite_pwm_lookup, ARRAY_SIZE(zylonite_pwm_lookup)); platform_device_register(&zylonite_backlight_device); if (lcd_id & 0x20) {