lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Nov 2016 10:03:39 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Laxman Dewangan <ldewangan@...dia.com>
Cc:     Alexandre Courbot <gnurou@...il.com>,
        Arnd Bergmann <arnd@...db.de>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 1/1] gpio: lib: Add gpio_is_enabled() to get pin mode

On Fri, Nov 11, 2016 at 1:17 PM, Laxman Dewangan <ldewangan@...dia.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.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ