aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ali14xx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 22:36:05 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 22:36:05 -0400
commit5f737085beea3a5c5b6f44a16e6d3e2fd03095e0 (patch)
tree218643043a16f9af32b2b1037ddbb3ecd271c779 /drivers/ide/legacy/ali14xx.c
parente9a404580ccaeb31dd2a976f9929c4f9eb6f3540 (diff)
parent276d789e1794560d7ce53a7f2687415e2a80bb8a (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (50 commits) ide: remove inclusion of non-existent io_trace.h ide-disk: add get_smart_data() helper ide: fix ->data_phase in taskfile_load_raw() ide: check drive->using_dma in flagged_taskfile() ide: check ->dma_setup() return value in flagged_taskfile() dtc2278: note on docs qd65xx: remove pointless qd_{read,write}_reg() (take 2) ide: PCI BMDMA initialization fixes (take 2) ide: remove stale comments from ide-taskfile.c ide: remove dead code from ide_driveid_update() ide: use __ide_end_request() in ide_end_dequeued_request() ide: enhance ide_setup_pci_noise() cs5530: remove needless ide_lock taking ide: take ide_lock for prefetch disable/enable in do_special() ht6560b: fix deadlock on error handling cmd640: fix deadlock on error handling slc90e66: fix deadlock on error handling opti621: fix deadlock on error handling qd65xx: fix deadlock on error handling dtc2278: fix deadlock on error handling ...
Diffstat (limited to 'drivers/ide/legacy/ali14xx.c')
-rw-r--r--drivers/ide/legacy/ali14xx.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index 2f0ef9b44033..10311ecc674a 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -102,6 +102,8 @@ static void outReg (u8 data, u8 reg)
102 outb_p(data, dataPort); 102 outb_p(data, dataPort);
103} 103}
104 104
105static DEFINE_SPINLOCK(ali14xx_lock);
106
105/* 107/*
106 * Set PIO mode for the specified drive. 108 * Set PIO mode for the specified drive.
107 * This function computes timing parameters 109 * This function computes timing parameters
@@ -129,14 +131,14 @@ static void ali14xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
129 131
130 /* stuff timing parameters into controller registers */ 132 /* stuff timing parameters into controller registers */
131 driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit; 133 driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit;
132 spin_lock_irqsave(&ide_lock, flags); 134 spin_lock_irqsave(&ali14xx_lock, flags);
133 outb_p(regOn, basePort); 135 outb_p(regOn, basePort);
134 outReg(param1, regTab[driveNum].reg1); 136 outReg(param1, regTab[driveNum].reg1);
135 outReg(param2, regTab[driveNum].reg2); 137 outReg(param2, regTab[driveNum].reg2);
136 outReg(param3, regTab[driveNum].reg3); 138 outReg(param3, regTab[driveNum].reg3);
137 outReg(param4, regTab[driveNum].reg4); 139 outReg(param4, regTab[driveNum].reg4);
138 outb_p(regOff, basePort); 140 outb_p(regOff, basePort);
139 spin_unlock_irqrestore(&ide_lock, flags); 141 spin_unlock_irqrestore(&ali14xx_lock, flags);
140} 142}
141 143
142/* 144/*
@@ -193,6 +195,7 @@ static int __init initRegisters (void) {
193static int __init ali14xx_probe(void) 195static int __init ali14xx_probe(void)
194{ 196{
195 ide_hwif_t *hwif, *mate; 197 ide_hwif_t *hwif, *mate;
198 static u8 idx[4] = { 0, 1, 0xff, 0xff };
196 199
197 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n", 200 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
198 basePort, regOn); 201 basePort, regOn);
@@ -217,11 +220,7 @@ static int __init ali14xx_probe(void)
217 mate->mate = hwif; 220 mate->mate = hwif;
218 mate->channel = 1; 221 mate->channel = 1;
219 222
220 probe_hwif_init(hwif); 223 ide_device_add(idx);
221 probe_hwif_init(mate);
222
223 ide_proc_register_port(hwif);
224 ide_proc_register_port(mate);
225 224
226 return 0; 225 return 0;
227} 226}