Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1607674 > unrolled thread

[RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT

Started byNeil Armstrong <narmstrong@baylibre.com>
First post2017-03-23 17:30 +0100
Last post2017-03-28 11:50 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Neil Armstrong <narmstrong@baylibre.com> - 2017-03-23 17:30 +0100
    Re: [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Martin Blumenstingl <martin.blumenstingl@googlemail.com> - 2017-03-23 21:20 +0100
      Re: [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Neil Armstrong <narmstrong@baylibre.com> - 2017-03-24 18:00 +0100
    Re: [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Neil Armstrong <narmstrong@baylibre.com> - 2017-03-28 11:40 +0200
      Re: [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Kevin Hilman <khilman@baylibre.com> - 2017-03-28 17:10 +0200
    Re: [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Linus Walleij <linus.walleij@linaro.org> - 2017-03-28 11:50 +0200
    Re: [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Linus Walleij <linus.walleij@linaro.org> - 2017-03-28 11:50 +0200

#1607674 — [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT

FromNeil Armstrong <narmstrong@baylibre.com>
Date2017-03-23 17:30 +0100
Subject[RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT
Message-ID<todMB-4Je-1@gated-at.bofh.it>
When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
is needed when gpiochip_add_data() is called but in the current implementation
the ranges are added from the driver afterwards.

A simple solution is to rely on the DR gpio-ranges attribute and remove the
call to gpiochip_add_pin_range().

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/pinctrl/meson/pinctrl-meson.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index cf1686e..66ed70c 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -555,22 +555,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
 	if (ret) {
 		dev_err(pc->dev, "can't add gpio chip %s\n",
 			pc->data->name);
-		goto fail;
-	}
-
-	ret = gpiochip_add_pin_range(&pc->chip, dev_name(pc->dev),
-				     0, pc->data->pin_base,
-				     pc->chip.ngpio);
-	if (ret) {
-		dev_err(pc->dev, "can't add pin range\n");
-		goto fail;
+		return ret;
 	}
 
 	return 0;
-fail:
-	gpiochip_remove(&pc->chip);
-
-	return ret;
 }
 
 static struct regmap_config meson_regmap_config = {
-- 
1.9.1

[toc] | [next] | [standalone]


#1607870

FromMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Date2017-03-23 21:20 +0100
Message-ID<tohnc-7os-13@gated-at.bofh.it>
In reply to#1607674
Hi Neil,

On Thu, Mar 23, 2017 at 5:27 PM, Neil Armstrong <narmstrong@baylibre.com> wrote:
> When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
> is needed when gpiochip_add_data() is called but in the current implementation
> the ranges are added from the driver afterwards.
>
> A simple solution is to rely on the DR gpio-ranges attribute and remove the
> call to gpiochip_add_pin_range().
did you mean devicetree or DT instead of "DR"?


Regards,
Martin

[toc] | [prev] | [next] | [standalone]


#1608683

FromNeil Armstrong <narmstrong@baylibre.com>
Date2017-03-24 18:00 +0100
Message-ID<toAJc-4pW-25@gated-at.bofh.it>
In reply to#1607870
On 03/23/2017 09:09 PM, Martin Blumenstingl wrote:
> Hi Neil,
> 
> On Thu, Mar 23, 2017 at 5:27 PM, Neil Armstrong <narmstrong@baylibre.com> wrote:
>> When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
>> is needed when gpiochip_add_data() is called but in the current implementation
>> the ranges are added from the driver afterwards.
>>
>> A simple solution is to rely on the DR gpio-ranges attribute and remove the
>> call to gpiochip_add_pin_range().
> did you mean devicetree or DT instead of "DR"?
> 
> 
> Regards,
> Martin
> 

Indeed, sorry for the typo.

Neil

[toc] | [prev] | [next] | [standalone]


#1610482

FromNeil Armstrong <narmstrong@baylibre.com>
Date2017-03-28 11:40 +0200
Message-ID<tpVLz-5we-3@gated-at.bofh.it>
In reply to#1607674
On 03/28/2017 11:30 AM, Linus Walleij wrote:
> On Thu, Mar 23, 2017 at 5:27 PM, Neil Armstrong <narmstrong@baylibre.com> wrote:
> 
> '> When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
>> is needed when gpiochip_add_data() is called but in the current implementation
>> the ranges are added from the driver afterwards.
>>
>> A simple solution is to rely on the DR gpio-ranges attribute and remove the
>> call to gpiochip_add_pin_range().
>>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> 
> This is fine once the ranges have been applied to the device trees I guess.
> 
> Tell me when you want me to merge this.
> 
> Yours,
> Linus Walleij
> 

Hi Linus,

Kevin should merge the DT patches since they have now Tested and Reviewed by's, so you can merge it now if you can.
Since it will live in you pinctrl tree, it will only impact linux-next until Kevin merges them.

Thanks,
Neil

[toc] | [prev] | [next] | [standalone]


#1611064

FromKevin Hilman <khilman@baylibre.com>
Date2017-03-28 17:10 +0200
Message-ID<tq0UW-12M-29@gated-at.bofh.it>
In reply to#1610482
Neil Armstrong <narmstrong@baylibre.com> writes:

> On 03/28/2017 11:30 AM, Linus Walleij wrote:
>> On Thu, Mar 23, 2017 at 5:27 PM, Neil Armstrong <narmstrong@baylibre.com> wrote:
>> 
>> '> When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
>>> is needed when gpiochip_add_data() is called but in the current implementation
>>> the ranges are added from the driver afterwards.
>>>
>>> A simple solution is to rely on the DR gpio-ranges attribute and remove the
>>> call to gpiochip_add_pin_range().
>>>
>>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> 
>> This is fine once the ranges have been applied to the device trees I guess.
>> 
>> Tell me when you want me to merge this.
>> 
>> Yours,
>> Linus Walleij
>> 
>
> Hi Linus,
>
> Kevin should merge the DT patches since they have now Tested and Reviewed by's, so you can merge it now if you can.
> Since it will live in you pinctrl tree, it will only impact linux-next until Kevin merges them.

I've applied the DT patches now (branch: v4.12/dt64)

Kevin

[toc] | [prev] | [next] | [standalone]


#1610497

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-03-28 11:50 +0200
Message-ID<tpVLz-5we-5@gated-at.bofh.it>
In reply to#1607674
On Thu, Mar 23, 2017 at 5:27 PM, Neil Armstrong <narmstrong@baylibre.com> wrote:

'> When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
> is needed when gpiochip_add_data() is called but in the current implementation
> the ranges are added from the driver afterwards.
>
> A simple solution is to rely on the DR gpio-ranges attribute and remove the
> call to gpiochip_add_pin_range().
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

This is fine once the ranges have been applied to the device trees I guess.

Tell me when you want me to merge this.

Yours,
Linus Walleij

[toc] | [prev] | [next] | [standalone]


#1610500

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-03-28 11:50 +0200
Message-ID<tpVVh-5DA-29@gated-at.bofh.it>
In reply to#1607674
On Thu, Mar 23, 2017 at 5:27 PM, Neil Armstrong <narmstrong@baylibre.com> wrote:

> When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
> is needed when gpiochip_add_data() is called but in the current implementation
> the ranges are added from the driver afterwards.
>
> A simple solution is to rely on the DR gpio-ranges attribute and remove the
> call to gpiochip_add_pin_range().
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

Patch applied.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web