* [PATCH] iio: improve usage of gpiod API
@ 2015-02-17 9:21 Uwe Kleine-König
2015-02-17 10:05 ` Linus Walleij
2015-02-18 1:08 ` Alexandre Courbot
0 siblings, 2 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2015-02-17 9:21 UTC (permalink / raw)
To: Jonathan Cameron, linux-iio
Cc: kernel, Alexandre Courbot, Mark Brown, Linus Walleij
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for
outputs.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/accel/bmc150-accel.c | 6 +-----
drivers/iio/accel/kxcjk-1013.c | 6 +-----
drivers/iio/gyro/bmg160.c | 6 +-----
3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c
index 066d0c04072c..9f208755eb66 100644
--- a/drivers/iio/accel/bmc150-accel.c
+++ b/drivers/iio/accel/bmc150-accel.c
@@ -1176,16 +1176,12 @@ static int bmc150_accel_gpio_probe(struct i2c_client *client,
dev = &client->dev;
/* data ready gpio interrupt pin */
- gpio = devm_gpiod_get_index(dev, BMC150_ACCEL_GPIO_NAME, 0);
+ gpio = devm_gpiod_get_index(dev, BMC150_ACCEL_GPIO_NAME, 0, GPIOD_IN);
if (IS_ERR(gpio)) {
dev_err(dev, "Failed: gpio get index\n");
return PTR_ERR(gpio);
}
- ret = gpiod_direction_input(gpio);
- if (ret)
- return ret;
-
ret = gpiod_to_irq(gpio);
dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index da2fe93739a2..d0a140fd7a9e 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -1155,16 +1155,12 @@ static int kxcjk1013_gpio_probe(struct i2c_client *client,
dev = &client->dev;
/* data ready gpio interrupt pin */
- gpio = devm_gpiod_get_index(dev, "kxcjk1013_int", 0);
+ gpio = devm_gpiod_get_index(dev, "kxcjk1013_int", 0, GPIOD_IN);
if (IS_ERR(gpio)) {
dev_err(dev, "acpi gpio get index failed\n");
return PTR_ERR(gpio);
}
- ret = gpiod_direction_input(gpio);
- if (ret)
- return ret;
-
ret = gpiod_to_irq(gpio);
dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c
index 60451b328242..56d68e1d0987 100644
--- a/drivers/iio/gyro/bmg160.c
+++ b/drivers/iio/gyro/bmg160.c
@@ -1001,16 +1001,12 @@ static int bmg160_gpio_probe(struct i2c_client *client,
dev = &client->dev;
/* data ready gpio interrupt pin */
- gpio = devm_gpiod_get_index(dev, BMG160_GPIO_NAME, 0);
+ gpio = devm_gpiod_get_index(dev, BMG160_GPIO_NAME, 0, GPIOD_IN);
if (IS_ERR(gpio)) {
dev_err(dev, "acpi gpio get index failed\n");
return PTR_ERR(gpio);
}
- ret = gpiod_direction_input(gpio);
- if (ret)
- return ret;
-
ret = gpiod_to_irq(gpio);
dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-17 9:21 [PATCH] iio: improve usage of gpiod API Uwe Kleine-König
@ 2015-02-17 10:05 ` Linus Walleij
2015-02-18 1:08 ` Alexandre Courbot
1 sibling, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2015-02-17 10:05 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Jonathan Cameron, linux-iio@vger.kernel.org, Sascha Hauer,
Alexandre Courbot, Mark Brown
On Tue, Feb 17, 2015 at 10:21 AM, Uwe Kleine-K=C3=B6nig
<u.kleine-koenig@pengutronix.de> wrote:
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
> which appeared in v3.17-rc1, the gpiod_get* functions take an additional
> parameter that allows to specify direction and initial value for
> outputs.
>
> Signed-off-by: Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-17 9:21 [PATCH] iio: improve usage of gpiod API Uwe Kleine-König
2015-02-17 10:05 ` Linus Walleij
@ 2015-02-18 1:08 ` Alexandre Courbot
2015-02-18 7:15 ` Uwe Kleine-König
2015-02-22 9:51 ` Jonathan Cameron
1 sibling, 2 replies; 10+ messages in thread
From: Alexandre Courbot @ 2015-02-18 1:08 UTC (permalink / raw)
To: Uwe Kleine-König, Jonathan Cameron, linux-iio
Cc: kernel, Mark Brown, Linus Walleij
On 02/17/2015 06:21 PM, Uwe Kleine-K=C3=B6nig wrote:
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)=
> which appeared in v3.17-rc1, the gpiod_get* functions take an additiona=
l
> parameter that allows to specify direction and initial value for
> outputs.
>
> Signed-off-by: Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.de>
Nice, thanks for taking the time to do this!
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
-------------------------------------------------------------------------=
----------
This email message is for the sole use of the intended recipient(s) and m=
ay contain
confidential information. Any unauthorized review, use, disclosure or di=
stribution
is prohibited. If you are not the intended recipient, please contact the=
=20sender by
reply email and destroy all copies of the original message.
-------------------------------------------------------------------------=
----------
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-18 1:08 ` Alexandre Courbot
@ 2015-02-18 7:15 ` Uwe Kleine-König
2015-02-18 7:22 ` Alexandre Courbot
2015-02-18 9:39 ` Linus Walleij
2015-02-22 9:51 ` Jonathan Cameron
1 sibling, 2 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2015-02-18 7:15 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Jonathan Cameron, linux-iio, Linus Walleij, kernel, Mark Brown
On Wed, Feb 18, 2015 at 10:08:42AM +0900, Alexandre Courbot wrote:
> On 02/17/2015 06:21 PM, Uwe Kleine-König wrote:
> >Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
> >which appeared in v3.17-rc1, the gpiod_get* functions take an additional
> >parameter that allows to specify direction and initial value for
> >outputs.
> >
> >Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Nice, thanks for taking the time to do this!
I have some more, just didn't come around to wrap in commits and send
out:
http://git.pengutronix.de/?p=ukl/linux.git;a=commitdiff;h=1783b17ba922f92d043bad650c0209de1c201080;hp=e36f014edff70fc02b3d3d79cead1d58f289332e
I will do one patch a day ...
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-18 7:15 ` Uwe Kleine-König
@ 2015-02-18 7:22 ` Alexandre Courbot
2015-02-18 7:25 ` Uwe Kleine-König
2015-02-18 9:39 ` Linus Walleij
1 sibling, 1 reply; 10+ messages in thread
From: Alexandre Courbot @ 2015-02-18 7:22 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Jonathan Cameron, linux-iio, Linus Walleij, kernel, Mark Brown
On 02/18/2015 04:15 PM, Uwe Kleine-König wrote:
> On Wed, Feb 18, 2015 at 10:08:42AM +0900, Alexandre Courbot wrote:
>> On 02/17/2015 06:21 PM, Uwe Kleine-König wrote:
>>> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
>>> which appeared in v3.17-rc1, the gpiod_get* functions take an additional
>>> parameter that allows to specify direction and initial value for
>>> outputs.
>>>
>>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>
>> Nice, thanks for taking the time to do this!
> I have some more, just didn't come around to wrap in commits and send
> out:
>
> http://git.pengutronix.de/?p=ukl/linux.git;a=commitdiff;h=1783b17ba922f92d043bad650c0209de1c201080;hp=e36f014edff70fc02b3d3d79cead1d58f289332e
>
> I will do one patch a day ...
That's great - do these cover all the uses of gpiod_get* that need to be
updated? If so, you could close this series with a final patch that
removes the macro definitions allowing variable arguments.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-18 7:22 ` Alexandre Courbot
@ 2015-02-18 7:25 ` Uwe Kleine-König
2015-02-18 7:28 ` Alexandre Courbot
2015-02-18 9:55 ` Daniel Baluta
0 siblings, 2 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2015-02-18 7:25 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Jonathan Cameron, linux-iio, Linus Walleij, kernel, Mark Brown
Hello Alexandre,
On Wed, Feb 18, 2015 at 04:22:06PM +0900, Alexandre Courbot wrote:
> On 02/18/2015 04:15 PM, Uwe Kleine-König wrote:
> >On Wed, Feb 18, 2015 at 10:08:42AM +0900, Alexandre Courbot wrote:
> >>On 02/17/2015 06:21 PM, Uwe Kleine-König wrote:
> >>>Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
> >>>which appeared in v3.17-rc1, the gpiod_get* functions take an additional
> >>>parameter that allows to specify direction and initial value for
> >>>outputs.
> >>>
> >>>Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >>
> >>Nice, thanks for taking the time to do this!
> >I have some more, just didn't come around to wrap in commits and send
> >out:
> >
> > http://git.pengutronix.de/?p=ukl/linux.git;a=commitdiff;h=1783b17ba922f92d043bad650c0209de1c201080;hp=e36f014edff70fc02b3d3d79cead1d58f289332e
> >
> >I will do one patch a day ...
>
> That's great - do these cover all the uses of gpiod_get* that need
> to be updated? If so, you could close this series with a final patch
> that removes the macro definitions allowing variable arguments.
That's
http://git.pengutronix.de/?p=ukl/linux.git;a=commitdiff;h=bc10c10785a883133762280f9878d89f2e14ffc6;hp=474ad70e111489255eb622947d3a0a949680ed55
:-)
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-18 7:25 ` Uwe Kleine-König
@ 2015-02-18 7:28 ` Alexandre Courbot
2015-02-18 9:55 ` Daniel Baluta
1 sibling, 0 replies; 10+ messages in thread
From: Alexandre Courbot @ 2015-02-18 7:28 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Jonathan Cameron, linux-iio, Linus Walleij, kernel, Mark Brown
On 02/18/2015 04:25 PM, Uwe Kleine-K=F6nig wrote:
> Hello Alexandre,
>
> On Wed, Feb 18, 2015 at 04:22:06PM +0900, Alexandre Courbot wrote:
>> On 02/18/2015 04:15 PM, Uwe Kleine-K=F6nig wrote:
>>> On Wed, Feb 18, 2015 at 10:08:42AM +0900, Alexandre Courbot wrote:
>>>> On 02/17/2015 06:21 PM, Uwe Kleine-K=F6nig wrote:
>>>>> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() function=
s)
>>>>> which appeared in v3.17-rc1, the gpiod_get* functions take an additio=
nal
>>>>> parameter that allows to specify direction and initial value for
>>>>> outputs.
>>>>>
>>>>> Signed-off-by: Uwe Kleine-K=F6nig <u.kleine-koenig@pengutronix.de>
>>>>
>>>> Nice, thanks for taking the time to do this!
>>> I have some more, just didn't come around to wrap in commits and send
>>> out:
>>>
>>> http://git.pengutronix.de/?p=3Dukl/linux.git;a=3Dcommitdiff;h=3D1783b1=
7ba922f92d043bad650c0209de1c201080;hp=3De36f014edff70fc02b3d3d79cead1d58f28=
9332e
>>>
>>> I will do one patch a day ...
>>
>> That's great - do these cover all the uses of gpiod_get* that need
>> to be updated? If so, you could close this series with a final patch
>> that removes the macro definitions allowing variable arguments.
> That's
> http://git.pengutronix.de/?p=3Dukl/linux.git;a=3Dcommitdiff;h=3Dbc10c1078=
5a883133762280f9878d89f2e14ffc6;hp=3D474ad70e111489255eb622947d3a0a949680ed=
55
> :-)
Joy. :)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-18 7:15 ` Uwe Kleine-König
2015-02-18 7:22 ` Alexandre Courbot
@ 2015-02-18 9:39 ` Linus Walleij
1 sibling, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2015-02-18 9:39 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Alexandre Courbot, Jonathan Cameron, linux-iio@vger.kernel.org,
Sascha Hauer, Mark Brown
On Wed, Feb 18, 2015 at 8:15 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> I have some more, just didn't come around to wrap in commits and send
> out:
>
> http://git.pengutronix.de/?p=ukl/linux.git;a=commitdiff;h=1783b17ba922f92d043bad650c0209de1c201080;hp=e36f014edff70fc02b3d3d79cead1d58f289332e
>
> I will do one patch a day ...
If this was Facebook I would click "LIKE" on this.
Keep it up Uwe!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-18 7:25 ` Uwe Kleine-König
2015-02-18 7:28 ` Alexandre Courbot
@ 2015-02-18 9:55 ` Daniel Baluta
1 sibling, 0 replies; 10+ messages in thread
From: Daniel Baluta @ 2015-02-18 9:55 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Alexandre Courbot, Jonathan Cameron, linux-iio@vger.kernel.org,
Linus Walleij, kernel, Mark Brown
On Wed, Feb 18, 2015 at 9:25 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> Hello Alexandre,
>
> On Wed, Feb 18, 2015 at 04:22:06PM +0900, Alexandre Courbot wrote:
>> On 02/18/2015 04:15 PM, Uwe Kleine-König wrote:
>> >On Wed, Feb 18, 2015 at 10:08:42AM +0900, Alexandre Courbot wrote:
>> >>On 02/17/2015 06:21 PM, Uwe Kleine-König wrote:
>> >>>Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
>> >>>which appeared in v3.17-rc1, the gpiod_get* functions take an additional
>> >>>parameter that allows to specify direction and initial value for
>> >>>outputs.
>> >>>
>> >>>Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> >>
>> >>Nice, thanks for taking the time to do this!
>> >I have some more, just didn't come around to wrap in commits and send
>> >out:
>> >
>> > http://git.pengutronix.de/?p=ukl/linux.git;a=commitdiff;h=1783b17ba922f92d043bad650c0209de1c201080;hp=e36f014edff70fc02b3d3d79cead1d58f289332e
>> >
>> >I will do one patch a day ...
>>
>> That's great - do these cover all the uses of gpiod_get* that need
>> to be updated? If so, you could close this series with a final patch
>> that removes the macro definitions allowing variable arguments.
> That's
> http://git.pengutronix.de/?p=ukl/linux.git;a=commitdiff;h=bc10c10785a883133762280f9878d89f2e14ffc6;hp=474ad70e111489255eb622947d3a0a949680ed55
Hi Uwe,
Please make sure you also fix this:
$ ack-grep devm_gpiod_get_index
imu/kmx61.c
1270: gpio = devm_gpiod_get_index(dev, KMX61_GPIO_NAME, 0);
accel/mma9551.c
421: gpio = devm_gpiod_get_index(dev, MMA9551_GPIO_NAME, i);
proximity/sx9500.c
621: gpio = devm_gpiod_get_index(dev, SX9500_GPIO_NAME, 0);
thanks,
Daniel.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] iio: improve usage of gpiod API
2015-02-18 1:08 ` Alexandre Courbot
2015-02-18 7:15 ` Uwe Kleine-König
@ 2015-02-22 9:51 ` Jonathan Cameron
1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2015-02-22 9:51 UTC (permalink / raw)
To: Alexandre Courbot, Uwe Kleine-König, linux-iio
Cc: kernel, Mark Brown, Linus Walleij
On 18/02/15 01:08, Alexandre Courbot wrote:
> On 02/17/2015 06:21 PM, Uwe Kleine-König wrote:
>> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
>> which appeared in v3.17-rc1, the gpiod_get* functions take an additional
>> parameter that allows to specify direction and initial value for
>> outputs.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Nice, thanks for taking the time to do this!
>
> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Have picked up the reviewed bys and added them to v3 (which covers a few more drivers)
on the basis it was much the same and you guys would approve ;)
Jonathan
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may contain
> confidential information. Any unauthorized review, use, disclosure or distribution
> is prohibited. If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-02-22 9:51 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-17 9:21 [PATCH] iio: improve usage of gpiod API Uwe Kleine-König
2015-02-17 10:05 ` Linus Walleij
2015-02-18 1:08 ` Alexandre Courbot
2015-02-18 7:15 ` Uwe Kleine-König
2015-02-18 7:22 ` Alexandre Courbot
2015-02-18 7:25 ` Uwe Kleine-König
2015-02-18 7:28 ` Alexandre Courbot
2015-02-18 9:55 ` Daniel Baluta
2015-02-18 9:39 ` Linus Walleij
2015-02-22 9:51 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).