linux_dsm_epyc7002/drivers/i2c/chips
David Brownell d8f388d8dc gpio: sysfs interface
This adds a simple sysfs interface for GPIOs.

    /sys/class/gpio
    	/export ... asks the kernel to export a GPIO to userspace
    	/unexport ... to return a GPIO to the kernel
        /gpioN ... for each exported GPIO #N
	    /value ... always readable, writes fail for input GPIOs
	    /direction ... r/w as: in, out (default low); write high, low
	/gpiochipN ... for each gpiochip; #N is its first GPIO
	    /base ... (r/o) same as N
	    /label ... (r/o) descriptive, not necessarily unique
	    /ngpio ... (r/o) number of GPIOs; numbered N .. N+(ngpio - 1)

GPIOs claimed by kernel code may be exported by its owner using a new
gpio_export() call, which should be most useful for driver debugging.
Such exports may optionally be done without a "direction" attribute.

Userspace may ask to take over a GPIO by writing to a sysfs control file,
helping to cope with incomplete board support or other "one-off"
requirements that don't merit full kernel support:

  echo 23 > /sys/class/gpio/export
	... will gpio_request(23, "sysfs") and gpio_export(23);
	use /sys/class/gpio/gpio-23/direction to (re)configure it,
	when that GPIO can be used as both input and output.
  echo 23 > /sys/class/gpio/unexport
	... will gpio_free(23), when it was exported as above

The extra D-space footprint is a few hundred bytes, except for the sysfs
resources associated with each exported GPIO.  The additional I-space
footprint is about two thirds of the current size of gpiolib (!).  Since
no /dev node creation is involved, no "udev" support is needed.

Related changes:

  * This adds a device pointer to "struct gpio_chip".  When GPIO
    providers initialize that, sysfs gpio class devices become children of
    that device instead of being "virtual" devices.

  * The (few) gpio_chip providers which have such a device node have
    been updated.

  * Some gpio_chip drivers also needed to update their module "owner"
    field ...  for which missing kerneldoc was added.

  * Some gpio_chips don't support input GPIOs.  Those GPIOs are now
    flagged appropriately when the chip is registered.

Based on previous patches, and discussion both on and off LKML.

A Documentation/ABI/testing/sysfs-gpio update is ready to submit once this
merges to mainline.

[akpm@linux-foundation.org: a few maintenance build fixes]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-25 10:53:30 -07:00
..
at24.c i2c: New-style EEPROM driver using device IDs 2008-07-14 22:38:35 +02:00
ds1682.c i2c: Convert most new-style drivers to use module aliasing 2008-04-29 23:11:40 +02:00
eeprom.c i2c: Convert the eeprom driver to a new-style i2c driver 2008-07-16 19:30:05 +02:00
isp1301_omap.c ARM: OMAP: USB: Change omap USB code to use omap_read/write instead of __REG 2008-07-03 12:24:43 +03:00
Kconfig i2c: New-style EEPROM driver using device IDs 2008-07-14 22:38:35 +02:00
Makefile i2c: New-style EEPROM driver using device IDs 2008-07-14 22:38:35 +02:00
max6875.c i2c: Convert the max6875 driver to a new-style i2c driver 2008-07-16 19:30:07 +02:00
menelaus.c i2c: Convert most new-style drivers to use module aliasing 2008-04-29 23:11:40 +02:00
pca9539.c i2c: Convert the pca9539 driver to a new-style i2c driver 2008-07-16 19:30:07 +02:00
pcf8574.c i2c: Convert the pcf8574 driver to a new-style i2c driver 2008-07-16 19:30:06 +02:00
pcf8575.c i2c: Convert the pcf8575 driver to a new-style i2c driver 2008-07-16 19:30:06 +02:00
pcf8591.c i2c: Convert the pcf8591 driver to a new-style i2c driver 2008-07-16 19:30:06 +02:00
tps65010.c gpio: sysfs interface 2008-07-25 10:53:30 -07:00
tsl2550.c i2c: Convert most new-style drivers to use module aliasing 2008-04-29 23:11:40 +02:00