All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
	clemens.gruber@pqgruber.com, andriy.shevchenko@linux.intel.com,
	Sven Van Asbroeck <TheSven73@googlemail.com>
Subject: Re: [PATCH 1/1] pwm: pca9685: fix gpio-only operation.
Date: Tue, 11 Apr 2017 12:11:26 +0300	[thread overview]
Message-ID: <20170411091126.GP2957@lahna.fi.intel.com> (raw)
In-Reply-To: <CAGngYiVpWa9qrTFn9BmTahgyBZDsX22vjfjL=4JZUMV9W+nxmw@mail.gmail.com>

On Mon, Apr 10, 2017 at 11:35:39PM -0400, Sven Van Asbroeck wrote:
> > How about implementing a real runtime PM in the driver? Then when the
> > device is idle regardless of whether it is GPIO or PWM, the SLEEP bit is
> > set and cleared accordingly.
> 
> You mean: increase the runtime_pm refcnt when a pwm/gpio is enabled,
> and vice versa ? And don't touch the refcnt on pwm/gpio export/unexport?

I mean whenever the thing is in use, it is in runtime PM active state.
Then when the last user closes the device, it goest to runtime PM
suspend state where you effectively set that SLEEP bit. The functions
for refcounting are called pm_runtime_get* and pm_runtime_put*.

You need to implement runtime PM callbacks for the driver as well.

See Documentation/power/runtime_pm.txt for more information.

      reply	other threads:[~2017-04-11  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-09 16:11 [PATCH 0/1] pwm: pca9685: fix gpio-only operation Sven Van Asbroeck
2017-04-09 16:11 ` [PATCH 1/1] " Sven Van Asbroeck
2017-04-10 10:33   ` Mika Westerberg
2017-04-10 16:08     ` Sven Van Asbroeck
2017-04-11  3:35     ` Sven Van Asbroeck
2017-04-11  9:11       ` Mika Westerberg [this message]

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=20170411091126.GP2957@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=TheSven73@googlemail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=clemens.gruber@pqgruber.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thesven73@gmail.com \
    --cc=thierry.reding@gmail.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.