All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: i2c/adp1653: set enable gpio to output
@ 2015-06-12  7:47 Uwe Kleine-König
  2015-06-12 21:13 ` Sakari Ailus
  2015-06-16 10:16 ` Pavel Machek
  0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2015-06-12  7:47 UTC (permalink / raw)
  To: Pavel Machek, Sakari Ailus, Mauro Carvalho Chehab
  Cc: kernel, Alexandre Courbot, Linus Walleij, linux-media

Without setting the direction of a gpio to output a call to
gpiod_set_value doesn't have a defined outcome.

Furthermore this is one caller less that stops us making the flags
argument to gpiod_get*() mandatory.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this patch applies to next and is only necessary on top of 074c57a25fa2
([media] media: i2c/adp1653: Devicetree support for adp1653).

Note I plan to make the flags parameter mandatory for 4.3. So unless
this change gets into 4.2, would it be ok to let it go in via the gpio
tree?

Best regards
Uwe

 drivers/media/i2c/adp1653.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c
index c70ababce954..5dd39775d6ca 100644
--- a/drivers/media/i2c/adp1653.c
+++ b/drivers/media/i2c/adp1653.c
@@ -465,7 +465,7 @@ static int adp1653_of_init(struct i2c_client *client,
 
 	of_node_put(child);
 
-	pd->enable_gpio = devm_gpiod_get(&client->dev, "enable");
+	pd->enable_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
 	if (!pd->enable_gpio) {
 		dev_err(&client->dev, "Error getting GPIO\n");
 		return -EINVAL;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: i2c/adp1653: set enable gpio to output
  2015-06-12  7:47 [PATCH] media: i2c/adp1653: set enable gpio to output Uwe Kleine-König
@ 2015-06-12 21:13 ` Sakari Ailus
  2015-06-16 10:16 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2015-06-12 21:13 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Pavel Machek, Mauro Carvalho Chehab, kernel, Alexandre Courbot,
	Linus Walleij, linux-media

Hallo Uwe,

Thanks for the patch!

On Fri, Jun 12, 2015 at 09:47:28AM +0200, Uwe Kleine-König wrote:
> Without setting the direction of a gpio to output a call to
> gpiod_set_value doesn't have a defined outcome.
> 
> Furthermore this is one caller less that stops us making the flags
> argument to gpiod_get*() mandatory.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> this patch applies to next and is only necessary on top of 074c57a25fa2
> ([media] media: i2c/adp1653: Devicetree support for adp1653).
> 
> Note I plan to make the flags parameter mandatory for 4.3. So unless
> this change gets into 4.2, would it be ok to let it go in via the gpio
> tree?

Fine for me.

For the patch,

Acked-by: Sakari Ailus <sakari.ailus@iki.fi>

-- 
Freundliche hilsen,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: i2c/adp1653: set enable gpio to output
  2015-06-12  7:47 [PATCH] media: i2c/adp1653: set enable gpio to output Uwe Kleine-König
  2015-06-12 21:13 ` Sakari Ailus
@ 2015-06-16 10:16 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2015-06-16 10:16 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Sakari Ailus, Mauro Carvalho Chehab, kernel, Alexandre Courbot,
	Linus Walleij, linux-media

On Fri 2015-06-12 09:47:28, Uwe Kleine-König wrote:
> Without setting the direction of a gpio to output a call to
> gpiod_set_value doesn't have a defined outcome.
> 
> Furthermore this is one caller less that stops us making the flags
> argument to gpiod_get*() mandatory.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Pavel Machek <pavel@ucw.cz>

> diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c
> index c70ababce954..5dd39775d6ca 100644
> --- a/drivers/media/i2c/adp1653.c
> +++ b/drivers/media/i2c/adp1653.c
> @@ -465,7 +465,7 @@ static int adp1653_of_init(struct i2c_client *client,
>  
>  	of_node_put(child);
>  
> -	pd->enable_gpio = devm_gpiod_get(&client->dev, "enable");
> +	pd->enable_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
>  	if (!pd->enable_gpio) {
>  		dev_err(&client->dev, "Error getting GPIO\n");
>  		return -EINVAL;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-16 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-12  7:47 [PATCH] media: i2c/adp1653: set enable gpio to output Uwe Kleine-König
2015-06-12 21:13 ` Sakari Ailus
2015-06-16 10:16 ` Pavel Machek

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.