aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/amiga
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/m68k/amiga
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/m68k/amiga')
-rw-r--r--arch/m68k/amiga/amiints.c168
-rw-r--r--arch/m68k/amiga/amisound.c1
-rw-r--r--arch/m68k/amiga/cia.c39
-rw-r--r--arch/m68k/amiga/config.c4
-rw-r--r--arch/m68k/amiga/platform.c125
5 files changed, 161 insertions, 176 deletions
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c
index 47b5f90002a..c5b5212cc3f 100644
--- a/arch/m68k/amiga/amiints.c
+++ b/arch/m68k/amiga/amiints.c
@@ -1,15 +1,43 @@
1/* 1/*
2 * Amiga Linux interrupt handling code 2 * linux/arch/m68k/amiga/amiints.c -- Amiga Linux interrupt handling code
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive 5 * License. See the file COPYING in the main directory of this archive
6 * for more details. 6 * for more details.
7 *
8 * 11/07/96: rewritten interrupt handling, irq lists are exists now only for
9 * this sources where it makes sense (VERTB/PORTS/EXTER) and you must
10 * be careful that dev_id for this sources is unique since this the
11 * only possibility to distinguish between different handlers for
12 * free_irq. irq lists also have different irq flags:
13 * - IRQ_FLG_FAST: handler is inserted at top of list (after other
14 * fast handlers)
15 * - IRQ_FLG_SLOW: handler is inserted at bottom of list and before
16 * they're executed irq level is set to the previous
17 * one, but handlers don't need to be reentrant, if
18 * reentrance occurred, slow handlers will be just
19 * called again.
20 * The whole interrupt handling for CIAs is moved to cia.c
21 * /Roman Zippel
22 *
23 * 07/08/99: rewamp of the interrupt handling - we now have two types of
24 * interrupts, normal and fast handlers, fast handlers being
25 * marked with IRQF_DISABLED and runs with all other interrupts
26 * disabled. Normal interrupts disable their own source but
27 * run with all other interrupt sources enabled.
28 * PORTS and EXTER interrupts are always shared even if the
29 * drivers do not explicitly mark this when calling
30 * request_irq which they really should do.
31 * This is similar to the way interrupts are handled on all
32 * other architectures and makes a ton of sense besides
33 * having the advantage of making it easier to share
34 * drivers.
35 * /Jes
7 */ 36 */
8 37
9#include <linux/init.h> 38#include <linux/init.h>
10#include <linux/interrupt.h> 39#include <linux/interrupt.h>
11#include <linux/errno.h> 40#include <linux/errno.h>
12#include <linux/irq.h>
13 41
14#include <asm/irq.h> 42#include <asm/irq.h>
15#include <asm/traps.h> 43#include <asm/traps.h>
@@ -17,6 +45,56 @@
17#include <asm/amigaints.h> 45#include <asm/amigaints.h>
18#include <asm/amipcmcia.h> 46#include <asm/amipcmcia.h>
19 47
48static void amiga_enable_irq(unsigned int irq);
49static void amiga_disable_irq(unsigned int irq);
50static irqreturn_t ami_int1(int irq, void *dev_id);
51static irqreturn_t ami_int3(int irq, void *dev_id);
52static irqreturn_t ami_int4(int irq, void *dev_id);
53static irqreturn_t ami_int5(int irq, void *dev_id);
54
55static struct irq_controller amiga_irq_controller = {
56 .name = "amiga",
57 .lock = __SPIN_LOCK_UNLOCKED(amiga_irq_controller.lock),
58 .enable = amiga_enable_irq,
59 .disable = amiga_disable_irq,
60};
61
62/*
63 * void amiga_init_IRQ(void)
64 *
65 * Parameters: None
66 *
67 * Returns: Nothing
68 *
69 * This function should be called during kernel startup to initialize
70 * the amiga IRQ handling routines.
71 */
72
73void __init amiga_init_IRQ(void)
74{
75 if (request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL))
76 pr_err("Couldn't register int%d\n", 1);
77 if (request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL))
78 pr_err("Couldn't register int%d\n", 3);
79 if (request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL))
80 pr_err("Couldn't register int%d\n", 4);
81 if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL))
82 pr_err("Couldn't register int%d\n", 5);
83
84 m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS);
85
86 /* turn off PCMCIA interrupts */
87 if (AMIGAHW_PRESENT(PCMCIA))
88 gayle.inten = GAYLE_IRQ_IDE;
89
90 /* turn off all interrupts and enable the master interrupt bit */
91 amiga_custom.intena = 0x7fff;
92 amiga_custom.intreq = 0x7fff;
93 amiga_custom.intena = IF_SETCLR | IF_INTEN;
94
95 cia_init_IRQ(&ciaa_base);
96 cia_init_IRQ(&ciab_base);
97}
20 98
21/* 99/*
22 * Enable/disable a particular machine specific interrupt source. 100 * Enable/disable a particular machine specific interrupt source.
@@ -25,150 +103,112 @@
25 * internal data, that may not be changed by the interrupt at the same time. 103 * internal data, that may not be changed by the interrupt at the same time.
26 */ 104 */
27 105
28static void amiga_irq_enable(struct irq_data *data) 106static void amiga_enable_irq(unsigned int irq)
29{ 107{
30 amiga_custom.intena = IF_SETCLR | (1 << (data->irq - IRQ_USER)); 108 amiga_custom.intena = IF_SETCLR | (1 << (irq - IRQ_USER));
31} 109}
32 110
33static void amiga_irq_disable(struct irq_data *data) 111static void amiga_disable_irq(unsigned int irq)
34{ 112{
35 amiga_custom.intena = 1 << (data->irq - IRQ_USER); 113 amiga_custom.intena = 1 << (irq - IRQ_USER);
36} 114}
37 115
38static struct irq_chip amiga_irq_chip = {
39 .name = "amiga",
40 .irq_enable = amiga_irq_enable,
41 .irq_disable = amiga_irq_disable,
42};
43
44
45/* 116/*
46 * The builtin Amiga hardware interrupt handlers. 117 * The builtin Amiga hardware interrupt handlers.
47 */ 118 */
48 119
49static void ami_int1(unsigned int irq, struct irq_desc *desc) 120static irqreturn_t ami_int1(int irq, void *dev_id)
50{ 121{
51 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 122 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
52 123
53 /* if serial transmit buffer empty, interrupt */ 124 /* if serial transmit buffer empty, interrupt */
54 if (ints & IF_TBE) { 125 if (ints & IF_TBE) {
55 amiga_custom.intreq = IF_TBE; 126 amiga_custom.intreq = IF_TBE;
56 generic_handle_irq(IRQ_AMIGA_TBE); 127 m68k_handle_int(IRQ_AMIGA_TBE);
57 } 128 }
58 129
59 /* if floppy disk transfer complete, interrupt */ 130 /* if floppy disk transfer complete, interrupt */
60 if (ints & IF_DSKBLK) { 131 if (ints & IF_DSKBLK) {
61 amiga_custom.intreq = IF_DSKBLK; 132 amiga_custom.intreq = IF_DSKBLK;
62 generic_handle_irq(IRQ_AMIGA_DSKBLK); 133 m68k_handle_int(IRQ_AMIGA_DSKBLK);
63 } 134 }
64 135
65 /* if software interrupt set, interrupt */ 136 /* if software interrupt set, interrupt */
66 if (ints & IF_SOFT) { 137 if (ints & IF_SOFT) {
67 amiga_custom.intreq = IF_SOFT; 138 amiga_custom.intreq = IF_SOFT;
68 generic_handle_irq(IRQ_AMIGA_SOFT); 139 m68k_handle_int(IRQ_AMIGA_SOFT);
69 } 140 }
141 return IRQ_HANDLED;
70} 142}
71 143
72static void ami_int3(unsigned int irq, struct irq_desc *desc) 144static irqreturn_t ami_int3(int irq, void *dev_id)
73{ 145{
74 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 146 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
75 147
76 /* if a blitter interrupt */ 148 /* if a blitter interrupt */
77 if (ints & IF_BLIT) { 149 if (ints & IF_BLIT) {
78 amiga_custom.intreq = IF_BLIT; 150 amiga_custom.intreq = IF_BLIT;
79 generic_handle_irq(IRQ_AMIGA_BLIT); 151 m68k_handle_int(IRQ_AMIGA_BLIT);
80 } 152 }
81 153
82 /* if a copper interrupt */ 154 /* if a copper interrupt */
83 if (ints & IF_COPER) { 155 if (ints & IF_COPER) {
84 amiga_custom.intreq = IF_COPER; 156 amiga_custom.intreq = IF_COPER;
85 generic_handle_irq(IRQ_AMIGA_COPPER); 157 m68k_handle_int(IRQ_AMIGA_COPPER);
86 } 158 }
87 159
88 /* if a vertical blank interrupt */ 160 /* if a vertical blank interrupt */
89 if (ints & IF_VERTB) { 161 if (ints & IF_VERTB) {
90 amiga_custom.intreq = IF_VERTB; 162 amiga_custom.intreq = IF_VERTB;
91 generic_handle_irq(IRQ_AMIGA_VERTB); 163 m68k_handle_int(IRQ_AMIGA_VERTB);
92 } 164 }
165 return IRQ_HANDLED;
93} 166}
94 167
95static void ami_int4(unsigned int irq, struct irq_desc *desc) 168static irqreturn_t ami_int4(int irq, void *dev_id)
96{ 169{
97 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 170 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
98 171
99 /* if audio 0 interrupt */ 172 /* if audio 0 interrupt */
100 if (ints & IF_AUD0) { 173 if (ints & IF_AUD0) {
101 amiga_custom.intreq = IF_AUD0; 174 amiga_custom.intreq = IF_AUD0;
102 generic_handle_irq(IRQ_AMIGA_AUD0); 175 m68k_handle_int(IRQ_AMIGA_AUD0);
103 } 176 }
104 177
105 /* if audio 1 interrupt */ 178 /* if audio 1 interrupt */
106 if (ints & IF_AUD1) { 179 if (ints & IF_AUD1) {
107 amiga_custom.intreq = IF_AUD1; 180 amiga_custom.intreq = IF_AUD1;
108 generic_handle_irq(IRQ_AMIGA_AUD1); 181 m68k_handle_int(IRQ_AMIGA_AUD1);
109 } 182 }
110 183
111 /* if audio 2 interrupt */ 184 /* if audio 2 interrupt */
112 if (ints & IF_AUD2) { 185 if (ints & IF_AUD2) {
113 amiga_custom.intreq = IF_AUD2; 186 amiga_custom.intreq = IF_AUD2;
114 generic_handle_irq(IRQ_AMIGA_AUD2); 187 m68k_handle_int(IRQ_AMIGA_AUD2);
115 } 188 }
116 189
117 /* if audio 3 interrupt */ 190 /* if audio 3 interrupt */
118 if (ints & IF_AUD3) { 191 if (ints & IF_AUD3) {
119 amiga_custom.intreq = IF_AUD3; 192 amiga_custom.intreq = IF_AUD3;
120 generic_handle_irq(IRQ_AMIGA_AUD3); 193 m68k_handle_int(IRQ_AMIGA_AUD3);
121 } 194 }
195 return IRQ_HANDLED;
122} 196}
123 197
124static void ami_int5(unsigned int irq, struct irq_desc *desc) 198static irqreturn_t ami_int5(int irq, void *dev_id)
125{ 199{
126 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 200 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
127 201
128 /* if serial receive buffer full interrupt */ 202 /* if serial receive buffer full interrupt */
129 if (ints & IF_RBF) { 203 if (ints & IF_RBF) {
130 /* acknowledge of IF_RBF must be done by the serial interrupt */ 204 /* acknowledge of IF_RBF must be done by the serial interrupt */
131 generic_handle_irq(IRQ_AMIGA_RBF); 205 m68k_handle_int(IRQ_AMIGA_RBF);
132 } 206 }
133 207
134 /* if a disk sync interrupt */ 208 /* if a disk sync interrupt */
135 if (ints & IF_DSKSYN) { 209 if (ints & IF_DSKSYN) {
136 amiga_custom.intreq = IF_DSKSYN; 210 amiga_custom.intreq = IF_DSKSYN;
137 generic_handle_irq(IRQ_AMIGA_DSKSYN); 211 m68k_handle_int(IRQ_AMIGA_DSKSYN);
138 } 212 }
139} 213 return IRQ_HANDLED;
140
141
142/*
143 * void amiga_init_IRQ(void)
144 *
145 * Parameters: None
146 *
147 * Returns: Nothing
148 *
149 * This function should be called during kernel startup to initialize
150 * the amiga IRQ handling routines.
151 */
152
153void __init amiga_init_IRQ(void)
154{
155 m68k_setup_irq_controller(&amiga_irq_chip, handle_simple_irq, IRQ_USER,
156 AMI_STD_IRQS);
157
158 irq_set_chained_handler(IRQ_AUTO_1, ami_int1);
159 irq_set_chained_handler(IRQ_AUTO_3, ami_int3);
160 irq_set_chained_handler(IRQ_AUTO_4, ami_int4);
161 irq_set_chained_handler(IRQ_AUTO_5, ami_int5);
162
163 /* turn off PCMCIA interrupts */
164 if (AMIGAHW_PRESENT(PCMCIA))
165 gayle.inten = GAYLE_IRQ_IDE;
166
167 /* turn off all interrupts and enable the master interrupt bit */
168 amiga_custom.intena = 0x7fff;
169 amiga_custom.intreq = 0x7fff;
170 amiga_custom.intena = IF_SETCLR | IF_INTEN;
171
172 cia_init_IRQ(&ciaa_base);
173 cia_init_IRQ(&ciab_base);
174} 214}
diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
index 2559eefc6af..61e5c54625a 100644
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -14,6 +14,7 @@
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/module.h> 15#include <linux/module.h>
16 16
17#include <asm/system.h>
17#include <asm/amigahw.h> 18#include <asm/amigahw.h>
18 19
19static unsigned short *snd_data; 20static unsigned short *snd_data;
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c
index 18c0e29976e..ecd0f7ca6f0 100644
--- a/arch/m68k/amiga/cia.c
+++ b/arch/m68k/amiga/cia.c
@@ -93,14 +93,13 @@ static irqreturn_t cia_handler(int irq, void *dev_id)
93 amiga_custom.intreq = base->int_mask; 93 amiga_custom.intreq = base->int_mask;
94 for (; ints; mach_irq++, ints >>= 1) { 94 for (; ints; mach_irq++, ints >>= 1) {
95 if (ints & 1) 95 if (ints & 1)
96 generic_handle_irq(mach_irq); 96 m68k_handle_int(mach_irq);
97 } 97 }
98 return IRQ_HANDLED; 98 return IRQ_HANDLED;
99} 99}
100 100
101static void cia_irq_enable(struct irq_data *data) 101static void cia_enable_irq(unsigned int irq)
102{ 102{
103 unsigned int irq = data->irq;
104 unsigned char mask; 103 unsigned char mask;
105 104
106 if (irq >= IRQ_AMIGA_CIAB) { 105 if (irq >= IRQ_AMIGA_CIAB) {
@@ -114,20 +113,19 @@ static void cia_irq_enable(struct irq_data *data)
114 } 113 }
115} 114}
116 115
117static void cia_irq_disable(struct irq_data *data) 116static void cia_disable_irq(unsigned int irq)
118{ 117{
119 unsigned int irq = data->irq;
120
121 if (irq >= IRQ_AMIGA_CIAB) 118 if (irq >= IRQ_AMIGA_CIAB)
122 cia_able_irq(&ciab_base, 1 << (irq - IRQ_AMIGA_CIAB)); 119 cia_able_irq(&ciab_base, 1 << (irq - IRQ_AMIGA_CIAB));
123 else 120 else
124 cia_able_irq(&ciaa_base, 1 << (irq - IRQ_AMIGA_CIAA)); 121 cia_able_irq(&ciaa_base, 1 << (irq - IRQ_AMIGA_CIAA));
125} 122}
126 123
127static struct irq_chip cia_irq_chip = { 124static struct irq_controller cia_irq_controller = {
128 .name = "cia", 125 .name = "cia",
129 .irq_enable = cia_irq_enable, 126 .lock = __SPIN_LOCK_UNLOCKED(cia_irq_controller.lock),
130 .irq_disable = cia_irq_disable, 127 .enable = cia_enable_irq,
128 .disable = cia_disable_irq,
131}; 129};
132 130
133/* 131/*
@@ -136,9 +134,9 @@ static struct irq_chip cia_irq_chip = {
136 * into this chain. 134 * into this chain.
137 */ 135 */
138 136
139static void auto_irq_enable(struct irq_data *data) 137static void auto_enable_irq(unsigned int irq)
140{ 138{
141 switch (data->irq) { 139 switch (irq) {
142 case IRQ_AUTO_2: 140 case IRQ_AUTO_2:
143 amiga_custom.intena = IF_SETCLR | IF_PORTS; 141 amiga_custom.intena = IF_SETCLR | IF_PORTS;
144 break; 142 break;
@@ -148,9 +146,9 @@ static void auto_irq_enable(struct irq_data *data)
148 } 146 }
149} 147}
150 148
151static void auto_irq_disable(struct irq_data *data) 149static void auto_disable_irq(unsigned int irq)
152{ 150{
153 switch (data->irq) { 151 switch (irq) {
154 case IRQ_AUTO_2: 152 case IRQ_AUTO_2:
155 amiga_custom.intena = IF_PORTS; 153 amiga_custom.intena = IF_PORTS;
156 break; 154 break;
@@ -160,25 +158,24 @@ static void auto_irq_disable(struct irq_data *data)
160 } 158 }
161} 159}
162 160
163static struct irq_chip auto_irq_chip = { 161static struct irq_controller auto_irq_controller = {
164 .name = "auto", 162 .name = "auto",
165 .irq_enable = auto_irq_enable, 163 .lock = __SPIN_LOCK_UNLOCKED(auto_irq_controller.lock),
166 .irq_disable = auto_irq_disable, 164 .enable = auto_enable_irq,
165 .disable = auto_disable_irq,
167}; 166};
168 167
169void __init cia_init_IRQ(struct ciabase *base) 168void __init cia_init_IRQ(struct ciabase *base)
170{ 169{
171 m68k_setup_irq_controller(&cia_irq_chip, handle_simple_irq, 170 m68k_setup_irq_controller(&cia_irq_controller, base->cia_irq, CIA_IRQS);
172 base->cia_irq, CIA_IRQS);
173 171
174 /* clear any pending interrupt and turn off all interrupts */ 172 /* clear any pending interrupt and turn off all interrupts */
175 cia_set_irq(base, CIA_ICR_ALL); 173 cia_set_irq(base, CIA_ICR_ALL);
176 cia_able_irq(base, CIA_ICR_ALL); 174 cia_able_irq(base, CIA_ICR_ALL);
177 175
178 /* override auto int and install CIA handler */ 176 /* override auto int and install CIA handler */
179 m68k_setup_irq_controller(&auto_irq_chip, handle_simple_irq, 177 m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1);
180 base->handler_irq, 1); 178 m68k_irq_startup(base->handler_irq);
181 m68k_irq_startup_irq(base->handler_irq);
182 if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED, 179 if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED,
183 base->name, base)) 180 base->name, base))
184 pr_err("Couldn't register %s interrupt\n", base->name); 181 pr_err("Couldn't register %s interrupt\n", base->name);
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index ee01b7a38e5..82a4bb51d5d 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -29,6 +29,7 @@
29 29
30#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
31#include <asm/setup.h> 31#include <asm/setup.h>
32#include <asm/system.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/amigahw.h> 34#include <asm/amigahw.h>
34#include <asm/amigaints.h> 35#include <asm/amigaints.h>
@@ -510,7 +511,8 @@ static unsigned long amiga_gettimeoffset(void)
510 return ticks + offset; 511 return ticks + offset;
511} 512}
512 513
513static void amiga_reset(void) __noreturn; 514static NORET_TYPE void amiga_reset(void)
515 ATTRIB_NORET;
514 516
515static void amiga_reset(void) 517static void amiga_reset(void)
516{ 518{
diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c
index 6083088c0cc..7fd8b41723e 100644
--- a/arch/m68k/amiga/platform.c
+++ b/arch/m68k/amiga/platform.c
@@ -6,7 +6,6 @@
6 * for more details. 6 * for more details.
7 */ 7 */
8 8
9#include <linux/err.h>
10#include <linux/init.h> 9#include <linux/init.h>
11#include <linux/platform_device.h> 10#include <linux/platform_device.h>
12#include <linux/zorro.h> 11#include <linux/zorro.h>
@@ -47,22 +46,18 @@ static const struct resource zorro_resources[] __initconst = {
47 46
48static int __init amiga_init_bus(void) 47static int __init amiga_init_bus(void)
49{ 48{
50 struct platform_device *pdev;
51 unsigned int n;
52
53 if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) 49 if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
54 return -ENODEV; 50 return -ENODEV;
55 51
56 n = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2; 52 platform_device_register_simple("amiga-zorro", -1, zorro_resources,
57 pdev = platform_device_register_simple("amiga-zorro", -1, 53 AMIGAHW_PRESENT(ZORRO3) ? 4 : 2);
58 zorro_resources, n); 54 return 0;
59 return PTR_RET(pdev);
60} 55}
61 56
62subsys_initcall(amiga_init_bus); 57subsys_initcall(amiga_init_bus);
63 58
64 59
65static int __init z_dev_present(zorro_id id) 60static int z_dev_present(zorro_id id)
66{ 61{
67 unsigned int i; 62 unsigned int i;
68 63
@@ -131,122 +126,72 @@ static const struct resource amiga_rtc_resource __initconst = {
131static int __init amiga_init_devices(void) 126static int __init amiga_init_devices(void)
132{ 127{
133 struct platform_device *pdev; 128 struct platform_device *pdev;
134 int error;
135 129
136 if (!MACH_IS_AMIGA) 130 if (!MACH_IS_AMIGA)
137 return -ENODEV; 131 return -ENODEV;
138 132
139 /* video hardware */ 133 /* video hardware */
140 if (AMIGAHW_PRESENT(AMI_VIDEO)) { 134 if (AMIGAHW_PRESENT(AMI_VIDEO))
141 pdev = platform_device_register_simple("amiga-video", -1, NULL, 135 platform_device_register_simple("amiga-video", -1, NULL, 0);
142 0);
143 if (IS_ERR(pdev))
144 return PTR_ERR(pdev);
145 }
146 136
147 137
148 /* sound hardware */ 138 /* sound hardware */
149 if (AMIGAHW_PRESENT(AMI_AUDIO)) { 139 if (AMIGAHW_PRESENT(AMI_AUDIO))
150 pdev = platform_device_register_simple("amiga-audio", -1, NULL, 140 platform_device_register_simple("amiga-audio", -1, NULL, 0);
151 0);
152 if (IS_ERR(pdev))
153 return PTR_ERR(pdev);
154 }
155 141
156 142
157 /* storage interfaces */ 143 /* storage interfaces */
158 if (AMIGAHW_PRESENT(AMI_FLOPPY)) { 144 if (AMIGAHW_PRESENT(AMI_FLOPPY))
159 pdev = platform_device_register_simple("amiga-floppy", -1, 145 platform_device_register_simple("amiga-floppy", -1, NULL, 0);
160 NULL, 0);
161 if (IS_ERR(pdev))
162 return PTR_ERR(pdev);
163 }
164 146
165 if (AMIGAHW_PRESENT(A3000_SCSI)) { 147 if (AMIGAHW_PRESENT(A3000_SCSI))
166 pdev = platform_device_register_simple("amiga-a3000-scsi", -1, 148 platform_device_register_simple("amiga-a3000-scsi", -1,
167 &a3000_scsi_resource, 1); 149 &a3000_scsi_resource, 1);
168 if (IS_ERR(pdev))
169 return PTR_ERR(pdev);
170 }
171 150
172 if (AMIGAHW_PRESENT(A4000_SCSI)) { 151 if (AMIGAHW_PRESENT(A4000_SCSI))
173 pdev = platform_device_register_simple("amiga-a4000t-scsi", -1, 152 platform_device_register_simple("amiga-a4000t-scsi", -1,
174 &a4000t_scsi_resource, 153 &a4000t_scsi_resource, 1);
175 1);
176 if (IS_ERR(pdev))
177 return PTR_ERR(pdev);
178 }
179 154
180 if (AMIGAHW_PRESENT(A1200_IDE) || 155 if (AMIGAHW_PRESENT(A1200_IDE) ||
181 z_dev_present(ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE)) { 156 z_dev_present(ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE)) {
182 pdev = platform_device_register_simple("amiga-gayle-ide", -1, 157 pdev = platform_device_register_simple("amiga-gayle-ide", -1,
183 &a1200_ide_resource, 1); 158 &a1200_ide_resource, 1);
184 if (IS_ERR(pdev)) 159 platform_device_add_data(pdev, &a1200_ide_pdata,
185 return PTR_ERR(pdev); 160 sizeof(a1200_ide_pdata));
186 error = platform_device_add_data(pdev, &a1200_ide_pdata,
187 sizeof(a1200_ide_pdata));
188 if (error)
189 return error;
190 } 161 }
191 162
192 if (AMIGAHW_PRESENT(A4000_IDE)) { 163 if (AMIGAHW_PRESENT(A4000_IDE)) {
193 pdev = platform_device_register_simple("amiga-gayle-ide", -1, 164 pdev = platform_device_register_simple("amiga-gayle-ide", -1,
194 &a4000_ide_resource, 1); 165 &a4000_ide_resource, 1);
195 if (IS_ERR(pdev)) 166 platform_device_add_data(pdev, &a4000_ide_pdata,
196 return PTR_ERR(pdev); 167 sizeof(a4000_ide_pdata));
197 error = platform_device_add_data(pdev, &a4000_ide_pdata,
198 sizeof(a4000_ide_pdata));
199 if (error)
200 return error;
201 } 168 }
202 169
203 170
204 /* other I/O hardware */ 171 /* other I/O hardware */
205 if (AMIGAHW_PRESENT(AMI_KEYBOARD)) { 172 if (AMIGAHW_PRESENT(AMI_KEYBOARD))
206 pdev = platform_device_register_simple("amiga-keyboard", -1, 173 platform_device_register_simple("amiga-keyboard", -1, NULL, 0);
207 NULL, 0);
208 if (IS_ERR(pdev))
209 return PTR_ERR(pdev);
210 }
211 174
212 if (AMIGAHW_PRESENT(AMI_MOUSE)) { 175 if (AMIGAHW_PRESENT(AMI_MOUSE))
213 pdev = platform_device_register_simple("amiga-mouse", -1, NULL, 176 platform_device_register_simple("amiga-mouse", -1, NULL, 0);
214 0);
215 if (IS_ERR(pdev))
216 return PTR_ERR(pdev);
217 }
218 177
219 if (AMIGAHW_PRESENT(AMI_SERIAL)) { 178 if (AMIGAHW_PRESENT(AMI_SERIAL))
220 pdev = platform_device_register_simple("amiga-serial", -1, 179 platform_device_register_simple("amiga-serial", -1, NULL, 0);
221 NULL, 0);
222 if (IS_ERR(pdev))
223 return PTR_ERR(pdev);
224 }
225 180
226 if (AMIGAHW_PRESENT(AMI_PARALLEL)) { 181 if (AMIGAHW_PRESENT(AMI_PARALLEL))
227 pdev = platform_device_register_simple("amiga-parallel", -1, 182 platform_device_register_simple("amiga-parallel", -1, NULL, 0);
228 NULL, 0);
229 if (IS_ERR(pdev))
230 return PTR_ERR(pdev);
231 }
232 183
233 184
234 /* real time clocks */ 185 /* real time clocks */
235 if (AMIGAHW_PRESENT(A2000_CLK)) { 186 if (AMIGAHW_PRESENT(A2000_CLK))
236 pdev = platform_device_register_simple("rtc-msm6242", -1, 187 platform_device_register_simple("rtc-msm6242", -1,
237 &amiga_rtc_resource, 1); 188 &amiga_rtc_resource, 1);
238 if (IS_ERR(pdev))
239 return PTR_ERR(pdev);
240 }
241 189
242 if (AMIGAHW_PRESENT(A3000_CLK)) { 190 if (AMIGAHW_PRESENT(A3000_CLK))
243 pdev = platform_device_register_simple("rtc-rp5c01", -1, 191 platform_device_register_simple("rtc-rp5c01", -1,
244 &amiga_rtc_resource, 1); 192 &amiga_rtc_resource, 1);
245 if (IS_ERR(pdev))
246 return PTR_ERR(pdev);
247 }
248 193
249 return 0; 194 return 0;
250} 195}
251 196
252arch_initcall(amiga_init_devices); 197device_initcall(amiga_init_devices);