diff options
Diffstat (limited to 'arch/arm/mach-ixp4xx')
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/nslu2-power.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/nslu2-setup.c | 13 |
3 files changed, 27 insertions, 9 deletions
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 4bdc9d4526cd..fbadf3021b9e 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -111,24 +111,30 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) | |||
111 | if (line < 0) | 111 | if (line < 0) |
112 | return -EINVAL; | 112 | return -EINVAL; |
113 | 113 | ||
114 | if (type & IRQT_BOTHEDGE) { | 114 | switch (type){ |
115 | case IRQT_BOTHEDGE: | ||
115 | int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; | 116 | int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; |
116 | irq_type = IXP4XX_IRQ_EDGE; | 117 | irq_type = IXP4XX_IRQ_EDGE; |
117 | } else if (type & IRQT_RISING) { | 118 | break; |
119 | case IRQT_RISING: | ||
118 | int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; | 120 | int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; |
119 | irq_type = IXP4XX_IRQ_EDGE; | 121 | irq_type = IXP4XX_IRQ_EDGE; |
120 | } else if (type & IRQT_FALLING) { | 122 | break; |
123 | case IRQT_FALLING: | ||
121 | int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; | 124 | int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; |
122 | irq_type = IXP4XX_IRQ_EDGE; | 125 | irq_type = IXP4XX_IRQ_EDGE; |
123 | } else if (type & IRQT_HIGH) { | 126 | break; |
127 | case IRQT_HIGH: | ||
124 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; | 128 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; |
125 | irq_type = IXP4XX_IRQ_LEVEL; | 129 | irq_type = IXP4XX_IRQ_LEVEL; |
126 | } else if (type & IRQT_LOW) { | 130 | break; |
131 | case IRQT_LOW: | ||
127 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; | 132 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; |
128 | irq_type = IXP4XX_IRQ_LEVEL; | 133 | irq_type = IXP4XX_IRQ_LEVEL; |
129 | } else | 134 | break; |
135 | default: | ||
130 | return -EINVAL; | 136 | return -EINVAL; |
131 | 137 | } | |
132 | ixp4xx_config_irq(irq, irq_type); | 138 | ixp4xx_config_irq(irq, irq_type); |
133 | 139 | ||
134 | if (line >= 8) { /* pins 8-15 */ | 140 | if (line >= 8) { /* pins 8-15 */ |
diff --git a/arch/arm/mach-ixp4xx/nslu2-power.c b/arch/arm/mach-ixp4xx/nslu2-power.c index b0ad9e901f6e..d80c362bc539 100644 --- a/arch/arm/mach-ixp4xx/nslu2-power.c +++ b/arch/arm/mach-ixp4xx/nslu2-power.c | |||
@@ -77,6 +77,9 @@ static int __init nslu2_power_init(void) | |||
77 | 77 | ||
78 | static void __exit nslu2_power_exit(void) | 78 | static void __exit nslu2_power_exit(void) |
79 | { | 79 | { |
80 | if (!(machine_is_nslu2())) | ||
81 | return; | ||
82 | |||
80 | free_irq(NSLU2_RB_IRQ, NULL); | 83 | free_irq(NSLU2_RB_IRQ, NULL); |
81 | free_irq(NSLU2_PB_IRQ, NULL); | 84 | free_irq(NSLU2_PB_IRQ, NULL); |
82 | } | 85 | } |
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index da9340a53434..55411f21d838 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c | |||
@@ -27,8 +27,6 @@ static struct flash_platform_data nslu2_flash_data = { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | static struct resource nslu2_flash_resource = { | 29 | static struct resource nslu2_flash_resource = { |
30 | .start = NSLU2_FLASH_BASE, | ||
31 | .end = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE, | ||
32 | .flags = IORESOURCE_MEM, | 30 | .flags = IORESOURCE_MEM, |
33 | }; | 31 | }; |
34 | 32 | ||
@@ -52,6 +50,12 @@ static struct platform_device nslu2_i2c_controller = { | |||
52 | .num_resources = 0, | 50 | .num_resources = 0, |
53 | }; | 51 | }; |
54 | 52 | ||
53 | static struct platform_device nslu2_beeper = { | ||
54 | .name = "ixp4xx-beeper", | ||
55 | .id = NSLU2_GPIO_BUZZ, | ||
56 | .num_resources = 0, | ||
57 | }; | ||
58 | |||
55 | static struct resource nslu2_uart_resources[] = { | 59 | static struct resource nslu2_uart_resources[] = { |
56 | { | 60 | { |
57 | .start = IXP4XX_UART1_BASE_PHYS, | 61 | .start = IXP4XX_UART1_BASE_PHYS, |
@@ -99,6 +103,7 @@ static struct platform_device *nslu2_devices[] __initdata = { | |||
99 | &nslu2_i2c_controller, | 103 | &nslu2_i2c_controller, |
100 | &nslu2_flash, | 104 | &nslu2_flash, |
101 | &nslu2_uart, | 105 | &nslu2_uart, |
106 | &nslu2_beeper, | ||
102 | }; | 107 | }; |
103 | 108 | ||
104 | static void nslu2_power_off(void) | 109 | static void nslu2_power_off(void) |
@@ -116,6 +121,10 @@ static void __init nslu2_init(void) | |||
116 | { | 121 | { |
117 | ixp4xx_sys_init(); | 122 | ixp4xx_sys_init(); |
118 | 123 | ||
124 | nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); | ||
125 | nslu2_flash_resource.end = | ||
126 | IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; | ||
127 | |||
119 | pm_power_off = nslu2_power_off; | 128 | pm_power_off = nslu2_power_off; |
120 | 129 | ||
121 | platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); | 130 | platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); |