From patchwork Fri Oct 26 18:41:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 10657739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C22D5109C for ; Fri, 26 Oct 2018 18:46:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8653281C3 for ; Fri, 26 Oct 2018 18:46:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC7192CA5C; Fri, 26 Oct 2018 18:46:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 335EE281C3 for ; Fri, 26 Oct 2018 18:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LNlB0K20bKlmgMbJdYBh9wXOYWUviOlBaAvqCLxdN1c=; b=pAzd1+gU97IlYx bph4LPvHrxAf37WFRdL8wsu9s7XHxx0rqaKTeLFqSKWH2E4WUqSkf1wUVnMoRLglLHNpe1OfDB9SF wX/q5wVUq8wZtH1EyuXZbMmi86hEj+jMTcy0bSrpbMXuYB6MgLZwzeGTVCf2wHWizpsMbLScUUBlW I3vozAdzFO+BLzCSCzMeDwp9EJNve+c01/mNc1nkxyk5cE6EMOPEdsp8z2OhvYFL+y4ZsMwCPCU/q qx9VLUkR6QMS2qKWE9v69Ei2XoWwxzuL8Hu6YWgm2YkYzMnYGQdZ4ktaUeYuD4by95+XMQnSsythW 1r9gyMDEeLTBG7ErVv/g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG780-0003RD-LS; Fri, 26 Oct 2018 18:46:36 +0000 Received: from antares.kleine-koenig.org ([94.130.110.236]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG76E-0001MH-5O for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 18:45:12 +0000 Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id 64444434235; Fri, 26 Oct 2018 20:44:18 +0200 (CEST) From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding , Krzysztof Kozlowski Subject: [PATCH 2/4] ARM: S3C24XX: rx1950: make use of atomic PWM API Date: Fri, 26 Oct 2018 20:41:56 +0200 Message-Id: <20181026184157.16371-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181026184157.16371-1-u.kleine-koenig@pengutronix.de> References: <20181026184157.16371-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_114446_416341_67EF101D X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The legacy PWM API should be removed in the long run, so convert a user to the atomic PWM API. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/mach-rx1950.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index 7f5a18fa305b..5c4459f9a5f7 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c @@ -375,6 +375,7 @@ static struct pwm_lookup rx1950_pwm_lookup[] = { PWM_POLARITY_NORMAL), }; +static struct pwm_state lcd_pwm_state; static struct pwm_device *lcd_pwm; static void rx1950_lcd_power(int enable) @@ -428,15 +429,17 @@ static void rx1950_lcd_power(int enable) /* GPB1->OUTPUT, GPB1->0 */ gpio_direction_output(S3C2410_GPB(1), 0); - pwm_config(lcd_pwm, 0, LCD_PWM_PERIOD); - pwm_disable(lcd_pwm); + lcd_pwm_state.duty_cycle = 0; + lcd_pwm_state.enabled = false; + pwm_apply_state(lcd_pwm, &lcd_pwm_state); /* GPC0->0, GPC10->0 */ gpio_direction_output(S3C2410_GPC(0), 0); gpio_direction_output(S3C2410_GPC(10), 0); } else { - pwm_config(lcd_pwm, LCD_PWM_DUTY, LCD_PWM_PERIOD); - pwm_enable(lcd_pwm); + lcd_pwm_state.duty_cycle = LCD_PWM_DUTY; + lcd_pwm_state.enabled = true; + pwm_apply_state(lcd_pwm, &lcd_pwm_state); gpio_direction_output(S3C2410_GPC(0), 1); gpio_direction_output(S3C2410_GPC(5), 1); @@ -491,11 +494,8 @@ static int rx1950_backlight_init(struct device *dev) return PTR_ERR(lcd_pwm); } - /* - * FIXME: pwm_apply_args() should be removed when switching to - * the atomic PWM API. - */ - pwm_apply_args(lcd_pwm); + pwm_get_state_default(lcd_pwm, &lcd_pwm_state); + lcd_pwm_state.period = LCD_PWM_PERIOD; rx1950_lcd_power(1); rx1950_bl_power(1);