All of lore.kernel.org
 help / color / mirror / Atom feed
From: stigge@antcom.de (Roland Stigge)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] gpio: Device tree support for LPC32xx
Date: Tue, 03 Apr 2012 11:13:10 +0200	[thread overview]
Message-ID: <4F7ABF26.8030606@antcom.de> (raw)
In-Reply-To: <201204030829.21911.arnd@arndb.de>

Hi Arnd,

thanks for your further suggestions. I'm integrating them, comments below:

On 04/03/2012 10:29 AM, Arnd Bergmann wrote:
>> +- gpio-lines: Number of GPIOs in that subnode/GPIO group
> 
> While I suggested the gpio-lines property, I'm not sure if it's worth
> including it when you don't actually use it.

Right. I'm actually removing it now since for enabling individual GPIO 
lines selectively, it's not flexible enough, anyway: only the first n 
lines of a GPIO "group" could be chosen.

However, I will keep (and document) the possible status="disabled" 
property to disable whole GPIO groups of LPC32xx, if really necessary.

Looks like all LPC32xx variants have and will have the same GPIO layout.

To fix disruptiveness of this patch, I'll make it support both DT and 
non-DT so it doesn't depend on LPC32xx being switched together 
atomically. (Posting below).

Roland



        if (pdev->dev.of_node) {
                for_each_child_of_node(pdev->dev.of_node, node) {
                        if (of_device_is_available(node)) {
                                u32 index;
                                struct gpio_chip *chip;
                                if (of_property_read_u32(node, "reg", &index) <  0)
                                        continue;
                                if (index >= ARRAY_SIZE(lpc32xx_gpiochip))
                                        continue;
                                chip = &lpc32xx_gpiochip[index].chip;
                                chip->of_node = of_node_get(node);
                                gpiochip_add(chip);
                        }
                }
        } else {
                for (i = 0; i < ARRAY_SIZE(lpc32xx_gpiochip); i++)
                	gpiochip_add(&lpc32xx_gpiochip[i].chip);
        }

WARNING: multiple messages have this Message-ID (diff)
From: Roland Stigge <stigge@antcom.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: arm@kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca,
	linus.walleij@stericsson.com,
	Srinivas Bakki <srinivas.bakki@nxp.com>,
	Kevin Wells <kevin.wells@nxp.com>
Subject: Re: [PATCH] gpio: Device tree support for LPC32xx
Date: Tue, 03 Apr 2012 11:13:10 +0200	[thread overview]
Message-ID: <4F7ABF26.8030606@antcom.de> (raw)
In-Reply-To: <201204030829.21911.arnd@arndb.de>

Hi Arnd,

thanks for your further suggestions. I'm integrating them, comments below:

On 04/03/2012 10:29 AM, Arnd Bergmann wrote:
>> +- gpio-lines: Number of GPIOs in that subnode/GPIO group
> 
> While I suggested the gpio-lines property, I'm not sure if it's worth
> including it when you don't actually use it.

Right. I'm actually removing it now since for enabling individual GPIO 
lines selectively, it's not flexible enough, anyway: only the first n 
lines of a GPIO "group" could be chosen.

However, I will keep (and document) the possible status="disabled" 
property to disable whole GPIO groups of LPC32xx, if really necessary.

Looks like all LPC32xx variants have and will have the same GPIO layout.

To fix disruptiveness of this patch, I'll make it support both DT and 
non-DT so it doesn't depend on LPC32xx being switched together 
atomically. (Posting below).

Roland



        if (pdev->dev.of_node) {
                for_each_child_of_node(pdev->dev.of_node, node) {
                        if (of_device_is_available(node)) {
                                u32 index;
                                struct gpio_chip *chip;
                                if (of_property_read_u32(node, "reg", &index) <  0)
                                        continue;
                                if (index >= ARRAY_SIZE(lpc32xx_gpiochip))
                                        continue;
                                chip = &lpc32xx_gpiochip[index].chip;
                                chip->of_node = of_node_get(node);
                                gpiochip_add(chip);
                        }
                }
        } else {
                for (i = 0; i < ARRAY_SIZE(lpc32xx_gpiochip); i++)
                	gpiochip_add(&lpc32xx_gpiochip[i].chip);
        }

  reply	other threads:[~2012-04-03  9:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 22:58 [PATCH] gpio: Device tree support for LPC32xx Roland Stigge
2012-04-02 22:58 ` Roland Stigge
2012-04-03  8:29 ` Arnd Bergmann
2012-04-03  8:29   ` Arnd Bergmann
2012-04-03  9:13   ` Roland Stigge [this message]
2012-04-03  9:13     ` Roland Stigge
2012-04-03 15:04 ` Grant Likely
2012-04-03 15:04   ` Grant Likely
2012-04-03 23:39   ` Roland Stigge
2012-04-03 23:39     ` Roland Stigge
2012-04-03 23:52     ` Roland Stigge
2012-04-03 23:52       ` Roland Stigge
2012-04-04 11:13     ` Mark Brown
2012-04-04 11:13       ` Mark Brown

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=4F7ABF26.8030606@antcom.de \
    --to=stigge@antcom.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.