diff options
Diffstat (limited to 'drivers/ata/pata_cypress.c')
-rw-r--r-- | drivers/ata/pata_cypress.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c index 8fb040bf7361..0fcc096b8dac 100644 --- a/drivers/ata/pata_cypress.c +++ b/drivers/ata/pata_cypress.c | |||
@@ -62,14 +62,16 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
62 | return; | 62 | return; |
63 | } | 63 | } |
64 | 64 | ||
65 | time_16 = clamp_val(t.recover, 0, 15) | (clamp_val(t.active, 0, 15) << 4); | 65 | time_16 = clamp_val(t.recover - 1, 0, 15) | |
66 | time_8 = clamp_val(t.act8b, 0, 15) | (clamp_val(t.rec8b, 0, 15) << 4); | 66 | (clamp_val(t.active - 1, 0, 15) << 4); |
67 | time_8 = clamp_val(t.act8b - 1, 0, 15) | | ||
68 | (clamp_val(t.rec8b - 1, 0, 15) << 4); | ||
67 | 69 | ||
68 | if (adev->devno == 0) { | 70 | if (adev->devno == 0) { |
69 | pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr); | 71 | pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr); |
70 | 72 | ||
71 | addr &= ~0x0F; /* Mask bits */ | 73 | addr &= ~0x0F; /* Mask bits */ |
72 | addr |= clamp_val(t.setup, 0, 15); | 74 | addr |= clamp_val(t.setup - 1, 0, 15); |
73 | 75 | ||
74 | pci_write_config_dword(pdev, CY82_IDE_ADDRSETUP, addr); | 76 | pci_write_config_dword(pdev, CY82_IDE_ADDRSETUP, addr); |
75 | pci_write_config_byte(pdev, CY82_IDE_MASTER_IOR, time_16); | 77 | pci_write_config_byte(pdev, CY82_IDE_MASTER_IOR, time_16); |
@@ -79,7 +81,7 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
79 | pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr); | 81 | pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr); |
80 | 82 | ||
81 | addr &= ~0xF0; /* Mask bits */ | 83 | addr &= ~0xF0; /* Mask bits */ |
82 | addr |= (clamp_val(t.setup, 0, 15) << 4); | 84 | addr |= (clamp_val(t.setup - 1, 0, 15) << 4); |
83 | 85 | ||
84 | pci_write_config_dword(pdev, CY82_IDE_ADDRSETUP, addr); | 86 | pci_write_config_dword(pdev, CY82_IDE_ADDRSETUP, addr); |
85 | pci_write_config_byte(pdev, CY82_IDE_SLAVE_IOR, time_16); | 87 | pci_write_config_byte(pdev, CY82_IDE_SLAVE_IOR, time_16); |
@@ -136,7 +138,7 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *i | |||
136 | if (PCI_FUNC(pdev->devfn) != 1) | 138 | if (PCI_FUNC(pdev->devfn) != 1) |
137 | return -ENODEV; | 139 | return -ENODEV; |
138 | 140 | ||
139 | return ata_pci_sff_init_one(pdev, ppi, &cy82c693_sht, NULL); | 141 | return ata_pci_sff_init_one(pdev, ppi, &cy82c693_sht, NULL, 0); |
140 | } | 142 | } |
141 | 143 | ||
142 | static const struct pci_device_id cy82c693[] = { | 144 | static const struct pci_device_id cy82c693[] = { |