From patchwork Mon Oct 5 12:47:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 7327191 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 85F869F2F7 for ; Mon, 5 Oct 2015 12:47:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A22672065D for ; Mon, 5 Oct 2015 12:47:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FE412066C for ; Mon, 5 Oct 2015 12:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752217AbbJEMrW (ORCPT ); Mon, 5 Oct 2015 08:47:22 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:38755 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbbJEMrV (ORCPT ); Mon, 5 Oct 2015 08:47:21 -0400 Received: by wiclk2 with SMTP id lk2so112873733wic.1 for ; Mon, 05 Oct 2015 05:47: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=hEEl5HL2DjS1u7cIkAQtdM5u3jtI8oO/Jv6lAqlIMeY=; b=EPZjV8TPNmniHycm6hp3WPSDj8ojSCH4qmru01d+sJlC3YaWoO0iLmBjsGVJFhKuo3 MsCZDWN6Wyflvsndc32/Iruk8kehPXQjbygz8M4XSy2PDVuiQg642UwYMoMyA5q34DYI kR1gKpwujKxTEjEDc1aE4jufc3dyvP1bUJQZyF453v0fpqPzdfZxyFClIb32a67C4cRw DelxarRXBKXKS17Su2Md781RaIVepr1o8RjBXi3fTQ29KJXy1XBMuOFiubJQVTaHlw0T hMsM4Dw1MSePNb8g71pQ4Zx6hio7KEyXp87YipCJix6tJJ1w9sbPOQaPyjbz1RB8UvKA k5Xg== X-Received: by 10.180.188.101 with SMTP id fz5mr12410190wic.3.1444049240473; Mon, 05 Oct 2015 05:47:20 -0700 (PDT) Received: from localhost (port-54044.pppoe.wtnet.de. [46.59.211.200]) by smtp.gmail.com with ESMTPSA id lj12sm14492035wic.0.2015.10.05.05.47.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 05:47:19 -0700 (PDT) From: Thierry Reding To: Kukjin Kim , Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Thierry Reding Subject: [PATCH 1/6] ARM: s3c24xx: h1940: Use PWM lookup table Date: Mon, 5 Oct 2015 14:47:12 +0200 Message-Id: <1444049237-29878-2-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1444049237-29878-1-git-send-email-thierry.reding@gmail.com> References: <1444049237-29878-1-git-send-email-thierry.reding@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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: Kukjin Kim Cc: Krzysztof Kozlowski Signed-off-by: Thierry Reding Reviewed-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/mach-h1940.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index d40d4f5244c6..9f54300df4b3 100644 --- a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -469,6 +470,11 @@ static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = { .ocr_avail = MMC_VDD_32_33, }; +static struct pwm_lookup h1940_pwm_lookup[] = { + PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight", NULL, 36296, + PWM_POLARITY_NORMAL), +}; + static int h1940_backlight_init(struct device *dev) { gpio_request(S3C2410_GPB(0), "Backlight"); @@ -503,11 +509,8 @@ static void h1940_backlight_exit(struct device *dev) static struct platform_pwm_backlight_data backlight_data = { - .pwm_id = 0, .max_brightness = 100, .dft_brightness = 50, - /* tcnt = 0x31 */ - .pwm_period_ns = 36296, .enable_gpio = -1, .init = h1940_backlight_init, .notify = h1940_backlight_notify, @@ -725,6 +728,7 @@ static void __init h1940_init(void) gpio_request(H1940_LATCH_SD_POWER, "SD power"); gpio_direction_output(H1940_LATCH_SD_POWER, 0); + pwm_add_table(h1940_pwm_lookup, ARRAY_SIZE(h1940_pwm_lookup)); platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); gpio_request(S3C2410_GPA(1), "Red LED blink");