mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
pwm: Add hardware readout infrastructure
Add a ->get_state() function to the pwm_ops struct to let PWM drivers initialize the PWM state attached to a PWM device. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
parent
09a7e4a3d9
commit
15fa8a43c1
2 changed files with 31 additions and 0 deletions
|
|
@ -270,6 +270,9 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip,
|
|||
pwm->hwpwm = i;
|
||||
pwm->state.polarity = polarity;
|
||||
|
||||
if (chip->ops->get_state)
|
||||
chip->ops->get_state(chip, pwm, &pwm->state);
|
||||
|
||||
radix_tree_insert(&pwm_tree, pwm->pwm, pwm);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue