diff options
author | Thierry Reding <thierry.reding@gmail.com> | 2019-10-21 12:51:56 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2019-12-09 10:05:41 +0100 |
commit | cfc4c189bc70b1acc17e6f1abf1dc1c0ae890bd8 (patch) | |
tree | 9831fc05aad7280b76944a4d7ca809070f81ebef /drivers/pwm/pwm-cros-ec.c | |
parent | Linux 5.5-rc1 (diff) | |
download | linux-cfc4c189bc70b1acc17e6f1abf1dc1c0ae890bd8.tar.xz linux-cfc4c189bc70b1acc17e6f1abf1dc1c0ae890bd8.zip |
pwm: Read initial hardware state at request time
Drivers that support reading the hardware state (using ->get_state())
may want to rely on per-PWM data to do so. Defer reading the hardware
state for the first time until the PWM has been requested and after
drivers have had a chance to allocate per-PWM data.
Conceptually this is also a more natural place to read the hardware
state because the PWM core doesn't need to know the hardware state of a
PWM unless there is a user for it. This also ensures that the state is
read everytime a user requests a PWM. If the PWM changes between users
for some reason, the PWM core will reload the state from hardware and
keep its copy of the state up-to-date.
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-cros-ec.c')
0 files changed, 0 insertions, 0 deletions