From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: [PATCH v4 17/24] backlight: pwm_bl: remove useless call to pwm_set_period Date: Mon, 16 Nov 2015 09:56:40 +0100 Message-ID: <1447664207-24370-18-git-send-email-boris.brezillon@free-electrons.com> References: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> Reply-To: boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <1447664207-24370-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Thierry Reding , linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Mike Turquette , Stephen Boyd , linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mark Brown , Liam Girdwood , Kamil Debski , lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org, Jean Delvare , Guenter Roeck , Dmitry Torokhov , linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Bryan Wu , Richard Purdie , Jacek Anaszewski , linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Maxime Ripard , Chen-Yu Tsai , linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Joachim Eastwood , Thomas Petazzoni , Heiko Stuebner , linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Jingoo Han , Lee Jones linu List-Id: linux-leds@vger.kernel.org The PWM period will be set when calling pwm_config. Remove this useless call to pwm_set_period, which might mess up with the initial PWM state once we have added proper support for PWM init state retrieval. Signed-off-by: Boris Brezillon Acked-by: Lee Jones --- drivers/video/backlight/pwm_bl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 54d5a03..5ff2976 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -292,12 +292,14 @@ static int pwm_backlight_probe(struct platform_device *pdev) * period, parsed from the DT, in the PWM device. For the non-DT case, * set the period from platform data if it has not already been set * via the PWM lookup table. + * FIXME: This assignment should be dropped as soon as all the boards + * have moved to the PWM lookup table approach. The same goes for the + * pb->period field which should be replaced by + * pwm_get_default_period() calls. */ pb->period = pwm_get_default_period(pb->pwm); - if (!pb->period && (data->pwm_period_ns > 0)) { + if (!pb->period && (data->pwm_period_ns > 0)) pb->period = data->pwm_period_ns; - pwm_set_period(pb->pwm, data->pwm_period_ns); - } pb->lth_brightness = data->lth_brightness * (pb->period / pb->scale); -- 2.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752817AbbKPJAA (ORCPT ); Mon, 16 Nov 2015 04:00:00 -0500 Received: from down.free-electrons.com ([37.187.137.238]:34686 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752427AbbKPI5P (ORCPT ); Mon, 16 Nov 2015 03:57:15 -0500 From: Boris Brezillon To: Thierry Reding , linux-pwm@vger.kernel.org Cc: Mike Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Mark Brown , Liam Girdwood , Kamil Debski , lm-sensors@lm-sensors.org, Jean Delvare , Guenter Roeck , Dmitry Torokhov , linux-input@vger.kernel.org, Bryan Wu , Richard Purdie , Jacek Anaszewski , linux-leds@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Joachim Eastwood , Thomas Petazzoni , Heiko Stuebner , linux-rockchip@lists.infradead.org, Jingoo Han , Lee Jones , linux-fbdev@vger.kernel.org, Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Robert Jarzmik , Alexandre Belloni , Julia Lawall , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Boris Brezillon Subject: [PATCH v4 17/24] backlight: pwm_bl: remove useless call to pwm_set_period Date: Mon, 16 Nov 2015 09:56:40 +0100 Message-Id: <1447664207-24370-18-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> References: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PWM period will be set when calling pwm_config. Remove this useless call to pwm_set_period, which might mess up with the initial PWM state once we have added proper support for PWM init state retrieval. Signed-off-by: Boris Brezillon Acked-by: Lee Jones --- drivers/video/backlight/pwm_bl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 54d5a03..5ff2976 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -292,12 +292,14 @@ static int pwm_backlight_probe(struct platform_device *pdev) * period, parsed from the DT, in the PWM device. For the non-DT case, * set the period from platform data if it has not already been set * via the PWM lookup table. + * FIXME: This assignment should be dropped as soon as all the boards + * have moved to the PWM lookup table approach. The same goes for the + * pb->period field which should be replaced by + * pwm_get_default_period() calls. */ pb->period = pwm_get_default_period(pb->pwm); - if (!pb->period && (data->pwm_period_ns > 0)) { + if (!pb->period && (data->pwm_period_ns > 0)) pb->period = data->pwm_period_ns; - pwm_set_period(pb->pwm, data->pwm_period_ns); - } pb->lth_brightness = data->lth_brightness * (pb->period / pb->scale); -- 2.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Mon, 16 Nov 2015 08:56:40 +0000 Subject: [PATCH v4 17/24] backlight: pwm_bl: remove useless call to pwm_set_period Message-Id: <1447664207-24370-18-git-send-email-boris.brezillon@free-electrons.com> List-Id: References: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> In-Reply-To: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org The PWM period will be set when calling pwm_config. Remove this useless call to pwm_set_period, which might mess up with the initial PWM state once we have added proper support for PWM init state retrieval. Signed-off-by: Boris Brezillon Acked-by: Lee Jones --- drivers/video/backlight/pwm_bl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 54d5a03..5ff2976 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -292,12 +292,14 @@ static int pwm_backlight_probe(struct platform_device *pdev) * period, parsed from the DT, in the PWM device. For the non-DT case, * set the period from platform data if it has not already been set * via the PWM lookup table. + * FIXME: This assignment should be dropped as soon as all the boards + * have moved to the PWM lookup table approach. The same goes for the + * pb->period field which should be replaced by + * pwm_get_default_period() calls. */ pb->period = pwm_get_default_period(pb->pwm); - if (!pb->period && (data->pwm_period_ns > 0)) { + if (!pb->period && (data->pwm_period_ns > 0)) pb->period = data->pwm_period_ns; - pwm_set_period(pb->pwm, data->pwm_period_ns); - } pb->lth_brightness = data->lth_brightness * (pb->period / pb->scale); -- 2.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: boris.brezillon@free-electrons.com (Boris Brezillon) Date: Mon, 16 Nov 2015 09:56:40 +0100 Subject: [PATCH v4 17/24] backlight: pwm_bl: remove useless call to pwm_set_period In-Reply-To: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> References: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> Message-ID: <1447664207-24370-18-git-send-email-boris.brezillon@free-electrons.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org The PWM period will be set when calling pwm_config. Remove this useless call to pwm_set_period, which might mess up with the initial PWM state once we have added proper support for PWM init state retrieval. Signed-off-by: Boris Brezillon Acked-by: Lee Jones --- drivers/video/backlight/pwm_bl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 54d5a03..5ff2976 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -292,12 +292,14 @@ static int pwm_backlight_probe(struct platform_device *pdev) * period, parsed from the DT, in the PWM device. For the non-DT case, * set the period from platform data if it has not already been set * via the PWM lookup table. + * FIXME: This assignment should be dropped as soon as all the boards + * have moved to the PWM lookup table approach. The same goes for the + * pb->period field which should be replaced by + * pwm_get_default_period() calls. */ pb->period = pwm_get_default_period(pb->pwm); - if (!pb->period && (data->pwm_period_ns > 0)) { + if (!pb->period && (data->pwm_period_ns > 0)) pb->period = data->pwm_period_ns; - pwm_set_period(pb->pwm, data->pwm_period_ns); - } pb->lth_brightness = data->lth_brightness * (pb->period / pb->scale); -- 2.1.4