Skip to content
Commit c40c461e authored by Sven Van Asbroeck's avatar Sven Van Asbroeck Committed by Thierry Reding
Browse files

pwm: pca9685: Fix GPIO-only operation

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 not turn on
                                    because SLEEP bit is set

Prevent this behaviour by letting the runtime PM framework control the
SLEEP bit. This will put the chip to SLEEP if no PWMs/GPIOs are exported
or in use.

Fixes: bccec89f

 ("Allow any of the 16 PWMs to be used as a GPIO")
Reported-by: default avatarSven Van Asbroeck <TheSven73@googlemail.com>
Signed-off-by: default avatarSven Van Asbroeck <TheSven73@googlemail.com>
Suggested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 6db249db
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment