aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_acpi.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-04-19 12:17:34 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 12:17:34 -0400
commitcf816ecb533ab96b883dfdc0db174598b5b5c4d2 (patch)
tree1b7705db288ae2917105e624b01fdf81e0882bf1 /drivers/ata/pata_acpi.c
parentadf6d34e460387ee3e8f1e1875d52bff51212c7d (diff)
parent15f7d677ccff6f0f5de8a1ee43a792567e9f9de9 (diff)
Merge branch 'merge-fixes' into devel
Diffstat (limited to 'drivers/ata/pata_acpi.c')
-rw-r--r--drivers/ata/pata_acpi.c83
1 files changed, 14 insertions, 69 deletions
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index bdc3b9d7395c..c5f91e629945 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -47,7 +47,7 @@ static int pacpi_pre_reset(struct ata_link *link, unsigned long deadline)
47 if (ap->acpi_handle == NULL || ata_acpi_gtm(ap, &acpi->gtm) < 0) 47 if (ap->acpi_handle == NULL || ata_acpi_gtm(ap, &acpi->gtm) < 0)
48 return -ENODEV; 48 return -ENODEV;
49 49
50 return ata_std_prereset(link, deadline); 50 return ata_sff_prereset(link, deadline);
51} 51}
52 52
53/** 53/**
@@ -68,20 +68,6 @@ static int pacpi_cable_detect(struct ata_port *ap)
68} 68}
69 69
70/** 70/**
71 * pacpi_error_handler - Setup and error handler
72 * @ap: Port to handle
73 *
74 * LOCKING:
75 * None (inherited from caller).
76 */
77
78static void pacpi_error_handler(struct ata_port *ap)
79{
80 ata_bmdma_drive_eh(ap, pacpi_pre_reset, ata_std_softreset, NULL,
81 ata_std_postreset);
82}
83
84/**
85 * pacpi_discover_modes - filter non ACPI modes 71 * pacpi_discover_modes - filter non ACPI modes
86 * @adev: ATA device 72 * @adev: ATA device
87 * @mask: proposed modes 73 * @mask: proposed modes
@@ -120,7 +106,7 @@ static unsigned long pacpi_discover_modes(struct ata_port *ap, struct ata_device
120static unsigned long pacpi_mode_filter(struct ata_device *adev, unsigned long mask) 106static unsigned long pacpi_mode_filter(struct ata_device *adev, unsigned long mask)
121{ 107{
122 struct pata_acpi *acpi = adev->link->ap->private_data; 108 struct pata_acpi *acpi = adev->link->ap->private_data;
123 return ata_pci_default_filter(adev, mask & acpi->mask[adev->devno]); 109 return ata_bmdma_mode_filter(adev, mask & acpi->mask[adev->devno]);
124} 110}
125 111
126/** 112/**
@@ -176,7 +162,7 @@ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
176} 162}
177 163
178/** 164/**
179 * pacpi_qc_issue_prot - command issue 165 * pacpi_qc_issue - command issue
180 * @qc: command pending 166 * @qc: command pending
181 * 167 *
182 * Called when the libata layer is about to issue a command. We wrap 168 * Called when the libata layer is about to issue a command. We wrap
@@ -184,14 +170,14 @@ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
184 * neccessary. 170 * neccessary.
185 */ 171 */
186 172
187static unsigned int pacpi_qc_issue_prot(struct ata_queued_cmd *qc) 173static unsigned int pacpi_qc_issue(struct ata_queued_cmd *qc)
188{ 174{
189 struct ata_port *ap = qc->ap; 175 struct ata_port *ap = qc->ap;
190 struct ata_device *adev = qc->dev; 176 struct ata_device *adev = qc->dev;
191 struct pata_acpi *acpi = ap->private_data; 177 struct pata_acpi *acpi = ap->private_data;
192 178
193 if (acpi->gtm.flags & 0x10) 179 if (acpi->gtm.flags & 0x10)
194 return ata_qc_issue_prot(qc); 180 return ata_sff_qc_issue(qc);
195 181
196 if (adev != acpi->last) { 182 if (adev != acpi->last) {
197 pacpi_set_piomode(ap, adev); 183 pacpi_set_piomode(ap, adev);
@@ -199,7 +185,7 @@ static unsigned int pacpi_qc_issue_prot(struct ata_queued_cmd *qc)
199 pacpi_set_dmamode(ap, adev); 185 pacpi_set_dmamode(ap, adev);
200 acpi->last = adev; 186 acpi->last = adev;
201 } 187 }
202 return ata_qc_issue_prot(qc); 188 return ata_sff_qc_issue(qc);
203} 189}
204 190
205/** 191/**
@@ -232,57 +218,17 @@ static int pacpi_port_start(struct ata_port *ap)
232} 218}
233 219
234static struct scsi_host_template pacpi_sht = { 220static struct scsi_host_template pacpi_sht = {
235 .module = THIS_MODULE, 221 ATA_BMDMA_SHT(DRV_NAME),
236 .name = DRV_NAME,
237 .ioctl = ata_scsi_ioctl,
238 .queuecommand = ata_scsi_queuecmd,
239 .can_queue = ATA_DEF_QUEUE,
240 .this_id = ATA_SHT_THIS_ID,
241 .sg_tablesize = LIBATA_MAX_PRD,
242 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
243 .emulated = ATA_SHT_EMULATED,
244 .use_clustering = ATA_SHT_USE_CLUSTERING,
245 .proc_name = DRV_NAME,
246 .dma_boundary = ATA_DMA_BOUNDARY,
247 .slave_configure = ata_scsi_slave_config,
248 .slave_destroy = ata_scsi_slave_destroy,
249 /* Use standard CHS mapping rules */
250 .bios_param = ata_std_bios_param,
251}; 222};
252 223
253static const struct ata_port_operations pacpi_ops = { 224static struct ata_port_operations pacpi_ops = {
225 .inherits = &ata_bmdma_port_ops,
226 .qc_issue = pacpi_qc_issue,
227 .cable_detect = pacpi_cable_detect,
228 .mode_filter = pacpi_mode_filter,
254 .set_piomode = pacpi_set_piomode, 229 .set_piomode = pacpi_set_piomode,
255 .set_dmamode = pacpi_set_dmamode, 230 .set_dmamode = pacpi_set_dmamode,
256 .mode_filter = pacpi_mode_filter, 231 .prereset = pacpi_pre_reset,
257
258 /* Task file is PCI ATA format, use helpers */
259 .tf_load = ata_tf_load,
260 .tf_read = ata_tf_read,
261 .check_status = ata_check_status,
262 .exec_command = ata_exec_command,
263 .dev_select = ata_std_dev_select,
264
265 .freeze = ata_bmdma_freeze,
266 .thaw = ata_bmdma_thaw,
267 .error_handler = pacpi_error_handler,
268 .post_internal_cmd = ata_bmdma_post_internal_cmd,
269 .cable_detect = pacpi_cable_detect,
270
271 /* BMDMA handling is PCI ATA format, use helpers */
272 .bmdma_setup = ata_bmdma_setup,
273 .bmdma_start = ata_bmdma_start,
274 .bmdma_stop = ata_bmdma_stop,
275 .bmdma_status = ata_bmdma_status,
276 .qc_prep = ata_qc_prep,
277 .qc_issue = pacpi_qc_issue_prot,
278 .data_xfer = ata_data_xfer,
279
280 /* Timeout handling */
281 .irq_handler = ata_interrupt,
282 .irq_clear = ata_bmdma_irq_clear,
283 .irq_on = ata_irq_on,
284
285 /* Generic PATA PCI ATA helpers */
286 .port_start = pacpi_port_start, 232 .port_start = pacpi_port_start,
287}; 233};
288 234
@@ -304,7 +250,6 @@ static const struct ata_port_operations pacpi_ops = {
304static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id) 250static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
305{ 251{
306 static const struct ata_port_info info = { 252 static const struct ata_port_info info = {
307 .sht = &pacpi_sht,
308 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 253 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
309 254
310 .pio_mask = 0x1f, 255 .pio_mask = 0x1f,
@@ -314,7 +259,7 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
314 .port_ops = &pacpi_ops, 259 .port_ops = &pacpi_ops,
315 }; 260 };
316 const struct ata_port_info *ppi[] = { &info, NULL }; 261 const struct ata_port_info *ppi[] = { &info, NULL };
317 return ata_pci_init_one(pdev, ppi); 262 return ata_pci_sff_init_one(pdev, ppi, &pacpi_sht, NULL);
318} 263}
319 264
320static const struct pci_device_id pacpi_pci_tbl[] = { 265static const struct pci_device_id pacpi_pci_tbl[] = {