* [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
@ 2015-05-16 14:08 ` Axel Lin
0 siblings, 0 replies; 8+ messages in thread
From: Axel Lin @ 2015-05-16 14:08 UTC (permalink / raw)
To: linux-pwm, linux-fbdev
Cc: Thierry Reding, Alexandre Courbot, Jingoo Han, Lee Jones
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
the gpiod_get* functions take an additional parameter that allows to
specify direction and initial value for output.
Simplify the usage of devm_gpiod_get_optional accordingly.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/video/backlight/pwm_bl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 3a145a6..57cb9ec 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->dev = &pdev->dev;
pb->enabled = false;
- pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
+ pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
+ GPIOD_OUT_HIGH);
if (IS_ERR(pb->enable_gpio)) {
ret = PTR_ERR(pb->enable_gpio);
goto err_alloc;
@@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->enable_gpio = gpio_to_desc(data->enable_gpio);
}
- if (pb->enable_gpio)
- gpiod_direction_output(pb->enable_gpio, 1);
-
pb->power_supply = devm_regulator_get(&pdev->dev, "power");
if (IS_ERR(pb->power_supply)) {
ret = PTR_ERR(pb->power_supply);
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
@ 2015-05-16 14:08 ` Axel Lin
0 siblings, 0 replies; 8+ messages in thread
From: Axel Lin @ 2015-05-16 14:08 UTC (permalink / raw)
To: linux-pwm, linux-fbdev
Cc: Thierry Reding, Alexandre Courbot, Jingoo Han, Lee Jones
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
the gpiod_get* functions take an additional parameter that allows to
specify direction and initial value for output.
Simplify the usage of devm_gpiod_get_optional accordingly.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/video/backlight/pwm_bl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 3a145a6..57cb9ec 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->dev = &pdev->dev;
pb->enabled = false;
- pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
+ pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
+ GPIOD_OUT_HIGH);
if (IS_ERR(pb->enable_gpio)) {
ret = PTR_ERR(pb->enable_gpio);
goto err_alloc;
@@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->enable_gpio = gpio_to_desc(data->enable_gpio);
}
- if (pb->enable_gpio)
- gpiod_direction_output(pb->enable_gpio, 1);
-
pb->power_supply = devm_regulator_get(&pdev->dev, "power");
if (IS_ERR(pb->power_supply)) {
ret = PTR_ERR(pb->power_supply);
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
2015-05-16 14:08 ` Axel Lin
@ 2015-05-18 8:47 ` Lee Jones
-1 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-05-18 8:47 UTC (permalink / raw)
To: Axel Lin
Cc: linux-pwm, linux-fbdev, Thierry Reding, Alexandre Courbot, Jingoo Han
On Sat, 16 May 2015, Axel Lin wrote:
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
> the gpiod_get* functions take an additional parameter that allows to
> specify direction and initial value for output.
> Simplify the usage of devm_gpiod_get_optional accordingly.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/video/backlight/pwm_bl.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Applied, thanks.
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 3a145a6..57cb9ec 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> pb->dev = &pdev->dev;
> pb->enabled = false;
>
> - pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
> + pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
> + GPIOD_OUT_HIGH);
> if (IS_ERR(pb->enable_gpio)) {
> ret = PTR_ERR(pb->enable_gpio);
> goto err_alloc;
> @@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> pb->enable_gpio = gpio_to_desc(data->enable_gpio);
> }
>
> - if (pb->enable_gpio)
> - gpiod_direction_output(pb->enable_gpio, 1);
> -
> pb->power_supply = devm_regulator_get(&pdev->dev, "power");
> if (IS_ERR(pb->power_supply)) {
> ret = PTR_ERR(pb->power_supply);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
@ 2015-05-18 8:47 ` Lee Jones
0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-05-18 8:47 UTC (permalink / raw)
To: Axel Lin
Cc: linux-pwm, linux-fbdev, Thierry Reding, Alexandre Courbot, Jingoo Han
On Sat, 16 May 2015, Axel Lin wrote:
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
> the gpiod_get* functions take an additional parameter that allows to
> specify direction and initial value for output.
> Simplify the usage of devm_gpiod_get_optional accordingly.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/video/backlight/pwm_bl.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Applied, thanks.
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 3a145a6..57cb9ec 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> pb->dev = &pdev->dev;
> pb->enabled = false;
>
> - pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
> + pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
> + GPIOD_OUT_HIGH);
> if (IS_ERR(pb->enable_gpio)) {
> ret = PTR_ERR(pb->enable_gpio);
> goto err_alloc;
> @@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
> pb->enable_gpio = gpio_to_desc(data->enable_gpio);
> }
>
> - if (pb->enable_gpio)
> - gpiod_direction_output(pb->enable_gpio, 1);
> -
> pb->power_supply = devm_regulator_get(&pdev->dev, "power");
> if (IS_ERR(pb->power_supply)) {
> ret = PTR_ERR(pb->power_supply);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
2015-05-16 14:08 ` Axel Lin
@ 2015-05-19 7:59 ` Uwe Kleine-König
-1 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2015-05-19 7:59 UTC (permalink / raw)
To: Axel Lin
Cc: linux-pwm, linux-fbdev, Thierry Reding, Alexandre Courbot,
Jingoo Han, Lee Jones
Hello,
On Sat, May 16, 2015 at 10:08:10PM +0800, Axel Lin wrote:
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
> the gpiod_get* functions take an additional parameter that allows to
> specify direction and initial value for output.
> Simplify the usage of devm_gpiod_get_optional accordingly.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
as I just sent the same patch:
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
@Axel: Do you have some more patches of this type in the queue? I
currently have several fixes on top of 4.1-rc4. Some of them are still
in a single wip patch, some other are already sent out.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
@ 2015-05-19 7:59 ` Uwe Kleine-König
0 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2015-05-19 7:59 UTC (permalink / raw)
To: Axel Lin
Cc: linux-pwm, linux-fbdev, Thierry Reding, Alexandre Courbot,
Jingoo Han, Lee Jones
Hello,
On Sat, May 16, 2015 at 10:08:10PM +0800, Axel Lin wrote:
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
> the gpiod_get* functions take an additional parameter that allows to
> specify direction and initial value for output.
> Simplify the usage of devm_gpiod_get_optional accordingly.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
as I just sent the same patch:
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
@Axel: Do you have some more patches of this type in the queue? I
currently have several fixes on top of 4.1-rc4. Some of them are still
in a single wip patch, some other are already sent out.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
2015-05-19 7:59 ` Uwe Kleine-König
@ 2015-05-19 9:18 ` Axel Lin
-1 siblings, 0 replies; 8+ messages in thread
From: Axel Lin @ 2015-05-19 9:18 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-pwm, linux-fbdev, Thierry Reding, Alexandre Courbot,
Jingoo Han, Lee Jones
2015-05-19 15:59 GMT+08:00 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
> Hello,
>
> On Sat, May 16, 2015 at 10:08:10PM +0800, Axel Lin wrote:
>> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
>> the gpiod_get* functions take an additional parameter that allows to
>> specify direction and initial value for output.
>> Simplify the usage of devm_gpiod_get_optional accordingly.
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> as I just sent the same patch:
>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> @Axel: Do you have some more patches of this type in the queue? I
No, I don't have other patches of this type in the queue.
Regards,
Axel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
@ 2015-05-19 9:18 ` Axel Lin
0 siblings, 0 replies; 8+ messages in thread
From: Axel Lin @ 2015-05-19 9:18 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-pwm, linux-fbdev, Thierry Reding, Alexandre Courbot,
Jingoo Han, Lee Jones
2015-05-19 15:59 GMT+08:00 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
> Hello,
>
> On Sat, May 16, 2015 at 10:08:10PM +0800, Axel Lin wrote:
>> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions),
>> the gpiod_get* functions take an additional parameter that allows to
>> specify direction and initial value for output.
>> Simplify the usage of devm_gpiod_get_optional accordingly.
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> as I just sent the same patch:
>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> @Axel: Do you have some more patches of this type in the queue? I
No, I don't have other patches of this type in the queue.
Regards,
Axel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-05-19 9:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-16 14:08 [PATCH] backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional Axel Lin
2015-05-16 14:08 ` Axel Lin
2015-05-18 8:47 ` Lee Jones
2015-05-18 8:47 ` Lee Jones
2015-05-19 7:59 ` Uwe Kleine-König
2015-05-19 7:59 ` Uwe Kleine-König
2015-05-19 9:18 ` Axel Lin
2015-05-19 9:18 ` Axel Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.