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: 989746 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pAzd1+gU"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42hXz01fLwz9sCW for ; Sat, 27 Oct 2018 05:46:52 +1100 (AEDT) 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 1gG785-0003RD-Iv; Fri, 26 Oct 2018 18:46:41 +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-Spam-Score: 0.2 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [94.130.110.236 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list 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+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 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);