Message ID | 1434095248-31057-1-git-send-email-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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>
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;
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;
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(-)