Skip to contentSkip to conversation

sis5513: backport short cables support from pata_sis.c

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 3 messages Jun 10, 2007 – Jun 27, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 sis5513: backport short cables support from pata_sis.c

Backport short cables support from pata_sis.c.

This patch should allow UDMA > 2 modes on ASUS A6K.

---
 drivers/ide/pci/sis5513.c |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
drivers/ide/pci/sis5513.c +24 -1
Index: b/drivers/ide/pci/sis5513.c
===================================================================
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/sis5513.c	Version 0.20	Mar 4, 2007
+ * linux/drivers/ide/pci/sis5513.c	Version 0.25	Jun 10, 2007
  *
  * Copyright (C) 1999-2000	Andre Hedrick <[email protected]>
  * Copyright (C) 2002		Lionel Bouton <[email protected]>, Maintainer
@@ -796,10 +796,33 @@ static unsigned int __devinit init_chips
 	return 0;
 }
 
+struct sis_laptop {
+	u16 device;
+	u16 subvendor;
+	u16 subdevice;
+};
+
+static const struct sis_laptop sis_laptop[] = {
+	/* devid, subvendor, subdev */
+	{ 0x5513, 0x1043, 0x1107 },	/* ASUS A6K */
+	/* end marker */
+	{ 0, }
+};
+
 static u8 __devinit ata66_sis5513(ide_hwif_t *hwif)
 {
+	struct pci_dev *pdev = hwif->pci_dev;
+	const struct sis_laptop *lap = &sis_laptop[0];
 	u8 ata66 = 0;
 
+	while (lap->device) {
+		if (lap->device == pdev->device &&
+		    lap->subvendor == pdev->subsystem_vendor &&
+		    lap->subdevice == pdev->subsystem_device)
+			return ATA_CBL_PATA40_SHORT;
+		lap++;
+	}
+
 	if (chipset_family >= ATA_133) {
 		u16 regw = 0;
 		u16 reg_addr = hwif->channel ? 0x52: 0x50;
Acked-by on v1 4/5
#1 lore raw
Quoted 5 lines · Bartlomiej Zolnierkiewicz

Backport short cables support from pata_sis.c.

This patch should allow UDMA > 2 modes on ASUS A6K.

Quoted 4 lines

Index: b/drivers/ide/pci/sis5513.c
===================================================================

drivers/ide/pci/sis5513.c +0 -0

[...]

Quoted 21 lines
drivers/ide/pci/sis5513.c +15 -0
@@ -796,10 +796,33 @@ static unsigned int __devinit init_chips
 	return 0;
 }
 
+struct sis_laptop {
+	u16 device;
+	u16 subvendor;
+	u16 subdevice;
+};
+
+static const struct sis_laptop sis_laptop[] = {
+	/* devid, subvendor, subdev */
+	{ 0x5513, 0x1043, 0x1107 },	/* ASUS A6K */
+	/* end marker */
+	{ 0, }
+};
+
 static u8 __devinit ata66_sis5513(ide_hwif_t *hwif)
 {
+	struct pci_dev *pdev = hwif->pci_dev;
+	const struct sis_laptop *lap = &sis_laptop[0];

drivers/ide/pci/sis5513.c static unsigned int __devinit init_chips · line 825

Quoted 10 lines
drivers/ide/pci/sis5513.c +8 -0
 	u8 ata66 = 0;
 
+	while (lap->device) {
+		if (lap->device == pdev->device &&
+		    lap->subvendor == pdev->subsystem_vendor &&
+		    lap->subdevice == pdev->subsystem_device)
+			return ATA_CBL_PATA40_SHORT;
+		lap++;
+	}
+

The code even starts looking generic enough to be put into helper...

drivers/ide/pci/sis5513.c static unsigned int __devinit init_chips · line 828

Quoted 3 lines
drivers/ide/pci/sis5513.c +0 -0
 	if (chipset_family >= ATA_133) {
 		u16 regw = 0;
 		u16 reg_addr = hwif->channel ? 0x52: 0x50;

MBR, Sergei

#2 lore raw
Quoted 38 lines · Sergei Shtylyov
Quoted 5 lines · Bartlomiej Zolnierkiewicz

Backport short cables support from pata_sis.c.

This patch should allow UDMA > 2 modes on ASUS A6K.

Quoted 4 lines

Index: b/drivers/ide/pci/sis5513.c
===================================================================

drivers/ide/pci/sis5513.c +0 -0

[...]

Quoted 23 lines
drivers/ide/pci/sis5513.c +15 -0
@@ -796,10 +796,33 @@ static unsigned int __devinit init_chips
 	return 0;
 }
 
+struct sis_laptop {
+	u16 device;
+	u16 subvendor;
+	u16 subdevice;
+};
+
+static const struct sis_laptop sis_laptop[] = {
+	/* devid, subvendor, subdev */
+	{ 0x5513, 0x1043, 0x1107 },	/* ASUS A6K */
+	/* end marker */
+	{ 0, }
+};
+
 static u8 __devinit ata66_sis5513(ide_hwif_t *hwif)
 {
+	struct pci_dev *pdev = hwif->pci_dev;
+	const struct sis_laptop *lap = &sis_laptop[0];
 	u8 ata66 = 0;
 
Quoted 10 lines

drivers/ide/pci/sis5513.c static unsigned int __devinit init_chips · line 825

Quoted 8 lines
drivers/ide/pci/sis5513.c +8 -0
+	while (lap->device) {
+		if (lap->device == pdev->device &&
+		    lap->subvendor == pdev->subsystem_vendor &&
+		    lap->subdevice == pdev->subsystem_device)
+			return ATA_CBL_PATA40_SHORT;
+		lap++;
+	}
+

The code even starts looking generic enough to be put into helper...

Hmm, agreed, now if somebody could send me a patch...

Thanks,
Bart