Index: arch/arm/mach-pxa/magician/magician.c =================================================================== RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/magician/magician.c,v retrieving revision 1.42 diff -u -r1.42 magician.c --- arch/arm/mach-pxa/magician/magician.c 22 Jul 2007 21:16:10 -0000 1.42 +++ arch/arm/mach-pxa/magician/magician.c 23 Jul 2007 15:54:22 -0000 @@ -207,6 +207,7 @@ struct htc_egpio_platform_data egpio_data = { .bus_shift = 1, /* 32bit alignment instead of 16bit */ .irq_base = IRQ_BOARD_START, /* 16 IRQs, we only have 4 though */ + .gpio_base = GPIO_BASE_INCREMENT, .nrRegs = 7, .ackRegister = 3, .pins = egpio_pins, Index: arch/arm/mach-pxa/htcapache/htcapache.c =================================================================== RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/htcapache/htcapache.c,v retrieving revision 1.24 diff -u -r1.24 htcapache.c --- arch/arm/mach-pxa/htcapache/htcapache.c 17 Jul 2007 17:29:26 -0000 1.24 +++ arch/arm/mach-pxa/htcapache/htcapache.c 23 Jul 2007 15:54:22 -0000 @@ -81,6 +81,7 @@ struct htc_egpio_platform_data egpio_data = { .invertAcks = 1, .irq_base = IRQ_BOARD_START, + .gpio_base = GPIO_BASE_INCREMENT, .nrRegs = 3, .pins = pins, .nr_pins = ARRAY_SIZE(pins), Index: include/linux/mfd/htc-egpio.h =================================================================== RCS file: /cvs/linux/kernel26/include/linux/mfd/htc-egpio.h,v retrieving revision 1.4 diff -u -r1.4 htc-egpio.h --- include/linux/mfd/htc-egpio.h 1 Jul 2007 23:42:53 -0000 1.4 +++ include/linux/mfd/htc-egpio.h 23 Jul 2007 15:54:22 -0000 @@ -42,12 +42,14 @@ struct htc_egpio_platform_data { /* This is 'gpiodev' capable */ struct gpiodev_ops ops; + /* Beginning of available irqs (eg, IRQ_BOARD_START) */ + int irq_base; + /* Beginning of available gpios (eg, GPIO_BASE_INCREMENT) */ + int gpio_base; /* Shift register number by this value (bus_shift=1 for 32bit register alignment) */ int bus_shift; /* Set if chip requires writing '0' to ack an irq */ int invertAcks; - /* Beginning of available irqs (eg, IRQ_BOARD_START) */ - int irq_base; /* Number of registers (optional if all output pins specified * below) */ int nrRegs; Index: drivers/mfd/htc-egpio.c =================================================================== RCS file: /cvs/linux/kernel26/drivers/mfd/htc-egpio.c,v retrieving revision 1.4 diff -u -r1.4 htc-egpio.c --- drivers/mfd/htc-egpio.c 1 Jul 2007 23:42:53 -0000 1.4 +++ drivers/mfd/htc-egpio.c 23 Jul 2007 15:54:23 -0000 @@ -12,6 +12,7 @@ #include /* enable_irq_wake */ #include /* spinlock_t */ #include +#include #include #include /* IRQT_RISING */ @@ -249,6 +250,14 @@ pdata->ops.to_irq = egpio_to_irq; platform_set_drvdata(pdev, ei); + { + struct gpio_ops ops; + ops.get_value = egpio_get; + ops.set_value = egpio_set; + ops.to_irq = egpio_to_irq; + gpiodev_register(pdata->gpio_base, &pdev->dev, &ops); + } + /* Go through list of pins. */ ei->irqStart = pdata->irq_base; ei->maxRegs = pdata->nrRegs - 1;