diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-10 18:32:13 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-10 18:32:13 -0500 |
commit | c79b60ddf6ff0e884c09cecbbddd656f7bf277a3 (patch) | |
tree | fb8284eff86fa5fe0870ec1f166f2df69fcda492 /drivers/ide | |
parent | c92a7f1d8254fabd99df33af59094935fc2cfe32 (diff) |
palm_bk3710: use struct ide_port_info
* Factor out cable detection to palm_bk3710_cable_detect().
* Add palm_bk3710_init_hwif() (->init_hwif method implementation).
* Remove needless ->quirkproc initialization.
* Add missing ->pio_mask initialization.
* Use ATA_* defines for setting ->{ultra,mwdma}_mask.
* Add 'struct ide_port_info palm_bk3710_port_info' and pass it to
ide_device_add(). Then remove open-coded 'hwif' initialization.
Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/arm/palm_bk3710.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c index 8e40bdbc3970..8e1f6bd33887 100644 --- a/drivers/ide/arm/palm_bk3710.c +++ b/drivers/ide/arm/palm_bk3710.c | |||
@@ -311,6 +311,28 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base) | |||
311 | palm_bk3710_setpiomode(base, NULL, 0, 600, 0); | 311 | palm_bk3710_setpiomode(base, NULL, 0, 600, 0); |
312 | palm_bk3710_setpiomode(base, NULL, 1, 600, 0); | 312 | palm_bk3710_setpiomode(base, NULL, 1, 600, 0); |
313 | } | 313 | } |
314 | |||
315 | static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif) | ||
316 | { | ||
317 | return ATA_CBL_PATA80; | ||
318 | } | ||
319 | |||
320 | static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif) | ||
321 | { | ||
322 | hwif->set_pio_mode = palm_bk3710_set_pio_mode; | ||
323 | hwif->set_dma_mode = palm_bk3710_set_dma_mode; | ||
324 | |||
325 | hwif->cable_detect = palm_bk3710_cable_detect; | ||
326 | } | ||
327 | |||
328 | static const struct ide_port_info __devinitdata palm_bk3710_port_info = { | ||
329 | .init_hwif = palm_bk3710_init_hwif, | ||
330 | .host_flags = IDE_HFLAG_NO_DMA, /* hack (no PCI) */ | ||
331 | .pio_mask = ATA_PIO4, | ||
332 | .udma_mask = ATA_UDMA4, /* (input clk 99MHz) */ | ||
333 | .mwdma_mask = ATA_MWDMA2, | ||
334 | }; | ||
335 | |||
314 | static int __devinit palm_bk3710_probe(struct platform_device *pdev) | 336 | static int __devinit palm_bk3710_probe(struct platform_device *pdev) |
315 | { | 337 | { |
316 | struct clk *clkp; | 338 | struct clk *clkp; |
@@ -368,24 +390,15 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
368 | ide_init_port_data(hwif, i); | 390 | ide_init_port_data(hwif, i); |
369 | 391 | ||
370 | ide_init_port_hw(hwif, &hw); | 392 | ide_init_port_hw(hwif, &hw); |
371 | hwif->quirkproc = NULL; | ||
372 | 393 | ||
373 | hwif->set_pio_mode = &palm_bk3710_set_pio_mode; | ||
374 | hwif->set_dma_mode = &palm_bk3710_set_dma_mode; | ||
375 | hwif->mmio = 1; | 394 | hwif->mmio = 1; |
376 | default_hwif_mmiops(hwif); | 395 | default_hwif_mmiops(hwif); |
377 | hwif->cbl = ATA_CBL_PATA80; | ||
378 | hwif->ultra_mask = 0x1f; /* Ultra DMA Mode 4 Max | ||
379 | (input clk 99MHz) */ | ||
380 | hwif->mwdma_mask = 0x7; | ||
381 | hwif->drives[0].autotune = 1; | ||
382 | hwif->drives[1].autotune = 1; | ||
383 | 396 | ||
384 | ide_setup_dma(hwif, mem->start); | 397 | ide_setup_dma(hwif, mem->start); |
385 | 398 | ||
386 | idx[0] = i; | 399 | idx[0] = i; |
387 | 400 | ||
388 | ide_device_add(idx, NULL); | 401 | ide_device_add(idx, &palm_bk3710_port_info); |
389 | 402 | ||
390 | if (!hwif->present) | 403 | if (!hwif->present) |
391 | goto out; | 404 | goto out; |