mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
pwm: Add the pwm_is_enabled() helper
Some PWM drivers are testing the PWMF_ENABLED flag. Create a helper function to hide the logic behind enabled test. This will allow us to smoothly move from the current approach to an atomic PWM update approach. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
d770e558e2
commit
5c31252c4a
13 changed files with 31 additions and 26 deletions
|
@ -92,6 +92,11 @@ struct pwm_device {
|
|||
enum pwm_polarity polarity;
|
||||
};
|
||||
|
||||
static inline bool pwm_is_enabled(const struct pwm_device *pwm)
|
||||
{
|
||||
return test_bit(PWMF_ENABLED, &pwm->flags);
|
||||
}
|
||||
|
||||
static inline void pwm_set_period(struct pwm_device *pwm, unsigned int period)
|
||||
{
|
||||
if (pwm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue