* [PATCH] sc6000: enable joystick port
@ 2009-04-24 16:23 Krzysztof Helt
2009-04-27 9:26 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Helt @ 2009-04-24 16:23 UTC (permalink / raw)
To: Alsa-devel; +Cc: Rene Herman
From: Krzysztof Helt <krzysztof.h1@wp.pl>
Add module parameter to enable or disable
joystick port (gameport) on the SC6600 and
later cards.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---
sound/isa/sc6000.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c
index c803b2e..7e2526a 100644
--- a/sound/isa/sc6000.c
+++ b/sound/isa/sc6000.c
@@ -56,6 +56,7 @@ static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
/* 0x300, 0x310, 0x320, 0x330 */
static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 0 */
static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0, 1, 3 */
+static int joystick[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 };
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for sc-6000 based soundcard.");
@@ -75,6 +76,8 @@ module_param_array(mpu_irq, int, NULL, 0444);
MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for sc-6000 driver.");
module_param_array(dma, int, NULL, 0444);
MODULE_PARM_DESC(dma, "DMA # for sc-6000 driver.");
+module_param_array(joystick, int, NULL, 0444);
+MODULE_PARM_DESC(dma, "Enable gameport.");
/*
* Commands of SC6000's DSP (SBPRO+special).
@@ -363,7 +366,7 @@ static int __devinit sc6000_init_mss(char __iomem *vport, int config,
static void __devinit sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
long xport, long xmpu,
- long xmss_port)
+ long xmss_port, int joystick)
{
cfg[0] = 0;
cfg[1] = 0;
@@ -376,6 +379,8 @@ static void __devinit sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
if (xmss_port == 0xe80)
cfg[0] |= 0x10;
cfg[0] |= 0x40; /* always set */
+ if (!joystick)
+ cfg[0] |= 0x02;
cfg[1] |= 0x80; /* enable WSS system */
cfg[1] &= ~0x40; /* disable IDE */
snd_printd("hw cfg %x, %x\n", cfg[0], cfg[1]);
@@ -427,7 +432,7 @@ static int __devinit sc6000_init_board(char __iomem *vport,
if (!old) {
int cfg[2];
sc6000_hw_cfg_encode(vport, &cfg[0], port[dev], mpu_port[dev],
- mss_port[dev]);
+ mss_port[dev], joystick[dev]);
if (sc6000_hw_cfg_write(vport, cfg) < 0) {
snd_printk(KERN_ERR "sc6000_hw_cfg_write: failed!\n");
return -EIO;
--
1.6.0.3
----------------------------------------------------------------------
Kawalerka od 69 tys. zl.
Sprawdz atrakcyjne oferty >>> http://link.interia.pl/f2132
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] sc6000: enable joystick port
2009-04-24 16:23 [PATCH] sc6000: enable joystick port Krzysztof Helt
@ 2009-04-27 9:26 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2009-04-27 9:26 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: Alsa-devel, Rene Herman
At Fri, 24 Apr 2009 18:23:39 +0200,
Krzysztof Helt wrote:
>
> From: Krzysztof Helt <krzysztof.h1@wp.pl>
>
> Add module parameter to enable or disable
> joystick port (gameport) on the SC6600 and
> later cards.
>
> Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
> ---
> sound/isa/sc6000.c | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c
> index c803b2e..7e2526a 100644
> --- a/sound/isa/sc6000.c
> +++ b/sound/isa/sc6000.c
> @@ -56,6 +56,7 @@ static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
> /* 0x300, 0x310, 0x320, 0x330 */
> static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 0 */
> static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0, 1, 3 */
> +static int joystick[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 };
>
> module_param_array(index, int, NULL, 0444);
> MODULE_PARM_DESC(index, "Index value for sc-6000 based soundcard.");
> @@ -75,6 +76,8 @@ module_param_array(mpu_irq, int, NULL, 0444);
> MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for sc-6000 driver.");
> module_param_array(dma, int, NULL, 0444);
> MODULE_PARM_DESC(dma, "DMA # for sc-6000 driver.");
> +module_param_array(joystick, int, NULL, 0444);
Better to be bool.
> +MODULE_PARM_DESC(dma, "Enable gameport.");
This doesn't match with the real name...
Also, don't forget to update
Documentation/sound/alsa/ALSA-Configuration.txt, too.
Could you fix and repost?
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] sc6000: enable joystick port
@ 2009-05-03 8:39 Krzysztof Helt
2009-05-04 7:09 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Helt @ 2009-05-03 8:39 UTC (permalink / raw)
To: Alsa-devel; +Cc: Rene Herman
From: Krzysztof Helt <krzysztof.h1@wp.pl>
Add module parameter to enable or disable
joystick port (gameport) on the SC6600 and
later cards.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---
The second version of the patch with fixed
the bug spotted Takashi.
Documentation/sound/alsa/ALSA-Configuration.txt | 4 +++-
sound/isa/sc6000.c | 9 +++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 012858d..11a80a9 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -1543,13 +1543,15 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
Module snd-sc6000
-----------------
- Module for Gallant SC-6000 soundcard.
+ Module for Gallant SC-6000 soundcard and later models: SC-6600
+ and SC-7000.
port - Port # (0x220 or 0x240)
mss_port - MSS Port # (0x530 or 0xe80)
irq - IRQ # (5,7,9,10,11)
mpu_irq - MPU-401 IRQ # (5,7,9,10) ,0 - no MPU-401 irq
dma - DMA # (1,3,0)
+ joystick - Enable gameport - 0 = disable (default), 1 = enable
This module supports multiple cards.
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c
index c803b2e..9a8bbf6 100644
--- a/sound/isa/sc6000.c
+++ b/sound/isa/sc6000.c
@@ -56,6 +56,7 @@ static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
/* 0x300, 0x310, 0x320, 0x330 */
static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 0 */
static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0, 1, 3 */
+static bool joystick[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = false };
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for sc-6000 based soundcard.");
@@ -75,6 +76,8 @@ module_param_array(mpu_irq, int, NULL, 0444);
MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for sc-6000 driver.");
module_param_array(dma, int, NULL, 0444);
MODULE_PARM_DESC(dma, "DMA # for sc-6000 driver.");
+module_param_array(joystick, bool, NULL, 0444);
+MODULE_PARM_DESC(joystick, "Enable gameport.");
/*
* Commands of SC6000's DSP (SBPRO+special).
@@ -363,7 +366,7 @@ static int __devinit sc6000_init_mss(char __iomem *vport, int config,
static void __devinit sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
long xport, long xmpu,
- long xmss_port)
+ long xmss_port, int joystick)
{
cfg[0] = 0;
cfg[1] = 0;
@@ -376,6 +379,8 @@ static void __devinit sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
if (xmss_port == 0xe80)
cfg[0] |= 0x10;
cfg[0] |= 0x40; /* always set */
+ if (!joystick)
+ cfg[0] |= 0x02;
cfg[1] |= 0x80; /* enable WSS system */
cfg[1] &= ~0x40; /* disable IDE */
snd_printd("hw cfg %x, %x\n", cfg[0], cfg[1]);
@@ -427,7 +432,7 @@ static int __devinit sc6000_init_board(char __iomem *vport,
if (!old) {
int cfg[2];
sc6000_hw_cfg_encode(vport, &cfg[0], port[dev], mpu_port[dev],
- mss_port[dev]);
+ mss_port[dev], joystick[dev]);
if (sc6000_hw_cfg_write(vport, cfg) < 0) {
snd_printk(KERN_ERR "sc6000_hw_cfg_write: failed!\n");
return -EIO;
--
1.6.0.3
----------------------------------------------------------------------
Wygraj 3000 zl, wycieczke lub lot balonem!
Sprawdz >> http://link.interia.pl/f2154
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] sc6000: enable joystick port
2009-05-03 8:39 Krzysztof Helt
@ 2009-05-04 7:09 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2009-05-04 7:09 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: Alsa-devel, Rene Herman
At Sun, 3 May 2009 10:39:19 +0200,
Krzysztof Helt wrote:
>
> From: Krzysztof Helt <krzysztof.h1@wp.pl>
>
> Add module parameter to enable or disable
> joystick port (gameport) on the SC6600 and
> later cards.
>
> Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
> ---
>
> The second version of the patch with fixed
> the bug spotted Takashi.
Applied now. Thanks!
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-04 7:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-24 16:23 [PATCH] sc6000: enable joystick port Krzysztof Helt
2009-04-27 9:26 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2009-05-03 8:39 Krzysztof Helt
2009-05-04 7:09 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox