[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGngYiXK0R4+CkVnPuBUp9sKzg3Fng306o8SiPJEf9uVABScYQ@mail.gmail.com>
Date: Mon, 10 Apr 2017 12:08:05 -0400
From: Sven Van Asbroeck <thesven73@...il.com>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
clemens.gruber@...ruber.com, andriy.shevchenko@...ux.intel.com
Subject: Re: [PATCH 1/1] pwm: pca9685: fix gpio-only operation.
Thanks for the feedback Mika, I really appreciate it.
> 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.
The current code will keep driving pwms/leds even when these are
currently not exported in sysfs. Until the last export disappears.
That behaviour feels counter-intuitive to me.
Example:
1. export pwm1 and pwm2
echo 1 > export
echo 2 > export
2. configure/enable pwm1 and pwm2
3. enjoy the blinkenlights on your board
4. unexport pwm1
echo 1 > unexport
both pwms are still driven !
5. unexport pwm2
echo 2 > unexport
both pwms shut down !
6. export pwm1
echo 1 > export
both pwms come back on !
Do we want to get rid of this behaviour? I see two intuitive alternatives:
a) keep SLEEP off all the time, so LEDs are still driven even when no
pwms/gpios are exported.
Pro: simple, predictable
Con: not power efficient
b) when a pwm/gpio is unexported, turn off the LED. when all pwms/gpios
are unexported, set the SLEEP bit.
Pro: power efficient
Con: output turns off when gpio/pwm is unexported, this may surprise users
Sven
Powered by blists - more mailing lists