From patchwork Mon Oct 5 12:47:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 7327211 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 F2A769F2F7 for ; Mon, 5 Oct 2015 12:47:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A82D20658 for ; Mon, 5 Oct 2015 12:47:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26FD820660 for ; Mon, 5 Oct 2015 12:47:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328AbbJEMrY (ORCPT ); Mon, 5 Oct 2015 08:47:24 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35739 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910AbbJEMrY (ORCPT ); Mon, 5 Oct 2015 08:47:24 -0400 Received: by wicge5 with SMTP id ge5so118954818wic.0 for ; Mon, 05 Oct 2015 05:47:23 -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=X0hREthB9SfdOuto+pAIZ31T4qnzHbuhmXm/ddP4kV8=; b=bx5i4L4NCNLCfM0/hGVDcOBrnuCSC3Vppw9ztCMjAuThzQ7Tc8W4d6zwuIkQ1WPutL zZN1y74s79m7uoPROM/WoSeip5yU6nJux0YnDwOjq4dMCt4i0dJkV6HOaL2B4tvZM5eF 3l7dKZrZi/0shCYCA+d+VCd8ChpaEMU+Z6axYZJpmel0YCcl8MInsd1A6O4fZOABIwIJ ePjhnElRk6BdWzVMoulXKmI5J8UK+r45mEfClkhDEz8UnU1QEp8UN6IBaO3TzE43wuEG CbNYacI4T1v6N9x7nsgLnN3tBFafgKL/oZ9fNe+X8/VI3y732HfQRt/yO556qBZVlp2A vdmQ== X-Received: by 10.194.234.40 with SMTP id ub8mr29061484wjc.95.1444049243064; Mon, 05 Oct 2015 05:47:23 -0700 (PDT) Received: from localhost (port-54044.pppoe.wtnet.de. [46.59.211.200]) by smtp.gmail.com with ESMTPSA id mc20sm14475794wic.16.2015.10.05.05.47.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 05:47:22 -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 3/6] ARM: s3c64xx: smdk6410: Use PWM lookup table Date: Mon, 5 Oct 2015 14:47:14 +0200 Message-Id: <1444049237-29878-4-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-s3c64xx/dev-backlight.c | 4 ---- arch/arm/mach-s3c64xx/mach-smdk6410.c | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c index 38c323e68e3f..e62e789f9aee 100644 --- a/arch/arm/mach-s3c64xx/dev-backlight.c +++ b/arch/arm/mach-s3c64xx/dev-backlight.c @@ -69,7 +69,6 @@ static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = { .plat_data = { .max_brightness = 255, .dft_brightness = 255, - .pwm_period_ns = 78770, .enable_gpio = -1, .init = samsung_bl_init, .exit = samsung_bl_exit, @@ -111,7 +110,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, samsung_bl_data = &samsung_bl_drvdata->plat_data; /* Copy board specific data provided by user */ - samsung_bl_data->pwm_id = bl_data->pwm_id; samsung_bl_device->dev.parent = &samsung_device_pwm.dev; if (bl_data->max_brightness) @@ -120,8 +118,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, samsung_bl_data->dft_brightness = bl_data->dft_brightness; if (bl_data->lth_brightness) samsung_bl_data->lth_brightness = bl_data->lth_brightness; - if (bl_data->pwm_period_ns) - samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns; if (bl_data->enable_gpio >= 0) samsung_bl_data->enable_gpio = bl_data->enable_gpio; if (bl_data->init) diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index d590b88bd8a8..2722800d5c11 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -623,8 +624,12 @@ static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = { .func = S3C_GPIO_SFN(2), }; +static struct pwm_lookup smdk6410_pwm_lookup[] = { + PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL, 78770, + PWM_POLARITY_NORMAL), +}; + static struct platform_pwm_backlight_data smdk6410_bl_data = { - .pwm_id = 1, .enable_gpio = -1, }; @@ -695,6 +700,7 @@ static void __init smdk6410_machine_init(void) platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); + pwm_add_table(smdk6410_pwm_lookup, ARRAY_SIZE(smdk6410_pwm_lookup)); samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data); }