aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/dtc2278.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/dtc2278.c')
-rw-r--r--drivers/ide/legacy/dtc2278.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index f16521254867..24a845d45bd2 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -67,20 +67,24 @@ static void sub22 (char b, char c)
67 } 67 }
68} 68}
69 69
70static DEFINE_SPINLOCK(dtc2278_lock);
71
70static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio) 72static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
71{ 73{
72 unsigned long flags; 74 unsigned long flags;
73 75
74 if (pio >= 3) { 76 if (pio >= 3) {
75 spin_lock_irqsave(&ide_lock, flags); 77 spin_lock_irqsave(&dtc2278_lock, flags);
76 /* 78 /*
77 * This enables PIO mode4 (3?) on the first interface 79 * This enables PIO mode4 (3?) on the first interface
78 */ 80 */
79 sub22(1,0xc3); 81 sub22(1,0xc3);
80 sub22(0,0xa0); 82 sub22(0,0xa0);
81 spin_unlock_irqrestore(&ide_lock, flags); 83 spin_unlock_irqrestore(&dtc2278_lock, flags);
82 } else { 84 } else {
83 /* we don't know how to set it back again.. */ 85 /* we don't know how to set it back again.. */
86 /* Actually we do - there is a data sheet available for the
87 Winbond but does anyone actually care */
84 } 88 }
85 89
86 /* 90 /*
@@ -94,6 +98,7 @@ static int __init dtc2278_probe(void)
94{ 98{
95 unsigned long flags; 99 unsigned long flags;
96 ide_hwif_t *hwif, *mate; 100 ide_hwif_t *hwif, *mate;
101 static u8 idx[4] = { 0, 1, 0xff, 0xff };
97 102
98 hwif = &ide_hwifs[0]; 103 hwif = &ide_hwifs[0];
99 mate = &ide_hwifs[1]; 104 mate = &ide_hwifs[1];
@@ -129,16 +134,13 @@ static int __init dtc2278_probe(void)
129 134
130 mate->serialized = 1; 135 mate->serialized = 1;
131 mate->chipset = ide_dtc2278; 136 mate->chipset = ide_dtc2278;
137 mate->pio_mask = ATA_PIO4;
132 mate->drives[0].no_unmask = 1; 138 mate->drives[0].no_unmask = 1;
133 mate->drives[1].no_unmask = 1; 139 mate->drives[1].no_unmask = 1;
134 mate->mate = hwif; 140 mate->mate = hwif;
135 mate->channel = 1; 141 mate->channel = 1;
136 142
137 probe_hwif_init(hwif); 143 ide_device_add(idx);
138 probe_hwif_init(mate);
139
140 ide_proc_register_port(hwif);
141 ide_proc_register_port(mate);
142 144
143 return 0; 145 return 0;
144} 146}