From: Sven Van Asbroeck <thesven73@gmail.com>
To: thierry.reding@gmail.com
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
clemens.gruber@pqgruber.com, mika.westerberg@linux.intel.com,
andriy.shevchenko@linux.intel.com
Subject: [PATCH v3 0/1] pwm: pca9685: fix gpio-only operation.
Date: Wed, 12 Apr 2017 11:15:58 -0400 [thread overview]
Message-ID: <1492010159-6050-1-git-send-email-svenv@arcx.com> (raw)
Mika, I investigated what's required to suspend the device on remove,
by compiling as a module and running insmod/rmmod in various
circumstances.
As you suspected, pm_runtime_suspend() is unneccessary. I removed it,
and the chip is suspended ok when the module unloads. But this could be
because the pm_runtime refcnt is always zero when _remove() is called ?
When unloading the module (rmmod) :
If a gpio is still exported, the kernel unexports the gpio before calling
_remove().
If a pwm is still exported, the kernel refuses to rmmod the module. Even
'rmmod -f' does not work.
I am not sure if the kernel will ever call _unload() without releasing
the associated pwms/gpios. And if it ever does, I am also not sure how
we could convince pm_runtime to go to suspend.
v3:
remove unnecessary call to pm_runtime_suspend()
fix coding style for multi-line comment
(checkpatch.pl should ideally catch this, but did not?)
v2:
the pm_runtime framework controls the SLEEP bit, as suggested by
Mika Westerberg.
v1:
the SLEEP bit is always on.
Sven Van Asbroeck (1):
pwm: pca9685: fix gpio-only operation.
drivers/pwm/pwm-pca9685.c | 111 ++++++++++++++++++++++++++++++++--------------
1 file changed, 78 insertions(+), 33 deletions(-)
--
1.9.1
next reply other threads:[~2017-04-12 15:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-12 15:15 Sven Van Asbroeck [this message]
2017-04-12 15:15 ` [PATCH v3 1/1] pwm: pca9685: fix gpio-only operation Sven Van Asbroeck
2017-04-13 8:15 ` Mika Westerberg
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=1492010159-6050-1-git-send-email-svenv@arcx.com \
--to=thesven73@gmail.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=mika.westerberg@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).