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: 989723 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pwm-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42hXw50Zmnz9sDT for ; Sat, 27 Oct 2018 05:44:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727595AbeJ0DW2 (ORCPT ); Fri, 26 Oct 2018 23:22:28 -0400 Received: from antares.kleine-koenig.org ([94.130.110.236]:36048 "EHLO antares.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728003AbeJ0DW1 (ORCPT ); Fri, 26 Oct 2018 23:22:27 -0400 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 Cc: linux-pwm@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org 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 Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.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);