1. 23 7月, 2008 1 次提交
  2. 07 2月, 2008 2 次提交
  3. 06 2月, 2008 5 次提交
    • E
      gpiolib: pca9539 i2c gpio expander support · 9e60fdcf
      eric miao 提交于
      This adds a new-style I2C driver with basic support for the sixteen bit
      PCA9539 GPIO expanders.  These chips have multiple registers, push-pull output
      drivers, and (not supported in this patch) pin change interrupts.
      
      Board-specific code must provide "pca9539_platform_data" with each chip's
      "i2c_board_info".  That provides the GPIO numbers to be used by that chip, and
      callbacks for board-specific setup/teardown logic.
      
      Derived from drivers/i2c/chips/pca9539.c (which has no current known users).
      This is faster and simpler; it uses 16-bit register access, and cache the
      OUTPUT and DIRECTION registers for fast access
      Signed-off-by: Neric miao <eric.miao@marvell.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Acked-by: NJean Delvare <khali@linux-fr.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Philipp Zabel <philipp.zabel@gmail.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ben Gardner <bgardner@wabtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9e60fdcf
    • D
      mcp23s08 spi gpio expander support · e58b9e27
      David Brownell 提交于
      Basic driver for 8-bit SPI based MCP23S08 GPIO expander, without support for
      IRQs or the shared chipselect mechanism.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Eric Miao <eric.miao@marvell.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Philipp Zabel <philipp.zabel@gmail.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ben Gardner <bgardner@wabtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e58b9e27
    • D
      gpiolib: pcf857x i2c gpio expander support · 15fae37d
      David Brownell 提交于
      This is a new-style I2C driver for most common 8 and 16 bit I2C based
      "quasi-bidirectional" GPIO expanders: pcf8574 or pcf8575, and several
      compatible models (mostly faster, supporting I2C at up to 1 MHz).
      
      The driver exposes the GPIO signals using the platform-neutral GPIO
      programming interface, so they are easily accessed by other kernel code.  The
      lack of such a flexible kernel API has been a big factor in the proliferation
      of board-specific drivers for these chips...  stuff that rarely makes it
      upstream since it's so ugly.  This driver will let such boards use standard
      calls.
      
      Since it's a new-style driver, these devices must be configured as part of
      board-specific init.  That eliminates the need for error-prone manual
      configuration of module parameters, and makes compatibility with legacy
      drivers (pcf8574.c, pc8575.c) for these chips easier (there's a clear
      either/or disjunction).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Acked-by: NJean Delvare <khali@linux-fr.org>
      Cc: Eric Miao <eric.miao@marvell.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Philipp Zabel <philipp.zabel@gmail.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ben Gardner <bgardner@wabtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      15fae37d
    • D
      gpiolib: add gpio provider infrastructure · d2876d08
      David Brownell 提交于
      Provide new implementation infrastructure that platforms may choose to use
      when implementing the GPIO programming interface.  Platforms can update their
      GPIO support to use this.  In many cases the incremental cost to access a
      non-inlined GPIO should be less than a dozen instructions, with the memory
      cost being about a page (total) of extra data and code.  The upside is:
      
        * Providing two features which were "want to have (but OK to defer)" when
          GPIO interfaces were first discussed in November 2006:
      
          -	A "struct gpio_chip" to plug in GPIOs that aren't directly supported
      	by SOC platforms, but come from FPGAs or other multifunction devices
      	using conventional device registers (like UCB-1x00 or SM501 GPIOs,
      	and southbridges in PCs with more open specs than usual).
      
          -	Full support for message-based GPIO expanders, where registers are
      	accessed through sleeping I/O calls.  Previous support for these
      	"cansleep" calls was just stubs.  (One example: the widely used
      	pcf8574 I2C chips, with 8 GPIOs each.)
      
        * Including a non-stub implementation of the gpio_{request,free}() calls,
          making those calls much more useful.  The diagnostic labels are also
          recorded given DEBUG_FS, so /sys/kernel/debug/gpio can show a snapshot
          of all GPIOs known to this infrastructure.
      
      The driver programming interfaces introduced in 2.6.21 do not change at all;
      this infrastructure is entirely below those covers.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Eric Miao <eric.miao@marvell.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Philipp Zabel <philipp.zabel@gmail.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ben Gardner <bgardner@wabtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2876d08
    • D
      gpiolib: add drivers/gpio directory · a9c5fff5
      David Brownell 提交于
      Add an empty drivers/gpio directory for gpiolib infrastructure and GPIO
      expanders.  It will be populated by later patches.
      
      This won't be the only place to hold such gpio_chip code.  Many external chips
      add a few GPIOs as secondary functionality (such as MFD drivers) and platform
      code frequently needs to closely integrate GPIO and IRQ support.
      
      This is placed *early* in the build/link sequence since it's common for other
      drivers to depend on GPIOs to do their work, so they must be initialized early
      in the device_initcall() sequence.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Acked-by: NJean Delvare <khali@linux-fr.org>
      Cc: Eric Miao <eric.miao@marvell.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Philipp Zabel <philipp.zabel@gmail.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ben Gardner <bgardner@wabtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9c5fff5