2014-07-06 17:46:23

by Himangi Saraogi

[permalink] [raw]
Subject: [PATCH 0/5] Introduce a managed function for gpio_request_array

This patchset intoduces a new managed interface devm_gpio_request_array,
adds it in the documentation and its declaration in the gpio.h include
file. Some cases of gpio_request_array are changed to
devm_gpio_request_array.

Himangi Saraogi (5):
gpiolib: devres: Introduce the function devm_request_gpio_array
ASoC: wm1250-ev1: Use devm_gpio_request_array
ASoC: pxa: Use devm_gpio_request_array
ASoC: pxa: e800_wm9712: Introduce the use of devm_gpio_request_array
ASoC: pxa/hx4700: Introduce the use of devm_gpio_request_array

Documentation/driver-model/devres.txt | 1 +
drivers/gpio/devres.c | 21 +++++++++++++++++++++
include/linux/gpio.h | 2 ++
sound/soc/codecs/wm1250-ev1.c | 24 +++++-------------------
sound/soc/pxa/e740_wm9705.c | 9 +++------
sound/soc/pxa/e800_wm9712.c | 9 +++------
sound/soc/pxa/hx4700.c | 12 +++---------
7 files changed, 38 insertions(+), 40 deletions(-)

--
1.9.1


2014-07-06 17:47:58

by Himangi Saraogi

[permalink] [raw]
Subject: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array

This patch introduces the function devm_request_gpio_array that
allocates multiple GPIOs in a single call in a managed manner. The
function is also included in the documentation and a declaration is
added in include/linux/gpio.h.

Signed-off-by: Himangi Saraogi <[email protected]>
---
Documentation/driver-model/devres.txt | 1 +
drivers/gpio/devres.c | 21 +++++++++++++++++++++
include/linux/gpio.h | 2 ++
3 files changed, 24 insertions(+)

diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 9e2098e..756f6cf 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -337,6 +337,7 @@ GPIO
devm_gpiod_put()
devm_gpio_request()
devm_gpio_request_one()
+ devm_gpio_request_array()
devm_gpio_free()

SND
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index 65978cf..adae7fa 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -229,6 +229,27 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio,
EXPORT_SYMBOL(devm_gpio_request_one);

/**
+ * devm_gpio_request_array - request multiple GPIOs in a single call
+ * @dev: device to request for
+ * @array: array of the 'struct gpio'
+ * @num: how many GPIOs in the array
+ */
+int devm_gpio_request_array(struct device *dev, const struct gpio *array,
+ size_t num)
+{
+ int i, err;
+
+ for (i = 0; i < num; i++, array++) {
+ err = devm_gpio_request_one(dev, array->gpio, array->flags,
+ array->label);
+ if (err)
+ return err;
+ }
+ return 0;
+}
+EXPORT_SYMBOL_GPL(devm_gpio_request_array);
+
+/**
* devm_gpio_free - free a GPIO
* @dev: device to free GPIO for
* @gpio: GPIO to free
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 85aa5d0..c85f243 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -84,6 +84,8 @@ struct device;
int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
int devm_gpio_request_one(struct device *dev, unsigned gpio,
unsigned long flags, const char *label);
+int devm_gpio_request_array(struct device *dev, const struct gpio *array,
+ size_t num);
void devm_gpio_free(struct device *dev, unsigned int gpio);

#else /* ! CONFIG_GPIOLIB */
--
1.9.1

2014-07-06 17:48:54

by Himangi Saraogi

[permalink] [raw]
Subject: [PATCH 2/5] ASoC: wm1250-ev1: Use devm_gpio_request_array

This patch replaces a call to the unmanaged function
gpio_request_array by a call to the managed function
devm_gpio_request_array and removes the calls to gpio_free_array
in wm1250_ev1_pdata, which is called by the probe function. The
function wm1250_ev1_free is no longer needed and is removed.

Signed-off-by: Himangi Saraogi <[email protected]>
---
sound/soc/codecs/wm1250-ev1.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c
index 8011f75..44534e6 100644
--- a/sound/soc/codecs/wm1250-ev1.c
+++ b/sound/soc/codecs/wm1250-ev1.c
@@ -176,7 +176,8 @@ static int wm1250_ev1_pdata(struct i2c_client *i2c)
wm1250->gpios[WM1250_EV1_GPIO_CLK_SEL0].flags = GPIOF_OUT_INIT_HIGH;
wm1250->gpios[WM1250_EV1_GPIO_CLK_SEL1].flags = GPIOF_OUT_INIT_HIGH;

- ret = gpio_request_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios));
+ ret = devm_gpio_request_array(&i2c->dev, wm1250->gpios,
+ ARRAY_SIZE(wm1250->gpios));
if (ret != 0) {
dev_err(&i2c->dev, "Failed to get GPIOs: %d\n", ret);
goto err;
@@ -190,14 +191,6 @@ err:
return ret;
}

-static void wm1250_ev1_free(struct i2c_client *i2c)
-{
- struct wm1250_priv *wm1250 = dev_get_drvdata(&i2c->dev);
-
- if (wm1250)
- gpio_free_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios));
-}
-
static int wm1250_ev1_probe(struct i2c_client *i2c,
const struct i2c_device_id *i2c_id)
{
@@ -229,7 +222,6 @@ static int wm1250_ev1_probe(struct i2c_client *i2c,
&wm1250_ev1_dai, 1);
if (ret != 0) {
dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret);
- wm1250_ev1_free(i2c);
return ret;
}

@@ -239,7 +231,6 @@ static int wm1250_ev1_probe(struct i2c_client *i2c,
static int wm1250_ev1_remove(struct i2c_client *i2c)
{
snd_soc_unregister_codec(&i2c->dev);
- wm1250_ev1_free(i2c);

return 0;
}
--
1.9.1

2014-07-06 17:49:59

by Himangi Saraogi

[permalink] [raw]
Subject: [PATCH 3/5] ASoC: pxa: Use devm_gpio_request_array

This patch moves data allocated using gpio_request_array to the managed
interface and removes the calls to gpio_free_array in the probe and
remove functions.

Signed-off-by: Himangi Saraogi <[email protected]>
Acked-by: Julia Lawall <[email protected]>
---
sound/soc/pxa/e740_wm9705.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c
index c29feda..d462dc9 100644
--- a/sound/soc/pxa/e740_wm9705.c
+++ b/sound/soc/pxa/e740_wm9705.c
@@ -149,19 +149,17 @@ static int e740_probe(struct platform_device *pdev)
struct snd_soc_card *card = &e740;
int ret;

- ret = gpio_request_array(e740_audio_gpios,
- ARRAY_SIZE(e740_audio_gpios));
+ ret = devm_gpio_request_array(&pdev->dev, e740_audio_gpios,
+ ARRAY_SIZE(e740_audio_gpios));
if (ret)
return ret;

card->dev = &pdev->dev;

ret = snd_soc_register_card(card);
- if (ret) {
+ if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
- gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios));
- }
return ret;
}

@@ -169,7 +167,6 @@ static int e740_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);

- gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios));
snd_soc_unregister_card(card);
return 0;
}
--
1.9.1

2014-07-06 17:51:52

by Himangi Saraogi

[permalink] [raw]
Subject: [PATCH 4/5] ASoC: pxa: e800_wm9712: Introduce the use of devm_gpio_request_array

This patch moves the resources allocated using gpio_request_array to the
managed interface and removes the calls to gpio_free_array in the probe
and remove functions.

Signed-off-by: Himangi Saraogi <[email protected]>
Acked-by: Julia Lawall <[email protected]>
---
sound/soc/pxa/e800_wm9712.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c
index 24c2078..dbc3670 100644
--- a/sound/soc/pxa/e800_wm9712.c
+++ b/sound/soc/pxa/e800_wm9712.c
@@ -112,19 +112,17 @@ static int e800_probe(struct platform_device *pdev)
struct snd_soc_card *card = &e800;
int ret;

- ret = gpio_request_array(e800_audio_gpios,
- ARRAY_SIZE(e800_audio_gpios));
+ ret = devm_gpio_request_array(&pdev->dev, e800_audio_gpios,
+ ARRAY_SIZE(e800_audio_gpios));
if (ret)
return ret;

card->dev = &pdev->dev;

ret = snd_soc_register_card(card);
- if (ret) {
+ if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
- gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios));
- }
return ret;
}

@@ -132,7 +130,6 @@ static int e800_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);

- gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios));
snd_soc_unregister_card(card);
return 0;
}
--
1.9.1

2014-07-06 17:52:56

by Himangi Saraogi

[permalink] [raw]
Subject: [PATCH 5/5] ASoC: pxa/hx4700: Introduce the use of devm_gpio_request_array

This patch moves the resources allocated using gpio_request_array to the
managed interface and removes the calls to gpio_free_array in the probe
and remove functions.

Signed-off-by: Himangi Saraogi <[email protected]>
Acked-by: Julia Lawall <[email protected]>
---
sound/soc/pxa/hx4700.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c
index 05559a7..b624526 100644
--- a/sound/soc/pxa/hx4700.c
+++ b/sound/soc/pxa/hx4700.c
@@ -198,18 +198,13 @@ static int hx4700_audio_probe(struct platform_device *pdev)
if (!machine_is_h4700())
return -ENODEV;

- ret = gpio_request_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
+ ret = devm_gpio_request_array(&pdev->dev, hx4700_audio_gpios,
+ ARRAY_SIZE(hx4700_audio_gpios));
if (ret)
return ret;

snd_soc_card_hx4700.dev = &pdev->dev;
- ret = snd_soc_register_card(&snd_soc_card_hx4700);
- if (ret)
- gpio_free_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
-
- return ret;
+ return snd_soc_register_card(&snd_soc_card_hx4700);
}

static int hx4700_audio_remove(struct platform_device *pdev)
@@ -219,7 +214,6 @@ static int hx4700_audio_remove(struct platform_device *pdev)
gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);

- gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios));
return 0;
}

--
1.9.1

2014-07-09 10:14:46

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/5] Introduce a managed function for gpio_request_array

On Sun, Jul 6, 2014 at 7:46 PM, Himangi Saraogi <[email protected]> wrote:

> This patchset intoduces a new managed interface devm_gpio_request_array,
> adds it in the documentation and its declaration in the gpio.h include
> file. Some cases of gpio_request_array are changed to
> devm_gpio_request_array.
>
> Himangi Saraogi (5):
> gpiolib: devres: Introduce the function devm_request_gpio_array
> ASoC: wm1250-ev1: Use devm_gpio_request_array
> ASoC: pxa: Use devm_gpio_request_array
> ASoC: pxa: e800_wm9712: Introduce the use of devm_gpio_request_array
> ASoC: pxa/hx4700: Introduce the use of devm_gpio_request_array

Sorry, we're not encouraging extension of the old gpio* plain API anymore.

The right thing to do is convert users over to using GPIO descriptors
internally, then introduce devm_gpiod_get_array() if that makes some
sense.

Alexandre, what do you say?

Yours,
Linus Walleij

2014-07-09 11:18:50

by Rob Jones

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array

Please note that I submitted a patch on 02/07/14 to create this
function which was acked by Linus Walleij on 05/07/14.

Great minds think alike, and all that.

However, I think that the version I submitted better replicates the
original (non devm) functionality, see below.

I didn't, however, add it to the documentation. +1 on that.

On 06/07/14 18:47, Himangi Saraogi wrote:
> This patch introduces the function devm_request_gpio_array that
> allocates multiple GPIOs in a single call in a managed manner. The
> function is also included in the documentation and a declaration is
> added in include/linux/gpio.h.
>
> Signed-off-by: Himangi Saraogi <[email protected]>
> ---
> Documentation/driver-model/devres.txt | 1 +
> drivers/gpio/devres.c | 21 +++++++++++++++++++++
> include/linux/gpio.h | 2 ++
> 3 files changed, 24 insertions(+)
>
> diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
> index 9e2098e..756f6cf 100644
> --- a/Documentation/driver-model/devres.txt
> +++ b/Documentation/driver-model/devres.txt
> @@ -337,6 +337,7 @@ GPIO
> devm_gpiod_put()
> devm_gpio_request()
> devm_gpio_request_one()
> + devm_gpio_request_array()
> devm_gpio_free()
>
> SND
> diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
> index 65978cf..adae7fa 100644
> --- a/drivers/gpio/devres.c
> +++ b/drivers/gpio/devres.c
> @@ -229,6 +229,27 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio,
> EXPORT_SYMBOL(devm_gpio_request_one);
>
> /**
> + * devm_gpio_request_array - request multiple GPIOs in a single call
> + * @dev: device to request for
> + * @array: array of the 'struct gpio'
> + * @num: how many GPIOs in the array
> + */
> +int devm_gpio_request_array(struct device *dev, const struct gpio *array,
> + size_t num)
> +{
> + int i, err;
> +
> + for (i = 0; i < num; i++, array++) {
> + err = devm_gpio_request_one(dev, array->gpio, array->flags,
> + array->label);
> + if (err)
> + return err;

The failure path in the version I submitted frees up any already
allocated gpios on the first failure.

> + }
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(devm_gpio_request_array);
> +
> +/**
> * devm_gpio_free - free a GPIO
> * @dev: device to free GPIO for
> * @gpio: GPIO to free
> diff --git a/include/linux/gpio.h b/include/linux/gpio.h
> index 85aa5d0..c85f243 100644
> --- a/include/linux/gpio.h
> +++ b/include/linux/gpio.h
> @@ -84,6 +84,8 @@ struct device;
> int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
> int devm_gpio_request_one(struct device *dev, unsigned gpio,
> unsigned long flags, const char *label);
> +int devm_gpio_request_array(struct device *dev, const struct gpio *array,
> + size_t num);
> void devm_gpio_free(struct device *dev, unsigned int gpio);
>
> #else /* ! CONFIG_GPIOLIB */
>

--
Rob Jones
Codethink Ltd
mailto:[email protected]
tel:+44 161 236 5575

2014-07-09 11:53:04

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array



On Wed, 9 Jul 2014, Rob Jones wrote:

> Please note that I submitted a patch on 02/07/14 to create this
> function which was acked by Linus Walleij on 05/07/14.
>
> Great minds think alike, and all that.
>
> However, I think that the version I submitted better replicates the
> original (non devm) functionality, see below.
>
> I didn't, however, add it to the documentation. +1 on that.
>
> On 06/07/14 18:47, Himangi Saraogi wrote:
> > This patch introduces the function devm_request_gpio_array that
> > allocates multiple GPIOs in a single call in a managed manner. The
> > function is also included in the documentation and a declaration is
> > added in include/linux/gpio.h.
> >
> > Signed-off-by: Himangi Saraogi <[email protected]>
> > ---
> > Documentation/driver-model/devres.txt | 1 +
> > drivers/gpio/devres.c | 21 +++++++++++++++++++++
> > include/linux/gpio.h | 2 ++
> > 3 files changed, 24 insertions(+)
> >
> > diff --git a/Documentation/driver-model/devres.txt
> > b/Documentation/driver-model/devres.txt
> > index 9e2098e..756f6cf 100644
> > --- a/Documentation/driver-model/devres.txt
> > +++ b/Documentation/driver-model/devres.txt
> > @@ -337,6 +337,7 @@ GPIO
> > devm_gpiod_put()
> > devm_gpio_request()
> > devm_gpio_request_one()
> > + devm_gpio_request_array()
> > devm_gpio_free()
> >
> > SND
> > diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
> > index 65978cf..adae7fa 100644
> > --- a/drivers/gpio/devres.c
> > +++ b/drivers/gpio/devres.c
> > @@ -229,6 +229,27 @@ int devm_gpio_request_one(struct device *dev, unsigned
> > gpio,
> > EXPORT_SYMBOL(devm_gpio_request_one);
> >
> > /**
> > + * devm_gpio_request_array - request multiple GPIOs in a single call
> > + * @dev: device to request for
> > + * @array: array of the 'struct gpio'
> > + * @num: how many GPIOs in the array
> > + */
> > +int devm_gpio_request_array(struct device *dev, const struct gpio *array,
> > + size_t num)
> > +{
> > + int i, err;
> > +
> > + for (i = 0; i < num; i++, array++) {
> > + err = devm_gpio_request_one(dev, array->gpio, array->flags,
> > + array->label);
> > + if (err)
> > + return err;
>
> The failure path in the version I submitted frees up any already
> allocated gpios on the first failure.

Himangi first proposed doing that, but I thought it was not really in the
spirit of devm functions, which is to leave that implicit. No strong
opinion on the matter, though.

julia


>
> > + }
> > + return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(devm_gpio_request_array);
> > +
> > +/**
> > * devm_gpio_free - free a GPIO
> > * @dev: device to free GPIO for
> > * @gpio: GPIO to free
> > diff --git a/include/linux/gpio.h b/include/linux/gpio.h
> > index 85aa5d0..c85f243 100644
> > --- a/include/linux/gpio.h
> > +++ b/include/linux/gpio.h
> > @@ -84,6 +84,8 @@ struct device;
> > int devm_gpio_request(struct device *dev, unsigned gpio, const char
> > *label);
> > int devm_gpio_request_one(struct device *dev, unsigned gpio,
> > unsigned long flags, const char *label);
> > +int devm_gpio_request_array(struct device *dev, const struct gpio *array,
> > + size_t num);
> > void devm_gpio_free(struct device *dev, unsigned int gpio);
> >
> > #else /* ! CONFIG_GPIOLIB */
> >
>
> --
> Rob Jones
> Codethink Ltd
> mailto:[email protected]
> tel:+44 161 236 5575
>

2014-07-09 12:10:53

by Alexandre Courbot

[permalink] [raw]
Subject: Re: [PATCH 0/5] Introduce a managed function for gpio_request_array

On Wed, Jul 9, 2014 at 7:14 PM, Linus Walleij <[email protected]> wrote:
> On Sun, Jul 6, 2014 at 7:46 PM, Himangi Saraogi <[email protected]> wrote:
>
>> This patchset intoduces a new managed interface devm_gpio_request_array,
>> adds it in the documentation and its declaration in the gpio.h include
>> file. Some cases of gpio_request_array are changed to
>> devm_gpio_request_array.
>>
>> Himangi Saraogi (5):
>> gpiolib: devres: Introduce the function devm_request_gpio_array
>> ASoC: wm1250-ev1: Use devm_gpio_request_array
>> ASoC: pxa: Use devm_gpio_request_array
>> ASoC: pxa: e800_wm9712: Introduce the use of devm_gpio_request_array
>> ASoC: pxa/hx4700: Introduce the use of devm_gpio_request_array
>
> Sorry, we're not encouraging extension of the old gpio* plain API anymore.
>
> The right thing to do is convert users over to using GPIO descriptors
> internally, then introduce devm_gpiod_get_array() if that makes some
> sense.
>
> Alexandre, what do you say?

I do agree that we want to discourage people from using the integer
API, and would also prefer to see the consumers converted to gpiod and
proper gpiod functions introduced.

On the other hand with Rob's similar patch which seems to be about to
be merged (https://lkml.org/lkml/2014/7/2/149 ) I guess the pressure
to accept one or the other is quite high. At least, I hope Rob or
Himangi will follow-up with a patch adding similar functionality to
the gpiod API, and will consider converting their consumers to it
(it's for your own good!).

2014-07-09 12:48:44

by Rob Jones

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array



On 09/07/14 12:52, Julia Lawall wrote:
>
>
> On Wed, 9 Jul 2014, Rob Jones wrote:
>
>> Please note that I submitted a patch on 02/07/14 to create this
>> function which was acked by Linus Walleij on 05/07/14.
>>
>> Great minds think alike, and all that.
>>
>> However, I think that the version I submitted better replicates the
>> original (non devm) functionality, see below.

<snip>

>>> +int devm_gpio_request_array(struct device *dev, const struct gpio *array,
>>> + size_t num)
>>> +{
>>> + int i, err;
>>> +
>>> + for (i = 0; i < num; i++, array++) {
>>> + err = devm_gpio_request_one(dev, array->gpio, array->flags,
>>> + array->label);
>>> + if (err)
>>> + return err;
>>
>> The failure path in the version I submitted frees up any already
>> allocated gpios on the first failure.
>
> Himangi first proposed doing that, but I thought it was not really in the
> spirit of devm functions, which is to leave that implicit. No strong
> opinion on the matter, though.
>

Interestingly, we came at it from the other direction: I originally
didn't have the unwind in and our internal review guys suggested that
it was in the original function so putting it in would:

1. make this a better analogue of the original
2. help avoid deadlocks
3. allow the driver to retry, perhaps requesting reduced functionality.

> julia
>

<snip>

--
Rob Jones
Codethink Ltd
mailto:[email protected]
tel:+44 161 236 5575

2014-07-10 09:21:35

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array

On Wed, Jul 9, 2014 at 1:18 PM, Rob Jones <[email protected]> wrote:

> Please note that I submitted a patch on 02/07/14 to create this
> function which was acked by Linus Walleij on 05/07/14.
>
> Great minds think alike, and all that.

My mind certainly isn't any great :-(

My left hand seems to be unaware of what the right hand is doing.

Did I ACK that for merging through some other tree then?

And I guess if Himangi want to submit these ASoC patches, they
will have to go through the same tree as those patches in that case?

And would you consider implementing a gpiod version...?

> However, I think that the version I submitted better replicates the
> original (non devm) functionality, see below.
>
> I didn't, however, add it to the documentation. +1 on that.

Can you include that oneliner in your patch then to reduce
problems?

Yours,
Linus Walleij

2014-07-10 11:01:35

by Rob Jones

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array



On 10/07/14 10:21, Linus Walleij wrote:
> On Wed, Jul 9, 2014 at 1:18 PM, Rob Jones <[email protected]> wrote:
>
>> Please note that I submitted a patch on 02/07/14 to create this
>> function which was acked by Linus Walleij on 05/07/14.
>>
>> Great minds think alike, and all that.
>
> My mind certainly isn't any great :-(
>

I doubt that :-)

> My left hand seems to be unaware of what the right hand is doing.
>
> Did I ACK that for merging through some other tree then?
>

You did: https://lkml.org/lkml/2014/7/4/715

> And I guess if Himangi want to submit these ASoC patches, they
> will have to go through the same tree as those patches in that case?
>

I don't know enough to comment.

> And would you consider implementing a gpiod version...?
>

I will certainly consider it. I'm in the middle of something else right
now but I should be available in a day or two and I'll have a look.

>> However, I think that the version I submitted better replicates the
>> original (non devm) functionality, see below.
>>
>> I didn't, however, add it to the documentation. +1 on that.
>
> Can you include that oneliner in your patch then to reduce
> problems?
>

Certainly, with acknowledgement to Himangi Saraogi. Should I resubmit
the patch series with amendment or should I put it in as a separate
patch? Sorry for the noobie question but I *am* new to the kernel
lists.

> Yours,
> Linus Walleij
>
>

--
Rob Jones
Codethink Ltd
mailto:[email protected]
tel:+44 161 236 5575

2014-07-11 00:35:44

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array

Hello Rob,

On Thu, Jul 10, 2014 at 1:01 PM, Rob Jones <[email protected]> wrote:
>
>
> On 10/07/14 10:21, Linus Walleij wrote:
>>
>> On Wed, Jul 9, 2014 at 1:18 PM, Rob Jones <[email protected]>
>> wrote:
>>
>>> Please note that I submitted a patch on 02/07/14 to create this
>>> function which was acked by Linus Walleij on 05/07/14.
>>>
>>> Great minds think alike, and all that.
>>
>>
>> My mind certainly isn't any great :-(
>>
>
> I doubt that :-)
>
>
>> My left hand seems to be unaware of what the right hand is doing.
>>
>> Did I ACK that for merging through some other tree then?
>>
>
> You did: https://lkml.org/lkml/2014/7/4/715
>
>
>> And I guess if Himangi want to submit these ASoC patches, they
>> will have to go through the same tree as those patches in that case?
>>
>
> I don't know enough to comment.
>
>
>> And would you consider implementing a gpiod version...?
>>
>
> I will certainly consider it. I'm in the middle of something else right
> now but I should be available in a day or two and I'll have a look.
>
>

I'm working on a driver for a PMIC which uses a set of GPIO to select
a particular register. Right now I'm getting each GPIO independently
but Linus mentioned [0] the devm_gpio_request_array() patch you
posted.

Now, I'm not using the integer-based GPIO API but the new
descriptor-based one so I was wondering if you are already
implementing a devm_gpiod_get_array() or if you want me to implement
it myself.

Best regards,
Javier

[0]: https://lkml.org/lkml/2014/7/10/166

2014-07-11 10:03:15

by Rob Jones

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array



On 11/07/14 01:35, Javier Martinez Canillas wrote:
> Hello Rob,
>
> On Thu, Jul 10, 2014 at 1:01 PM, Rob Jones <[email protected]> wrote:

<snip>

>>
>> I will certainly consider it. I'm in the middle of something else right
>> now but I should be available in a day or two and I'll have a look.
>>
>>
>
> I'm working on a driver for a PMIC which uses a set of GPIO to select
> a particular register. Right now I'm getting each GPIO independently
> but Linus mentioned [0] the devm_gpio_request_array() patch you
> posted.
>
> Now, I'm not using the integer-based GPIO API but the new
> descriptor-based one so I was wondering if you are already
> implementing a devm_gpiod_get_array() or if you want me to implement
> it myself.
>

As I said, I'm deep in something else for the next day or two so if you
need it urgently you should probably do it yourself but if you don't
mind waiting until next week, I can have a go.

Your call, let me know.

> Best regards,
> Javier
>
> [0]: https://lkml.org/lkml/2014/7/10/166
> --
> To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

--
Rob Jones
Codethink Ltd
mailto:[email protected]
tel:+44 161 236 5575

2014-07-11 10:07:50

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array

Hello Rob,

On Fri, Jul 11, 2014 at 12:03 PM, Rob Jones <[email protected]> wrote:
>
>
> On 11/07/14 01:35, Javier Martinez Canillas wrote:
>>
>> Hello Rob,
>>
>> On Thu, Jul 10, 2014 at 1:01 PM, Rob Jones <[email protected]>
>> wrote:
>
>
> <snip>
>
>
>>>
>>> I will certainly consider it. I'm in the middle of something else right
>>> now but I should be available in a day or two and I'll have a look.
>>>
>>>
>>
>> I'm working on a driver for a PMIC which uses a set of GPIO to select
>> a particular register. Right now I'm getting each GPIO independently
>> but Linus mentioned [0] the devm_gpio_request_array() patch you
>> posted.
>>
>> Now, I'm not using the integer-based GPIO API but the new
>> descriptor-based one so I was wondering if you are already
>> implementing a devm_gpiod_get_array() or if you want me to implement
>> it myself.
>>
>
> As I said, I'm deep in something else for the next day or two so if you
> need it urgently you should probably do it yourself but if you don't
> mind waiting until next week, I can have a go.
>
> Your call, let me know.
>

I'm not in a hurry, just wanted to know if it was on your plate. I'll
wait for your patch then, thanks!

Best regards,
Javier