Re: [PATCH 1/1] pwm: pca9685: fix gpio-only operation.

2017-04-11 Thread Mika Westerberg
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 wh

Re: [PATCH 1/1] pwm: pca9685: fix gpio-only operation.

2017-04-10 Thread Sven Van Asbroeck
> 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/

Re: [PATCH 1/1] pwm: pca9685: fix gpio-only operation.

2017-04-10 Thread Sven Van Asbroeck
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

Re: [PATCH 1/1] pwm: pca9685: fix gpio-only operation.

2017-04-10 Thread Mika Westerberg
On Sun, Apr 09, 2017 at 12:11:24PM -0400, Sven Van Asbroeck wrote: > gpio-only driver operation never clears the SLEEP bit, which can > cause the gpios to become unusable. > > Example: > 1. user requests first pwm -> driver clears SLEEP bit > 2. user frees last pwm -> driver sets S

[PATCH 1/1] pwm: pca9685: fix gpio-only operation.

2017-04-09 Thread Sven Van Asbroeck
gpio-only driver operation never clears the SLEEP bit, which can cause the gpios to become unusable. Example: 1. user requests first pwm -> driver clears SLEEP bit 2. user frees last pwm -> driver sets SLEEP bit 3. user requests gpio 4. user switches gpio on-> output does