aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_icside.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_icside.c')
-rw-r--r--drivers/ata/pata_icside.c67
1 files changed, 14 insertions, 53 deletions
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index f97068be2d79..17138436423d 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -250,7 +250,7 @@ static void pata_icside_bmdma_setup(struct ata_queued_cmd *qc)
250 set_dma_mode(state->dma, write ? DMA_MODE_WRITE : DMA_MODE_READ); 250 set_dma_mode(state->dma, write ? DMA_MODE_WRITE : DMA_MODE_READ);
251 251
252 /* issue r/w command */ 252 /* issue r/w command */
253 ap->ops->exec_command(ap, &qc->tf); 253 ap->ops->sff_exec_command(ap, &qc->tf);
254} 254}
255 255
256static void pata_icside_bmdma_start(struct ata_queued_cmd *qc) 256static void pata_icside_bmdma_start(struct ata_queued_cmd *qc)
@@ -270,7 +270,7 @@ static void pata_icside_bmdma_stop(struct ata_queued_cmd *qc)
270 disable_dma(state->dma); 270 disable_dma(state->dma);
271 271
272 /* see ata_bmdma_stop */ 272 /* see ata_bmdma_stop */
273 ata_altstatus(ap); 273 ata_sff_altstatus(ap);
274} 274}
275 275
276static u8 pata_icside_bmdma_status(struct ata_port *ap) 276static u8 pata_icside_bmdma_status(struct ata_port *ap)
@@ -305,35 +305,18 @@ static int icside_dma_init(struct pata_icside_info *info)
305 305
306 306
307static struct scsi_host_template pata_icside_sht = { 307static struct scsi_host_template pata_icside_sht = {
308 .module = THIS_MODULE, 308 ATA_BASE_SHT(DRV_NAME),
309 .name = DRV_NAME,
310 .ioctl = ata_scsi_ioctl,
311 .queuecommand = ata_scsi_queuecmd,
312 .can_queue = ATA_DEF_QUEUE,
313 .this_id = ATA_SHT_THIS_ID,
314 .sg_tablesize = PATA_ICSIDE_MAX_SG, 309 .sg_tablesize = PATA_ICSIDE_MAX_SG,
315 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
316 .emulated = ATA_SHT_EMULATED,
317 .use_clustering = ATA_SHT_USE_CLUSTERING,
318 .proc_name = DRV_NAME,
319 .dma_boundary = ~0, /* no dma boundaries */ 310 .dma_boundary = ~0, /* no dma boundaries */
320 .slave_configure = ata_scsi_slave_config,
321 .slave_destroy = ata_scsi_slave_destroy,
322 .bios_param = ata_std_bios_param,
323}; 311};
324 312
325/* wish this was exported from libata-core */
326static void ata_dummy_noret(struct ata_port *port)
327{
328}
329
330static void pata_icside_postreset(struct ata_link *link, unsigned int *classes) 313static void pata_icside_postreset(struct ata_link *link, unsigned int *classes)
331{ 314{
332 struct ata_port *ap = link->ap; 315 struct ata_port *ap = link->ap;
333 struct pata_icside_state *state = ap->host->private_data; 316 struct pata_icside_state *state = ap->host->private_data;
334 317
335 if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE) 318 if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE)
336 return ata_std_postreset(link, classes); 319 return ata_sff_postreset(link, classes);
337 320
338 state->port[ap->port_no].disabled = 1; 321 state->port[ap->port_no].disabled = 1;
339 322
@@ -349,42 +332,20 @@ static void pata_icside_postreset(struct ata_link *link, unsigned int *classes)
349 } 332 }
350} 333}
351 334
352static void pata_icside_error_handler(struct ata_port *ap)
353{
354 ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, NULL,
355 pata_icside_postreset);
356}
357
358static struct ata_port_operations pata_icside_port_ops = { 335static struct ata_port_operations pata_icside_port_ops = {
359 .set_dmamode = pata_icside_set_dmamode, 336 .inherits = &ata_sff_port_ops,
360
361 .tf_load = ata_tf_load,
362 .tf_read = ata_tf_read,
363 .exec_command = ata_exec_command,
364 .check_status = ata_check_status,
365 .dev_select = ata_std_dev_select,
366
367 .cable_detect = ata_cable_40wire,
368
369 .bmdma_setup = pata_icside_bmdma_setup,
370 .bmdma_start = pata_icside_bmdma_start,
371
372 .data_xfer = ata_data_xfer_noirq,
373
374 /* no need to build any PRD tables for DMA */ 337 /* no need to build any PRD tables for DMA */
375 .qc_prep = ata_noop_qc_prep, 338 .qc_prep = ata_noop_qc_prep,
376 .qc_issue = ata_qc_issue_prot, 339 .sff_data_xfer = ata_sff_data_xfer_noirq,
377 340 .bmdma_setup = pata_icside_bmdma_setup,
378 .freeze = ata_bmdma_freeze, 341 .bmdma_start = pata_icside_bmdma_start,
379 .thaw = ata_bmdma_thaw,
380 .error_handler = pata_icside_error_handler,
381 .post_internal_cmd = pata_icside_bmdma_stop,
382
383 .irq_clear = ata_dummy_noret,
384 .irq_on = ata_irq_on,
385
386 .bmdma_stop = pata_icside_bmdma_stop, 342 .bmdma_stop = pata_icside_bmdma_stop,
387 .bmdma_status = pata_icside_bmdma_status, 343 .bmdma_status = pata_icside_bmdma_status,
344
345 .cable_detect = ata_cable_40wire,
346 .set_dmamode = pata_icside_set_dmamode,
347 .postreset = pata_icside_postreset,
348 .post_internal_cmd = pata_icside_bmdma_stop,
388}; 349};
389 350
390static void __devinit 351static void __devinit
@@ -520,7 +481,7 @@ static int __devinit pata_icside_add_ports(struct pata_icside_info *info)
520 pata_icside_setup_ioaddr(ap, info->base, info, info->port[i]); 481 pata_icside_setup_ioaddr(ap, info->base, info, info->port[i]);
521 } 482 }
522 483
523 return ata_host_activate(host, ec->irq, ata_interrupt, 0, 484 return ata_host_activate(host, ec->irq, ata_sff_interrupt, 0,
524 &pata_icside_sht); 485 &pata_icside_sht);
525} 486}
526 487