Linux Sound subsystem development
 help / color / mirror / Atom feed
* Re: [PATCH] opl3sa2 isapnp activation fix
@ 2002-06-04 15:42 Zwane Mwaikambo
  2002-06-04 15:48 ` Zwane Mwaikambo
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Zwane Mwaikambo @ 2002-06-04 15:42 UTC (permalink / raw)
  To: linux-sound

On Tue, 4 Jun 2002, Gerald Teschl wrote:

> --- linux-2.4.18-4/drivers/sound/opl3sa2.c.orig    Thu May  2 23:36:45 2002
> +++ linux-2.4.18-4/drivers/sound/opl3sa2.c    Tue Jun  4 16:09:50 2002
> @@ -57,6 +57,7 @@
>   *                         (Jan 7, 2001)
>   * Zwane Mwaikambo       Added PM support. (Dec 4 2001)
>   * Zwane Mwaikambo       Code, data structure cleanups. (Feb 15 2002)
> + * Gerald Teschl       Fixed ISA PnP activate. (Jun 02 2002)
>   *
>   */
>  
> @@ -869,10 +870,24 @@
>      }
>      else {
>          if(dev->activate(dev) < 0) {
> -            printk(KERN_WARNING PFX "ISA PnP activate failed\n");
> -            opl3sa2_state[card].activated = 0;
> -            return -ENODEV;
> +            /*
> +             * isapnp.c disallows dma=0 but some opl3sa2 cards need it.
> +             * So we set dma by hand and try again
> +             */
> +            if (dma < 0 || dma > 7)
> +                dma= 0;
> +            if (dma2 < 0 || dma2 >7)
> +                dma2= 1;

Oops, that won't work on isapnp since dma = dma2 = -1 at this stage, how 
about;

if ((dma != -1) && (dma2 != -1)) frob();

you shouldn't hard set 0,1

> +            isapnp_resource_change(&dev->dma_resource[0], dma, 1);
> +            isapnp_resource_change(&dev->dma_resource[1], dma2, 1);
>          }
> +        if(!dev->active)
> +           if (dev->activate(dev) < 0) {
> +                printk(KERN_WARNING PFX "ISA PnP activate failed.\n");
> +                opl3sa2_state[card].activated = 0;
> +                return -ENODEV;
> +            }
> +        opl3sa2_state[card].activated = 1;
>  
>          printk(KERN_DEBUG
>                 PFX "Activated ISA PnP card %d (active=%d)\n",

The rest looks ok.

Cheers,
	Zwane
-- 
http://function.linuxpower.ca
		



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

end of thread, other threads:[~2002-06-06 18:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-04 15:42 [PATCH] opl3sa2 isapnp activation fix Zwane Mwaikambo
2002-06-04 15:48 ` Zwane Mwaikambo
2002-06-04 15:57 ` Gerald Teschl
2002-06-04 17:33 ` Zwane Mwaikambo
2002-06-04 17:34 ` Gerald Teschl
2002-06-05 15:05 ` Gerald Teschl
2002-06-06 18:44 ` Gerald Teschl

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