diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
commit | ac95beedf8bc97b24f9540d4da9952f07221c023 (patch) | |
tree | c29837142c8083b6fcaf1767abcb0a4533676cd1 /drivers/ide/arm/icside.c | |
parent | 4a27214d7be31e122db4102166f49ec15958e8e9 (diff) |
ide: add struct ide_port_ops (take 2)
* Move hooks for port/host specific methods from ide_hwif_t to
'struct ide_port_ops'.
* Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info'
and ide_hwif_t.
* Update host drivers and core code accordingly.
While at it:
* Rename ata66_*() cable detect functions to *_cable_detect() to match
the standard naming. (Suggested by Sergei Shtylyov)
v2:
* Fix build for bast-ide. (Noticed by Andrew Morton)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/arm/icside.c')
-rw-r--r-- | drivers/ide/arm/icside.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index fd12bbe93f11..b219818a400a 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -191,6 +191,10 @@ static void icside_maskproc(ide_drive_t *drive, int mask) | |||
191 | local_irq_restore(flags); | 191 | local_irq_restore(flags); |
192 | } | 192 | } |
193 | 193 | ||
194 | static const struct ide_port_ops icside_v6_no_dma_port_ops = { | ||
195 | .maskproc = icside_maskproc, | ||
196 | }; | ||
197 | |||
194 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS | 198 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS |
195 | /* | 199 | /* |
196 | * SG-DMA support. | 200 | * SG-DMA support. |
@@ -266,6 +270,11 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode) | |||
266 | ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); | 270 | ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); |
267 | } | 271 | } |
268 | 272 | ||
273 | static const struct ide_port_ops icside_v6_port_ops = { | ||
274 | .set_dma_mode = icside_set_dma_mode, | ||
275 | .maskproc = icside_maskproc, | ||
276 | }; | ||
277 | |||
269 | static void icside_dma_host_set(ide_drive_t *drive, int on) | 278 | static void icside_dma_host_set(ide_drive_t *drive, int on) |
270 | { | 279 | { |
271 | } | 280 | } |
@@ -379,7 +388,6 @@ static void icside_dma_init(ide_hwif_t *hwif) | |||
379 | { | 388 | { |
380 | hwif->dmatable_cpu = NULL; | 389 | hwif->dmatable_cpu = NULL; |
381 | hwif->dmatable_dma = 0; | 390 | hwif->dmatable_dma = 0; |
382 | hwif->set_dma_mode = icside_set_dma_mode; | ||
383 | 391 | ||
384 | hwif->dma_host_set = icside_dma_host_set; | 392 | hwif->dma_host_set = icside_dma_host_set; |
385 | hwif->dma_setup = icside_dma_setup; | 393 | hwif->dma_setup = icside_dma_setup; |
@@ -462,6 +470,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec) | |||
462 | } | 470 | } |
463 | 471 | ||
464 | static const struct ide_port_info icside_v6_port_info __initdata = { | 472 | static const struct ide_port_info icside_v6_port_info __initdata = { |
473 | .port_ops = &icside_v6_no_dma_port_ops, | ||
465 | .host_flags = IDE_HFLAG_SERIALIZE | | 474 | .host_flags = IDE_HFLAG_SERIALIZE | |
466 | IDE_HFLAG_NO_DMA | /* no SFF-style DMA */ | 475 | IDE_HFLAG_NO_DMA | /* no SFF-style DMA */ |
467 | IDE_HFLAG_NO_AUTOTUNE, | 476 | IDE_HFLAG_NO_AUTOTUNE, |
@@ -526,7 +535,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) | |||
526 | state->hwif[0] = hwif; | 535 | state->hwif[0] = hwif; |
527 | state->hwif[1] = mate; | 536 | state->hwif[1] = mate; |
528 | 537 | ||
529 | hwif->maskproc = icside_maskproc; | ||
530 | hwif->hwif_data = state; | 538 | hwif->hwif_data = state; |
531 | hwif->config_data = (unsigned long)ioc_base; | 539 | hwif->config_data = (unsigned long)ioc_base; |
532 | hwif->select_data = sel; | 540 | hwif->select_data = sel; |
@@ -539,6 +547,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) | |||
539 | if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { | 547 | if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { |
540 | icside_dma_init(hwif); | 548 | icside_dma_init(hwif); |
541 | icside_dma_init(mate); | 549 | icside_dma_init(mate); |
550 | d.port_ops = &icside_v6_dma_port_ops; | ||
542 | } else | 551 | } else |
543 | d.mwdma_mask = d.swdma_mask = 0; | 552 | d.mwdma_mask = d.swdma_mask = 0; |
544 | 553 | ||