patch-2.4.0-test9 linux/drivers/macintosh/mediabay.c

Next file: linux/drivers/macintosh/nvram.c
Previous file: linux/drivers/macintosh/macserial.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/macintosh/mediabay.c linux/drivers/macintosh/mediabay.c
@@ -472,8 +472,11 @@
 	    	} else if (MB_IDE_READY(i)) {
 			bay->timer = 0;
 			bay->state = mb_up;
-			if (bay->cd_index < 0)
+			if (bay->cd_index < 0) {
+				pmu_suspend();
 				bay->cd_index = ide_register(bay->cd_base, 0, bay->cd_irq);
+				pmu_resume();
+			}
 			if (bay->cd_index == -1) {
 				/* We eventually do a retry */
 				bay->cd_retry++;
@@ -605,7 +608,9 @@
 			   only if it did not change. Note those bozo timings,
 			   they seem to help the 3400 get it right.
 			 */
-			mdelay(MB_STABLE_DELAY);
+			/* Force MB power to 0 */
+			set_mb_power(i, 0);
+			mdelay(MB_POWER_DELAY);
 			if (!bay->pismo)
 				out_8(&bay->addr->contents, 0x70);
 			mdelay(MB_STABLE_DELAY);
@@ -615,7 +620,9 @@
 			bay->last_value = bay->content_id;
 			bay->value_count = MS_TO_HZ(MB_STABLE_DELAY);
 			bay->timer = MS_TO_HZ(MB_POWER_DELAY);
+#ifdef CONFIG_BLK_DEV_IDE
 			bay->cd_retry = 0;
+#endif
 			do {
 				mdelay(1000/HZ);
 				media_bay_step(i);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)