login
Header Space

 
 

Re: [PATCH 1/1] [GPIO]: new arch-independent simple-gpio driver

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bryan Wu <cooloney@...>, Mike Frysinger <vapier.adi@...>
Cc: <dbrownell@...>, <linux-kernel@...>
Date: Thursday, March 27, 2008 - 1:52 am

Hi,

On Wed, 2008-03-26 at 18:05 -0700, Bryan Wu wrote:

Considered putting this in drivers/gpio?  Not a real problem, up to you
(or David).


Userspace notification of a GPIO IRQ?  Not too 'simple' but very
worthwhile.

If you're feeling keen (and it doesn't violate the 'simple' in the name)
then I think it would be well worth being able to attach a string to
each gpio entry in the platform_data and make them available through
sysfs.  Very few userspace users will know what gpio_id they actually
want unless they can see a "PortA-05" tag attached to it somewhere.

This is extra-especially true for dynamically allocated gpio ids
(through gpiolib).


This don't sit right with me; I reckon an IORESOURCE_GPIO may not be a
bad move but that's for a different patch.  In the mean time getting the
user to fill out some platform_data would be preferable IMO.


Hmm, a bit of a cleanup regarding messaging is needed IMO.

Should your pr_*init macros be accepted somewhere higher up the tree?
Either that or dropped, it doesn't seem right wedging them in here.
Sure it might cost you a few hundred bytes of RAM but would be nice to
keep it all consistent across the kernel.


Hmm, coding style question marks around a 2- or even 3-entry switch
statement...


Was it a conscious thing to only allow 1 range of gpios per device?  I
can imagine that it's quite likely that people are going to want to
expose all unused gpios on a SoC to userspace.  This is going to mean
lots of small ranges split either side of pre-reserved pins and one
device per little range is gonna get cumbersome.



Why this ugliness, can't you just allocate the gpio_data separately?


Making assumptions about the format of a dev_t is Bad.  Sure it's a bit
of a pain constructing the correct node with MKDEV/MAJOR macros but it's
the way to do it (rather than '+').


same dev_t assumptions as above

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/1] [GPIO]: new arch-independent simple-gpio dri..., Ben Nizette, (Thu Mar 27, 1:52 am)
speck-geostationary