aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-10-05 12:18:57 -0400
committerTakashi Iwai <tiwai@suse.de>2009-10-05 12:21:33 -0400
commit1cb0fdebae08f6daaac81197d8dde1746e0a1d96 (patch)
tree94b319d622fac17d8178e3c654cc82eb5ed852da /sound
parentbcde1f8a80d1bdfd43fb498996dfa89666fd7fe3 (diff)
ALSA: sscape: force AD1848 codec mode on old Soundscape
Old Soundscape cards (pre PnP) work only with AD1848 codecs. If the CS4231 codec is installed it must be used in AD1848 compatible mode. Also, add gameport support and remove an unused mpu field. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/isa/sscape.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index c739374af20e..279be505b72e 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -54,6 +54,7 @@ static int irq[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_IRQ;
54static int mpu_irq[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_IRQ; 54static int mpu_irq[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_IRQ;
55static int dma[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_DMA; 55static int dma[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_DMA;
56static int dma2[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_DMA; 56static int dma2[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_DMA;
57static bool joystick[SNDRV_CARDS] __devinitdata;
57 58
58module_param_array(index, int, NULL, 0444); 59module_param_array(index, int, NULL, 0444);
59MODULE_PARM_DESC(index, "Index number for SoundScape soundcard"); 60MODULE_PARM_DESC(index, "Index number for SoundScape soundcard");
@@ -79,6 +80,9 @@ MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");
79module_param_array(dma2, int, NULL, 0444); 80module_param_array(dma2, int, NULL, 0444);
80MODULE_PARM_DESC(dma2, "DMA2 # for SoundScape driver."); 81MODULE_PARM_DESC(dma2, "DMA2 # for SoundScape driver.");
81 82
83module_param_array(joystick, bool, NULL, 0444);
84MODULE_PARM_DESC(joystick, "Enable gameport.");
85
82#ifdef CONFIG_PNP 86#ifdef CONFIG_PNP
83static int isa_registered; 87static int isa_registered;
84static int pnp_registered; 88static int pnp_registered;
@@ -145,7 +149,6 @@ struct soundscape {
145 struct resource *io_res; 149 struct resource *io_res;
146 struct resource *wss_res; 150 struct resource *wss_res;
147 struct snd_wss *chip; 151 struct snd_wss *chip;
148 struct snd_mpu401 *mpu;
149 152
150 unsigned char midi_vol; 153 unsigned char midi_vol;
151}; 154};
@@ -815,7 +818,6 @@ static int __devinit create_mpu401(struct snd_card *card, int devnum, unsigned l
815 mpu->open_input = mpu401_open; 818 mpu->open_input = mpu401_open;
816 mpu->open_output = mpu401_open; 819 mpu->open_output = mpu401_open;
817 mpu->private_data = sscape; 820 mpu->private_data = sscape;
818 sscape->mpu = mpu;
819 821
820 initialise_mpu401(mpu); 822 initialise_mpu401(mpu);
821 } 823 }
@@ -836,12 +838,30 @@ static int __devinit create_ad1845(struct snd_card *card, unsigned port,
836 register struct soundscape *sscape = get_card_soundscape(card); 838 register struct soundscape *sscape = get_card_soundscape(card);
837 struct snd_wss *chip; 839 struct snd_wss *chip;
838 int err; 840 int err;
841 int codec_type = WSS_HW_DETECT;
842
843 switch (sscape->type) {
844 case MEDIA_FX:
845 case SSCAPE:
846 /*
847 * There are some freak examples of early Soundscape cards
848 * with CS4231 instead of AD1848/CS4248. Unfortunately, the
849 * CS4231 works only in CS4248 compatibility mode on
850 * these cards so force it.
851 */
852 if (sscape->ic_type != IC_OPUS)
853 codec_type = WSS_HW_AD1848;
854 break;
839 855
840 if (sscape->type == SSCAPE_VIVO) 856 case SSCAPE_VIVO:
841 port += 4; 857 port += 4;
858 break;
859 default:
860 break;
861 }
842 862
843 err = snd_wss_create(card, port, -1, irq, dma1, dma2, 863 err = snd_wss_create(card, port, -1, irq, dma1, dma2,
844 WSS_HW_DETECT, WSS_HWSHARE_DMA1, &chip); 864 codec_type, WSS_HWSHARE_DMA1, &chip);
845 if (!err) { 865 if (!err) {
846 unsigned long flags; 866 unsigned long flags;
847 struct snd_pcm *pcm; 867 struct snd_pcm *pcm;
@@ -927,6 +947,7 @@ static int __devinit create_sscape(int dev, struct snd_card *card)
927 struct resource *wss_res; 947 struct resource *wss_res;
928 unsigned long flags; 948 unsigned long flags;
929 int err; 949 int err;
950 int val;
930 const char *name; 951 const char *name;
931 952
932 /* 953 /*
@@ -1026,6 +1047,10 @@ static int __devinit create_sscape(int dev, struct snd_card *card)
1026 sscape_write_unsafe(sscape->io_base, GA_DMAB_REG, 0x20); 1047 sscape_write_unsafe(sscape->io_base, GA_DMAB_REG, 0x20);
1027 1048
1028 mpu_irq_cfg |= mpu_irq_cfg << 2; 1049 mpu_irq_cfg |= mpu_irq_cfg << 2;
1050 val = sscape_read_unsafe(sscape->io_base, GA_HMCTL_REG) & 0xF7;
1051 if (joystick[dev])
1052 val |= 8;
1053 sscape_write_unsafe(sscape->io_base, GA_HMCTL_REG, val | 0x10);
1029 sscape_write_unsafe(sscape->io_base, GA_INTCFG_REG, 0xf0 | mpu_irq_cfg); 1054 sscape_write_unsafe(sscape->io_base, GA_INTCFG_REG, 0xf0 | mpu_irq_cfg);
1030 sscape_write_unsafe(sscape->io_base, 1055 sscape_write_unsafe(sscape->io_base,
1031 GA_CDCFG_REG, 0x09 | DMA_8BIT 1056 GA_CDCFG_REG, 0x09 | DMA_8BIT