summaryrefslogtreecommitdiff
path: root/include/linux/pwm.h
diff options
context:
space:
mode:
authorTim Kryger <tim.kryger@gmail.com>2015-05-26 23:08:16 +0300
committerThierry Reding <thierry.reding@gmail.com>2015-06-12 12:36:30 +0300
commitb6a00fae9760a49114016e4764d09e522a5ba5b6 (patch)
tree88bb0e1cc5c1ca9c4eb66d8c7a2a3c54bf958387 /include/linux/pwm.h
parent472ac3dcac108d6648ee28616c6de1e3b0bb361f (diff)
downloadlinux-b6a00fae9760a49114016e4764d09e522a5ba5b6.tar.xz
pwm: Add pwmchip_add_with_polarity() API
Add a new function to register a PWM chip with channels that have their initial polarity as specified by an additional parameter. This benefits drivers of controllers that by default operate with inversed polarity by removing the need to modify the polarity during initialization. Signed-off-by: Tim Kryger <tim.kryger@gmail.com> Signed-off-by: Jonathan Richardson <jonathar@broadcom.com> [thierry.reding@gmail.com: export pwmchip_add_with_polarity()] Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'include/linux/pwm.h')
-rw-r--r--include/linux/pwm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index cfe2d8df5be0..36262d08a9da 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -182,6 +182,8 @@ struct pwm_chip {
int pwm_set_chip_data(struct pwm_device *pwm, void *data);
void *pwm_get_chip_data(struct pwm_device *pwm);
+int pwmchip_add_with_polarity(struct pwm_chip *chip,
+ enum pwm_polarity polarity);
int pwmchip_add(struct pwm_chip *chip);
int pwmchip_remove(struct pwm_chip *chip);
struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
@@ -217,6 +219,11 @@ static inline int pwmchip_add(struct pwm_chip *chip)
return -EINVAL;
}
+static inline int pwmchip_add_inversed(struct pwm_chip *chip)
+{
+ return -EINVAL;
+}
+
static inline int pwmchip_remove(struct pwm_chip *chip)
{
return -EINVAL;