public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sylvain Lemieux <slemieux.tyco@gmail.com>
To: Axel Haslam <ahaslam@baylibre.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	gnurou@gmail.com, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org, yamada.masahiro@socionext.com,
	Kevin Hilman <khilman@baylibre.com>,
	Vladimir Zapolskiy <vz@mleia.com>
Subject: Re: gpiolib-of: Cannot request gpio with multiple chips
Date: Fri, 21 Oct 2016 08:36:40 -0400	[thread overview]
Message-ID: <1477053400.22861.3.camel@localhost> (raw)
In-Reply-To: <CAKXjFTNbWRcNfCZdCPq6e8GVDoe-5ipdtDGC8XsiX-J=yJPK8A@mail.gmail.com>

Hi Alex,


On Thu, 2016-10-20 at 17:22 +0200, Axel Haslam wrote:
> Hi Linus,
> 
> I have recently started testing a omap-lcdk board which uses the
> davinci gpio driver,
> and im running into an issue when i try to request a gpio larger than 31, which
> i think might be a regression of gpiolib-of.
> 
> The davinci gpio driver, creates several chips, and relies in a single DT node.
> in other words, davinci gpio chips have a single DT entry were ngpio = 144
> but the driver internally creates multiple chips of ngpio = 32.
> 
> It used to be that gpiolib-of would iterate through all gpio chips
> calling xlate until
> xlate would match for the chip that can handle a particular gpio number.
> 
> Starting form a series sent on june:
> "gpio: refactor of_parse_own_gpio() and of_get_named_gpiod_flags()"
> https://lkml.org/lkml/2016/6/14/188
> 
> patches:
> 99468c1 gpio: of: factor out common code to a new helper function
> 762c2e4 gpio: of: remove of_gpiochip_and_xlate() and struct gg_data
> 1020dfd gpio: of: move chip->of_gpio_n_cells checking to of_gpiochip_add()
> be71534 gpio: of: drop needless gpio_chip look-up in of_parse_own_gpio()
> 3f9547e gpio: of: optimize "gpios" property parsing of of_parse_own_gpio()
> 
> 
> The gpiolib-of will fail at of_get_named_gpiod_flags the first time if the xlate
> function returns error. Which means that only the first gpio chip will be tried.
> For the davinci dirver,  for example, we are not able to use any gpio outside of
> the first gpio chip (32 gpios).
> 
> if you agree with the above, What is the best way to proceed ?
> - fix the davinci gpio driver to the new behavior of gpiolib-of
> - fix the gpiolib-of to loop all chips again?
> - revert the patches?
> 
Other GPIO drivers are also affected.

This was reported for the LPC32xx platform on Tuesday:
http://www.spinics.net/lists/linux-gpio/msg17283.html


> Regards
> Axel.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Sylvain

  reply	other threads:[~2016-10-21 12:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 15:22 gpiolib-of: Cannot request gpio with multiple chips Axel Haslam
2016-10-21 12:36 ` Sylvain Lemieux [this message]
2016-10-24  0:37 ` Linus Walleij

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=1477053400.22861.3.camel@localhost \
    --to=slemieux.tyco@gmail.com \
    --cc=ahaslam@baylibre.com \
    --cc=gnurou@gmail.com \
    --cc=khilman@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vz@mleia.com \
    --cc=yamada.masahiro@socionext.com \
    /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