All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: vishakha.joshi@intel.com, thierry.reding@gmail.com,
	lee.jones@linaro.org, linux-pwm@vger.kernel.org,
	linux-kernel@vger.kernel.org, jarkko.nikula@linux.intel.com,
	vijayakannan.ayyathurai@intel.com, bala.senthil@intel.com,
	tamal.saha@intel.com, lakshmi.bai.raja.subramanian@intel.com
Subject: Re: [PATCH v1 1/2] pwm: Add count to sysfs for Intel PWM driver
Date: Tue, 4 Jan 2022 15:58:55 +0200	[thread overview]
Message-ID: <YdRSnxqIJf1C14+x@smile.fi.intel.com> (raw)
In-Reply-To: <20220103121454.rduz4jftean4hkaw@pengutronix.de>

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



  reply	other threads:[~2022-01-04 14:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03  8:16 [PATCH v1 0/2] pwm: Add count to sysfs for Intel PWM driver vishakha.joshi
2022-01-03  8:16 ` [PATCH v1 1/2] " vishakha.joshi
2022-01-03 12:14   ` Uwe Kleine-König
2022-01-04 13:58     ` Andy Shevchenko [this message]
2022-01-13 14:11       ` Uwe Kleine-König
2022-01-03  8:16 ` [PATCH v1 2/2] pwm: Update the REPEAT_COUNT value vishakha.joshi

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=YdRSnxqIJf1C14+x@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bala.senthil@intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=lakshmi.bai.raja.subramanian@intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=tamal.saha@intel.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vijayakannan.ayyathurai@intel.com \
    --cc=vishakha.joshi@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.