linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: Re: [PATCH 1/1] gpio: lib: Add gpio_is_enabled() to get pin mode
Date: Tue, 15 Nov 2016 17:06:48 +0530	[thread overview]
Message-ID: <582AF350.1000007@nvidia.com> (raw)
In-Reply-To: <CACRpkdacDcy_Y_5g8739DF+f3fRzzMQ_bkM1TQ+uTtPq1=VmFg@mail.gmail.com>


On Tuesday 15 November 2016 02:33 PM, Linus Walleij wrote:
> On Fri, Nov 11, 2016 at 1:17 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>
>>> Yeah but since pinctrl and pinmux has its own debugfs files why is this
>>> necessary? I understand it is convenient but only for debugging
>>> right? They the inconvenience of using pinctrls debugfs files should
>>> be bearable.
>> Yes, it is debugging and capturing all the info at single place. Currently,
>> gpio debugFs shows the gpio related stuff and the pinctrl on pinconfig but
>> there is not any dump which shows the complete pin mapping.
>> The effort is to compile all the data in single place with proper message to
>> avoid any manual work for decoding multiple outputs.
> I don't know if this is a good idea. I don't want to clutter the
> gpiolib ABI for no good reason.
>
> For certain this should only be available for drivers using pin
> control as a back-end for their GPIOs.
>
> For that purpose we have (in <linux/pinctrl/consumer.h>:
>
> /* External interface to pin control */
> extern int pinctrl_request_gpio(unsigned gpio);
> extern void pinctrl_free_gpio(unsigned gpio);
> extern int pinctrl_gpio_direction_input(unsigned gpio);
> extern int pinctrl_gpio_direction_output(unsigned gpio);
>
> It would be more natural to add a function pinctrl_is_gpio(unsigned gpio)
> to call back to the pin controller, then that can be called from
> the generic or driver-specific debug print callback.

We have two type of IPs, GPIO mode is configured in the register which 
is part of GPIO controller and in other IP, it is configured in register 
which is in pincontroller registers.

Your suggested API pinctrl_is_gpio() will definitely help on second case 
and I will work on this once we will have the new IP driver in mainline. 
This will be in coming T186 patches.


For T210 SoC, the configuration is done in gpio controller and we need 
to have debug utility outside of driver and hence the requirements was.

  reply	other threads:[~2016-11-15 11:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 12:17 [PATCH 1/1] gpio: lib: Add gpio_is_enabled() to get pin mode Laxman Dewangan
2016-11-04 22:20 ` Linus Walleij
2016-11-11 12:17   ` Laxman Dewangan
2016-11-15  9:03     ` Linus Walleij
2016-11-15 11:36       ` Laxman Dewangan [this message]
2016-11-16 19:41         ` 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=582AF350.1000007@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=arnd@arndb.de \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).