2 * Driver for the media bay on the PowerBook 3400 and 2400.
4 * Copyright (C) 1998 Paul Mackerras.
6 * Various evolutions by Benjamin Herrenschmidt & Henry Worth
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
13 #define __KERNEL_SYSCALLS__
15 #include <linux/config.h>
16 #include <linux/types.h>
17 #include <linux/errno.h>
18 #include <linux/kernel.h>
19 #include <linux/delay.h>
20 #include <linux/sched.h>
21 #include <linux/timer.h>
22 #include <linux/hdreg.h>
23 #include <linux/stddef.h>
24 #include <linux/unistd.h>
26 #include <asm/pgtable.h>
28 #include <asm/machdep.h>
29 #include <asm/pmac_feature.h>
30 #include <asm/mediabay.h>
31 #include <asm/sections.h>
32 #include <asm/ohare.h>
33 #include <asm/heathrow.h>
34 #include <asm/keylargo.h>
35 #include <linux/adb.h>
36 #include <linux/pmu.h>
38 #ifdef CONFIG_PMAC_PBOOK
39 static int mb_notify_sleep(struct pmu_sleep_notifier *self, int when);
40 static struct pmu_sleep_notifier mb_sleep_notifier = {
46 #undef MB_USE_INTERRUPTS
48 #define MB_IGNORE_SIGNALS
51 #define MBDBG(fmt, arg...) printk(KERN_INFO fmt , ## arg)
53 #define MBDBG(fmt, arg...) do { } while (0)
56 /* Type of media bay */
63 #define MB_FCR32(bay, r) ((bay)->base + ((r) >> 2))
64 #define MB_FCR8(bay, r) (((volatile u8*)((bay)->base)) + (r))
66 #define MB_IN32(bay,r) (in_le32(MB_FCR32(bay,r)))
67 #define MB_OUT32(bay,r,v) (out_le32(MB_FCR32(bay,r), (v)))
68 #define MB_BIS(bay,r,v) (MB_OUT32((bay), (r), MB_IN32((bay), r) | (v)))
69 #define MB_BIC(bay,r,v) (MB_OUT32((bay), (r), MB_IN32((bay), r) & ~(v)))
70 #define MB_IN8(bay,r) (in_8(MB_FCR8(bay,r)))
71 #define MB_OUT8(bay,r,v) (out_8(MB_FCR8(bay,r), (v)))
73 struct media_bay_info;
77 u8 (*content)(struct media_bay_info* bay);
78 void (*power)(struct media_bay_info* bay, int on_off);
79 int (*setup_bus)(struct media_bay_info* bay, u8 device_id);
80 void (*un_reset)(struct media_bay_info* bay);
81 void (*un_reset_ide)(struct media_bay_info* bay);
84 struct media_bay_info {
91 struct device_node* dev_node;
96 #ifdef CONFIG_BLK_DEV_IDE
97 unsigned long cd_base;
106 static struct media_bay_info media_bays[MAX_BAYS];
107 int media_bay_count = 0;
109 #ifdef CONFIG_BLK_DEV_IDE
110 /* check the busy bit in the media-bay ide interface
111 (assumes the media-bay contains an ide device) */
112 #define MB_IDE_READY(i) ((readb(media_bays[i].cd_base + 0x70) & 0x80) == 0)
115 /* Note: All delays are not in milliseconds and converted to HZ relative
116 * values by the macro below
118 #define MS_TO_HZ(ms) ((ms * HZ) / 1000)
121 * Consider the media-bay ID value stable if it is the same for
122 * this number of milliseconds
124 #define MB_STABLE_DELAY 100
126 /* Wait after powering up the media bay this delay in ms
127 * timeout bumped for some powerbooks
129 #define MB_POWER_DELAY 200
132 * Hold the media-bay reset signal true for this many ticks
133 * after a device is inserted before releasing it.
135 #define MB_RESET_DELAY 40
138 * Wait this long after the reset signal is released and before doing
139 * further operations. After this delay, the IDE reset signal is released
140 * too for an IDE device
142 #define MB_SETUP_DELAY 100
145 * Wait this many ticks after an IDE device (e.g. CD-ROM) is inserted
146 * (or until the device is ready) before waiting for busy bit to disappear
148 #define MB_IDE_WAIT 1000
151 * Timeout waiting for busy bit of an IDE device to go down
153 #define MB_IDE_TIMEOUT 5000
156 * Max retries of the full power up/down sequence for an IDE device
158 #define MAX_CD_RETRIES 3
161 * States of a media bay
164 mb_empty = 0, /* Idle */
165 mb_powering_up, /* power bit set, waiting MB_POWER_DELAY */
166 mb_enabling_bay, /* enable bits set, waiting MB_RESET_DELAY */
167 mb_resetting, /* reset bit unset, waiting MB_SETUP_DELAY */
168 mb_ide_resetting, /* IDE reset bit unser, waiting MB_IDE_WAIT */
169 mb_ide_waiting, /* Waiting for BUSY bit to go away until MB_IDE_TIMEOUT */
170 mb_up, /* Media bay full */
171 mb_powering_down /* Powering down (avoid too fast down/up) */
174 #define MB_POWER_SOUND 0x08
175 #define MB_POWER_FLOPPY 0x04
176 #define MB_POWER_ATA 0x02
177 #define MB_POWER_PCI 0x01
178 #define MB_POWER_OFF 0x00
181 * Functions for polling content of media bay
185 ohare_mb_content(struct media_bay_info *bay)
187 return (MB_IN32(bay, OHARE_MBCR) >> 12) & 7;
191 heathrow_mb_content(struct media_bay_info *bay)
193 return (MB_IN32(bay, HEATHROW_MBCR) >> 12) & 7;
197 keylargo_mb_content(struct media_bay_info *bay)
201 new_gpio = MB_IN8(bay, KL_GPIO_MEDIABAY_IRQ) & KEYLARGO_GPIO_INPUT_DATA;
203 bay->cached_gpio = new_gpio;
205 } else if (bay->cached_gpio != new_gpio) {
206 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_ENABLE);
207 (void)MB_IN32(bay, KEYLARGO_MBCR);
209 MB_BIC(bay, KEYLARGO_MBCR, 0x0000000F);
210 (void)MB_IN32(bay, KEYLARGO_MBCR);
212 bay->cached_gpio = new_gpio;
214 return (MB_IN32(bay, KEYLARGO_MBCR) >> 4) & 7;
218 * Functions for powering up/down the bay, puts the bay device
219 * into reset state as well
223 ohare_mb_power(struct media_bay_info* bay, int on_off)
226 /* Power up device, assert it's reset line */
227 MB_BIC(bay, OHARE_FCR, OH_BAY_RESET_N);
228 MB_BIC(bay, OHARE_FCR, OH_BAY_POWER_N);
230 /* Disable all devices */
231 MB_BIC(bay, OHARE_FCR, OH_BAY_DEV_MASK);
232 MB_BIC(bay, OHARE_FCR, OH_FLOPPY_ENABLE);
233 /* Cut power from bay, release reset line */
234 MB_BIS(bay, OHARE_FCR, OH_BAY_POWER_N);
235 MB_BIS(bay, OHARE_FCR, OH_BAY_RESET_N);
236 MB_BIS(bay, OHARE_FCR, OH_IDE1_RESET_N);
238 MB_BIC(bay, OHARE_MBCR, 0x00000F00);
242 heathrow_mb_power(struct media_bay_info* bay, int on_off)
245 /* Power up device, assert it's reset line */
246 MB_BIC(bay, HEATHROW_FCR, HRW_BAY_RESET_N);
247 MB_BIC(bay, HEATHROW_FCR, HRW_BAY_POWER_N);
249 /* Disable all devices */
250 MB_BIC(bay, HEATHROW_FCR, HRW_BAY_DEV_MASK);
251 MB_BIC(bay, HEATHROW_FCR, HRW_SWIM_ENABLE);
252 /* Cut power from bay, release reset line */
253 MB_BIS(bay, HEATHROW_FCR, HRW_BAY_POWER_N);
254 MB_BIS(bay, HEATHROW_FCR, HRW_BAY_RESET_N);
255 MB_BIS(bay, HEATHROW_FCR, HRW_IDE1_RESET_N);
257 MB_BIC(bay, HEATHROW_MBCR, 0x00000F00);
261 keylargo_mb_power(struct media_bay_info* bay, int on_off)
264 /* Power up device, assert it's reset line */
265 MB_BIC(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_RESET);
266 MB_BIC(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_POWER);
268 /* Disable all devices */
269 MB_BIC(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_MASK);
270 MB_BIC(bay, KEYLARGO_FCR1, KL1_EIDE0_ENABLE);
271 /* Cut power from bay, release reset line */
272 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_POWER);
273 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_RESET);
274 MB_BIS(bay, KEYLARGO_FCR1, KL1_EIDE0_RESET_N);
276 MB_BIC(bay, KEYLARGO_MBCR, 0x0000000F);
280 * Functions for configuring the media bay for a given type of device,
281 * enable the related busses
285 ohare_mb_setup_bus(struct media_bay_info* bay, u8 device_id)
290 MB_BIS(bay, OHARE_FCR, OH_BAY_FLOPPY_ENABLE);
291 MB_BIS(bay, OHARE_FCR, OH_FLOPPY_ENABLE);
294 MB_BIC(bay, OHARE_FCR, OH_IDE1_RESET_N);
295 MB_BIS(bay, OHARE_FCR, OH_BAY_IDE_ENABLE);
298 MB_BIS(bay, OHARE_FCR, OH_BAY_PCI_ENABLE);
305 heathrow_mb_setup_bus(struct media_bay_info* bay, u8 device_id)
310 MB_BIS(bay, HEATHROW_FCR, HRW_BAY_FLOPPY_ENABLE);
311 MB_BIS(bay, HEATHROW_FCR, HRW_SWIM_ENABLE);
314 MB_BIC(bay, HEATHROW_FCR, HRW_IDE1_RESET_N);
315 MB_BIS(bay, HEATHROW_FCR, HRW_BAY_IDE_ENABLE);
318 MB_BIS(bay, HEATHROW_FCR, HRW_BAY_PCI_ENABLE);
325 keylargo_mb_setup_bus(struct media_bay_info* bay, u8 device_id)
329 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_IDE_ENABLE);
330 MB_BIC(bay, KEYLARGO_FCR1, KL1_EIDE0_RESET_N);
331 MB_BIS(bay, KEYLARGO_FCR1, KL1_EIDE0_ENABLE);
334 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_PCI_ENABLE);
337 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_SOUND_ENABLE);
344 * Functions for tweaking resets
348 ohare_mb_un_reset(struct media_bay_info* bay)
350 MB_BIS(bay, OHARE_FCR, OH_BAY_RESET_N);
354 heathrow_mb_un_reset(struct media_bay_info* bay)
356 MB_BIS(bay, HEATHROW_FCR, HRW_BAY_RESET_N);
360 keylargo_mb_un_reset(struct media_bay_info* bay)
362 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_RESET);
366 ohare_mb_un_reset_ide(struct media_bay_info* bay)
368 MB_BIS(bay, OHARE_FCR, OH_IDE1_RESET_N);
372 heathrow_mb_un_reset_ide(struct media_bay_info* bay)
374 MB_BIS(bay, HEATHROW_FCR, HRW_IDE1_RESET_N);
378 keylargo_mb_un_reset_ide(struct media_bay_info* bay)
380 MB_BIS(bay, KEYLARGO_FCR1, KL1_EIDE0_RESET_N);
383 static inline void __pmac
384 set_mb_power(struct media_bay_info* bay, int onoff)
386 /* Power up up and assert the bay reset line */
388 bay->ops->power(bay, 1);
389 bay->state = mb_powering_up;
390 MBDBG("mediabay%d: powering up\n", bay->index);
392 /* Make sure everything is powered down & disabled */
393 bay->ops->power(bay, 0);
394 bay->state = mb_powering_down;
395 MBDBG("mediabay%d: powering down\n", bay->index);
397 bay->timer = MS_TO_HZ(MB_POWER_DELAY);
401 poll_media_bay(struct media_bay_info* bay)
403 int id = bay->ops->content(bay);
405 if (id == bay->last_value) {
406 if (id != bay->content_id
407 && ++bay->value_count >= MS_TO_HZ(MB_STABLE_DELAY)) {
408 /* If the device type changes without going thru "MB_NO", we force
409 a pass by "MB_NO" to make sure things are properly reset */
410 if ((id != MB_NO) && (bay->content_id != MB_NO)) {
412 MBDBG("mediabay%d: forcing MB_NO\n", bay->index);
414 MBDBG("mediabay%d: switching to %d\n", bay->index, id);
415 set_mb_power(bay, id != MB_NO);
416 bay->content_id = id;
418 #ifdef CONFIG_BLK_DEV_IDE
421 printk(KERN_INFO "media bay %d is empty\n", bay->index);
425 bay->last_value = id;
426 bay->value_count = 0;
431 check_media_bay(struct device_node *which_bay, int what)
433 #ifdef CONFIG_BLK_DEV_IDE
436 for (i=0; i<media_bay_count; i++)
437 if (which_bay == media_bays[i].dev_node)
439 if ((what == media_bays[i].content_id) && media_bays[i].state == mb_up)
441 media_bays[i].cd_index = -1;
444 #endif /* CONFIG_BLK_DEV_IDE */
449 check_media_bay_by_base(unsigned long base, int what)
451 #ifdef CONFIG_BLK_DEV_IDE
454 for (i=0; i<media_bay_count; i++)
455 if (base == media_bays[i].cd_base)
457 if ((what == media_bays[i].content_id) && media_bays[i].state == mb_up)
459 media_bays[i].cd_index = -1;
468 media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base,
471 #ifdef CONFIG_BLK_DEV_IDE
474 for (i=0; i<media_bay_count; i++)
475 if (which_bay == media_bays[i].dev_node)
479 media_bays[i].cd_base = base;
480 media_bays[i].cd_irq = irq;
482 if ((MB_CD != media_bays[i].content_id) || media_bays[i].state != mb_up)
485 printk(KERN_DEBUG "Registered ide %d for media bay %d\n", index, i);
487 if (MB_IDE_READY(i)) {
488 media_bays[i].cd_index = index;
493 printk(KERN_DEBUG "Timeount waiting IDE in bay %d\n", i);
502 media_bay_step(int i)
504 struct media_bay_info* bay = &media_bays[i];
506 /* We don't poll when powering down */
507 if (bay->state != mb_powering_down)
510 /* If timer expired or polling IDE busy, run state machine */
511 if ((bay->state != mb_ide_waiting) && (bay->timer != 0) && ((--bay->timer) != 0))
516 if (bay->ops->setup_bus(bay, bay->last_value) < 0) {
517 MBDBG("mediabay%d: device not supported (kind:%d)\n", i, bay->content_id);
518 set_mb_power(bay, 0);
521 bay->timer = MS_TO_HZ(MB_RESET_DELAY);
522 bay->state = mb_enabling_bay;
523 MBDBG("mediabay%d: enabling (kind:%d)\n", i, bay->content_id);
525 case mb_enabling_bay:
526 bay->ops->un_reset(bay);
527 bay->timer = MS_TO_HZ(MB_SETUP_DELAY);
528 bay->state = mb_resetting;
529 MBDBG("mediabay%d: waiting reset (kind:%d)\n", i, bay->content_id);
533 if (bay->content_id != MB_CD) {
534 MBDBG("mediabay%d: bay is up (kind:%d)\n", i, bay->content_id);
538 #ifdef CONFIG_BLK_DEV_IDE
539 MBDBG("mediabay%d: waiting IDE reset (kind:%d)\n", i, bay->content_id);
540 bay->ops->un_reset_ide(bay);
541 bay->timer = MS_TO_HZ(MB_IDE_WAIT);
542 bay->state = mb_ide_resetting;
544 printk(KERN_DEBUG "media-bay %d is ide (not compiled in kernel)\n", i);
545 set_mb_power(bay, 0);
546 #endif /* CONFIG_BLK_DEV_IDE */
549 #ifdef CONFIG_BLK_DEV_IDE
550 case mb_ide_resetting:
551 bay->timer = MS_TO_HZ(MB_IDE_TIMEOUT);
552 bay->state = mb_ide_waiting;
553 MBDBG("mediabay%d: waiting IDE ready (kind:%d)\n", i, bay->content_id);
557 if (bay->cd_base == 0) {
560 MBDBG("mediabay%d: up before IDE init\n", i);
562 } else if (MB_IDE_READY(i)) {
565 if (bay->cd_index < 0) {
567 bay->cd_index = ide_register(bay->cd_base, 0, bay->cd_irq);
570 if (bay->cd_index == -1) {
571 /* We eventually do a retry */
573 printk("IDE register error\n");
574 set_mb_power(bay, 0);
576 printk(KERN_DEBUG "media-bay %d is ide %d\n", i, bay->cd_index);
577 MBDBG("mediabay %d IDE ready\n", i);
580 } else if (bay->timer > 0)
582 if (bay->timer == 0) {
583 printk("\nIDE Timeout in bay %d !\n", i);
584 MBDBG("mediabay%d: nIDE Timeout !\n", i);
585 set_mb_power(bay, 0);
588 #endif /* CONFIG_BLK_DEV_IDE */
590 case mb_powering_down:
591 bay->state = mb_empty;
592 #ifdef CONFIG_BLK_DEV_IDE
593 if (bay->cd_index >= 0) {
594 printk(KERN_DEBUG "Unregistering mb %d ide, index:%d\n", i,
596 ide_unregister(bay->cd_index);
600 if (bay->cd_retry > MAX_CD_RETRIES) {
601 /* Should add an error sound (sort of beep in dmasound) */
602 printk("\nmedia-bay %d, IDE device badly inserted or unrecognised\n", i);
604 /* Force a new power down/up sequence */
605 bay->content_id = MB_NO;
608 #endif /* CONFIG_BLK_DEV_IDE */
609 MBDBG("mediabay%d: end of power down\n", i);
615 * This procedure runs as a kernel thread to poll the media bay
616 * once each tick and register and unregister the IDE interface
617 * with the IDE driver. It needs to be a thread because
618 * ide_register can't be called from interrupt context.
621 media_bay_task(void *x)
625 strcpy(current->comm, "media-bay");
626 #ifdef MB_IGNORE_SIGNALS
627 sigfillset(¤t->blocked);
631 for (i = 0; i < media_bay_count; ++i)
634 current->state = TASK_INTERRUPTIBLE;
636 if (signal_pending(current))
641 #ifdef MB_USE_INTERRUPTS
643 media_bay_intr(int irq, void *devid, struct pt_regs *regs)
648 #ifdef CONFIG_PMAC_PBOOK
650 * notify clients before sleep and reset bus afterwards
653 mb_notify_sleep(struct pmu_sleep_notifier *self, int when)
655 struct media_bay_info* bay;
659 case PBOOK_SLEEP_REQUEST:
660 case PBOOK_SLEEP_REJECT:
663 case PBOOK_SLEEP_NOW:
664 for (i=0; i<media_bay_count; i++) {
665 bay = &media_bays[i];
666 set_mb_power(bay, 0);
671 for (i=0; i<media_bay_count; i++) {
672 bay = &media_bays[i];
673 /* We re-enable the bay using it's previous content
674 only if it did not change. Note those bozo timings,
675 they seem to help the 3400 get it right.
677 /* Force MB power to 0 */
678 set_mb_power(bay, 0);
679 mdelay(MB_POWER_DELAY);
680 if (bay->ops->content(bay) != bay->content_id)
682 set_mb_power(bay, 1);
683 bay->last_value = bay->content_id;
684 bay->value_count = MS_TO_HZ(MB_STABLE_DELAY);
685 bay->timer = MS_TO_HZ(MB_POWER_DELAY);
686 #ifdef CONFIG_BLK_DEV_IDE
692 } while((media_bays[i].state != mb_empty) &&
693 (media_bays[i].state != mb_up));
697 return PBOOK_SLEEP_OK;
699 #endif /* CONFIG_PMAC_PBOOK */
702 /* Definitions of "ops" structures.
704 static struct mb_ops ohare_mb_ops __pmacdata = {
706 content: ohare_mb_content,
707 power: ohare_mb_power,
708 setup_bus: ohare_mb_setup_bus,
709 un_reset: ohare_mb_un_reset,
710 un_reset_ide: ohare_mb_un_reset_ide,
713 static struct mb_ops heathrow_mb_ops __pmacdata = {
715 content: heathrow_mb_content,
716 power: heathrow_mb_power,
717 setup_bus: heathrow_mb_setup_bus,
718 un_reset: heathrow_mb_un_reset,
719 un_reset_ide: heathrow_mb_un_reset_ide,
722 static struct mb_ops keylargo_mb_ops __pmacdata = {
724 content: keylargo_mb_content,
725 power: keylargo_mb_power,
726 setup_bus: keylargo_mb_setup_bus,
727 un_reset: keylargo_mb_un_reset,
728 un_reset_ide: keylargo_mb_un_reset_ide,
732 * It seems that the bit for the media-bay interrupt in the IRQ_LEVEL
733 * register is always set when there is something in the media bay.
734 * This causes problems for the interrupt code if we attach an interrupt
735 * handler to the media-bay interrupt, because it tends to go into
736 * an infinite loop calling the media bay interrupt handler.
737 * Therefore we do it all by polling the media bay once each tick.
743 struct device_node *np;
746 for (i=0; i<MAX_BAYS; i++) {
747 memset((char *)&media_bays[i], 0, sizeof(struct media_bay_info));
748 media_bays[i].content_id = -1;
749 #ifdef CONFIG_BLK_DEV_IDE
750 media_bays[i].cd_index = -1;
754 np = find_devices("media-bay");
756 while(np && (n<MAX_BAYS)) {
757 struct media_bay_info* bay = &media_bays[n];
758 if (!np->parent || np->n_addrs == 0 || !request_OF_resource(np, 0, NULL)) {
760 printk(KERN_ERR "mediabay: Can't request IO resource !\n");
763 bay->mb_type = mb_ohare;
765 if (device_is_compatible(np, "keylargo-media-bay")) {
766 bay->mb_type = mb_keylargo;
767 bay->ops = &keylargo_mb_ops;
768 } else if (device_is_compatible(np, "heathrow-media-bay")) {
769 bay->mb_type = mb_heathrow;
770 bay->ops = &heathrow_mb_ops;
771 } else if (device_is_compatible(np, "ohare-media-bay")) {
772 bay->mb_type = mb_ohare;
773 bay->ops = &ohare_mb_ops;
775 printk(KERN_ERR "media-bay: Unknown bay type !\n");
779 bay->base = (volatile u32*)ioremap(np->parent->addrs[0].address, 0x1000);
781 /* Enable probe logic on keylargo */
782 if (bay->mb_type == mb_keylargo)
783 MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_ENABLE);
784 #ifdef MB_USE_INTERRUPTS
785 if (np->n_intrs == 0) {
786 printk(KERN_ERR "media-bay %d has no irq\n",n);
791 if (request_irq(np->intrs[0].line, media_bay_intr, 0, "Media bay", (void *)n)) {
792 printk(KERN_ERR "Couldn't get IRQ %d for media bay %d\n",
793 np->intrs[0].line, n);
800 printk(KERN_INFO "mediabay%d: Registered %s media-bay\n", n, bay->ops->name);
804 /* Force an immediate detect */
805 set_mb_power(bay, 0);
806 mdelay(MB_POWER_DELAY);
807 bay->content_id = MB_NO;
808 bay->last_value = bay->ops->content(bay);
809 bay->value_count = MS_TO_HZ(MB_STABLE_DELAY);
810 bay->state = mb_empty;
814 } while((bay->state != mb_empty) &&
815 (bay->state != mb_up));
823 #ifdef CONFIG_PMAC_PBOOK
824 pmu_register_sleep_notifier(&mb_sleep_notifier);
825 #endif /* CONFIG_PMAC_PBOOK */
827 if (kernel_thread(media_bay_task, NULL,
828 CLONE_FS | CLONE_FILES | CLONE_SIGHAND) < 0)
829 printk(KERN_ERR "media-bay: Cannot create polling thread !\n");