Skip to contentSkip to conversation

PATCH: intel8x0 AC97 modem.

PATCH SashaK 1 participant 1 message Nov 27, 2003

lore
Share & tools
lore

SashaK

author
#0 lore raw

Hello All,

There are two patches for intel8x0+si3606/8 AC97 soft modem support:

ac97 - GPIO definitions, modem related GPIO setup and patch for si3606/8 MC.

intel8x0m - modem driver (modified from intel8x0.c) for ICH chipsets. No support yet for non-ICH chipsets. Some things are same as in intel8x0.c. Many functions are not simplified yet regarding to future supports (ALI,SIS,NFORCE) .

Works for me.

Regards,
Sasha.

Index: alsa-kernel/include/ac97_codec.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/ac97_codec.h,v retrieving revision 1.37

include/ac97_codec.h +18 -0
diff -u -b -B -r1.37 ac97_codec.h
@@ -207,6 +207,24 @@
 #define AC97_MEA_PRG		0x4000	/* HADC power down (high) */
 #define AC97_MEA_PRH		0x8000	/* HDAC power down (high) */
 
+/* modem gpio status defines */
+#define AC97_GPIO_LINE1_OH      0x0001  /* Off Hook Line1 */
+#define AC97_GPIO_LINE1_RI      0x0002  /* Ring Detect Line1 */
+#define AC97_GPIO_LINE1_CID     0x0004  /* Caller ID path enable Line1 */
+#define AC97_GPIO_LINE1_LCS     0x0008  /* Loop Current Sense Line1 */
+#define AC97_GPIO_LINE1_PULSE   0x0010  /* Opt./ Pulse Dial Line1 (out) */
+#define AC97_GPIO_LINE1_HL1R    0x0020  /* Opt./ Handset to Line1 relay control (out) */
+#define AC97_GPIO_LINE1_HOHD    0x0040  /* Opt./ Handset off hook detect Line1 (in) */
+#define AC97_GPIO_LINE12_AC     0x0080  /* Opt./ Int.bit 1 / Line1/2 AC (out) */
+#define AC97_GPIO_LINE12_DC     0x0100  /* Opt./ Int.bit 2 / Line1/2 DC (out) */
+#define AC97_GPIO_LINE12_RS     0x0200  /* Opt./ Int.bit 3 / Line1/2 RS (out) */
+#define AC97_GPIO_LINE2_OH      0x0400  /* Off Hook Line2 */
+#define AC97_GPIO_LINE2_RI      0x0800  /* Ring Detect Line2 */
+#define AC97_GPIO_LINE2_CID     0x1000  /* Caller ID path enable Line2 */
+#define AC97_GPIO_LINE2_LCS     0x2000  /* Loop Current Sense Line2 */
+#define AC97_GPIO_LINE2_PULSE   0x4000  /* Opt./ Pulse Dial Line2 (out) */
+#define AC97_GPIO_LINE2_HL1R    0x8000  /* Opt./ Handset to Line2 relay control (out) */
+
 /* specific - SigmaTel */
 #define AC97_SIGMATEL_ANALOG	0x6c	/* Analog Special */
 #define AC97_SIGMATEL_DAC2INVERT 0x6e

Index: alsa-kernel/pci/ac97/ac97_codec.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v retrieving revision 1.115

pci/ac97/ac97_codec.c +7 -1
diff -u -b -B -r1.115 ac97_codec.c
@@ -146,7 +146,7 @@
 { 0x4e534331, 0xffffffff, "LM4549",		NULL,		NULL },
 { 0x4e534350, 0xffffffff, "LM4550",		NULL,		NULL },
 { 0x50534304, 0xffffffff, "UCB1400",		NULL,		NULL },
-{ 0x53494c20, 0xffffffe0, "Si3036/8",		NULL,		NULL },
+{ 0x53494c20, 0xffffffe0, "Si3036/8",		NULL,		mpatch_si3036 },
 { 0x54524102, 0xffffffff, "TR28022",		NULL,		NULL },
 { 0x54524106, 0xffffffff, "TR28026",		NULL,		NULL },
 { 0x54524108, 0xffffffff, "TR28028",		patch_tritech_tr28028,	NULL }, // added by xin jin [07/09/99]
@@ -1517,6 +1517,12 @@
 static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97)
 {
 	/* TODO */
+	//printk("AC97_GPIO_CFG = %x\n",snd_ac97_read(ac97,AC97_GPIO_CFG));
+	snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH));
+	snd_ac97_write(ac97, AC97_GPIO_POLARITY, 0xffff & ~(AC97_GPIO_LINE1_OH));
+	snd_ac97_write(ac97, AC97_GPIO_STICKY, 0xffff);
+	snd_ac97_write(ac97, AC97_GPIO_WAKEUP, 0x0);
+	snd_ac97_write(ac97, AC97_MISC_AFE, 0x0);
 	return 0;
 }
 

Index: alsa-kernel/pci/ac97/ac97_patch.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v retrieving revision 1.31

pci/ac97/ac97_patch.c +11 -0
diff -u -b -B -r1.31 ac97_patch.c
@@ -1383,3 +1383,14 @@
 	snd_ac97_write_cache(ac97, 0x7A, 0x0808);
 	return 0;
 }
+
+/* Si3036/8 specific registers */
+#define AC97_SI3036_CHIP_ID     0x5a
+
+int mpatch_si3036(ac97_t * ac97)
+{
+	//printk("mpatch_si3036: chip id = %x\n", snd_ac97_read(ac97, 0x5a));
+	snd_ac97_write_cache(ac97, 0x5c, 0xf210 );
+	snd_ac97_write_cache(ac97, 0x68, 0);
+	return 0;
+}

Index: alsa-kernel/pci/ac97/ac97_patch.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.h,v retrieving revision 1.12

pci/ac97/ac97_patch.h +1 -0
diff -u -b -B -r1.12 ac97_patch.h
@@ -51,3 +51,4 @@
 int patch_cm9739(ac97_t * ac97);
 int patch_vt1616(ac97_t * ac97);
 int patch_it2646(ac97_t * ac97);
+int mpatch_si3036(ac97_t * ac97);

Index: alsa-kernel/pci/Kconfig
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/Kconfig,v
retrieving revision 1.9

pci/Kconfig +7 -0
diff -u -b -B -r1.9 Kconfig
@@ -171,6 +171,13 @@
 	  Say 'Y' or 'M' to include support for Intel8x0 based soundcards,
 	  SiS 7012, AMD768/8111, NVidia NForce and ALi 5455 chips.
 
+config SND_INTEL8X0M
+	tristate "Intel i8x0/MX440; AMD768/8111 modems (EXPERIMENTAL)"
+	depends on SND && EXPERIMENTAL
+	help
+	  Say 'Y' or 'M' to include support for Intel8x0 and AMD768/8111 based
+	  modems.
+
 config SND_SONICVIBES
 	tristate "S3 SonicVibes"
 	depends on SND

Index: alsa-kernel/pci/Makefile
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/Makefile,v retrieving revision 1.11

pci/Makefile +2 -0
diff -u -b -B -r1.11 Makefile
@@ -13,6 +13,7 @@
 snd-es1968-objs := es1968.o
 snd-fm801-objs := fm801.o
 snd-intel8x0-objs := intel8x0.o
+snd-intel8x0m-objs := intel8x0m.o
 snd-maestro3-objs := maestro3.o
 snd-rme32-objs := rme32.o
 snd-rme96-objs := rme96.o
@@ -29,6 +30,7 @@
 obj-$(CONFIG_SND_ES1968) += snd-es1968.o
 obj-$(CONFIG_SND_FM801) += snd-fm801.o
 obj-$(CONFIG_SND_INTEL8X0) += snd-intel8x0.o
+obj-$(CONFIG_SND_INTEL8X0M) += snd-intel8x0m.o
 obj-$(CONFIG_SND_MAESTRO3) += snd-maestro3.o
 obj-$(CONFIG_SND_RME32) += snd-rme32.o
 obj-$(CONFIG_SND_RME96) += snd-rme96.o

Index: alsa-kernel/pci/intel8x0m.c
===================================================================
RCS file: alsa-kernel/pci/intel8x0m.c

pci/intel8x0m.c new file +1510 -0

1,510 lines not on this page · raw message