[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1459368249-13241-41-git-send-email-boris.brezillon@free-electrons.com>
Date: Wed, 30 Mar 2016 22:04:03 +0200
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
To: Thierry Reding <thierry.reding@...il.com>,
linux-pwm@...r.kernel.org
Cc: Mike Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...eaurora.org>, linux-clk@...r.kernel.org,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Kamil Debski <k.debski@...sung.com>, lm-sensors@...sensors.org,
Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, Bryan Wu <cooloney@...il.com>,
Richard Purdie <rpurdie@...ys.net>,
Jacek Anaszewski <j.anaszewski@...sung.com>,
linux-leds@...r.kernel.org,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
Chen-Yu Tsai <wens@...e.org>, linux-sunxi@...glegroups.com,
Joachim Eastwood <manabian@...il.com>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Heiko Stuebner <heiko@...ech.de>,
linux-rockchip@...ts.infradead.org,
Jingoo Han <jingoohan1@...il.com>,
Lee Jones <lee.jones@...aro.org>, linux-fbdev@...r.kernel.org,
Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
Tomi Valkeinen <tomi.valkeinen@...com>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <k.kozlowski@...sung.com>,
linux-samsung-soc@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
Daniel Vetter <daniel.vetter@...el.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Hartley Sweeten <hsweeten@...ionengravers.com>,
Ryan Mallon <rmallon@...il.com>,
Alexander Shiyan <shc_work@...l.ru>,
Milo Kim <milo.kim@...com>,
Boris Brezillon <boris.brezillon@...e-electrons.com>
Subject: [PATCH v5 40/46] backlight: lm3630a: switch to the atomic PWM API
pwm_config/enable/disable() have been deprecated and should be replaced
by pwm_apply_state().
Signed-off-by: Boris Brezillon <boris.brezillon@...e-electrons.com>
---
drivers/video/backlight/lm3630a_bl.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
index 3d16bd6..fdad23c 100644
--- a/drivers/video/backlight/lm3630a_bl.c
+++ b/drivers/video/backlight/lm3630a_bl.c
@@ -162,14 +162,16 @@ static int lm3630a_intr_config(struct lm3630a_chip *pchip)
static void lm3630a_pwm_ctrl(struct lm3630a_chip *pchip, int br, int br_max)
{
- unsigned int period = pchip->pdata->pwm_period;
- unsigned int duty = br * period / br_max;
+ struct pwm_state pstate;
- pwm_config(pchip->pwmd, duty, period);
- if (duty)
- pwm_enable(pchip->pwmd);
+ pwm_get_state(pchip->pwmd, &pstate);
+ pstate.period = pchip->pdata->pwm_period;
+ pstate.duty_cycle = br * pstate.period / br_max;
+ if (pstate.duty_cycle)
+ pstate.enabled = true;
else
- pwm_disable(pchip->pwmd);
+ pstate.enabled = false;
+ pwm_apply_state(pchip->pwmd, &pstate);
}
/* update and get brightness */
--
2.5.0
Powered by blists - more mailing lists