> 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? Neat. I will test such a solution and try to post it within the next few days.