Messages in this thread | | | Date | Tue, 4 Jan 2022 15:58:55 +0200 | From | Andy Shevchenko <> | Subject | Re: [PATCH v1 1/2] pwm: Add count to sysfs for Intel PWM driver |
| |
On Mon, Jan 03, 2022 at 01:14:54PM +0100, Uwe Kleine-König wrote: > On Mon, Jan 03, 2022 at 01:46:09PM +0530, vishakha.joshi@intel.com wrote: > > From: Vishakha Joshi <vishakha.joshi@intel.com>
...
> > struct pwm_state { > > u64 period; > > u64 duty_cycle; > > + u32 count; > > enum pwm_polarity polarity; > > bool enabled; > > bool usage_power; > > This needs more documentation about what the semantic should be. E.g. > what should .get_state return?
Good point. I guess ideally we should return the amount of the periods we still need to produce, but I'm not sure if it can be done cleanly.
It would probably require a timer to be run in parallel, hence almost full software implementation of the feature. (This answers the second concern)
> Also I doubt this is a good idea given that most controllers cannot > implement it. > > If we really want to support a count, I request that all drivers that > don't support it get updated to refuse a request with count != 0.
Hmm... Not sure it worth it, perhaps taking into account above the -1 (in unsigned type) returned on ->get_state() can suffice as not supporting feature?
-- With Best Regards, Andy Shevchenko
| |