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>
This commit is contained in:

committed by
Thierry Reding

parent
472ac3dcac
commit
b6a00fae97
@@ -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;
|
||||
|
Reference in New Issue
Block a user