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]
Message-ID: <20110418071716.GA334@kurt.e-circ.dyndns.org>
Date:	Mon, 18 Apr 2011 09:17:16 +0200
From:	Kurt Van Dijck <kurt.van.dijck@....be>
To:	Kyungmin Park <kmpark@...radead.org>
Cc:	Linus Walleij <linus.walleij@...ricsson.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Linus Walleij <linus.walleij@...aro.org>,
	Lee Jones <lee.jones@...aro.org>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/2] gpio: add pin biasing and drive mode to gpiolib

Hi,

The interface proposed here is a lot better than most ad hoc implementation.
But similar to what Kyungmin Park noticed, I doubt the usefulness
of a limited enumeration for all different types.

On one hand, upper layers benefit from a limited list (like proposed).
On the other hand, most SoC's have more options, which are not comparable.

How will this interface cope with such differences?
a) ignore SoC specifics
b) export it through an _unlimited_ enumeration
c) export it via some GPIO_DRIVE_PROPRIETARY+X where X is very
   SoC dependant.

Any suggestions?

Kurt

On Mon, Apr 18, 2011 at 09:09:28AM +0900, Kyungmin Park wrote:
> Hi Linus,
> 
> It's really required feature for ARM architectures.
> In case of samsung SoCs. it needs more things you described.
> In case of setting the drive, we can set the drive strength, 1x, 2x, 3x, and 4x.
> So can it add the more like this? or separate enumeration?
> 
> > +enum gpio_drive {
> > +       GPIO_DRIVE_PUSH_PULL,
> > +       GPIO_DRIVE_OPEN_DRAIN,
> > +       GPIO_DRIVE_OPEN_SOURCE,
>             GPIO_DRIVE_STRENGTH_1X,
>             GPIO_DRIVE_STRENGTH_2X,
>             GPIO_DRIVE_STRENGTH_3X,
>             GPIO_DRIVE_STRENGTH_4X,
> > +};
> 
> or
> 
> enum gpio_drive_strength {
>             GPIO_DRIVE_STRENGTH_1X,
>             GPIO_DRIVE_STRENGTH_2X,
>             GPIO_DRIVE_STRENGTH_3X,
>             GPIO_DRIVE_STRENGTH_4X,
> };
> 
> Thank you,
> Kyungmin Park
> 
> On Mon, Apr 18, 2011 at 6:37 AM, Linus Walleij
> <linus.walleij@...ricsson.com> wrote:
> > From: Linus Walleij <linus.walleij@...aro.org>
> >
> > This adds two functions for struct gpio_chip chips to provide pin
> > bias and drive mode settings for individual pins. Implementers does
> > this a bit differently and usually there are a few possible modes you
> > can select, I'm providing a few common modes for biasing and driving
> > pins.
> >
> > Since we have no previous hacked-up arch-specific drivers for this
> > we can avoid any __override_functions and we just allow this to be
> > properly implemented using gpiolib. Further the function is made
> > non-mandatory, if it is not defined for the chip it will be silently
> > ignored.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
[...]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ