Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756861AbcJWV5S (ORCPT ); Sun, 23 Oct 2016 17:57:18 -0400 Received: from 18.mo3.mail-out.ovh.net ([87.98.172.162]:55961 "EHLO 18.mo3.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755568AbcJWV45 (ORCPT ); Sun, 23 Oct 2016 17:56:57 -0400 From: Lukasz Majewski To: Thierry Reding , Stefan Agner , Boris Brezillon Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Fabio Estevam , Fabio Estevam , Lothar Wassmann , Bhuvanchandra DV , kernel@pengutronix.de, Lukasz Majewski Subject: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to PWMv2 driver Date: Sun, 23 Oct 2016 23:45:46 +0200 Message-Id: <1477259146-19167-7-git-send-email-l.majewski@majess.pl> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1477259146-19167-1-git-send-email-l.majewski@majess.pl> References: <1477259146-19167-1-git-send-email-l.majewski@majess.pl> X-Ovh-Tracer-Id: 3452572067534127749 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelvddrieeggddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1213 Lines: 42 The need for set_polarity() function has been removed by implementing PWM atomic support (apply() callback). To indicate that the PWMv2 supports polarity inversion, new flag - "polarity_supported" has been introduced. Signed-off-by: Lukasz Majewski --- drivers/pwm/pwm-imx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c index 02d3dfd..be3034d 100644 --- a/drivers/pwm/pwm-imx.c +++ b/drivers/pwm/pwm-imx.c @@ -258,6 +258,7 @@ static struct pwm_ops imx_pwm_ops_v2 = { }; struct imx_pwm_data { + bool polarity_supported; struct pwm_ops *pwm_ops; }; @@ -266,6 +267,7 @@ static struct imx_pwm_data imx_pwm_data_v1 = { }; static struct imx_pwm_data imx_pwm_data_v2 = { + .polarity_supported = true, .pwm_ops = &imx_pwm_ops_v2, }; @@ -313,7 +315,7 @@ static int imx_pwm_probe(struct platform_device *pdev) imx->chip.base = -1; imx->chip.npwm = 1; imx->chip.can_sleep = true; - if (data->pwm_ops->set_polarity) { + if (data->polarity_supported) { dev_dbg(&pdev->dev, "PWM supports output inversion\n"); imx->chip.of_xlate = of_pwm_xlate_with_flags; imx->chip.of_pwm_n_cells = 3; -- 2.1.4