pwm: cros-ec: Cache duty cycle value
authorThierry Reding <thierry.reding@gmail.com>
Thu, 17 Oct 2019 11:21:15 +0000 (13:21 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 9 Dec 2019 09:05:42 +0000 (10:05 +0100)
commit1db37f9561b2b3f57d84b6253a9cd97f6289f8e1
treed18480a1e22b7443c3869c8d60d9966414182839
parentcfc4c189bc70b1acc17e6f1abf1dc1c0ae890bd8
pwm: cros-ec: Cache duty cycle value

The ChromeOS embedded controller doesn't differentiate between disabled
and duty cycle being 0. In order not to potentially confuse consumers,
cache the duty cycle and return the cached value instead of the real
value when the PWM is disabled.

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-cros-ec.c