diff options
Diffstat (limited to 'drivers/ide/pci/sis5513.c')
-rw-r--r-- | drivers/ide/pci/sis5513.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index ec0adad9ef61..f875183ac8d9 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/sis5513.c Version 0.20 Mar 4, 2007 | 2 | * linux/drivers/ide/pci/sis5513.c Version 0.25 Jun 10, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org> |
5 | * Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer | 5 | * Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer |
@@ -796,10 +796,33 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c | |||
796 | return 0; | 796 | return 0; |
797 | } | 797 | } |
798 | 798 | ||
799 | static unsigned int __devinit ata66_sis5513 (ide_hwif_t *hwif) | 799 | struct sis_laptop { |
800 | u16 device; | ||
801 | u16 subvendor; | ||
802 | u16 subdevice; | ||
803 | }; | ||
804 | |||
805 | static const struct sis_laptop sis_laptop[] = { | ||
806 | /* devid, subvendor, subdev */ | ||
807 | { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */ | ||
808 | /* end marker */ | ||
809 | { 0, } | ||
810 | }; | ||
811 | |||
812 | static u8 __devinit ata66_sis5513(ide_hwif_t *hwif) | ||
800 | { | 813 | { |
814 | struct pci_dev *pdev = hwif->pci_dev; | ||
815 | const struct sis_laptop *lap = &sis_laptop[0]; | ||
801 | u8 ata66 = 0; | 816 | u8 ata66 = 0; |
802 | 817 | ||
818 | while (lap->device) { | ||
819 | if (lap->device == pdev->device && | ||
820 | lap->subvendor == pdev->subsystem_vendor && | ||
821 | lap->subdevice == pdev->subsystem_device) | ||
822 | return ATA_CBL_PATA40_SHORT; | ||
823 | lap++; | ||
824 | } | ||
825 | |||
803 | if (chipset_family >= ATA_133) { | 826 | if (chipset_family >= ATA_133) { |
804 | u16 regw = 0; | 827 | u16 regw = 0; |
805 | u16 reg_addr = hwif->channel ? 0x52: 0x50; | 828 | u16 reg_addr = hwif->channel ? 0x52: 0x50; |
@@ -811,7 +834,8 @@ static unsigned int __devinit ata66_sis5513 (ide_hwif_t *hwif) | |||
811 | pci_read_config_byte(hwif->pci_dev, 0x48, ®48h); | 834 | pci_read_config_byte(hwif->pci_dev, 0x48, ®48h); |
812 | ata66 = (reg48h & mask) ? 0 : 1; | 835 | ata66 = (reg48h & mask) ? 0 : 1; |
813 | } | 836 | } |
814 | return ata66; | 837 | |
838 | return ata66 ? ATA_CBL_PATA80 : ATA_CBL_PATA40; | ||
815 | } | 839 | } |
816 | 840 | ||
817 | static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif) | 841 | static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif) |
@@ -841,8 +865,8 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif) | |||
841 | if (!chipset_family) | 865 | if (!chipset_family) |
842 | return; | 866 | return; |
843 | 867 | ||
844 | if (!(hwif->udma_four)) | 868 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
845 | hwif->udma_four = ata66_sis5513(hwif); | 869 | hwif->cbl = ata66_sis5513(hwif); |
846 | 870 | ||
847 | if (chipset_family > ATA_16) { | 871 | if (chipset_family > ATA_16) { |
848 | hwif->ide_dma_check = &sis5513_config_xfer_rate; | 872 | hwif->ide_dma_check = &sis5513_config_xfer_rate; |