diff options
author | Florian Vaussard <florian.vaussard@epfl.ch> | 2013-01-28 09:00:57 -0500 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2013-01-30 03:12:18 -0500 |
commit | 6e69ab1361c44e3ee1398158b56d114b1aef8179 (patch) | |
tree | 44994b7b6cdfebaf1de44473597bb5a9adf2f912 /drivers/pwm | |
parent | 0132267d659107616eb044777f1b0be55381129a (diff) |
pwm: Add pwm_can_sleep() as exported API to users
Calls to some external PWM chips can sleep. To help users,
add pwm_can_sleep() API.
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 903138b18842..ffbef95e88dc 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c | |||
@@ -733,6 +733,18 @@ void devm_pwm_put(struct device *dev, struct pwm_device *pwm) | |||
733 | } | 733 | } |
734 | EXPORT_SYMBOL_GPL(devm_pwm_put); | 734 | EXPORT_SYMBOL_GPL(devm_pwm_put); |
735 | 735 | ||
736 | /** | ||
737 | * pwm_can_sleep() - report whether PWM access will sleep | ||
738 | * @pwm: PWM device | ||
739 | * | ||
740 | * It returns true if accessing the PWM can sleep, false otherwise. | ||
741 | */ | ||
742 | bool pwm_can_sleep(struct pwm_device *pwm) | ||
743 | { | ||
744 | return pwm->chip->can_sleep; | ||
745 | } | ||
746 | EXPORT_SYMBOL_GPL(pwm_can_sleep); | ||
747 | |||
736 | #ifdef CONFIG_DEBUG_FS | 748 | #ifdef CONFIG_DEBUG_FS |
737 | static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s) | 749 | static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s) |
738 | { | 750 | { |