[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1519300881-8136-4-git-send-email-claudiu.beznea@microchip.com>
Date: Thu, 22 Feb 2018 14:01:14 +0200
From: Claudiu Beznea <claudiu.beznea@...rochip.com>
To: <thierry.reding@...il.com>, <shc_work@...l.ru>, <kgene@...nel.org>,
<krzk@...nel.org>, <linux@...linux.org.uk>,
<mturquette@...libre.com>, <sboyd@...eaurora.org>,
<jani.nikula@...ux.intel.com>, <joonas.lahtinen@...ux.intel.com>,
<rodrigo.vivi@...el.com>, <airlied@...ux.ie>, <kamil@...as.org>,
<b.zolnierkie@...sung.com>, <jdelvare@...e.com>,
<linux@...ck-us.net>, <dmitry.torokhov@...il.com>,
<rpurdie@...ys.net>, <jacek.anaszewski@...il.com>, <pavel@....cz>,
<mchehab@...nel.org>, <sean@...s.org>, <lee.jones@...aro.org>,
<daniel.thompson@...aro.org>, <jingoohan1@...il.com>,
<milo.kim@...com>, <robh+dt@...nel.org>, <mark.rutland@....com>,
<corbet@....net>, <nicolas.ferre@...rochip.com>,
<alexandre.belloni@...e-electrons.com>
CC: <linux-pwm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-samsung-soc@...r.kernel.org>, <linux-clk@...r.kernel.org>,
<intel-gfx@...ts.freedesktop.org>,
<dri-devel@...ts.freedesktop.org>, <linux-hwmon@...r.kernel.org>,
<linux-input@...r.kernel.org>, <linux-leds@...r.kernel.org>,
<linux-media@...r.kernel.org>, <linux-fbdev@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-doc@...r.kernel.org>,
Claudiu Beznea <claudiu.beznea@...rochip.com>
Subject: [PATCH v3 03/10] pwm: cros-ec: populate PWM mode in of_xlate function
Populate PWM mode in of_xlate function to avoid pwm_apply_state() failure.
Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
---
drivers/pwm/pwm-cros-ec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 9c13694eaa24..e54954c13323 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -137,6 +137,7 @@ static struct pwm_device *
cros_ec_pwm_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
{
struct pwm_device *pwm;
+ struct pwm_caps caps;
if (args->args[0] >= pc->npwm)
return ERR_PTR(-EINVAL);
@@ -145,8 +146,11 @@ cros_ec_pwm_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
if (IS_ERR(pwm))
return pwm;
+ pwm_get_caps(pc, pwm, &caps);
+
/* The EC won't let us change the period */
pwm->args.period = EC_PWM_MAX_DUTY;
+ pwm->args.mode = BIT(ffs(caps.modes) - 1);
return pwm;
}
--
2.7.4
Powered by blists - more mailing lists