[PATCH] yenta: add modparam to tune EnE bridges (was Re: ENE CB1410 and Echo Indigo IO incompatibility)

Daniel Ritz daniel.ritz at gmx.ch
Fri Aug 19 22:48:28 EDT 2005


hi jon, akpm, dominik

find attached a patch to add a module parameter that allows changing the
behaviour of EnE bridges. just put
	options yenta_socket ene_tltenable=Y
into your /etc/modprobe.conf

akpm, dominik: to your queues, please.

rgds
-daniel

-----

[PATCH] yenta: add modparam to tune EnE bridges

EnE bridges have various compatibility problems with different CB cards. Eg.
are the RME HDSP soundcard, some CD writers, Echo Audio products and the
audigy 2 zs. There's a test bit (TLTEnable) that helps. but for some CB
cards it has to be cleared (HDSP, cd writer) and for some set (Echo
soundcards). Turn it into a modparam, default to clear to not break working
setups).

Also add some more EnE entries to pci_ids.h and use them.

Signed-off-by: Daniel Ritz <daniel.ritz at gmx.ch>

---

diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h
--- a/drivers/pcmcia/ti113x.h
+++ b/drivers/pcmcia/ti113x.h
@@ -791,16 +791,6 @@ static int ti12xx_override(struct yenta_
 		config_writel(socket, TI113X_SYSTEM_CONTROL, val);
 
 	/*
-	 * for EnE bridges only: clear testbit TLTEnable. this makes the
-	 * RME Hammerfall DSP sound card working.
-	 */
-	if (socket->dev->vendor == PCI_VENDOR_ID_ENE) {
-		u8 test_c9 = config_readb(socket, ENE_TEST_C9);
-		test_c9 &= ~ENE_TEST_C9_TLTENABLE;
-		config_writeb(socket, ENE_TEST_C9, test_c9);
-	}
-
-	/*
 	 * Yenta expects controllers to use CSCINT to route
 	 * CSC interrupts to PCI rather than INTVAL.
 	 */
@@ -841,5 +831,28 @@ static int ti1250_override(struct yenta_
 	return ti12xx_override(socket);
 }
 
+
+/**
+ * EnE specific part. EnE bridges are register compatible with TI bridges but
+ * have their own little problems (HW incompatibilities).
+ *
+ * set/clear TLTEnable testbit:
+ * - clearing it makes the RME Hammerfall DSP sound card working
+ * - setting it makes Echo Audio cards working
+ * Defaults to clear the bit.
+ */
+static int ene_override(struct yenta_socket *socket)
+{
+	u8 test_c9 = config_readb(socket, ENE_TEST_C9);
+	if (ene_tltenable)
+		test_c9 |= ENE_TEST_C9_TLTENABLE;
+	else
+		test_c9 &= ~ENE_TEST_C9_TLTENABLE;
+	config_writeb(socket, ENE_TEST_C9, test_c9);
+
+	/* and since it's register compatible... */
+	return ti1250_override(socket);
+}
+
 #endif /* _LINUX_TI113X_H */
 
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -39,6 +39,10 @@ static int pwr_irqs_off;
 module_param(pwr_irqs_off, bool, 0644);
 MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only when seeing IRQ storms!");
 
+static int ene_tltenable;
+module_param(ene_tltenable, bool, 0644);
+MODULE_PARM_DESC(ene_tltenable, "EnE bridges: set to Y when having problems with cardbus cards.");
+
 #if 0
 #define debug(x,args...) printk(KERN_DEBUG "%s: " x, __func__ , ##args)
 #else
@@ -753,6 +757,7 @@ enum {
 	CARDBUS_TYPE_RICOH,
 	CARDBUS_TYPE_TOPIC97,
 	CARDBUS_TYPE_O2MICRO,
+	CARDBUS_TYPE_ENE,
 };
 
 /*
@@ -796,6 +801,12 @@ static struct cardbus_type cardbus_type[
 		.override	= o2micro_override,
 		.restore_state	= o2micro_restore_state,
 	},
+	[CARDBUS_TYPE_ENE]	= {
+		.override	= ene_override,
+		.save_state	= ti_save_state,
+		.restore_state	= ti_restore_state,
+		.sock_init	= ti_init,
+	},
 };
 
 
@@ -1185,10 +1196,14 @@ static struct pci_device_id yenta_table 
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1250, TI1250),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1410, TI1250),
 
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1211, TI12XX),
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1225, TI12XX),
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1410, TI1250),
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1420, TI12XX),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1211, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1225, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1410, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1420, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_710, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_712, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_720, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_722, ENE),
 
 	CB_ID(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_RL5C465, RICOH),
 	CB_ID(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_RL5C466, RICOH),
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2143,7 +2143,11 @@
 #define PCI_DEVICE_ID_ENE_1211		0x1211
 #define PCI_DEVICE_ID_ENE_1225		0x1225
 #define PCI_DEVICE_ID_ENE_1410		0x1410
+#define PCI_DEVICE_ID_ENE_710		0x1411
+#define PCI_DEVICE_ID_ENE_712		0x1412
 #define PCI_DEVICE_ID_ENE_1420		0x1420
+#define PCI_DEVICE_ID_ENE_720		0x1421
+#define PCI_DEVICE_ID_ENE_722		0x1422
 
 #define PCI_VENDOR_ID_SYBA		0x1592
 #define PCI_DEVICE_ID_SYBA_2P_EPP	0x0782



More information about the linux-pcmcia mailing list