Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: ludovic.desroches@atmel.com (Ludovic Desroches)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] pinctrl: at91: allow disabled gpio controllers
Date: Wed, 3 Dec 2014 16:08:15 +0100	[thread overview]
Message-ID: <20141203150814.GD2714@ldesroches-Latitude-E6320> (raw)
In-Reply-To: <CACRpkdbXuXyfwAyFTHVDGa4OS88KsHXZeDDAeXf6ZJ_JQmduoQ@mail.gmail.com>

On Mon, Dec 01, 2014 at 02:56:22PM +0100, Linus Walleij wrote:
> On Fri, Nov 28, 2014 at 5:49 PM, Ludovic Desroches
> <ludovic.desroches@atmel.com> wrote:
> 
> > This patch allows to have gpio controller with status set to disabled.
> >
> > gpio_banks represents all the gpio banks available on the device whereas
> > nbanks represents the gpio banks used. Having a disabled gpio controller
> > involves that nbanks value is lower than gpio_banks and that some
> > pointers in the gpio_chips array are NULL. This patch deals with these
> > specific cases.
> >
> > Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> (...)
> >         /* We will handle a range of GPIO pins */
> > -       for (i = 0; i < info->nbanks; i++)
> > -               pinctrl_add_gpio_range(info->pctl, &gpio_chips[i]->range);
> > +       for (i = 0; i < gpio_banks; i++)
> > +               if (gpio_chips[i])
> > +                       pinctrl_add_gpio_range(info->pctl, &gpio_chips[i]->range);
> 
> I highly suspect the real solution to this problem is to get rid
> of the pinctrl_add_gpio_range() call from the driver.
> 
> Remobe these calls, and instead in at91_gpio_probe() in the same
> file, call gpiochip_add_pingroup_range() for each GPIO chip.
> 
> That way the GPIO ranges are inserted from the GPIO side instead
> of the pinctrl side, which is way better, since it is more relative,
> and make you only add ranges for the gpio chips actually there.

I had a quick look to Documentation about that stuff, I totally agree
that it is a better approach. Before going further I was wondering if it
would not cause backward compatibility issue with old dtb (it seems I'll
have to add some properties to gpio controllers).

Regards

Ludovic

  parent reply	other threads:[~2014-12-03 15:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28 16:49 [PATCH 1/2] pinctrl: at91: allow disabled gpio controllers Ludovic Desroches
2014-11-28 16:49 ` [PATCH 2/2] ARM: at91/dt: sama5d4: add pioD controller Ludovic Desroches
2014-12-01 13:56 ` [PATCH 1/2] pinctrl: at91: allow disabled gpio controllers Linus Walleij
2014-12-01 14:39   ` Ludovic Desroches
2014-12-03 15:08   ` Ludovic Desroches [this message]
2014-12-05 10:17     ` Linus Walleij
2014-12-15  9:57       ` [PATCH RFC] pinctrl: at91 Ludovic Desroches
2014-12-19 14:41         ` Nicolas Ferre
2015-01-06  9:37           ` Ludovic Desroches
2015-01-14 12:26             ` Linus Walleij
2015-01-14 15:03               ` Ludovic Desroches
2015-01-19 10:12                 ` Linus Walleij
2015-01-19 10:30                   ` Ludovic Desroches
2015-01-19 10:54                     ` Nicolas Ferre
2014-12-01 13:59 ` [PATCH 1/2] pinctrl: at91: allow disabled gpio controllers Nicolas Ferre
2014-12-02 14:50   ` Linus Walleij
2015-01-14 20:45 ` Jean-Christophe PLAGNIOL-VILLARD
2015-01-19 10:16   ` Linus Walleij
2015-01-19 10:34     ` Ludovic Desroches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141203150814.GD2714@ldesroches-Latitude-E6320 \
    --to=ludovic.desroches@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox