From 63890a0ee1af994122094bd01f87ea6251631a3f Mon Sep 17 00:00:00 2001 From: Matthias Kaehlcke Date: Wed, 29 Oct 2008 14:14:52 -0700 Subject: [ARM] ep93xx: fix OHCI DMA mask Signed-off-by: Matthias Kaehlcke Signed-off-by: Andrew Morton Signed-off-by: Russell King --- arch/arm/mach-ep93xx/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-ep93xx/core.c') diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index de53f0be71b..48345fb3461 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -449,12 +450,13 @@ static struct resource ep93xx_ohci_resources[] = { }, }; + static struct platform_device ep93xx_ohci_device = { .name = "ep93xx-ohci", .id = -1, .dev = { - .dma_mask = (void *)0xffffffff, - .coherent_dma_mask = 0xffffffff, + .dma_mask = &ep93xx_ohci_device.dev.coherent_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), }, .num_resources = ARRAY_SIZE(ep93xx_ohci_resources), .resource = ep93xx_ohci_resources, -- cgit v1.2.3 From d52a26a956d3925c6eaf8770e95e4d5f13740696 Mon Sep 17 00:00:00 2001 From: Hartley Sweeten Date: Thu, 16 Oct 2008 23:57:03 +0100 Subject: [ARM] 5311/1: ep93xx: add core support for built in i2c bus Allow the ep93xx platform init code to register the built-in i2c bus. The EP93xx processor has two GPIO pins dedicated for an I2C bus. This patch registers the platform supplied i2c_board_info and the necessary platform_device information for the i2c-gpio driver to use these pins. Signed-off-by: H Hartley Sweeten Acked-by: Ryan Mallon Signed-off-by: Russell King --- arch/arm/mach-ep93xx/core.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'arch/arm/mach-ep93xx/core.c') diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 48345fb3461..61da67f31ce 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include @@ -497,6 +499,26 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) platform_device_register(&ep93xx_eth_device); } +static struct i2c_gpio_platform_data ep93xx_i2c_data = { + .sda_pin = EP93XX_GPIO_LINE_EEDAT, + .sda_is_open_drain = 0, + .scl_pin = EP93XX_GPIO_LINE_EECLK, + .scl_is_open_drain = 0, + .udelay = 2, +}; + +static struct platform_device ep93xx_i2c_device = { + .name = "i2c-gpio", + .id = 0, + .dev.platform_data = &ep93xx_i2c_data, +}; + +void __init ep93xx_register_i2c(struct i2c_board_info *devices, int num) +{ + i2c_register_board_info(0, devices, num); + platform_device_register(&ep93xx_i2c_device); +} + extern void ep93xx_gpio_init(void); void __init ep93xx_init_devices(void) -- cgit v1.2.3 From 799a0600ac49b03c1a6244847c2725c0082ba775 Mon Sep 17 00:00:00 2001 From: Hartley Sweeten Date: Tue, 28 Oct 2008 17:55:30 +0100 Subject: [ARM] 5324/2: ep93xx: support gpio interrupt debounce Add debounce support for ep93xx gpio interrupts. On the EP93xx, GPIO ports A, B, and F can be used to generate interrupts. For each port, if interrupts are enabled, it is possible to debouce the input signal. Debouncing is implemented by passing the input signal through a 2-bit shift register clocked by a 128Hz clock. This patch adds a platform specific way to enable the debouce feature for these input ports. Signed-off-by: H Hartley Sweeten Signed-off-by: Russell King --- arch/arm/mach-ep93xx/core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'arch/arm/mach-ep93xx/core.c') diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 61da67f31ce..4781f323703 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -155,12 +155,14 @@ static unsigned char gpio_int_unmasked[3]; static unsigned char gpio_int_enabled[3]; static unsigned char gpio_int_type1[3]; static unsigned char gpio_int_type2[3]; +static unsigned char gpio_int_debouce[3]; /* Port ordering is: A B F */ static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 }; +static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 }; void ep93xx_gpio_update_int_params(unsigned port) { @@ -183,6 +185,22 @@ void ep93xx_gpio_int_mask(unsigned line) gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7)); } +void ep93xx_gpio_int_debounce(unsigned int irq, int enable) +{ + int line = irq_to_gpio(irq); + int port = line >> 3; + int port_mask = 1 << (line & 7); + + if (enable) + gpio_int_debouce[port] |= port_mask; + else + gpio_int_debouce[port] &= ~port_mask; + + __raw_writeb(gpio_int_debouce[port], + EP93XX_GPIO_REG(int_debounce_register_offset[port])); +} +EXPORT_SYMBOL(ep93xx_gpio_int_debounce); + /************************************************************************* * EP93xx IRQ handling *************************************************************************/ -- cgit v1.2.3