lkml.org 
[lkml]   [2011]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@stericsson.com> wrote:
> > From: Linus Walleij <linus.walleij@linaro.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@linaro.org>
[...]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-04-18 09:19    [W:0.248 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site