Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941100AbcJXPeQ (ORCPT ); Mon, 24 Oct 2016 11:34:16 -0400 Received: from up.free-electrons.com ([163.172.77.33]:47173 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932700AbcJXPeN (ORCPT ); Mon, 24 Oct 2016 11:34:13 -0400 Date: Mon, 24 Oct 2016 17:34:10 +0200 From: Boris Brezillon To: Lukasz Majewski Cc: Thierry Reding , Stefan Agner , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Fabio Estevam , Fabio Estevam , Lothar Wassmann , Bhuvanchandra DV , kernel@pengutronix.de Subject: Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to PWMv2 driver Message-ID: <20161024173410.6e641b9c@bbrezillon> In-Reply-To: <20161024172852.40662611@bbrezillon> References: <1477259146-19167-1-git-send-email-l.majewski@majess.pl> <1477259146-19167-7-git-send-email-l.majewski@majess.pl> <20161024172852.40662611@bbrezillon> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2076 Lines: 63 On Mon, 24 Oct 2016 17:28:52 +0200 Boris Brezillon wrote: > On Sun, 23 Oct 2016 23:45:46 +0200 > Lukasz Majewski wrote: > > > 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) { > > You're still breaking backward compatibility with DTs defining > #pwm-cells = 2. > > Please test the #pwm-cells value before deciding which of_xlate should > be used. Nevermind, I didn't look at [1] and [2]. But still, your series is not bisectable: this change should be part of patch 5 where you remove the ->set_polarity implementation. Otherwise, this means you don't support polarity setting between patch 5 and 6. > > > 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; > [1]http://patchwork.ozlabs.org/patch/679706/ [2]http://patchwork.ozlabs.org/patch/679707/