[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-hwmon
Subject: [PATCH v3 04/10] pwm: pxa: populate PWM mode in of_xlate function
From: Claudiu Beznea <claudiu.beznea () microchip ! com>
Date: 2018-02-22 12:01:15
Message-ID: 1519300881-8136-5-git-send-email-claudiu.beznea () microchip ! com
[Download RAW message or body]
Populate PWM mode in of_xlate function to avoid pwm_apply_state() failure.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
drivers/pwm/pwm-pxa.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index 4143a46684d2..7a035716e054 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -155,12 +155,16 @@ static struct pwm_device *
pxa_pwm_of_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
{
struct pwm_device *pwm;
+ struct pwm_caps caps;
pwm = pwm_request_from_chip(pc, 0, NULL);
if (IS_ERR(pwm))
return pwm;
+ pwm_get_caps(pc, pwm, &caps);
+
pwm->args.period = args->args[0];
+ pwm->args.mode = BIT(ffs(caps.modes) - 1);
return pwm;
}
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic