summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-22 22:45:41 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-20 12:04:38 +0200
commit4f2e22f60bf32ff46cc09815c26c2ac609fe4491 (patch)
treec792021d539f0682baa3efde384f061a143a5b7d /drivers
parente573c833f4cd479ee6803d25b8389be6b9442631 (diff)
downloadlinux-stable-4f2e22f60bf32ff46cc09815c26c2ac609fe4491.tar.gz
linux-stable-4f2e22f60bf32ff46cc09815c26c2ac609fe4491.tar.bz2
linux-stable-4f2e22f60bf32ff46cc09815c26c2ac609fe4491.zip
pwm: cros-ec: Explicitly set .polarity in .get_state()
[ Upstream commit 30006b77c7e130e01d1ab2148cc8abf73dfcc4bf ] The driver only supports normal polarity. Complete the implementation of .get_state() by setting .polarity accordingly. Reviewed-by: Guenter Roeck <groeck@chromium.org> Fixes: 1f0d3bb02785 ("pwm: Add ChromeOS EC PWM driver") Link: https://lore.kernel.org/r/20230228135508.1798428-3-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pwm/pwm-cros-ec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 98f6ac6cf6ab..bedf6298acfb 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -125,6 +125,7 @@ static void cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
state->enabled = (ret > 0);
state->period = EC_PWM_MAX_DUTY;
+ state->polarity = PWM_POLARITY_NORMAL;
/* Note that "disabled" and "duty cycle == 0" are treated the same */
state->duty_cycle = ret;