Index: linux-2.6.16/arch/arm/mach-ep93xx/core.c =================================================================== --- linux-2.6.16.orig/arch/arm/mach-ep93xx/core.c +++ linux-2.6.16/arch/arm/mach-ep93xx/core.c @@ -478,6 +478,46 @@ static struct platform_device ep93xx_rtc }; + +static struct timer_list blink_timer; +static int led_state; + +static void do_blink(unsigned long ignored) +{ + int i; + + blink_timer.expires = jiffies + HZ; + add_timer(&blink_timer); + + led_state ^= 1; + + for (i = 0; i < 8; i++) { + gpio_line_set(EP93XX_GPIO_LINE_A(i), led_state); + gpio_line_set(EP93XX_GPIO_LINE_B(i), led_state); + } + + gpio_line_set(EP93XX_GPIO_LINE_GRLED, led_state); + gpio_line_set(EP93XX_GPIO_LINE_RDLED, led_state ^ 1); + + gpio_line_set(EP93XX_GPIO_LINE_F(1), led_state); + + gpio_line_set(EP93XX_GPIO_LINE_H(3), led_state); + gpio_line_set(EP93XX_GPIO_LINE_H(4), led_state); + gpio_line_set(EP93XX_GPIO_LINE_H(5), led_state); +} + +static irqreturn_t test_int_handler(int irq, void *dev_id, struct pt_regs *regs) +{ + static long last = 0; + + if (jiffies - last > HZ) { + printk("got interrupt\n"); + last = jiffies; + } + + return IRQ_HANDLED; +} + void __init ep93xx_init_devices(void) { unsigned int v; @@ -497,4 +537,56 @@ void __init ep93xx_init_devices(void) platform_device_register(&ep93xx_ohci_device); platform_device_register(&ep93xx_i2c_device); platform_device_register(&ep93xx_rtc_device); + + if (0) { + int i; + + led_state = 0; + + for (i = 0; i < 8; i++) { + gpio_line_config(EP93XX_GPIO_LINE_A(i), GPIO_OUT); + gpio_line_config(EP93XX_GPIO_LINE_B(i), GPIO_OUT); + } + + gpio_line_config(EP93XX_GPIO_LINE_F(1), GPIO_OUT); + + gpio_line_config(EP93XX_GPIO_LINE_H(3), GPIO_OUT); + gpio_line_config(EP93XX_GPIO_LINE_H(4), GPIO_OUT); + gpio_line_config(EP93XX_GPIO_LINE_H(5), GPIO_OUT); + + init_timer(&blink_timer); + blink_timer.function = do_blink; + blink_timer.expires = jiffies + HZ; + add_timer(&blink_timer); + } + + if (0) { + int i; + + gpio_line_config(EP93XX_GPIO_LINE_C(0), GPIO_OUT); + gpio_line_set(EP93XX_GPIO_LINE_C(0), EP93XX_GPIO_HIGH); + for (i=0;i<1000000;i++) ; + printk("***** init %d\n",gpio_line_get(EP93XX_GPIO_LINE_C(0))); + gpio_line_set(EP93XX_GPIO_LINE_C(0), EP93XX_GPIO_LOW); + for (i=0;i<1000000;i++) ; + printk("***** init %d\n",gpio_line_get(EP93XX_GPIO_LINE_C(0))); + + gpio_line_config(EP93XX_GPIO_LINE_C(1), GPIO_OUT); + gpio_line_set(EP93XX_GPIO_LINE_C(1), EP93XX_GPIO_HIGH); + for (i=0;i<1000000;i++) ; + printk("***** init %d\n",gpio_line_get(EP93XX_GPIO_LINE_C(1))); + gpio_line_set(EP93XX_GPIO_LINE_C(1), EP93XX_GPIO_LOW); + for (i=0;i<1000000;i++) ; + printk("***** init %d\n",gpio_line_get(EP93XX_GPIO_LINE_C(1))); + } + + if (0) { + int err; + + err = request_irq(IRQ_EP93XX_GPIO(8), test_int_handler, + SA_INTERRUPT | SA_TRIGGER_LOW, + "test int", &err); + + printk("error %d\n", err); + } }