aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_ixp4xx_cf.c
diff options
context:
space:
mode:
authorAlessandro Zummo <a.zummo@towertech.it>2007-05-26 19:26:55 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-09 12:17:33 -0400
commit5d4c51f6beab08ada99064bab6ee74e995a4f24d (patch)
treee7bee4bdb372cf810e66cb31174a6b8709d4d896 /drivers/ata/pata_ixp4xx_cf.c
parent49de0ac823ed7826695c6a2ac62dc1f730a8b17d (diff)
[libata] pata_ixp4xx: convert to new EH
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_ixp4xx_cf.c')
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c73
1 files changed, 31 insertions, 42 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 887bbaae6efc..76332109a4f7 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -1,13 +1,14 @@
1/* 1/*
2 * ixp4xx PATA/Compact Flash driver 2 * ixp4xx PATA/Compact Flash driver
3 * Copyright (c) 2006 Tower Technologies 3 * Copyright (C) 2006-07 Tower Technologies
4 * Author: Alessandro Zummo <a.zummo@towertech.it> 4 * Author: Alessandro Zummo <a.zummo@towertech.it>
5 * 5 *
6 * An ATA driver to handle a Compact Flash connected 6 * An ATA driver to handle a Compact Flash connected
7 * to the ixp4xx expansion bus in TrueIDE mode. The CF 7 * to the ixp4xx expansion bus in TrueIDE mode. The CF
8 * must have it chip selects connected to two CS lines 8 * must have it chip selects connected to two CS lines
9 * on the ixp4xx. The interrupt line is optional, if not 9 * on the ixp4xx. In the irq is not available, you might
10 * specified the driver will run in polling mode. 10 * want to modify both this driver and libata to run in
11 * polling mode.
11 * 12 *
12 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
@@ -23,7 +24,7 @@
23#include <scsi/scsi_host.h> 24#include <scsi/scsi_host.h>
24 25
25#define DRV_NAME "pata_ixp4xx_cf" 26#define DRV_NAME "pata_ixp4xx_cf"
26#define DRV_VERSION "0.1.3" 27#define DRV_VERSION "0.2"
27 28
28static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error) 29static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error)
29{ 30{
@@ -42,13 +43,6 @@ static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device **error)
42 return 0; 43 return 0;
43} 44}
44 45
45static void ixp4xx_phy_reset(struct ata_port *ap)
46{
47 ap->cbl = ATA_CBL_PATA40;
48 ata_port_probe(ap);
49 ata_bus_reset(ap);
50}
51
52static void ixp4xx_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, 46static void ixp4xx_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
53 unsigned int buflen, int write_data) 47 unsigned int buflen, int write_data)
54{ 48{
@@ -92,10 +86,6 @@ static void ixp4xx_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
92 *data->cs0_cfg |= 0x01; 86 *data->cs0_cfg |= 0x01;
93} 87}
94 88
95static void ixp4xx_irq_clear(struct ata_port *ap)
96{
97}
98
99static struct scsi_host_template ixp4xx_sht = { 89static struct scsi_host_template ixp4xx_sht = {
100 .module = THIS_MODULE, 90 .module = THIS_MODULE,
101 .name = DRV_NAME, 91 .name = DRV_NAME,
@@ -115,29 +105,32 @@ static struct scsi_host_template ixp4xx_sht = {
115}; 105};
116 106
117static struct ata_port_operations ixp4xx_port_ops = { 107static struct ata_port_operations ixp4xx_port_ops = {
118 .set_mode = ixp4xx_set_mode, 108 .set_mode = ixp4xx_set_mode,
119 .mode_filter = ata_pci_default_filter, 109 .mode_filter = ata_pci_default_filter,
120 110
121 .port_disable = ata_port_disable, 111 .port_disable = ata_port_disable,
122 .tf_load = ata_tf_load, 112 .tf_load = ata_tf_load,
123 .tf_read = ata_tf_read, 113 .tf_read = ata_tf_read,
124 .check_status = ata_check_status, 114 .exec_command = ata_exec_command,
125 .exec_command = ata_exec_command, 115 .check_status = ata_check_status,
126 .dev_select = ata_std_dev_select, 116 .dev_select = ata_std_dev_select,
127 117
128 .qc_prep = ata_qc_prep, 118 .freeze = ata_bmdma_freeze,
129 .qc_issue = ata_qc_issue_prot, 119 .thaw = ata_bmdma_thaw,
130 .eng_timeout = ata_eng_timeout, 120 .error_handler = ata_bmdma_error_handler,
131 .data_xfer = ixp4xx_mmio_data_xfer, 121 .post_internal_cmd = ata_bmdma_post_internal_cmd,
132 .cable_detect = ata_cable_40wire, 122
133 123 .qc_prep = ata_qc_prep,
134 .irq_clear = ixp4xx_irq_clear, 124 .qc_issue = ata_qc_issue_prot,
135 .irq_on = ata_irq_on, 125 .data_xfer = ixp4xx_mmio_data_xfer,
136 .irq_ack = ata_irq_ack, 126 .cable_detect = ata_cable_40wire,
137 127
138 .port_start = ata_port_start, 128 .irq_handler = ata_interrupt,
139 129 .irq_clear = ata_bmdma_irq_clear,
140 .phy_reset = ixp4xx_phy_reset, 130 .irq_on = ata_irq_on,
131 .irq_ack = ata_dummy_irq_ack,
132
133 .port_start = ata_port_start,
141}; 134};
142 135
143static void ixp4xx_setup_port(struct ata_ioports *ioaddr, 136static void ixp4xx_setup_port(struct ata_ioports *ioaddr,
@@ -211,10 +204,6 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
211 ap->pio_mask = 0x1f; /* PIO4 */ 204 ap->pio_mask = 0x1f; /* PIO4 */
212 ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; 205 ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI;
213 206
214 /* run in polling mode if no irq has been assigned */
215 if (!irq)
216 ap->flags |= ATA_FLAG_PIO_POLLING;
217
218 ixp4xx_setup_port(&ap->ioaddr, data); 207 ixp4xx_setup_port(&ap->ioaddr, data);
219 208
220 dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); 209 dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");