lkml.org 
[lkml]   [2024]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 0/3] pwm: add support for duty_offset
Hello Trevor,

On Fri, Apr 05, 2024 at 10:19:20AM -0400, Trevor Gamblin wrote:
> On 2024-04-05 08:23, Uwe Kleine-König wrote:
> > Having said that I don't like the addition of .supports_offset to
> > struct pwm_chip, which only signals a new incomplete evolution of the
> > pwm framework. Better adapt all drivers and then assume all of them
> > support it.
> Can you clarify what you mean here - is the intent to put basic handling of
> duty_offset (even if that means simply setting it to 0) in each driver?

Well, it's a bit more complicated than setting it to 0. It involves
translating a setting with inverted polarity to one using .duty_offset
and make all drivers implement that accordingly.

For drivers that support both polarities the logic in .apply should be:

if (.duty_offset >= .period - .duty_cycle)
... set inverted polarity
else
... set normal polarity

I'm usure how to do the transformation in reviewable chunks. Maybe the
easiest option is a new .apply callback that honors .duty_offset?

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2024-05-27 16:26    [W:0.076 / U:2.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site