public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch to ymfpci from ALSA 0.99
@ 2001-03-06  0:25 Peter Zaitcev
  2001-03-06  1:46 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zaitcev @ 2001-03-06  0:25 UTC (permalink / raw)
  To: alan; +Cc: linux-kernel

Hello:

the patch does not fix the buzzing, but it does not hurt either.
And the way we loaded the microcode before was seriously wrong.
Please look.

-- Pete

diff -ur -X dontdiff linux-2.4.2/drivers/sound/ymfpci.c linux-2.4.2-p3/drivers/sound/ymfpci.c
--- linux-2.4.2/drivers/sound/ymfpci.c	Fri Feb 16 16:02:37 2001
+++ linux-2.4.2-p3/drivers/sound/ymfpci.c	Mon Feb 26 23:56:53 2001
@@ -2185,8 +2149,8 @@
 	ymfpci_writew(codec, YDSXGR_GLOBALCTRL, ctrl & ~0x0007);
 
 	/* setup DSP instruction code */
-	for (i = 0; i < YDSXG_DSPLENGTH; i++)
-		ymfpci_writel(codec, YDSXGR_DSPINSTRAM + i, DspInst[i >> 2]);
+	for (i = 0; i < YDSXG_DSPLENGTH / 4; i++)
+		ymfpci_writel(codec, YDSXGR_DSPINSTRAM + (i << 2), DspInst[i]);
 
 	switch (codec->pci->device) {
 	case PCI_DEVICE_ID_YAMAHA_724F:
@@ -2201,11 +2165,11 @@
 
 	if (ver_1e) {
 		/* setup control instruction code */
-		for (i = 0; i < YDSXG_CTRLLENGTH; i++)
-			ymfpci_writel(codec, YDSXGR_CTRLINSTRAM + i, CntrlInst1E[i >> 2]);
+		for (i = 0; i < YDSXG_CTRLLENGTH / 4; i++)
+			ymfpci_writel(codec, YDSXGR_CTRLINSTRAM + (i << 2), CntrlInst1E[i]);
 	} else {
-		for (i = 0; i < YDSXG_CTRLLENGTH; i++)
-			ymfpci_writel(codec, YDSXGR_CTRLINSTRAM + i, CntrlInst[i >> 2]);
+		for (i = 0; i < YDSXG_CTRLLENGTH / 4; i++)
+			ymfpci_writel(codec, YDSXGR_CTRLINSTRAM + (i << 2), CntrlInst[i]);
 	}
 
 	ymfpci_enable_dsp(codec);
diff -ur -X dontdiff linux-2.4.2/drivers/sound/ymfpci_image.h linux-2.4.2-p3/drivers/sound/ymfpci_image.h
--- linux-2.4.2/drivers/sound/ymfpci_image.h	Sun Dec  3 23:58:10 2000
+++ linux-2.4.2-p3/drivers/sound/ymfpci_image.h	Mon Feb 26 23:44:52 2001
@@ -1,7 +1,7 @@
 #ifndef _HWMCODE_
 #define _HWMCODE_
 
-static unsigned long int	DspInst[] = {
+static unsigned long DspInst[YDSXG_DSPLENGTH / 4] = {
 	0x00000081, 0x000001a4, 0x0000000a, 0x0000002f,
 	0x00080253, 0x01800317, 0x0000407b, 0x0000843f,
 	0x0001483c, 0x0001943c, 0x0005d83c, 0x00001c3c,
@@ -12,7 +12,7 @@
 	0x00000000, 0x00000000, 0x00000000, 0x00000000
 };
 
-static unsigned long int	CntrlInst[] = {
+static unsigned long CntrlInst[YDSXG_CTRLLENGTH / 4] = {
 	0x000007, 0x240007, 0x0C0007, 0x1C0007,
 	0x060007, 0x700002, 0x000020, 0x030040,
 	0x007104, 0x004286, 0x030040, 0x000F0D,
@@ -791,7 +791,7 @@
 // 04/09  creat
 // 04/12  stop nise fix
 // 06/21  WorkingOff timming
-static unsigned long int	CntrlInst1E[] = {
+static unsigned long CntrlInst1E[YDSXG_CTRLLENGTH / 4] = {
 	0x000007, 0x240007, 0x0C0007, 0x1C0007,
 	0x060007, 0x700002, 0x000020, 0x030040,
 	0x007104, 0x004286, 0x030040, 0x000F0D,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch to ymfpci from ALSA 0.99
  2001-03-06  0:25 Patch to ymfpci from ALSA 0.99 Peter Zaitcev
@ 2001-03-06  1:46 ` Alan Cox
  2001-03-06  1:51   ` Peter Zaitcev
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2001-03-06  1:46 UTC (permalink / raw)
  To: Peter Zaitcev; +Cc: alan, linux-kernel

> -static unsigned long int	DspInst[] = {
> +static unsigned long DspInst[YDSXG_DSPLENGTH / 4] = {
>  	0x00000081, 0x000001a4, 0x0000000a, 0x0000002f,
>  	0x00080253, 0x01800317, 0x0000407b, 0x0000843f,

This seems wrong (actually I suspect its a continuation of wrongness. What
about 64bit platforms - u32 maybe ?)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch to ymfpci from ALSA 0.99
  2001-03-06  1:46 ` Alan Cox
@ 2001-03-06  1:51   ` Peter Zaitcev
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Zaitcev @ 2001-03-06  1:51 UTC (permalink / raw)
  To: Alan Cox; +Cc: Peter Zaitcev, linux-kernel

> From: Alan Cox <alan@redhat.com>
> To: zaitcev@redhat.com (Peter Zaitcev)
> Date: Mon, 5 Mar 2001 20:46:32 -0500 (EST)

> > -static unsigned long int	DspInst[] = {
> > +static unsigned long DspInst[YDSXG_DSPLENGTH / 4] = {
> >  	0x00000081, 0x000001a4, 0x0000000a, 0x0000002f,
> >  	0x00080253, 0x01800317, 0x0000407b, 0x0000843f,
> 
> This seems wrong (actually I suspect its a continuation of wrongness. What
> about 64bit platforms - u32 maybe ?)

It will work on 64 bits, only use 2 times more memory for the storage.
Should be safe to change to int or u32.

-- Pete

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-03-06  1:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-06  0:25 Patch to ymfpci from ALSA 0.99 Peter Zaitcev
2001-03-06  1:46 ` Alan Cox
2001-03-06  1:51   ` Peter Zaitcev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox