dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-fbdev@vger.kernel.org, xllacyx@gmail.com,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v1 4/5] video: ssd1307fb: Convert to atomic PWM API
Date: Fri, 17 Apr 2020 16:07:40 +0200	[thread overview]
Message-ID: <2157cc9f-5e84-8ca5-fd67-70240eb238d4@samsung.com> (raw)
In-Reply-To: <20200324170532.44384-4-andriy.shevchenko@linux.intel.com>


[ added dri-devel ML to Cc: ]

On 3/24/20 6:05 PM, Andy Shevchenko wrote:
> Use the atomic API wherever appropriate and get rid of pwm_apply_args()
> call (the reference period and polarity are now explicitly set when
> calling pwm_apply_state()).
> 
> We also make use of the pwm_set_relative_duty_cycle() helper to ease
> relative to absolute duty_cycle conversion.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch queued for v5.8, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
>  drivers/video/fbdev/ssd1307fb.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 7a6a44a0b7a6..6e543396002a 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -79,7 +79,6 @@ struct ssd1307fb_par {
>  	u32 prechargep1;
>  	u32 prechargep2;
>  	struct pwm_device *pwm;
> -	u32 pwm_period;
>  	struct gpio_desc *reset;
>  	struct regulator *vbat_reg;
>  	u32 vcomh;
> @@ -297,9 +296,9 @@ static void ssd1307fb_deferred_io(struct fb_info *info,
>  
>  static int ssd1307fb_init(struct ssd1307fb_par *par)
>  {
> +	struct pwm_state pwmstate;
>  	int ret;
>  	u32 precharge, dclk, com_invdir, compins;
> -	struct pwm_args pargs;
>  
>  	if (par->device_info->need_pwm) {
>  		par->pwm = pwm_get(&par->client->dev, NULL);
> @@ -308,21 +307,15 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
>  			return PTR_ERR(par->pwm);
>  		}
>  
> -		/*
> -		 * FIXME: pwm_apply_args() should be removed when switching to
> -		 * the atomic PWM API.
> -		 */
> -		pwm_apply_args(par->pwm);
> +		pwm_init_state(par->pwm, &pwmstate);
> +		pwm_set_relative_duty_cycle(&pwmstate, 50, 100);
> +		pwm_apply_state(par->pwm, &pwmstate);
>  
> -		pwm_get_args(par->pwm, &pargs);
> -
> -		par->pwm_period = pargs.period;
>  		/* Enable the PWM */
> -		pwm_config(par->pwm, par->pwm_period / 2, par->pwm_period);
>  		pwm_enable(par->pwm);
>  
>  		dev_dbg(&par->client->dev, "Using PWM%d with a %dns period.\n",
> -			par->pwm->pwm, par->pwm_period);
> +			par->pwm->pwm, pwm_get_period(par->pwm));
>  	}
>  
>  	/* Set initial contrast */
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-04-17 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200324170539eucas1p25909201d48429c9489c286ac18af0f1c@eucas1p2.samsung.com>
     [not found] ` <20200324170532.44384-1-andriy.shevchenko@linux.intel.com>
     [not found]   ` <20200330095144.GL1922688@smile.fi.intel.com>
     [not found]     ` <CGME20200415142020eucas1p2b9c75eee5c24918c3c657386345f0732@eucas1p2.samsung.com>
     [not found]       ` <20200415142018.GH185537@smile.fi.intel.com>
2020-04-15 14:36         ` [PATCH v1 1/5] video: ssd1307fb: Convert driver to use ->probe_new() Bartlomiej Zolnierkiewicz
2020-04-17 14:07   ` Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200324170551eucas1p2a568c0296a5773cdf70e162c5a1e9b72@eucas1p2.samsung.com>
     [not found]     ` <20200324170532.44384-2-andriy.shevchenko@linux.intel.com>
2020-04-17 14:07       ` [PATCH v1 2/5] video: ssd1307fb: Introduce temporary variable to increase readability Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200324170554eucas1p164794d0c08b18a1d066b2b83957c73a1@eucas1p1.samsung.com>
     [not found]     ` <20200324170532.44384-3-andriy.shevchenko@linux.intel.com>
2020-04-17 14:07       ` [PATCH v1 3/5] video: ssd1307fb: Make use of device properties Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200324170539eucas1p12a3a4f7cd0d8cbd86f40d70a65ab0df5@eucas1p1.samsung.com>
     [not found]     ` <20200324170532.44384-4-andriy.shevchenko@linux.intel.com>
2020-04-17 14:07       ` Bartlomiej Zolnierkiewicz [this message]
     [not found]   ` <CGME20200324170539eucas1p19f81f8c31975734ab56e19d15033be77@eucas1p1.samsung.com>
     [not found]     ` <20200324170532.44384-5-andriy.shevchenko@linux.intel.com>
2020-04-17 14:07       ` [PATCH v1 5/5] video: ssd1307fb: Remove redundant forward declaration Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2157cc9f-5e84-8ca5-fd67-70240eb238d4@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=xllacyx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).