mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: ChenLi Tien <cltien@cmedia.com.tw>
Cc: ChenLi Tien <cltien@cmedia.com.tw>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cmpci.c fixes for joystick initialization in 2.4.27
Date: Thu, 25 Nov 2004 10:33:00 -0200	[thread overview]
Message-ID: <20041125123300.GH16189@logos.cnet> (raw)
In-Reply-To: <Pine.LNX.4.44.0410311137110.1383-100000@shampoo>



ChenLi, 

Have you received this patch?

Can you confirm 0x201 is the standard address for the port?

On Sun, Oct 31, 2004 at 12:01:53PM +0100, Michele Debandi wrote:
> Hello,
> 
> I hope you are the current mantainer of cmpci module on 2.4 series kernel.
> 
> I have an integrated CM8738 sound chip on my Asus P4B533 motherboard.
> The lspci -v output is:
> 
> 02:03.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
>         Subsystem: Asustek Computer, Inc.: Unknown device 80e2
>         Flags: bus master, stepping, medium devsel, latency 32, IRQ 21
>         I/O ports at b800 [size=256]
>         Capabilities: [c0] Power Management version 2
> 
> With the cmpci.c driver the joystick will not work. MSDOS initialization
> sets the joystick port at the address 0x201, and windows driver uses also
> this port. The cmpci driver initializes instead the port 0x200, and
> on my chipset at that address thre is nothing. So I modified the driver
> modules to use the port 0x201 but mantaining the 8-port allocation of the
> original driver.
> This is tested and seems to work on a stantard PC/XT style 2-axis/2-button
> joystick.
> 
> Below there is the diff file.
> 
> Greetings
> 
> Mike
> 
> --- drivers/sound/cmpci.c.ORIG	Tue Oct 26 20:55:08 2004
> +++ drivers/sound/cmpci.c	Tue Oct 26 21:01:23 2004
> @@ -3354,7 +3354,7 @@
>  #endif
>  	s->iosynth = fmio;
>  	s->iomidi = mpuio;
> -	s->gameport.io = 0x200;
> +	s->gameport.io = 0x201; /*use standard DOS io port */
>  	s->status = 0;
>  	/* range check */
>  	if (speakers < 2)
> @@ -3443,7 +3443,8 @@
>  #endif
>  	/* enable joystick */
>  	if (joystick) {
> -		if (s->gameport.io && !request_region(s->gameport.io, CM_EXTENT_GAME, "cmpci GAME")) {
> +	        /* need to use port 0x201, but the extent starts at 0x200??? */
> +		if (s->gameport.io && !request_region((s->gameport.io) - 1, CM_EXTENT_GAME, "cmpci GAME")) {
>  			printk(KERN_ERR "cmpci: gameport io ports in use\n");
>  			s->gameport.io = 0;
>  	       	} else
> @@ -3549,8 +3550,13 @@
>  		s->max_channels = 2;
>  	}
>  	/* register gameport */
> -	if (joystick)
> +	if (joystick) {
>  		gameport_register_port(&s->gameport);
> +		/* better write some more info */
> +		printk(KERN_INFO "gameport%d: CMPCI at %#x", s->gameport.number, s->gameport.io);
> +	        printk(" size %d", CM_EXTENT_GAME);
> +		printk(" speed %d kHz\n", s->gameport.speed);
> +	}
>  	/* store it in the driver field */
>  	pci_set_drvdata(pcidev, s);
>  	/* put it into driver list */
> @@ -3576,7 +3582,7 @@
>  	free_irq(s->irq, s);
>  err_irq:
>  	if (s->gameport.io)
> -		release_region(s->gameport.io, CM_EXTENT_GAME);
> +		release_region((s->gameport.io)-1, CM_EXTENT_GAME);
>  #ifdef CONFIG_SOUND_CMPCI_FM
>  	if (s->iosynth) release_region(s->iosynth, CM_EXTENT_SYNTH);
>  #endif
> @@ -3612,7 +3618,7 @@
> 
>  	if (s->gameport.io) {
>  		gameport_unregister_port(&s->gameport);
> -		release_region(s->gameport.io, CM_EXTENT_GAME);
> +		release_region((s->gameport.io)-1, CM_EXTENT_GAME);
>  	}
>  	release_region(s->iobase, CM_EXTENT_CODEC);
>  #ifdef CONFIG_SOUND_CMPCI_MIDI

      reply	other threads:[~2004-11-27  2:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-31 11:01 Michele Debandi
2004-11-25 12:33 ` Marcelo Tosatti [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041125123300.GH16189@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=cltien@cmedia.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®