linux/include
David Brownell 8f1cc3b10e gpio: mcp23s08 handles multiple chips per chipselect
Teach the mcp23s08 driver about a curious feature of these chips: up to
four of them can share the same chipselect, with the SPI signals wired in
parallel, by matching two bits in the first protocol byte against two
address lines on the chip.

This is handled by three software changes:

  * Platform data now holds an array of per-chip structs, not
    just one chip's address and pullup configuration.

  * Probe() and remove() now use another level of structure,
    wrapping an instance of the original structure for each
    mcp23s08 chip sharing that chipselect.

  * The HAEN bit is set, so that the hardware address bits can no
    longer be ignored (boot firmware may not have enabled them).

The "one struct per chip" preserves the guts of the current code,
but platform_data will need minor changes.

    OLD:
	/* incorrect "slave" ID may not have mattered */
	.slave = 3,
	.pullups = BIT(3) | BIT(1) | BIT(0),

    NEW:
	/* slave address _must_ match chip's wiring */
	.chip[3] = {
		.is_present = true,
		.pullups = BIT(3) | BIT(1) | BIT(0),
	},

There's no change in how things _behave_ for spi_device nodes with a
single mcp23s08 chip.  New multi-chip configurations assign GPIOs in
sequence, without holes.  The spi_device just resembles a bigger
controller, but internally it has multiple gpio_chip instances.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
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
..
acpi Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2008-07-16 17:25:46 -07:00
asm-alpha clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-arm clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-avr32 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-blackfin clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-cris clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-frv clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-generic gpio: sysfs interface 2008-07-25 10:53:30 -07:00
asm-h8300 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-ia64 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-m32r clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-m68k clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-m68knommu clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-mips clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-mn10300 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-parisc clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-powerpc clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-s390 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-sh clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-sparc clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-sparc64 Remove asm/semaphore.h 2008-07-24 08:31:12 -04:00
asm-um clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-v850 remove the v850 port 2008-07-24 10:47:24 -07:00
asm-x86 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-xtensa clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
crypto crypto: hash - Move ahash functions into crypto/hash.h 2008-07-10 20:35:18 +08:00
drm drm/radeon: fixup issue with radeon and PAT support. 2008-07-15 15:48:05 +10:00
keys
linux gpio: mcp23s08 handles multiple chips per chipselect 2008-07-25 10:53:30 -07:00
math-emu
media V4L/DVB (8395): saa7134: Fix Kbuild dependency of ir-kbd-i2c 2008-07-20 07:29:03 -03:00
mtd
net include: use get/put_unaligned_* helpers 2008-07-25 10:53:26 -07:00
pcmcia
rdma RDMA/cma: Add RDMA_CM_EVENT_TIMEWAIT_EXIT event 2008-07-22 14:14:23 -07:00
rxrpc
scsi driver core: remove KOBJ_NAME_LEN define 2008-07-21 21:54:52 -07:00
sound ALSA: Release v1.0.17 2008-07-14 09:54:43 +02:00
video neofb: drop the xtimings structure 2008-07-24 10:47:41 -07:00
xen xen: implement Xen-specific spinlocks 2008-07-16 11:15:53 +02:00
Kbuild drm: reorganise drm tree to be more future proof. 2008-07-14 10:45:01 +10:00