diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 11:18:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 11:18:01 -0500 |
commit | 23eb3b64b5e44680c867e165fe1cd18e57fba255 (patch) | |
tree | d6aed2971ef647f7be2986353f830577abd1fab9 /drivers/ata/pata_ns87415.c | |
parent | 1c496784a0d317535f846ddb2c93a08ba936266b (diff) | |
parent | 1b52f2a41c41052d2a7c78af0bd9b8b11d70f49a (diff) |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (54 commits)
Revert "pata_sis: Implement MWDMA for the UDMA 133 capable chips"
libata: Clarify ata_set_lba_range_entries function
libata: Report zeroed read after TRIM and max discard size
pata_hpt3x2n: fix overclocked MWDMA0 timing
pata_it8213: MWDMA0 is unsupported
[libata] MWDMA0 is unsupported on PIIX-like PATA controllers
pata_via: clear UDMA transfer mode bit for PIO and MWDMA
pata_sis: Power Management fix
pata_rz1000: Power Management fix
pata_radisys: fix UDMA handling
pata_ns87415: Power Management fix
pata_marvell: fix marvell_pre_reset() documentation
pata_legacy: add pointers to QDI65x0 documentation
pata_legacy: fix access to control register for QDI6580
pata_legacy: fix QDI6580DP support
pata_it8213: fix it8213_pre_reset() documentation
pata_it8213: fix wrong MWDMA timings being programmed
pata_it8213: fix PIO2 underclocking
pata_it8213: fix wrong PIO timings being programmed
pata_it8213: fix UDMA handling
...
Diffstat (limited to 'drivers/ata/pata_ns87415.c')
-rw-r--r-- | drivers/ata/pata_ns87415.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/ata/pata_ns87415.c b/drivers/ata/pata_ns87415.c index 773b1590b492..061aa1c41a48 100644 --- a/drivers/ata/pata_ns87415.c +++ b/drivers/ata/pata_ns87415.c | |||
@@ -325,6 +325,13 @@ static struct scsi_host_template ns87415_sht = { | |||
325 | ATA_BMDMA_SHT(DRV_NAME), | 325 | ATA_BMDMA_SHT(DRV_NAME), |
326 | }; | 326 | }; |
327 | 327 | ||
328 | static void ns87415_fixup(struct pci_dev *pdev) | ||
329 | { | ||
330 | /* Select 512 byte sectors */ | ||
331 | pci_write_config_byte(pdev, 0x55, 0xEE); | ||
332 | /* Select PIO0 8bit clocking */ | ||
333 | pci_write_config_byte(pdev, 0x54, 0xB7); | ||
334 | } | ||
328 | 335 | ||
329 | /** | 336 | /** |
330 | * ns87415_init_one - Register 87415 ATA PCI device with kernel services | 337 | * ns87415_init_one - Register 87415 ATA PCI device with kernel services |
@@ -371,10 +378,8 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e | |||
371 | if (rc) | 378 | if (rc) |
372 | return rc; | 379 | return rc; |
373 | 380 | ||
374 | /* Select 512 byte sectors */ | 381 | ns87415_fixup(pdev); |
375 | pci_write_config_byte(pdev, 0x55, 0xEE); | 382 | |
376 | /* Select PIO0 8bit clocking */ | ||
377 | pci_write_config_byte(pdev, 0x54, 0xB7); | ||
378 | return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL); | 383 | return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL); |
379 | } | 384 | } |
380 | 385 | ||
@@ -384,6 +389,23 @@ static const struct pci_device_id ns87415_pci_tbl[] = { | |||
384 | { } /* terminate list */ | 389 | { } /* terminate list */ |
385 | }; | 390 | }; |
386 | 391 | ||
392 | #ifdef CONFIG_PM | ||
393 | static int ns87415_reinit_one(struct pci_dev *pdev) | ||
394 | { | ||
395 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | ||
396 | int rc; | ||
397 | |||
398 | rc = ata_pci_device_do_resume(pdev); | ||
399 | if (rc) | ||
400 | return rc; | ||
401 | |||
402 | ns87415_fixup(pdev); | ||
403 | |||
404 | ata_host_resume(host); | ||
405 | return 0; | ||
406 | } | ||
407 | #endif | ||
408 | |||
387 | static struct pci_driver ns87415_pci_driver = { | 409 | static struct pci_driver ns87415_pci_driver = { |
388 | .name = DRV_NAME, | 410 | .name = DRV_NAME, |
389 | .id_table = ns87415_pci_tbl, | 411 | .id_table = ns87415_pci_tbl, |
@@ -391,7 +413,7 @@ static struct pci_driver ns87415_pci_driver = { | |||
391 | .remove = ata_pci_remove_one, | 413 | .remove = ata_pci_remove_one, |
392 | #ifdef CONFIG_PM | 414 | #ifdef CONFIG_PM |
393 | .suspend = ata_pci_device_suspend, | 415 | .suspend = ata_pci_device_suspend, |
394 | .resume = ata_pci_device_resume, | 416 | .resume = ns87415_reinit_one, |
395 | #endif | 417 | #endif |
396 | }; | 418 | }; |
397 | 419 | ||