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/pci/cs5530.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/pci/cs5530.c')
-rw-r--r-- | drivers/ide/pci/cs5530.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index 56a369c2a78a..f5534c1ff349 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c | |||
@@ -228,26 +228,25 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) | |||
228 | unsigned long basereg; | 228 | unsigned long basereg; |
229 | u32 d0_timings; | 229 | u32 d0_timings; |
230 | 230 | ||
231 | hwif->set_pio_mode = &cs5530_set_pio_mode; | ||
232 | hwif->set_dma_mode = &cs5530_set_dma_mode; | ||
233 | |||
234 | basereg = CS5530_BASEREG(hwif); | 231 | basereg = CS5530_BASEREG(hwif); |
235 | d0_timings = inl(basereg + 0); | 232 | d0_timings = inl(basereg + 0); |
236 | if (CS5530_BAD_PIO(d0_timings)) | 233 | if (CS5530_BAD_PIO(d0_timings)) |
237 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0); | 234 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0); |
238 | if (CS5530_BAD_PIO(inl(basereg + 8))) | 235 | if (CS5530_BAD_PIO(inl(basereg + 8))) |
239 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8); | 236 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8); |
240 | |||
241 | if (hwif->dma_base == 0) | ||
242 | return; | ||
243 | |||
244 | hwif->udma_filter = cs5530_udma_filter; | ||
245 | } | 237 | } |
246 | 238 | ||
239 | static const struct ide_port_ops cs5530_port_ops = { | ||
240 | .set_pio_mode = cs5530_set_pio_mode, | ||
241 | .set_dma_mode = cs5530_set_dma_mode, | ||
242 | .udma_filter = cs5530_udma_filter, | ||
243 | }; | ||
244 | |||
247 | static const struct ide_port_info cs5530_chipset __devinitdata = { | 245 | static const struct ide_port_info cs5530_chipset __devinitdata = { |
248 | .name = "CS5530", | 246 | .name = "CS5530", |
249 | .init_chipset = init_chipset_cs5530, | 247 | .init_chipset = init_chipset_cs5530, |
250 | .init_hwif = init_hwif_cs5530, | 248 | .init_hwif = init_hwif_cs5530, |
249 | .port_ops = &cs5530_port_ops, | ||
251 | .host_flags = IDE_HFLAG_SERIALIZE | | 250 | .host_flags = IDE_HFLAG_SERIALIZE | |
252 | IDE_HFLAG_POST_SET_MODE, | 251 | IDE_HFLAG_POST_SET_MODE, |
253 | .pio_mask = ATA_PIO4, | 252 | .pio_mask = ATA_PIO4, |