From 6e69ab1361c44e3ee1398158b56d114b1aef8179 Mon Sep 17 00:00:00 2001 From: Florian Vaussard Date: Mon, 28 Jan 2013 15:00:57 +0100 Subject: 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 Cc: Peter Ujfalusi Signed-off-by: Florian Vaussard Reviewed-by: Peter Ujfalusi Signed-off-by: Thierry Reding --- drivers/pwm/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/pwm/core.c') 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) } EXPORT_SYMBOL_GPL(devm_pwm_put); +/** + * pwm_can_sleep() - report whether PWM access will sleep + * @pwm: PWM device + * + * It returns true if accessing the PWM can sleep, false otherwise. + */ +bool pwm_can_sleep(struct pwm_device *pwm) +{ + return pwm->chip->can_sleep; +} +EXPORT_SYMBOL_GPL(pwm_can_sleep); + #ifdef CONFIG_DEBUG_FS static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s) { -- cgit v1.2.3 From 928c44775bbf312332c5cb8df7c7451c1d8fba25 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 30 Jan 2013 09:22:24 +0100 Subject: pwm: Export pwm_{set,get}_chip_data() When building a driver as a module, these functions need to be exported for linking to succeed. Signed-off-by: Thierry Reding --- drivers/pwm/core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/pwm/core.c') diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index ffbef95e88dc..7d6081879c13 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -211,6 +211,7 @@ int pwm_set_chip_data(struct pwm_device *pwm, void *data) return 0; } +EXPORT_SYMBOL_GPL(pwm_set_chip_data); /** * pwm_get_chip_data() - get private chip data for a PWM @@ -220,6 +221,7 @@ void *pwm_get_chip_data(struct pwm_device *pwm) { return pwm ? pwm->chip_data : NULL; } +EXPORT_SYMBOL_GPL(pwm_get_chip_data); /** * pwmchip_add() - register a new PWM chip -- cgit v1.2.3