diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/adb-iop.c | 10 | ||||
-rw-r--r-- | drivers/macintosh/adb.c | 10 | ||||
-rw-r--r-- | drivers/macintosh/adbhid.c | 20 | ||||
-rw-r--r-- | drivers/macintosh/macio-adb.c | 9 | ||||
-rw-r--r-- | drivers/macintosh/smu.c | 6 | ||||
-rw-r--r-- | drivers/macintosh/via-cuda.c | 14 | ||||
-rw-r--r-- | drivers/macintosh/via-macii.c | 9 | ||||
-rw-r--r-- | drivers/macintosh/via-maciisi.c | 14 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu.c | 32 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu68k.c | 19 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_pm112.c | 29 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_pm81.c | 25 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_pm91.c | 25 |
13 files changed, 110 insertions, 112 deletions
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c index d56d400b6aaa..17ef5d3c01b4 100644 --- a/drivers/macintosh/adb-iop.c +++ b/drivers/macintosh/adb-iop.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | /*#define DEBUG_ADB_IOP*/ | 31 | /*#define DEBUG_ADB_IOP*/ |
32 | 32 | ||
33 | extern void iop_ism_irq(int, void *, struct pt_regs *); | 33 | extern void iop_ism_irq(int, void *); |
34 | 34 | ||
35 | static struct adb_request *current_req; | 35 | static struct adb_request *current_req; |
36 | static struct adb_request *last_req; | 36 | static struct adb_request *last_req; |
@@ -78,7 +78,7 @@ static void adb_iop_end_req(struct adb_request *req, int state) | |||
78 | * This will be called when a packet has been successfully sent. | 78 | * This will be called when a packet has been successfully sent. |
79 | */ | 79 | */ |
80 | 80 | ||
81 | static void adb_iop_complete(struct iop_msg *msg, struct pt_regs *regs) | 81 | static void adb_iop_complete(struct iop_msg *msg) |
82 | { | 82 | { |
83 | struct adb_request *req; | 83 | struct adb_request *req; |
84 | uint flags; | 84 | uint flags; |
@@ -100,7 +100,7 @@ static void adb_iop_complete(struct iop_msg *msg, struct pt_regs *regs) | |||
100 | * commands or autopoll packets) are received. | 100 | * commands or autopoll packets) are received. |
101 | */ | 101 | */ |
102 | 102 | ||
103 | static void adb_iop_listen(struct iop_msg *msg, struct pt_regs *regs) | 103 | static void adb_iop_listen(struct iop_msg *msg) |
104 | { | 104 | { |
105 | struct adb_iopmsg *amsg = (struct adb_iopmsg *) msg->message; | 105 | struct adb_iopmsg *amsg = (struct adb_iopmsg *) msg->message; |
106 | struct adb_request *req; | 106 | struct adb_request *req; |
@@ -143,7 +143,7 @@ static void adb_iop_listen(struct iop_msg *msg, struct pt_regs *regs) | |||
143 | req->reply_len = amsg->count + 1; | 143 | req->reply_len = amsg->count + 1; |
144 | memcpy(req->reply, &amsg->cmd, req->reply_len); | 144 | memcpy(req->reply, &amsg->cmd, req->reply_len); |
145 | } else { | 145 | } else { |
146 | adb_input(&amsg->cmd, amsg->count + 1, regs, | 146 | adb_input(&amsg->cmd, amsg->count + 1, |
147 | amsg->flags & ADB_IOP_AUTOPOLL); | 147 | amsg->flags & ADB_IOP_AUTOPOLL); |
148 | } | 148 | } |
149 | memcpy(msg->reply, msg->message, IOP_MSG_LEN); | 149 | memcpy(msg->reply, msg->message, IOP_MSG_LEN); |
@@ -266,7 +266,7 @@ int adb_iop_autopoll(int devs) | |||
266 | void adb_iop_poll(void) | 266 | void adb_iop_poll(void) |
267 | { | 267 | { |
268 | if (adb_iop_state == idle) adb_iop_start(); | 268 | if (adb_iop_state == idle) adb_iop_start(); |
269 | iop_ism_irq(0, (void *) ADB_IOP, NULL); | 269 | iop_ism_irq(0, (void *) ADB_IOP); |
270 | } | 270 | } |
271 | 271 | ||
272 | int adb_iop_reset_bus(void) | 272 | int adb_iop_reset_bus(void) |
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index 360f93f6fcdb..be0bd34ff6f9 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
@@ -103,7 +103,7 @@ static void adbdev_init(void); | |||
103 | static int try_handler_change(int, int); | 103 | static int try_handler_change(int, int); |
104 | 104 | ||
105 | static struct adb_handler { | 105 | static struct adb_handler { |
106 | void (*handler)(unsigned char *, int, struct pt_regs *, int); | 106 | void (*handler)(unsigned char *, int, int); |
107 | int original_address; | 107 | int original_address; |
108 | int handler_id; | 108 | int handler_id; |
109 | int busy; | 109 | int busy; |
@@ -522,7 +522,7 @@ bail: | |||
522 | the handler_id id it doesn't match. */ | 522 | the handler_id id it doesn't match. */ |
523 | int | 523 | int |
524 | adb_register(int default_id, int handler_id, struct adb_ids *ids, | 524 | adb_register(int default_id, int handler_id, struct adb_ids *ids, |
525 | void (*handler)(unsigned char *, int, struct pt_regs *, int)) | 525 | void (*handler)(unsigned char *, int, int)) |
526 | { | 526 | { |
527 | int i; | 527 | int i; |
528 | 528 | ||
@@ -570,13 +570,13 @@ adb_unregister(int index) | |||
570 | } | 570 | } |
571 | 571 | ||
572 | void | 572 | void |
573 | adb_input(unsigned char *buf, int nb, struct pt_regs *regs, int autopoll) | 573 | adb_input(unsigned char *buf, int nb, int autopoll) |
574 | { | 574 | { |
575 | int i, id; | 575 | int i, id; |
576 | static int dump_adb_input = 0; | 576 | static int dump_adb_input = 0; |
577 | unsigned long flags; | 577 | unsigned long flags; |
578 | 578 | ||
579 | void (*handler)(unsigned char *, int, struct pt_regs *, int); | 579 | void (*handler)(unsigned char *, int, int); |
580 | 580 | ||
581 | /* We skip keystrokes and mouse moves when the sleep process | 581 | /* We skip keystrokes and mouse moves when the sleep process |
582 | * has been started. We stop autopoll, but this is another security | 582 | * has been started. We stop autopoll, but this is another security |
@@ -597,7 +597,7 @@ adb_input(unsigned char *buf, int nb, struct pt_regs *regs, int autopoll) | |||
597 | adb_handler[id].busy = 1; | 597 | adb_handler[id].busy = 1; |
598 | write_unlock_irqrestore(&adb_handler_lock, flags); | 598 | write_unlock_irqrestore(&adb_handler_lock, flags); |
599 | if (handler != NULL) { | 599 | if (handler != NULL) { |
600 | (*handler)(buf, nb, regs, autopoll); | 600 | (*handler)(buf, nb, autopoll); |
601 | wmb(); | 601 | wmb(); |
602 | adb_handler[id].busy = 0; | 602 | adb_handler[id].busy = 0; |
603 | } | 603 | } |
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c index b7fb367808d8..5066e7a8ea9c 100644 --- a/drivers/macintosh/adbhid.c +++ b/drivers/macintosh/adbhid.c | |||
@@ -222,7 +222,7 @@ static struct adbhid *adbhid[16]; | |||
222 | 222 | ||
223 | static void adbhid_probe(void); | 223 | static void adbhid_probe(void); |
224 | 224 | ||
225 | static void adbhid_input_keycode(int, int, int, struct pt_regs *); | 225 | static void adbhid_input_keycode(int, int, int); |
226 | 226 | ||
227 | static void init_trackpad(int id); | 227 | static void init_trackpad(int id); |
228 | static void init_trackball(int id); | 228 | static void init_trackball(int id); |
@@ -253,7 +253,7 @@ static struct adb_ids buttons_ids; | |||
253 | #define ADBMOUSE_MACALLY2 9 /* MacAlly 2-button mouse */ | 253 | #define ADBMOUSE_MACALLY2 9 /* MacAlly 2-button mouse */ |
254 | 254 | ||
255 | static void | 255 | static void |
256 | adbhid_keyboard_input(unsigned char *data, int nb, struct pt_regs *regs, int apoll) | 256 | adbhid_keyboard_input(unsigned char *data, int nb, int apoll) |
257 | { | 257 | { |
258 | int id = (data[0] >> 4) & 0x0f; | 258 | int id = (data[0] >> 4) & 0x0f; |
259 | 259 | ||
@@ -266,13 +266,13 @@ adbhid_keyboard_input(unsigned char *data, int nb, struct pt_regs *regs, int apo | |||
266 | /* first check this is from register 0 */ | 266 | /* first check this is from register 0 */ |
267 | if (nb != 3 || (data[0] & 3) != KEYB_KEYREG) | 267 | if (nb != 3 || (data[0] & 3) != KEYB_KEYREG) |
268 | return; /* ignore it */ | 268 | return; /* ignore it */ |
269 | adbhid_input_keycode(id, data[1], 0, regs); | 269 | adbhid_input_keycode(id, data[1], 0); |
270 | if (!(data[2] == 0xff || (data[2] == 0x7f && data[1] == 0x7f))) | 270 | if (!(data[2] == 0xff || (data[2] == 0x7f && data[1] == 0x7f))) |
271 | adbhid_input_keycode(id, data[2], 0, regs); | 271 | adbhid_input_keycode(id, data[2], 0); |
272 | } | 272 | } |
273 | 273 | ||
274 | static void | 274 | static void |
275 | adbhid_input_keycode(int id, int keycode, int repeat, struct pt_regs *regs) | 275 | adbhid_input_keycode(int id, int keycode, int repeat) |
276 | { | 276 | { |
277 | struct adbhid *ahid = adbhid[id]; | 277 | struct adbhid *ahid = adbhid[id]; |
278 | int up_flag; | 278 | int up_flag; |
@@ -282,7 +282,6 @@ adbhid_input_keycode(int id, int keycode, int repeat, struct pt_regs *regs) | |||
282 | 282 | ||
283 | switch (keycode) { | 283 | switch (keycode) { |
284 | case ADB_KEY_CAPSLOCK: /* Generate down/up events for CapsLock everytime. */ | 284 | case ADB_KEY_CAPSLOCK: /* Generate down/up events for CapsLock everytime. */ |
285 | input_regs(ahid->input, regs); | ||
286 | input_report_key(ahid->input, KEY_CAPSLOCK, 1); | 285 | input_report_key(ahid->input, KEY_CAPSLOCK, 1); |
287 | input_report_key(ahid->input, KEY_CAPSLOCK, 0); | 286 | input_report_key(ahid->input, KEY_CAPSLOCK, 0); |
288 | input_sync(ahid->input); | 287 | input_sync(ahid->input); |
@@ -338,7 +337,6 @@ adbhid_input_keycode(int id, int keycode, int repeat, struct pt_regs *regs) | |||
338 | } | 337 | } |
339 | 338 | ||
340 | if (adbhid[id]->keycode[keycode]) { | 339 | if (adbhid[id]->keycode[keycode]) { |
341 | input_regs(adbhid[id]->input, regs); | ||
342 | input_report_key(adbhid[id]->input, | 340 | input_report_key(adbhid[id]->input, |
343 | adbhid[id]->keycode[keycode], !up_flag); | 341 | adbhid[id]->keycode[keycode], !up_flag); |
344 | input_sync(adbhid[id]->input); | 342 | input_sync(adbhid[id]->input); |
@@ -349,7 +347,7 @@ adbhid_input_keycode(int id, int keycode, int repeat, struct pt_regs *regs) | |||
349 | } | 347 | } |
350 | 348 | ||
351 | static void | 349 | static void |
352 | adbhid_mouse_input(unsigned char *data, int nb, struct pt_regs *regs, int autopoll) | 350 | adbhid_mouse_input(unsigned char *data, int nb, int autopoll) |
353 | { | 351 | { |
354 | int id = (data[0] >> 4) & 0x0f; | 352 | int id = (data[0] >> 4) & 0x0f; |
355 | 353 | ||
@@ -432,8 +430,6 @@ adbhid_mouse_input(unsigned char *data, int nb, struct pt_regs *regs, int autopo | |||
432 | break; | 430 | break; |
433 | } | 431 | } |
434 | 432 | ||
435 | input_regs(adbhid[id]->input, regs); | ||
436 | |||
437 | input_report_key(adbhid[id]->input, BTN_LEFT, !((data[1] >> 7) & 1)); | 433 | input_report_key(adbhid[id]->input, BTN_LEFT, !((data[1] >> 7) & 1)); |
438 | input_report_key(adbhid[id]->input, BTN_MIDDLE, !((data[2] >> 7) & 1)); | 434 | input_report_key(adbhid[id]->input, BTN_MIDDLE, !((data[2] >> 7) & 1)); |
439 | 435 | ||
@@ -449,7 +445,7 @@ adbhid_mouse_input(unsigned char *data, int nb, struct pt_regs *regs, int autopo | |||
449 | } | 445 | } |
450 | 446 | ||
451 | static void | 447 | static void |
452 | adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int autopoll) | 448 | adbhid_buttons_input(unsigned char *data, int nb, int autopoll) |
453 | { | 449 | { |
454 | int id = (data[0] >> 4) & 0x0f; | 450 | int id = (data[0] >> 4) & 0x0f; |
455 | 451 | ||
@@ -458,8 +454,6 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto | |||
458 | return; | 454 | return; |
459 | } | 455 | } |
460 | 456 | ||
461 | input_regs(adbhid[id]->input, regs); | ||
462 | |||
463 | switch (adbhid[id]->original_handler_id) { | 457 | switch (adbhid[id]->original_handler_id) { |
464 | default: | 458 | default: |
465 | case 0x02: /* Adjustable keyboard button device */ | 459 | case 0x02: /* Adjustable keyboard button device */ |
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 4b08852c35ee..797cef72258f 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c | |||
@@ -64,7 +64,7 @@ static DEFINE_SPINLOCK(macio_lock); | |||
64 | 64 | ||
65 | static int macio_probe(void); | 65 | static int macio_probe(void); |
66 | static int macio_init(void); | 66 | static int macio_init(void); |
67 | static irqreturn_t macio_adb_interrupt(int irq, void *arg, struct pt_regs *regs); | 67 | static irqreturn_t macio_adb_interrupt(int irq, void *arg); |
68 | static int macio_send_request(struct adb_request *req, int sync); | 68 | static int macio_send_request(struct adb_request *req, int sync); |
69 | static int macio_adb_autopoll(int devs); | 69 | static int macio_adb_autopoll(int devs); |
70 | static void macio_adb_poll(void); | 70 | static void macio_adb_poll(void); |
@@ -189,8 +189,7 @@ static int macio_send_request(struct adb_request *req, int sync) | |||
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
191 | 191 | ||
192 | static irqreturn_t macio_adb_interrupt(int irq, void *arg, | 192 | static irqreturn_t macio_adb_interrupt(int irq, void *arg) |
193 | struct pt_regs *regs) | ||
194 | { | 193 | { |
195 | int i, n, err; | 194 | int i, n, err; |
196 | struct adb_request *req = NULL; | 195 | struct adb_request *req = NULL; |
@@ -260,7 +259,7 @@ static irqreturn_t macio_adb_interrupt(int irq, void *arg, | |||
260 | (*done)(req); | 259 | (*done)(req); |
261 | } | 260 | } |
262 | if (ibuf_len) | 261 | if (ibuf_len) |
263 | adb_input(ibuf, ibuf_len, regs, autopoll); | 262 | adb_input(ibuf, ibuf_len, autopoll); |
264 | 263 | ||
265 | return IRQ_RETVAL(handled); | 264 | return IRQ_RETVAL(handled); |
266 | } | 265 | } |
@@ -271,6 +270,6 @@ static void macio_adb_poll(void) | |||
271 | 270 | ||
272 | local_irq_save(flags); | 271 | local_irq_save(flags); |
273 | if (in_8(&adb->intr.r) != 0) | 272 | if (in_8(&adb->intr.r) != 0) |
274 | macio_adb_interrupt(0, NULL, NULL); | 273 | macio_adb_interrupt(0, NULL); |
275 | local_irq_restore(flags); | 274 | local_irq_restore(flags); |
276 | } | 275 | } |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index c0f9d82e4662..ade25b3fbb35 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -145,7 +145,7 @@ static void smu_start_cmd(void) | |||
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
148 | static irqreturn_t smu_db_intr(int irq, void *arg, struct pt_regs *regs) | 148 | static irqreturn_t smu_db_intr(int irq, void *arg) |
149 | { | 149 | { |
150 | unsigned long flags; | 150 | unsigned long flags; |
151 | struct smu_cmd *cmd; | 151 | struct smu_cmd *cmd; |
@@ -224,7 +224,7 @@ static irqreturn_t smu_db_intr(int irq, void *arg, struct pt_regs *regs) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | 226 | ||
227 | static irqreturn_t smu_msg_intr(int irq, void *arg, struct pt_regs *regs) | 227 | static irqreturn_t smu_msg_intr(int irq, void *arg) |
228 | { | 228 | { |
229 | /* I don't quite know what to do with this one, we seem to never | 229 | /* I don't quite know what to do with this one, we seem to never |
230 | * receive it, so I suspect we have to arm it someway in the SMU | 230 | * receive it, so I suspect we have to arm it someway in the SMU |
@@ -309,7 +309,7 @@ void smu_poll(void) | |||
309 | 309 | ||
310 | gpio = pmac_do_feature_call(PMAC_FTR_READ_GPIO, NULL, smu->doorbell); | 310 | gpio = pmac_do_feature_call(PMAC_FTR_READ_GPIO, NULL, smu->doorbell); |
311 | if ((gpio & 7) == 7) | 311 | if ((gpio & 7) == 7) |
312 | smu_db_intr(smu->db_irq, smu, NULL); | 312 | smu_db_intr(smu->db_irq, smu); |
313 | } | 313 | } |
314 | EXPORT_SYMBOL(smu_poll); | 314 | EXPORT_SYMBOL(smu_poll); |
315 | 315 | ||
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index 7512d1c15207..df66291b1322 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c | |||
@@ -98,8 +98,8 @@ static int cuda_reset_adb_bus(void); | |||
98 | 98 | ||
99 | static int cuda_init_via(void); | 99 | static int cuda_init_via(void); |
100 | static void cuda_start(void); | 100 | static void cuda_start(void); |
101 | static irqreturn_t cuda_interrupt(int irq, void *arg, struct pt_regs *regs); | 101 | static irqreturn_t cuda_interrupt(int irq, void *arg); |
102 | static void cuda_input(unsigned char *buf, int nb, struct pt_regs *regs); | 102 | static void cuda_input(unsigned char *buf, int nb); |
103 | void cuda_poll(void); | 103 | void cuda_poll(void); |
104 | static int cuda_write(struct adb_request *req); | 104 | static int cuda_write(struct adb_request *req); |
105 | 105 | ||
@@ -437,12 +437,12 @@ cuda_poll(void) | |||
437 | * disable_irq(), would that work on m68k ? --BenH | 437 | * disable_irq(), would that work on m68k ? --BenH |
438 | */ | 438 | */ |
439 | local_irq_save(flags); | 439 | local_irq_save(flags); |
440 | cuda_interrupt(0, NULL, NULL); | 440 | cuda_interrupt(0, NULL); |
441 | local_irq_restore(flags); | 441 | local_irq_restore(flags); |
442 | } | 442 | } |
443 | 443 | ||
444 | static irqreturn_t | 444 | static irqreturn_t |
445 | cuda_interrupt(int irq, void *arg, struct pt_regs *regs) | 445 | cuda_interrupt(int irq, void *arg) |
446 | { | 446 | { |
447 | int status; | 447 | int status; |
448 | struct adb_request *req = NULL; | 448 | struct adb_request *req = NULL; |
@@ -594,12 +594,12 @@ cuda_interrupt(int irq, void *arg, struct pt_regs *regs) | |||
594 | (*done)(req); | 594 | (*done)(req); |
595 | } | 595 | } |
596 | if (ibuf_len) | 596 | if (ibuf_len) |
597 | cuda_input(ibuf, ibuf_len, regs); | 597 | cuda_input(ibuf, ibuf_len); |
598 | return IRQ_HANDLED; | 598 | return IRQ_HANDLED; |
599 | } | 599 | } |
600 | 600 | ||
601 | static void | 601 | static void |
602 | cuda_input(unsigned char *buf, int nb, struct pt_regs *regs) | 602 | cuda_input(unsigned char *buf, int nb) |
603 | { | 603 | { |
604 | int i; | 604 | int i; |
605 | 605 | ||
@@ -615,7 +615,7 @@ cuda_input(unsigned char *buf, int nb, struct pt_regs *regs) | |||
615 | } | 615 | } |
616 | #endif /* CONFIG_XMON */ | 616 | #endif /* CONFIG_XMON */ |
617 | #ifdef CONFIG_ADB | 617 | #ifdef CONFIG_ADB |
618 | adb_input(buf+2, nb-2, regs, buf[1] & 0x40); | 618 | adb_input(buf+2, nb-2, buf[1] & 0x40); |
619 | #endif /* CONFIG_ADB */ | 619 | #endif /* CONFIG_ADB */ |
620 | break; | 620 | break; |
621 | 621 | ||
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index 2a2ffe060169..5d88d5b0ad99 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c | |||
@@ -77,7 +77,7 @@ static volatile unsigned char *via; | |||
77 | 77 | ||
78 | static int macii_init_via(void); | 78 | static int macii_init_via(void); |
79 | static void macii_start(void); | 79 | static void macii_start(void); |
80 | static irqreturn_t macii_interrupt(int irq, void *arg, struct pt_regs *regs); | 80 | static irqreturn_t macii_interrupt(int irq, void *arg); |
81 | static void macii_retransmit(int); | 81 | static void macii_retransmit(int); |
82 | static void macii_queue_poll(void); | 82 | static void macii_queue_poll(void); |
83 | 83 | ||
@@ -295,7 +295,7 @@ static void macii_poll(void) | |||
295 | unsigned long flags; | 295 | unsigned long flags; |
296 | 296 | ||
297 | local_irq_save(flags); | 297 | local_irq_save(flags); |
298 | if (via[IFR] & SR_INT) macii_interrupt(0, NULL, NULL); | 298 | if (via[IFR] & SR_INT) macii_interrupt(0, NULL); |
299 | local_irq_restore(flags); | 299 | local_irq_restore(flags); |
300 | } | 300 | } |
301 | 301 | ||
@@ -410,7 +410,7 @@ static void macii_start(void) | |||
410 | * Note: As of 21/10/97, the MacII ADB part works including timeout detection | 410 | * Note: As of 21/10/97, the MacII ADB part works including timeout detection |
411 | * and retransmit (Talk to the last active device). | 411 | * and retransmit (Talk to the last active device). |
412 | */ | 412 | */ |
413 | static irqreturn_t macii_interrupt(int irq, void *arg, struct pt_regs *regs) | 413 | static irqreturn_t macii_interrupt(int irq, void *arg) |
414 | { | 414 | { |
415 | int x, adbdir; | 415 | int x, adbdir; |
416 | unsigned long flags; | 416 | unsigned long flags; |
@@ -602,8 +602,7 @@ static irqreturn_t macii_interrupt(int irq, void *arg, struct pt_regs *regs) | |||
602 | current_req = req->next; | 602 | current_req = req->next; |
603 | if (req->done) (*req->done)(req); | 603 | if (req->done) (*req->done)(req); |
604 | } else { | 604 | } else { |
605 | adb_input(reply_buf, reply_ptr - reply_buf, | 605 | adb_input(reply_buf, reply_ptr - reply_buf, 0); |
606 | regs, 0); | ||
607 | } | 606 | } |
608 | 607 | ||
609 | /* | 608 | /* |
diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c index 0129fcc3b183..1f0aa5dc9aa5 100644 --- a/drivers/macintosh/via-maciisi.c +++ b/drivers/macintosh/via-maciisi.c | |||
@@ -84,8 +84,8 @@ static int maciisi_init(void); | |||
84 | static int maciisi_send_request(struct adb_request* req, int sync); | 84 | static int maciisi_send_request(struct adb_request* req, int sync); |
85 | static void maciisi_sync(struct adb_request *req); | 85 | static void maciisi_sync(struct adb_request *req); |
86 | static int maciisi_write(struct adb_request* req); | 86 | static int maciisi_write(struct adb_request* req); |
87 | static irqreturn_t maciisi_interrupt(int irq, void* arg, struct pt_regs* regs); | 87 | static irqreturn_t maciisi_interrupt(int irq, void* arg); |
88 | static void maciisi_input(unsigned char *buf, int nb, struct pt_regs *regs); | 88 | static void maciisi_input(unsigned char *buf, int nb); |
89 | static int maciisi_init_via(void); | 89 | static int maciisi_init_via(void); |
90 | static void maciisi_poll(void); | 90 | static void maciisi_poll(void); |
91 | static int maciisi_start(void); | 91 | static int maciisi_start(void); |
@@ -421,7 +421,7 @@ maciisi_poll(void) | |||
421 | 421 | ||
422 | local_irq_save(flags); | 422 | local_irq_save(flags); |
423 | if (via[IFR] & SR_INT) { | 423 | if (via[IFR] & SR_INT) { |
424 | maciisi_interrupt(0, NULL, NULL); | 424 | maciisi_interrupt(0, NULL); |
425 | } | 425 | } |
426 | else /* avoid calling this function too quickly in a loop */ | 426 | else /* avoid calling this function too quickly in a loop */ |
427 | udelay(ADB_DELAY); | 427 | udelay(ADB_DELAY); |
@@ -433,7 +433,7 @@ maciisi_poll(void) | |||
433 | register is either full or empty. In practice, I have no idea what | 433 | register is either full or empty. In practice, I have no idea what |
434 | it means :( */ | 434 | it means :( */ |
435 | static irqreturn_t | 435 | static irqreturn_t |
436 | maciisi_interrupt(int irq, void* arg, struct pt_regs* regs) | 436 | maciisi_interrupt(int irq, void* arg) |
437 | { | 437 | { |
438 | int status; | 438 | int status; |
439 | struct adb_request *req; | 439 | struct adb_request *req; |
@@ -612,7 +612,7 @@ maciisi_interrupt(int irq, void* arg, struct pt_regs* regs) | |||
612 | /* Obviously, we got it */ | 612 | /* Obviously, we got it */ |
613 | reading_reply = 0; | 613 | reading_reply = 0; |
614 | } else { | 614 | } else { |
615 | maciisi_input(maciisi_rbuf, reply_ptr - maciisi_rbuf, regs); | 615 | maciisi_input(maciisi_rbuf, reply_ptr - maciisi_rbuf); |
616 | } | 616 | } |
617 | maciisi_state = idle; | 617 | maciisi_state = idle; |
618 | status = via[B] & (TIP|TREQ); | 618 | status = via[B] & (TIP|TREQ); |
@@ -657,7 +657,7 @@ maciisi_interrupt(int irq, void* arg, struct pt_regs* regs) | |||
657 | } | 657 | } |
658 | 658 | ||
659 | static void | 659 | static void |
660 | maciisi_input(unsigned char *buf, int nb, struct pt_regs *regs) | 660 | maciisi_input(unsigned char *buf, int nb) |
661 | { | 661 | { |
662 | #ifdef DEBUG_MACIISI_ADB | 662 | #ifdef DEBUG_MACIISI_ADB |
663 | int i; | 663 | int i; |
@@ -665,7 +665,7 @@ maciisi_input(unsigned char *buf, int nb, struct pt_regs *regs) | |||
665 | 665 | ||
666 | switch (buf[0]) { | 666 | switch (buf[0]) { |
667 | case ADB_PACKET: | 667 | case ADB_PACKET: |
668 | adb_input(buf+2, nb-2, regs, buf[1] & 0x40); | 668 | adb_input(buf+2, nb-2, buf[1] & 0x40); |
669 | break; | 669 | break; |
670 | default: | 670 | default: |
671 | #ifdef DEBUG_MACIISI_ADB | 671 | #ifdef DEBUG_MACIISI_ADB |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 4f04fd0956a0..e63ea1c1f3c1 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -191,8 +191,8 @@ static int pmu_adb_reset_bus(void); | |||
191 | 191 | ||
192 | static int init_pmu(void); | 192 | static int init_pmu(void); |
193 | static void pmu_start(void); | 193 | static void pmu_start(void); |
194 | static irqreturn_t via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs); | 194 | static irqreturn_t via_pmu_interrupt(int irq, void *arg); |
195 | static irqreturn_t gpio1_interrupt(int irq, void *arg, struct pt_regs *regs); | 195 | static irqreturn_t gpio1_interrupt(int irq, void *arg); |
196 | static int proc_get_info(char *page, char **start, off_t off, | 196 | static int proc_get_info(char *page, char **start, off_t off, |
197 | int count, int *eof, void *data); | 197 | int count, int *eof, void *data); |
198 | static int proc_get_irqstats(char *page, char **start, off_t off, | 198 | static int proc_get_irqstats(char *page, char **start, off_t off, |
@@ -555,7 +555,7 @@ init_pmu(void) | |||
555 | } | 555 | } |
556 | if (pmu_state == idle) | 556 | if (pmu_state == idle) |
557 | adb_int_pending = 1; | 557 | adb_int_pending = 1; |
558 | via_pmu_interrupt(0, NULL, NULL); | 558 | via_pmu_interrupt(0, NULL); |
559 | udelay(10); | 559 | udelay(10); |
560 | } | 560 | } |
561 | 561 | ||
@@ -1215,7 +1215,7 @@ pmu_poll(void) | |||
1215 | return; | 1215 | return; |
1216 | if (disable_poll) | 1216 | if (disable_poll) |
1217 | return; | 1217 | return; |
1218 | via_pmu_interrupt(0, NULL, NULL); | 1218 | via_pmu_interrupt(0, NULL); |
1219 | } | 1219 | } |
1220 | 1220 | ||
1221 | void | 1221 | void |
@@ -1228,7 +1228,7 @@ pmu_poll_adb(void) | |||
1228 | /* Kicks ADB read when PMU is suspended */ | 1228 | /* Kicks ADB read when PMU is suspended */ |
1229 | adb_int_pending = 1; | 1229 | adb_int_pending = 1; |
1230 | do { | 1230 | do { |
1231 | via_pmu_interrupt(0, NULL, NULL); | 1231 | via_pmu_interrupt(0, NULL); |
1232 | } while (pmu_suspended && (adb_int_pending || pmu_state != idle | 1232 | } while (pmu_suspended && (adb_int_pending || pmu_state != idle |
1233 | || req_awaiting_reply)); | 1233 | || req_awaiting_reply)); |
1234 | } | 1234 | } |
@@ -1239,7 +1239,7 @@ pmu_wait_complete(struct adb_request *req) | |||
1239 | if (!via) | 1239 | if (!via) |
1240 | return; | 1240 | return; |
1241 | while((pmu_state != idle && pmu_state != locked) || !req->complete) | 1241 | while((pmu_state != idle && pmu_state != locked) || !req->complete) |
1242 | via_pmu_interrupt(0, NULL, NULL); | 1242 | via_pmu_interrupt(0, NULL); |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | /* This function loops until the PMU is idle and prevents it from | 1245 | /* This function loops until the PMU is idle and prevents it from |
@@ -1268,7 +1268,7 @@ pmu_suspend(void) | |||
1268 | spin_unlock_irqrestore(&pmu_lock, flags); | 1268 | spin_unlock_irqrestore(&pmu_lock, flags); |
1269 | if (req_awaiting_reply) | 1269 | if (req_awaiting_reply) |
1270 | adb_int_pending = 1; | 1270 | adb_int_pending = 1; |
1271 | via_pmu_interrupt(0, NULL, NULL); | 1271 | via_pmu_interrupt(0, NULL); |
1272 | spin_lock_irqsave(&pmu_lock, flags); | 1272 | spin_lock_irqsave(&pmu_lock, flags); |
1273 | if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) { | 1273 | if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) { |
1274 | #ifdef SUSPEND_USES_PMU | 1274 | #ifdef SUSPEND_USES_PMU |
@@ -1318,7 +1318,7 @@ pmu_resume(void) | |||
1318 | 1318 | ||
1319 | /* Interrupt data could be the result data from an ADB cmd */ | 1319 | /* Interrupt data could be the result data from an ADB cmd */ |
1320 | static void | 1320 | static void |
1321 | pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs) | 1321 | pmu_handle_data(unsigned char *data, int len) |
1322 | { | 1322 | { |
1323 | unsigned char ints, pirq; | 1323 | unsigned char ints, pirq; |
1324 | int i = 0; | 1324 | int i = 0; |
@@ -1393,7 +1393,7 @@ next: | |||
1393 | if (!(pmu_kind == PMU_OHARE_BASED && len == 4 | 1393 | if (!(pmu_kind == PMU_OHARE_BASED && len == 4 |
1394 | && data[1] == 0x2c && data[3] == 0xff | 1394 | && data[1] == 0x2c && data[3] == 0xff |
1395 | && (data[2] & ~1) == 0xf4)) | 1395 | && (data[2] & ~1) == 0xf4)) |
1396 | adb_input(data+1, len-1, regs, 1); | 1396 | adb_input(data+1, len-1, 1); |
1397 | #endif /* CONFIG_ADB */ | 1397 | #endif /* CONFIG_ADB */ |
1398 | } | 1398 | } |
1399 | } | 1399 | } |
@@ -1431,7 +1431,7 @@ next: | |||
1431 | } | 1431 | } |
1432 | 1432 | ||
1433 | static struct adb_request* | 1433 | static struct adb_request* |
1434 | pmu_sr_intr(struct pt_regs *regs) | 1434 | pmu_sr_intr(void) |
1435 | { | 1435 | { |
1436 | struct adb_request *req; | 1436 | struct adb_request *req; |
1437 | int bite = 0; | 1437 | int bite = 0; |
@@ -1537,7 +1537,7 @@ pmu_sr_intr(struct pt_regs *regs) | |||
1537 | } | 1537 | } |
1538 | 1538 | ||
1539 | static irqreturn_t | 1539 | static irqreturn_t |
1540 | via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) | 1540 | via_pmu_interrupt(int irq, void *arg) |
1541 | { | 1541 | { |
1542 | unsigned long flags; | 1542 | unsigned long flags; |
1543 | int intr; | 1543 | int intr; |
@@ -1567,7 +1567,7 @@ via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) | |||
1567 | pmu_irq_stats[0]++; | 1567 | pmu_irq_stats[0]++; |
1568 | } | 1568 | } |
1569 | if (intr & SR_INT) { | 1569 | if (intr & SR_INT) { |
1570 | req = pmu_sr_intr(regs); | 1570 | req = pmu_sr_intr(); |
1571 | if (req) | 1571 | if (req) |
1572 | break; | 1572 | break; |
1573 | } | 1573 | } |
@@ -1613,7 +1613,7 @@ no_free_slot: | |||
1613 | 1613 | ||
1614 | /* Deal with interrupt datas outside of the lock */ | 1614 | /* Deal with interrupt datas outside of the lock */ |
1615 | if (int_data >= 0) { | 1615 | if (int_data >= 0) { |
1616 | pmu_handle_data(interrupt_data[int_data], interrupt_data_len[int_data], regs); | 1616 | pmu_handle_data(interrupt_data[int_data], interrupt_data_len[int_data]); |
1617 | spin_lock_irqsave(&pmu_lock, flags); | 1617 | spin_lock_irqsave(&pmu_lock, flags); |
1618 | ++disable_poll; | 1618 | ++disable_poll; |
1619 | int_data_state[int_data] = int_data_empty; | 1619 | int_data_state[int_data] = int_data_empty; |
@@ -1638,7 +1638,7 @@ pmu_unlock(void) | |||
1638 | 1638 | ||
1639 | 1639 | ||
1640 | static irqreturn_t | 1640 | static irqreturn_t |
1641 | gpio1_interrupt(int irq, void *arg, struct pt_regs *regs) | 1641 | gpio1_interrupt(int irq, void *arg) |
1642 | { | 1642 | { |
1643 | unsigned long flags; | 1643 | unsigned long flags; |
1644 | 1644 | ||
@@ -1651,7 +1651,7 @@ gpio1_interrupt(int irq, void *arg, struct pt_regs *regs) | |||
1651 | pmu_irq_stats[1]++; | 1651 | pmu_irq_stats[1]++; |
1652 | adb_int_pending = 1; | 1652 | adb_int_pending = 1; |
1653 | spin_unlock_irqrestore(&pmu_lock, flags); | 1653 | spin_unlock_irqrestore(&pmu_lock, flags); |
1654 | via_pmu_interrupt(0, NULL, NULL); | 1654 | via_pmu_interrupt(0, NULL); |
1655 | return IRQ_HANDLED; | 1655 | return IRQ_HANDLED; |
1656 | } | 1656 | } |
1657 | return IRQ_NONE; | 1657 | return IRQ_NONE; |
@@ -2116,7 +2116,7 @@ pmac_wakeup_devices(void) | |||
2116 | 2116 | ||
2117 | /* Force a poll of ADB interrupts */ | 2117 | /* Force a poll of ADB interrupts */ |
2118 | adb_int_pending = 1; | 2118 | adb_int_pending = 1; |
2119 | via_pmu_interrupt(0, NULL, NULL); | 2119 | via_pmu_interrupt(0, NULL); |
2120 | 2120 | ||
2121 | /* Restart jiffies & scheduling */ | 2121 | /* Restart jiffies & scheduling */ |
2122 | wakeup_decrementer(); | 2122 | wakeup_decrementer(); |
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index 9f4eff1d1a0f..d9986f3a3fbf 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c | |||
@@ -107,7 +107,7 @@ BLOCKING_NOTIFIER_HEAD(sleep_notifier_list); | |||
107 | static int pmu_probe(void); | 107 | static int pmu_probe(void); |
108 | static int pmu_init(void); | 108 | static int pmu_init(void); |
109 | static void pmu_start(void); | 109 | static void pmu_start(void); |
110 | static irqreturn_t pmu_interrupt(int irq, void *arg, struct pt_regs *regs); | 110 | static irqreturn_t pmu_interrupt(int irq, void *arg); |
111 | static int pmu_send_request(struct adb_request *req, int sync); | 111 | static int pmu_send_request(struct adb_request *req, int sync); |
112 | static int pmu_autopoll(int devs); | 112 | static int pmu_autopoll(int devs); |
113 | void pmu_poll(void); | 113 | void pmu_poll(void); |
@@ -118,8 +118,7 @@ static void pmu_start(void); | |||
118 | static void send_byte(int x); | 118 | static void send_byte(int x); |
119 | static void recv_byte(void); | 119 | static void recv_byte(void); |
120 | static void pmu_done(struct adb_request *req); | 120 | static void pmu_done(struct adb_request *req); |
121 | static void pmu_handle_data(unsigned char *data, int len, | 121 | static void pmu_handle_data(unsigned char *data, int len); |
122 | struct pt_regs *regs); | ||
123 | static void set_volume(int level); | 122 | static void set_volume(int level); |
124 | static void pmu_enable_backlight(int on); | 123 | static void pmu_enable_backlight(int on); |
125 | static void pmu_set_brightness(int level); | 124 | static void pmu_set_brightness(int level); |
@@ -222,7 +221,7 @@ pmu_init(void) | |||
222 | } | 221 | } |
223 | if (pmu_state == idle) { | 222 | if (pmu_state == idle) { |
224 | adb_int_pending = 1; | 223 | adb_int_pending = 1; |
225 | pmu_interrupt(0, NULL, NULL); | 224 | pmu_interrupt(0, NULL); |
226 | } | 225 | } |
227 | pmu_poll(); | 226 | pmu_poll(); |
228 | udelay(10); | 227 | udelay(10); |
@@ -563,17 +562,17 @@ pmu_poll(void) | |||
563 | local_irq_save(flags); | 562 | local_irq_save(flags); |
564 | if (via1[IFR] & SR_INT) { | 563 | if (via1[IFR] & SR_INT) { |
565 | via1[IFR] = SR_INT; | 564 | via1[IFR] = SR_INT; |
566 | pmu_interrupt(IRQ_MAC_ADB_SR, NULL, NULL); | 565 | pmu_interrupt(IRQ_MAC_ADB_SR, NULL); |
567 | } | 566 | } |
568 | if (via1[IFR] & CB1_INT) { | 567 | if (via1[IFR] & CB1_INT) { |
569 | via1[IFR] = CB1_INT; | 568 | via1[IFR] = CB1_INT; |
570 | pmu_interrupt(IRQ_MAC_ADB_CL, NULL, NULL); | 569 | pmu_interrupt(IRQ_MAC_ADB_CL, NULL); |
571 | } | 570 | } |
572 | local_irq_restore(flags); | 571 | local_irq_restore(flags); |
573 | } | 572 | } |
574 | 573 | ||
575 | static irqreturn_t | 574 | static irqreturn_t |
576 | pmu_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 575 | pmu_interrupt(int irq, void *dev_id) |
577 | { | 576 | { |
578 | struct adb_request *req; | 577 | struct adb_request *req; |
579 | int timeout, bite = 0; /* to prevent compiler warning */ | 578 | int timeout, bite = 0; /* to prevent compiler warning */ |
@@ -657,7 +656,7 @@ pmu_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
657 | } | 656 | } |
658 | 657 | ||
659 | if (pmu_state == reading_intr) { | 658 | if (pmu_state == reading_intr) { |
660 | pmu_handle_data(interrupt_data, data_index, regs); | 659 | pmu_handle_data(interrupt_data, data_index); |
661 | } else { | 660 | } else { |
662 | req = current_req; | 661 | req = current_req; |
663 | current_req = req->next; | 662 | current_req = req->next; |
@@ -701,7 +700,7 @@ pmu_done(struct adb_request *req) | |||
701 | 700 | ||
702 | /* Interrupt data could be the result data from an ADB cmd */ | 701 | /* Interrupt data could be the result data from an ADB cmd */ |
703 | static void | 702 | static void |
704 | pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs) | 703 | pmu_handle_data(unsigned char *data, int len) |
705 | { | 704 | { |
706 | static int show_pmu_ints = 1; | 705 | static int show_pmu_ints = 1; |
707 | 706 | ||
@@ -726,7 +725,7 @@ pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs) | |||
726 | } | 725 | } |
727 | pmu_done(req); | 726 | pmu_done(req); |
728 | } else { | 727 | } else { |
729 | adb_input(data+1, len-1, regs, 1); | 728 | adb_input(data+1, len-1, 1); |
730 | } | 729 | } |
731 | } else { | 730 | } else { |
732 | if (data[0] == 0x08 && len == 3) { | 731 | if (data[0] == 0x08 && len == 3) { |
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index ef66bf2778ec..b3fbb45bc90a 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c | |||
@@ -650,24 +650,26 @@ static struct notifier_block pm112_events = { | |||
650 | .notifier_call = pm112_wf_notify, | 650 | .notifier_call = pm112_wf_notify, |
651 | }; | 651 | }; |
652 | 652 | ||
653 | static int wf_pm112_probe(struct device *dev) | 653 | static int wf_pm112_probe(struct platform_device *dev) |
654 | { | 654 | { |
655 | wf_register_client(&pm112_events); | 655 | wf_register_client(&pm112_events); |
656 | return 0; | 656 | return 0; |
657 | } | 657 | } |
658 | 658 | ||
659 | static int wf_pm112_remove(struct device *dev) | 659 | static int __devexit wf_pm112_remove(struct platform_device *dev) |
660 | { | 660 | { |
661 | wf_unregister_client(&pm112_events); | 661 | wf_unregister_client(&pm112_events); |
662 | /* should release all sensors and controls */ | 662 | /* should release all sensors and controls */ |
663 | return 0; | 663 | return 0; |
664 | } | 664 | } |
665 | 665 | ||
666 | static struct device_driver wf_pm112_driver = { | 666 | static struct platform_driver wf_pm112_driver = { |
667 | .name = "windfarm", | ||
668 | .bus = &platform_bus_type, | ||
669 | .probe = wf_pm112_probe, | 667 | .probe = wf_pm112_probe, |
670 | .remove = wf_pm112_remove, | 668 | .remove = __devexit_p(wf_pm112_remove), |
669 | .driver = { | ||
670 | .name = "windfarm", | ||
671 | .bus = &platform_bus_type, | ||
672 | }, | ||
671 | }; | 673 | }; |
672 | 674 | ||
673 | static int __init wf_pm112_init(void) | 675 | static int __init wf_pm112_init(void) |
@@ -683,13 +685,24 @@ static int __init wf_pm112_init(void) | |||
683 | ++nr_cores; | 685 | ++nr_cores; |
684 | 686 | ||
685 | printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); | 687 | printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); |
686 | driver_register(&wf_pm112_driver); | 688 | |
689 | #ifdef MODULE | ||
690 | request_module("windfarm_smu_controls"); | ||
691 | request_module("windfarm_smu_sensors"); | ||
692 | request_module("windfarm_smu_sat"); | ||
693 | request_module("windfarm_lm75_sensor"); | ||
694 | request_module("windfarm_max6690_sensor"); | ||
695 | request_module("windfarm_cpufreq_clamp"); | ||
696 | |||
697 | #endif /* MODULE */ | ||
698 | |||
699 | platform_driver_register(&wf_pm112_driver); | ||
687 | return 0; | 700 | return 0; |
688 | } | 701 | } |
689 | 702 | ||
690 | static void __exit wf_pm112_exit(void) | 703 | static void __exit wf_pm112_exit(void) |
691 | { | 704 | { |
692 | driver_unregister(&wf_pm112_driver); | 705 | platform_driver_unregister(&wf_pm112_driver); |
693 | } | 706 | } |
694 | 707 | ||
695 | module_init(wf_pm112_init); | 708 | module_init(wf_pm112_init); |
diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c index 2ff546e4c92f..f24fa734046a 100644 --- a/drivers/macintosh/windfarm_pm81.c +++ b/drivers/macintosh/windfarm_pm81.c | |||
@@ -131,8 +131,6 @@ | |||
131 | 131 | ||
132 | static int wf_smu_mach_model; /* machine model id */ | 132 | static int wf_smu_mach_model; /* machine model id */ |
133 | 133 | ||
134 | static struct device *wf_smu_dev; | ||
135 | |||
136 | /* Controls & sensors */ | 134 | /* Controls & sensors */ |
137 | static struct wf_sensor *sensor_cpu_power; | 135 | static struct wf_sensor *sensor_cpu_power; |
138 | static struct wf_sensor *sensor_cpu_temp; | 136 | static struct wf_sensor *sensor_cpu_temp; |
@@ -717,16 +715,14 @@ static int wf_init_pm(void) | |||
717 | return 0; | 715 | return 0; |
718 | } | 716 | } |
719 | 717 | ||
720 | static int wf_smu_probe(struct device *ddev) | 718 | static int wf_smu_probe(struct platform_device *ddev) |
721 | { | 719 | { |
722 | wf_smu_dev = ddev; | ||
723 | |||
724 | wf_register_client(&wf_smu_events); | 720 | wf_register_client(&wf_smu_events); |
725 | 721 | ||
726 | return 0; | 722 | return 0; |
727 | } | 723 | } |
728 | 724 | ||
729 | static int wf_smu_remove(struct device *ddev) | 725 | static int __devexit wf_smu_remove(struct platform_device *ddev) |
730 | { | 726 | { |
731 | wf_unregister_client(&wf_smu_events); | 727 | wf_unregister_client(&wf_smu_events); |
732 | 728 | ||
@@ -766,16 +762,16 @@ static int wf_smu_remove(struct device *ddev) | |||
766 | if (wf_smu_cpu_fans) | 762 | if (wf_smu_cpu_fans) |
767 | kfree(wf_smu_cpu_fans); | 763 | kfree(wf_smu_cpu_fans); |
768 | 764 | ||
769 | wf_smu_dev = NULL; | ||
770 | |||
771 | return 0; | 765 | return 0; |
772 | } | 766 | } |
773 | 767 | ||
774 | static struct device_driver wf_smu_driver = { | 768 | static struct platform_driver wf_smu_driver = { |
775 | .name = "windfarm", | ||
776 | .bus = &platform_bus_type, | ||
777 | .probe = wf_smu_probe, | 769 | .probe = wf_smu_probe, |
778 | .remove = wf_smu_remove, | 770 | .remove = __devexit_p(wf_smu_remove), |
771 | .driver = { | ||
772 | .name = "windfarm", | ||
773 | .bus = &platform_bus_type, | ||
774 | }, | ||
779 | }; | 775 | }; |
780 | 776 | ||
781 | 777 | ||
@@ -792,9 +788,10 @@ static int __init wf_smu_init(void) | |||
792 | request_module("windfarm_smu_controls"); | 788 | request_module("windfarm_smu_controls"); |
793 | request_module("windfarm_smu_sensors"); | 789 | request_module("windfarm_smu_sensors"); |
794 | request_module("windfarm_lm75_sensor"); | 790 | request_module("windfarm_lm75_sensor"); |
791 | request_module("windfarm_cpufreq_clamp"); | ||
795 | 792 | ||
796 | #endif /* MODULE */ | 793 | #endif /* MODULE */ |
797 | driver_register(&wf_smu_driver); | 794 | platform_driver_register(&wf_smu_driver); |
798 | } | 795 | } |
799 | 796 | ||
800 | return rc; | 797 | return rc; |
@@ -803,7 +800,7 @@ static int __init wf_smu_init(void) | |||
803 | static void __exit wf_smu_exit(void) | 800 | static void __exit wf_smu_exit(void) |
804 | { | 801 | { |
805 | 802 | ||
806 | driver_unregister(&wf_smu_driver); | 803 | platform_driver_unregister(&wf_smu_driver); |
807 | } | 804 | } |
808 | 805 | ||
809 | 806 | ||
diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c index 59e9ffe37c39..26eee69ebe6d 100644 --- a/drivers/macintosh/windfarm_pm91.c +++ b/drivers/macintosh/windfarm_pm91.c | |||
@@ -63,8 +63,6 @@ | |||
63 | */ | 63 | */ |
64 | #undef HACKED_OVERTEMP | 64 | #undef HACKED_OVERTEMP |
65 | 65 | ||
66 | static struct device *wf_smu_dev; | ||
67 | |||
68 | /* Controls & sensors */ | 66 | /* Controls & sensors */ |
69 | static struct wf_sensor *sensor_cpu_power; | 67 | static struct wf_sensor *sensor_cpu_power; |
70 | static struct wf_sensor *sensor_cpu_temp; | 68 | static struct wf_sensor *sensor_cpu_temp; |
@@ -641,16 +639,14 @@ static int wf_init_pm(void) | |||
641 | return 0; | 639 | return 0; |
642 | } | 640 | } |
643 | 641 | ||
644 | static int wf_smu_probe(struct device *ddev) | 642 | static int wf_smu_probe(struct platform_device *ddev) |
645 | { | 643 | { |
646 | wf_smu_dev = ddev; | ||
647 | |||
648 | wf_register_client(&wf_smu_events); | 644 | wf_register_client(&wf_smu_events); |
649 | 645 | ||
650 | return 0; | 646 | return 0; |
651 | } | 647 | } |
652 | 648 | ||
653 | static int wf_smu_remove(struct device *ddev) | 649 | static int __devexit wf_smu_remove(struct platform_device *ddev) |
654 | { | 650 | { |
655 | wf_unregister_client(&wf_smu_events); | 651 | wf_unregister_client(&wf_smu_events); |
656 | 652 | ||
@@ -698,16 +694,16 @@ static int wf_smu_remove(struct device *ddev) | |||
698 | if (wf_smu_cpu_fans) | 694 | if (wf_smu_cpu_fans) |
699 | kfree(wf_smu_cpu_fans); | 695 | kfree(wf_smu_cpu_fans); |
700 | 696 | ||
701 | wf_smu_dev = NULL; | ||
702 | |||
703 | return 0; | 697 | return 0; |
704 | } | 698 | } |
705 | 699 | ||
706 | static struct device_driver wf_smu_driver = { | 700 | static struct platform_driver wf_smu_driver = { |
707 | .name = "windfarm", | ||
708 | .bus = &platform_bus_type, | ||
709 | .probe = wf_smu_probe, | 701 | .probe = wf_smu_probe, |
710 | .remove = wf_smu_remove, | 702 | .remove = __devexit_p(wf_smu_remove), |
703 | .driver = { | ||
704 | .name = "windfarm", | ||
705 | .bus = &platform_bus_type, | ||
706 | }, | ||
711 | }; | 707 | }; |
712 | 708 | ||
713 | 709 | ||
@@ -723,9 +719,10 @@ static int __init wf_smu_init(void) | |||
723 | request_module("windfarm_smu_controls"); | 719 | request_module("windfarm_smu_controls"); |
724 | request_module("windfarm_smu_sensors"); | 720 | request_module("windfarm_smu_sensors"); |
725 | request_module("windfarm_lm75_sensor"); | 721 | request_module("windfarm_lm75_sensor"); |
722 | request_module("windfarm_cpufreq_clamp"); | ||
726 | 723 | ||
727 | #endif /* MODULE */ | 724 | #endif /* MODULE */ |
728 | driver_register(&wf_smu_driver); | 725 | platform_driver_register(&wf_smu_driver); |
729 | } | 726 | } |
730 | 727 | ||
731 | return rc; | 728 | return rc; |
@@ -734,7 +731,7 @@ static int __init wf_smu_init(void) | |||
734 | static void __exit wf_smu_exit(void) | 731 | static void __exit wf_smu_exit(void) |
735 | { | 732 | { |
736 | 733 | ||
737 | driver_unregister(&wf_smu_driver); | 734 | platform_driver_unregister(&wf_smu_driver); |
738 | } | 735 | } |
739 | 736 | ||
740 | 737 | ||