Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1507310

Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to PWMv2 driver

From Boris Brezillon <boris.brezillon@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to PWMv2 driver
Date 2016-10-24 17:30 +0200
Message-ID <svPmj-ZI-51@gated-at.bofh.it> (permalink)
References <svyY9-6no-3@gated-at.bofh.it> <svyY9-6no-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, 23 Oct 2016 23:45:46 +0200
Lukasz Majewski <l.majewski@majess.pl> 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 <l.majewski@majess.pl>
> ---
>  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.

>  		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;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to PWMv2 driver Lukasz Majewski <l.majewski@majess.pl> - 2016-10-24 00:00 +0200
  Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to  PWMv2 driver Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-10-24 17:30 +0200
    Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to  PWMv2 driver Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-10-24 17:40 +0200
      Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to  PWMv2 driver Lukasz Majewski <l.majewski@majess.pl> - 2016-10-24 23:30 +0200
        Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to  PWMv2 driver Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-10-25 08:40 +0200
          Re: [PATCH 6/6] pwm: imx: Introduce "polarity_supported" flag to  PWMv2 driver Lukasz Majewski <l.majewski@majess.pl> - 2016-10-25 09:00 +0200

csiph-web