[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170720110526.GA22000@amd>
Date: Thu, 20 Jul 2017 13:05:26 +0200
From: Pavel Machek <pavel@....cz>
To: Daniel Thompson <daniel.thompson@...aro.org>
Cc: Enric Balletbo i Serra <enric.balletbo@...labora.com>,
Thierry Reding <thierry.reding@...il.com>,
Lee Jones <lee.jones@...aro.org>,
Jingoo Han <jingoohan1@...il.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Rob Herring <robh+dt@...nel.org>,
Richard Purdie <rpurdie@...ys.net>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
Heiko Stuebner <heiko@...ech.de>, linux-pwm@...r.kernel.org,
linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
groeck@...omium.org, linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH v3 3/5] pwm-backlight: add support for PWM delays
proprieties.
On Thu 2017-07-20 11:37:17, Daniel Thompson wrote:
> On 20/07/17 09:06, Pavel Machek wrote:
> >Hi!
> >
> >>>--- a/drivers/video/backlight/pwm_bl.c
> >>>+++ b/drivers/video/backlight/pwm_bl.c
> >>>@@ -10,6 +10,7 @@
> >>> * published by the Free Software Foundation.
> >>> */
> >>>+#include <linux/delay.h>
> >>> #include <linux/gpio/consumer.h>
> >>> #include <linux/gpio.h>
> >>> #include <linux/module.h>
> >>>@@ -35,6 +36,7 @@ struct pwm_bl_data {
> >>> struct gpio_desc *enable_gpio;
> >>> unsigned int scale;
> >>> bool legacy;
> >>>+ unsigned int pwm_delay[2];
> >>
> >>Two named members would be better here (eliminating the "magic" 0
> >>and 1).
> >
> >My thought, too.
> >
> >>>@@ -56,6 +58,9 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness)
> >>> pwm_enable(pb->pwm);
> >>>+ if (pb->pwm_delay[0])
> >>>+ usleep_range(pb->pwm_delay[0], pb->pwm_delay[0] * 2);
> >
> >Plus I'd just do the delay unconditionally :-).
>
> ... does this still apply if this code is switched to msleep()?
>
> msleep() has no wait avoidance[1] and if lots of drivers are reckless about
> sleeping for 10ms it soon starts to show up in the boot time (especially
> optimized ones).
No, not for msleep.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists