[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210111204350.k2bhpdj7xnnqkfi3@pengutronix.de>
Date: Mon, 11 Jan 2021 21:43:50 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Clemens Gruber <clemens.gruber@...ruber.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Sven Van Asbroeck <thesven73@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-pwm@...r.kernel.org
Subject: Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout
On Sun, Jan 03, 2021 at 06:04:10PM +0100, Clemens Gruber wrote:
> Another point is the period: Sven suggested we do not read out the
> period at all, as the PWM is disabled anyway (see above).
> Is this acceptable?
In my eyes consumers should consider the period value as "don't care" if
the PWM is off. But this doesn't match reality (and maybe also it
doesn't match Thierry's opinion). See for example the
drivers/video/backlight/pwm_bl.c driver which uses the idiom:
pwm_get_state(mypwm, &state);
state.enabled = true;
pwm_apply_state(pb->pwm, &state);
which breaks if .period is invalid. (OK, this isn't totally accurate
because currently the .get_state callback has only little to do with
pwm_get_state(), but you get the point.)
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists