2008-02-04 22:28:17 -08:00
|
|
|
|
2011-05-20 00:40:19 -06:00
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
|
|
|
|
|
2012-04-15 10:52:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-25 01:46:11 -07:00
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
2008-07-25 01:46:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-25 01:46:11 -07:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
2008-07-25 01:46:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-20 00:40:19 -06:00
|
|
|
|
2008-07-25 01:46:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
2013-10-20 15:14:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-07 14:31:33 -06:00
|
|
|
|
|
|
|
|
|
2012-11-06 15:33:33 -08:00
|
|
|
|
2012-04-07 14:31:33 -06:00
|
|
|
|
2012-11-30 12:37:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-25 10:40:18 +01:00
|
|
|
|
2014-05-29 16:52:46 +02:00
|
|
|
|
2014-03-25 10:40:18 +01:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-26 11:12:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 01:46:07 -07:00
|
|
|
|
|
|
|
|
|
2013-01-16 18:53:32 -08:00
|
|
|
|
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 01:46:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-04 18:38:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-20 00:40:19 -06:00
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
2010-03-05 13:44:33 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
2008-11-12 13:25:38 -08:00
|
|
|
|
2014-10-03 11:31:57 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-19 11:07:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 14:36:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-28 19:14:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-31 18:17:43 -07:00
|
|
|
|
2015-05-28 19:14:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-09 20:05:56 +04:00
|
|
|
|
2013-04-26 19:47:28 +04:00
|
|
|
|
2013-12-24 18:08:54 +04:00
|
|
|
|
2013-04-26 19:47:28 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-09 20:05:56 +04:00
|
|
|
|
2013-11-21 17:34:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-25 17:01:01 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-17 15:22:23 +09:00
|
|
|
|
|
|
|
|
|
2013-09-02 16:44:55 +01:00
|
|
|
|
2012-05-17 15:22:23 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-01 10:09:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-08 14:35:33 -07:00
|
|
|
|
2011-06-01 10:09:19 -07:00
|
|
|
|
2015-06-06 22:30:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-31 14:48:57 +02:00
|
|
|
|
2015-06-06 22:30:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-02 23:11:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-19 18:35:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-24 20:54:58 +01:00
|
|
|
|
2012-05-11 18:48:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-29 12:11:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-01 17:39:34 +05:30
|
|
|
|
2013-11-29 12:11:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-06 11:54:19 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-21 12:49:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-19 22:52:58 +02:00
|
|
|
|
|
|
|
|
|
2012-11-17 17:00:43 +01:00
|
|
|
|
2012-12-19 12:31:11 +01:00
|
|
|
|
2012-09-19 22:52:58 +02:00
|
|
|
|
|
|
|
|
|
2011-06-06 00:07:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-04 18:38:28 -06:00
|
|
|
|
2011-06-07 16:25:37 +08:00
|
|
|
|
2011-06-04 18:38:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-06 22:31:29 +08:00
|
|
|
|
2011-06-07 22:00:54 +08:00
|
|
|
|
2011-06-06 00:07:54 +08:00
|
|
|
|
2013-07-29 14:29:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-06 16:58:15 +02:00
|
|
|
|
2015-04-23 16:56:22 -07:00
|
|
|
|
2014-04-06 16:58:15 +02:00
|
|
|
|
2014-04-28 11:07:03 +02:00
|
|
|
|
|
|
|
|
|
2014-04-06 16:58:16 +02:00
|
|
|
|
2014-04-06 16:58:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-18 16:48:58 -07:00
|
|
|
|
|
|
|
|
|
2013-11-05 21:27:02 -06:00
|
|
|
|
2014-02-04 20:39:01 +08:00
|
|
|
|
2014-03-25 10:42:35 +01:00
|
|
|
|
2009-06-18 16:48:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-17 20:37:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-13 20:32:13 +09:00
|
|
|
|
|
|
|
|
|
2015-08-25 09:12:43 +00:00
|
|
|
|
2015-01-12 11:07:59 +01:00
|
|
|
|
2013-03-13 20:32:13 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-19 01:22:20 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-16 10:45:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-12 10:48:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 14:51:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-11 21:55:14 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 15:27:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 15:27:45 +01:00
|
|
|
|
2013-06-25 15:27:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-25 15:27:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-16 21:47:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-31 12:03:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-16 14:34:19 +07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-12 13:25:38 -08:00
|
|
|
|
2014-12-17 16:51:10 +01:00
|
|
|
|
2015-10-22 21:51:18 -07:00
|
|
|
|
2008-11-12 13:25:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-28 20:10:45 +05:30
|
|
|
|
|
|
|
|
|
2015-10-15 18:23:32 +05:30
|
|
|
|
2015-04-28 20:10:45 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-12 11:18:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-18 09:10:29 +02:00
|
|
|
|
2013-12-12 11:18:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-29 11:11:05 +09:00
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
2009-06-29 11:11:05 +09:00
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
|
|
|
|
|
2015-06-04 17:40:32 +05:30
|
|
|
|
2014-07-25 09:54:46 +03:00
|
|
|
|
2012-12-12 17:42:38 +02:00
|
|
|
|
2015-04-08 10:08:56 +02:00
|
|
|
|
2012-12-12 17:42:38 +02:00
|
|
|
|
2015-11-01 10:50:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
|
|
|
|
|
2015-10-30 10:32:19 +01:00
|
|
|
|
2015-11-01 10:39:07 +01:00
|
|
|
|
2015-10-30 10:32:19 +01:00
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
2012-06-23 13:29:25 +01:00
|
|
|
|
2015-04-08 14:14:40 +02:00
|
|
|
|
|
|
|
|
|
2015-11-01 10:43:16 +01:00
|
|
|
|
2014-06-03 13:26:04 +08:00
|
|
|
|
|
|
|
|
|
2015-04-08 14:14:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gpio: add LP3943 I2C GPIO expander driver
This is one of LP3943 MFD driver.
LP3943 is configurable as a GPIO expander, up to 16 GPIOs.
* Application note: how to configure LP3943 as a GPIO expander
http://www.ti.com/lit/an/snva287a/snva287a.pdf
* Supported GPIO controller operations
request, free, direction_input, direction_output, get and set
* GPIO direction register not supported
LP3943 doesn't have the GPIO direction register. It only provides input and
output status registers.
So, private data for the direction should be handled manually.
This variable is updated whenever the direction is changed and
used in 'get' operation.
* Pin assignment
A driver data, 'pin_used' is checked when a GPIO is requested.
If the GPIO is already assigned, then returns as failure.
If the GPIO is available, 'pin_used' is set.
When the GPIO is not used anymore, then it is cleared.
It is defined as unsigned long type for atomic bit operation APIs,
but only LSB 16bits are used because LP3943 has 16 outputs.
Signed-off-by: Milo Kim <milo.kim@ti.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-12-06 11:18:42 +09:00
|
|
|
|
2010-03-05 13:44:33 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-19 14:25:48 +08:00
|
|
|
|
2010-03-05 13:44:33 -08:00
|
|
|
|
2008-07-25 01:46:14 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 14:42:16 -07:00
|
|
|
|
|
|
|
|
|
2013-08-30 09:39:53 +02:00
|
|
|
|
2015-01-30 11:32:01 +01:00
|
|
|
|
2010-05-26 14:42:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-30 14:31:20 +08:00
|
|
|
|
|
|
|
|
|
2012-08-29 09:35:24 +08:00
|
|
|
|
2012-01-30 14:31:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-06 01:39:03 -08:00
|
|
|
|
2014-02-13 13:59:23 +01:00
|
|
|
|
2008-02-04 22:28:26 -08:00
|
|
|
|
2008-07-04 09:59:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-06 17:11:46 +08:00
|
|
|
|
2014-02-07 16:36:21 -06:00
|
|
|
|
2008-07-04 09:59:37 -07:00
|
|
|
|
2012-04-06 17:11:46 +08:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:26 -08:00
|
|
|
|
2014-02-07 16:35:48 -06:00
|
|
|
|
|
|
|
|
|
2014-02-13 13:59:23 +01:00
|
|
|
|
2014-02-07 16:35:48 -06:00
|
|
|
|
2010-03-05 13:44:36 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-09 13:27:57 +02:00
|
|
|
|
2010-03-05 13:44:36 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:24 -08:00
|
|
|
|
2008-07-21 14:21:34 -07:00
|
|
|
|
2015-02-05 16:49:08 +01:00
|
|
|
|
2012-09-28 23:36:15 +02:00
|
|
|
|
2008-02-04 22:28:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-21 14:21:34 -07:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-14 12:46:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-02 16:52:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-13 08:00:29 +01:00
|
|
|
|
2014-04-15 23:38:56 +02:00
|
|
|
|
2010-07-02 16:52:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-13 09:33:13 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-19 15:52:45 +01:00
|
|
|
|
2014-04-09 13:38:33 +02:00
|
|
|
|
2010-05-10 23:43:47 +02:00
|
|
|
|
2010-12-13 09:33:13 +05:30
|
|
|
|
2010-05-10 23:43:47 +02:00
|
|
|
|
|
|
|
|
|
2015-04-08 14:51:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-09 14:50:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-20 23:51:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-16 15:13:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 14:51:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-27 14:46:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-07 16:10:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-29 18:20:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-25 01:46:10 -07:00
|
|
|
|
2015-04-08 14:30:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-22 16:46:39 -07:00
|
|
|
|
2015-04-08 14:30:37 +02:00
|
|
|
|
2009-09-22 16:46:39 -07:00
|
|
|
|
2015-04-08 14:30:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-08 14:43:08 -08:00
|
|
|
|
2015-04-08 14:30:37 +02:00
|
|
|
|
2009-12-14 18:00:32 -08:00
|
|
|
|
2008-07-25 01:46:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-11 11:23:44 +01:00
|
|
|
|
2008-07-25 01:46:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-04 13:01:41 -07:00
|
|
|
|
|
|
|
|
|
2011-03-17 19:32:46 +00:00
|
|
|
|
2014-05-29 16:52:46 +02:00
|
|
|
|
2009-09-22 16:46:36 -07:00
|
|
|
|
2013-10-04 13:01:41 -07:00
|
|
|
|
2009-09-22 16:46:36 -07:00
|
|
|
|
2015-04-08 14:30:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-27 15:33:21 -07:00
|
|
|
|
2011-10-28 09:23:32 +09:00
|
|
|
|
2014-05-16 11:59:14 +02:00
|
|
|
|
2011-07-21 09:19:59 +09:00
|
|
|
|
2010-10-27 15:33:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-28 09:23:32 +09:00
|
|
|
|
|
|
|
|
|
2011-05-09 19:58:49 +09:00
|
|
|
|
2011-10-28 09:23:32 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-09 19:58:49 +09:00
|
|
|
|
2010-03-21 01:06:09 +01:00
|
|
|
|
|
|
|
|
|
2013-08-30 09:39:53 +02:00
|
|
|
|
2010-05-11 13:24:20 -07:00
|
|
|
|
2010-03-21 01:06:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-27 09:26:23 +02:00
|
|
|
|
|
|
|
|
|
2012-03-28 14:55:04 -06:00
|
|
|
|
2011-06-27 09:26:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
2009-12-15 16:46:18 -08:00
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
2015-04-08 14:34:51 +02:00
|
|
|
|
|
|
|
|
|
2015-11-01 10:50:19 +01:00
|
|
|
|
2015-04-08 14:34:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:17 -08:00
|
|
|
|
2008-07-21 14:21:34 -07:00
|
|
|
|
|
|
|
|
|
2010-03-05 13:44:33 -08:00
|
|
|
|
2008-07-21 14:21:34 -07:00
|
|
|
|
2010-03-05 13:44:33 -08:00
|
|
|
|
2008-07-21 14:21:34 -07:00
|
|
|
|
2015-11-01 10:50:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:28:25 -08:00
|
|
|
|
mcp23s08: add i2c support
Add i2c bindings for the mcp230xx devices. This is quite a lot simpler
than the spi one as there's no funky sub addressing done (one struct
i2c_client per struct gpio_chip).
The mcp23s08_platform_data structure is reused for i2c, even though
only a single mcp23s08_chip_info structure is needed.
To use, simply fill out a platform_data structure and pass it in
i2c_board_info, E.G.:
static const struct mcp23s08_platform_data mcp23017_data = {
.chip[0] = {
.pullups = 0x00ff,
},
.base = 240,
};
static struct i2c_board_info __initdata i2c_devs[] = {
{ I2C_BOARD_INFO("mcp23017", 0x20),
.platform_data = &smartview_mcp23017_data, },
...
};
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-07-15 10:25:32 +02:00
|
|
|
|
2008-02-04 22:28:25 -08:00
|
|
|
|
mcp23s08: add i2c support
Add i2c bindings for the mcp230xx devices. This is quite a lot simpler
than the spi one as there's no funky sub addressing done (one struct
i2c_client per struct gpio_chip).
The mcp23s08_platform_data structure is reused for i2c, even though
only a single mcp23s08_chip_info structure is needed.
To use, simply fill out a platform_data structure and pass it in
i2c_board_info, E.G.:
static const struct mcp23s08_platform_data mcp23017_data = {
.chip[0] = {
.pullups = 0x00ff,
},
.base = 240,
};
static struct i2c_board_info __initdata i2c_devs[] = {
{ I2C_BOARD_INFO("mcp23017", 0x20),
.platform_data = &smartview_mcp23017_data, },
...
};
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-07-15 10:25:32 +02:00
|
|
|
|
|
|
|
|
|
2011-03-09 17:56:30 +01:00
|
|
|
|
2014-01-16 11:44:15 +01:00
|
|
|
|
2008-02-04 22:28:25 -08:00
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
2010-10-27 15:33:18 -07:00
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
|
|
|
|
|
2012-11-05 15:48:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-08 15:11:16 +02:00
|
|
|
|
2014-11-06 15:48:05 +02:00
|
|
|
|
2008-07-25 01:46:11 -07:00
|
|
|
|