aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_opti.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 11:38:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 11:38:06 -0400
commit8019aa946af5218bc4446c21e43cc19c9401ac68 (patch)
tree6681b73a560f5a4e4a4e8f97b3833a087a488439 /drivers/ata/pata_opti.c
parent73e3e6481f56b3b5b618671a8d32b19a35f84316 (diff)
parent48feb3c419508487becfb9ea3afcc54c3eac6d80 (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (79 commits) ata-acpi: don't call _GTF for disabled drive sata_mv add temporary 3 second init delay for SiliconImage PMs sata_mv remove redundant edma init code sata_mv add basic port multiplier support sata_mv fix SOC flags, enable NCQ on SOC sata_mv disable hotplug for now sata_mv cosmetics sata_mv hardreset rework [libata] improve Kconfig help text for new PMP, SFF options libata: make EH fail gracefully if no reset method is available libata: Be a bit more slack about early devices libata: cable logic libata: move link onlineness check out of softreset methods libata: kill dead code paths in reset path pata_scc: fix build breakage libata: make PMP support optional libata: implement PMP helpers libata: separate PMP support code from core code libata: make SFF support optional libata: don't use ap->ioaddr in non-SFF drivers ...
Diffstat (limited to 'drivers/ata/pata_opti.c')
-rw-r--r--drivers/ata/pata_opti.c66
1 files changed, 6 insertions, 60 deletions
diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c
index 8f79447b6151..fb2cf661b0e8 100644
--- a/drivers/ata/pata_opti.c
+++ b/drivers/ata/pata_opti.c
@@ -64,22 +64,7 @@ static int opti_pre_reset(struct ata_link *link, unsigned long deadline)
64 if (!pci_test_config_bits(pdev, &opti_enable_bits[ap->port_no])) 64 if (!pci_test_config_bits(pdev, &opti_enable_bits[ap->port_no]))
65 return -ENOENT; 65 return -ENOENT;
66 66
67 return ata_std_prereset(link, deadline); 67 return ata_sff_prereset(link, deadline);
68}
69
70/**
71 * opti_probe_reset - probe reset
72 * @ap: ATA port
73 *
74 * Perform the ATA probe and bus reset sequence plus specific handling
75 * for this hardware. The Opti needs little handling - we have no UDMA66
76 * capability that needs cable detection. All we must do is check the port
77 * is enabled.
78 */
79
80static void opti_error_handler(struct ata_port *ap)
81{
82 ata_bmdma_drive_eh(ap, opti_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
83} 68}
84 69
85/** 70/**
@@ -165,58 +150,19 @@ static void opti_set_piomode(struct ata_port *ap, struct ata_device *adev)
165} 150}
166 151
167static struct scsi_host_template opti_sht = { 152static struct scsi_host_template opti_sht = {
168 .module = THIS_MODULE, 153 ATA_PIO_SHT(DRV_NAME),
169 .name = DRV_NAME,
170 .ioctl = ata_scsi_ioctl,
171 .queuecommand = ata_scsi_queuecmd,
172 .can_queue = ATA_DEF_QUEUE,
173 .this_id = ATA_SHT_THIS_ID,
174 .sg_tablesize = LIBATA_MAX_PRD,
175 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
176 .emulated = ATA_SHT_EMULATED,
177 .use_clustering = ATA_SHT_USE_CLUSTERING,
178 .proc_name = DRV_NAME,
179 .dma_boundary = ATA_DMA_BOUNDARY,
180 .slave_configure = ata_scsi_slave_config,
181 .slave_destroy = ata_scsi_slave_destroy,
182 .bios_param = ata_std_bios_param,
183}; 154};
184 155
185static struct ata_port_operations opti_port_ops = { 156static struct ata_port_operations opti_port_ops = {
186 .set_piomode = opti_set_piomode, 157 .inherits = &ata_sff_port_ops,
187 .tf_load = ata_tf_load,
188 .tf_read = ata_tf_read,
189 .check_status = ata_check_status,
190 .exec_command = ata_exec_command,
191 .dev_select = ata_std_dev_select,
192
193 .freeze = ata_bmdma_freeze,
194 .thaw = ata_bmdma_thaw,
195 .error_handler = opti_error_handler,
196 .post_internal_cmd = ata_bmdma_post_internal_cmd,
197 .cable_detect = ata_cable_40wire, 158 .cable_detect = ata_cable_40wire,
198 159 .set_piomode = opti_set_piomode,
199 .bmdma_setup = ata_bmdma_setup, 160 .prereset = opti_pre_reset,
200 .bmdma_start = ata_bmdma_start,
201 .bmdma_stop = ata_bmdma_stop,
202 .bmdma_status = ata_bmdma_status,
203
204 .qc_prep = ata_qc_prep,
205 .qc_issue = ata_qc_issue_prot,
206
207 .data_xfer = ata_data_xfer,
208
209 .irq_handler = ata_interrupt,
210 .irq_clear = ata_bmdma_irq_clear,
211 .irq_on = ata_irq_on,
212
213 .port_start = ata_sff_port_start,
214}; 161};
215 162
216static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id) 163static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id)
217{ 164{
218 static const struct ata_port_info info = { 165 static const struct ata_port_info info = {
219 .sht = &opti_sht,
220 .flags = ATA_FLAG_SLAVE_POSS, 166 .flags = ATA_FLAG_SLAVE_POSS,
221 .pio_mask = 0x1f, 167 .pio_mask = 0x1f,
222 .port_ops = &opti_port_ops 168 .port_ops = &opti_port_ops
@@ -227,7 +173,7 @@ static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id)
227 if (!printed_version++) 173 if (!printed_version++)
228 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n"); 174 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
229 175
230 return ata_pci_init_one(dev, ppi); 176 return ata_pci_sff_init_one(dev, ppi, &opti_sht, NULL);
231} 177}
232 178
233static const struct pci_device_id opti[] = { 179static const struct pci_device_id opti[] = {