diff options
Diffstat (limited to 'sound/isa/sgalaxy.c')
-rw-r--r-- | sound/isa/sgalaxy.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c index a07274ecb149..2c7503bf1271 100644 --- a/sound/isa/sgalaxy.c +++ b/sound/isa/sgalaxy.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/dma.h> | 31 | #include <asm/dma.h> |
32 | #include <sound/core.h> | 32 | #include <sound/core.h> |
33 | #include <sound/sb.h> | 33 | #include <sound/sb.h> |
34 | #include <sound/ad1848.h> | 34 | #include <sound/wss.h> |
35 | #include <sound/control.h> | 35 | #include <sound/control.h> |
36 | #define SNDRV_LEGACY_FIND_FREE_IRQ | 36 | #define SNDRV_LEGACY_FIND_FREE_IRQ |
37 | #define SNDRV_LEGACY_FIND_FREE_DMA | 37 | #define SNDRV_LEGACY_FIND_FREE_DMA |
@@ -175,12 +175,14 @@ static int __devinit snd_sgalaxy_detect(int dev, int irq, int dma) | |||
175 | return snd_sgalaxy_setup_wss(wssport[dev], irq, dma); | 175 | return snd_sgalaxy_setup_wss(wssport[dev], irq, dma); |
176 | } | 176 | } |
177 | 177 | ||
178 | static struct ad1848_mix_elem snd_sgalaxy_controls[] = { | 178 | static struct snd_kcontrol_new snd_sgalaxy_controls[] = { |
179 | AD1848_DOUBLE("Aux Playback Switch", 0, SGALAXY_AUXC_LEFT, SGALAXY_AUXC_RIGHT, 7, 7, 1, 1), | 179 | WSS_DOUBLE("Aux Playback Switch", 0, |
180 | AD1848_DOUBLE("Aux Playback Volume", 0, SGALAXY_AUXC_LEFT, SGALAXY_AUXC_RIGHT, 0, 0, 31, 0) | 180 | SGALAXY_AUXC_LEFT, SGALAXY_AUXC_RIGHT, 7, 7, 1, 1), |
181 | WSS_DOUBLE("Aux Playback Volume", 0, | ||
182 | SGALAXY_AUXC_LEFT, SGALAXY_AUXC_RIGHT, 0, 0, 31, 0) | ||
181 | }; | 183 | }; |
182 | 184 | ||
183 | static int __devinit snd_sgalaxy_mixer(struct snd_ad1848 *chip) | 185 | static int __devinit snd_sgalaxy_mixer(struct snd_wss *chip) |
184 | { | 186 | { |
185 | struct snd_card *card = chip->card; | 187 | struct snd_card *card = chip->card; |
186 | struct snd_ctl_elem_id id1, id2; | 188 | struct snd_ctl_elem_id id1, id2; |
@@ -210,7 +212,9 @@ static int __devinit snd_sgalaxy_mixer(struct snd_ad1848 *chip) | |||
210 | return err; | 212 | return err; |
211 | /* build AUX2 input */ | 213 | /* build AUX2 input */ |
212 | for (idx = 0; idx < ARRAY_SIZE(snd_sgalaxy_controls); idx++) { | 214 | for (idx = 0; idx < ARRAY_SIZE(snd_sgalaxy_controls); idx++) { |
213 | if ((err = snd_ad1848_add_ctl_elem(chip, &snd_sgalaxy_controls[idx])) < 0) | 215 | err = snd_ctl_add(card, |
216 | snd_ctl_new1(&snd_sgalaxy_controls[idx], chip)); | ||
217 | if (err < 0) | ||
214 | return err; | 218 | return err; |
215 | } | 219 | } |
216 | return 0; | 220 | return 0; |
@@ -237,7 +241,7 @@ static int __devinit snd_sgalaxy_probe(struct device *devptr, unsigned int dev) | |||
237 | static int possible_dmas[] = {1, 3, 0, -1}; | 241 | static int possible_dmas[] = {1, 3, 0, -1}; |
238 | int err, xirq, xdma1; | 242 | int err, xirq, xdma1; |
239 | struct snd_card *card; | 243 | struct snd_card *card; |
240 | struct snd_ad1848 *chip; | 244 | struct snd_wss *chip; |
241 | 245 | ||
242 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); | 246 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); |
243 | if (card == NULL) | 247 | if (card == NULL) |
@@ -263,18 +267,21 @@ static int __devinit snd_sgalaxy_probe(struct device *devptr, unsigned int dev) | |||
263 | if ((err = snd_sgalaxy_detect(dev, xirq, xdma1)) < 0) | 267 | if ((err = snd_sgalaxy_detect(dev, xirq, xdma1)) < 0) |
264 | goto _err; | 268 | goto _err; |
265 | 269 | ||
266 | if ((err = snd_ad1848_create(card, wssport[dev] + 4, | 270 | err = snd_wss_create(card, wssport[dev] + 4, -1, |
267 | xirq, xdma1, | 271 | xirq, xdma1, -1, |
268 | AD1848_HW_DETECT, &chip)) < 0) | 272 | WSS_HW_DETECT, 0, &chip); |
273 | if (err < 0) | ||
269 | goto _err; | 274 | goto _err; |
270 | card->private_data = chip; | 275 | card->private_data = chip; |
271 | 276 | ||
272 | if ((err = snd_ad1848_pcm(chip, 0, NULL)) < 0) { | 277 | err = snd_wss_pcm(chip, 0, NULL); |
273 | snd_printdd(PFX "error creating new ad1848 PCM device\n"); | 278 | if (err < 0) { |
279 | snd_printdd(PFX "error creating new WSS PCM device\n"); | ||
274 | goto _err; | 280 | goto _err; |
275 | } | 281 | } |
276 | if ((err = snd_ad1848_mixer(chip)) < 0) { | 282 | err = snd_wss_mixer(chip); |
277 | snd_printdd(PFX "error creating new ad1848 mixer\n"); | 283 | if (err < 0) { |
284 | snd_printdd(PFX "error creating new WSS mixer\n"); | ||
278 | goto _err; | 285 | goto _err; |
279 | } | 286 | } |
280 | if ((err = snd_sgalaxy_mixer(chip)) < 0) { | 287 | if ((err = snd_sgalaxy_mixer(chip)) < 0) { |
@@ -312,7 +319,7 @@ static int snd_sgalaxy_suspend(struct device *pdev, unsigned int n, | |||
312 | pm_message_t state) | 319 | pm_message_t state) |
313 | { | 320 | { |
314 | struct snd_card *card = dev_get_drvdata(pdev); | 321 | struct snd_card *card = dev_get_drvdata(pdev); |
315 | struct snd_ad1848 *chip = card->private_data; | 322 | struct snd_wss *chip = card->private_data; |
316 | 323 | ||
317 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 324 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
318 | chip->suspend(chip); | 325 | chip->suspend(chip); |
@@ -322,11 +329,11 @@ static int snd_sgalaxy_suspend(struct device *pdev, unsigned int n, | |||
322 | static int snd_sgalaxy_resume(struct device *pdev, unsigned int n) | 329 | static int snd_sgalaxy_resume(struct device *pdev, unsigned int n) |
323 | { | 330 | { |
324 | struct snd_card *card = dev_get_drvdata(pdev); | 331 | struct snd_card *card = dev_get_drvdata(pdev); |
325 | struct snd_ad1848 *chip = card->private_data; | 332 | struct snd_wss *chip = card->private_data; |
326 | 333 | ||
327 | chip->resume(chip); | 334 | chip->resume(chip); |
328 | snd_ad1848_out(chip, SGALAXY_AUXC_LEFT, chip->image[SGALAXY_AUXC_LEFT]); | 335 | snd_wss_out(chip, SGALAXY_AUXC_LEFT, chip->image[SGALAXY_AUXC_LEFT]); |
329 | snd_ad1848_out(chip, SGALAXY_AUXC_RIGHT, chip->image[SGALAXY_AUXC_RIGHT]); | 336 | snd_wss_out(chip, SGALAXY_AUXC_RIGHT, chip->image[SGALAXY_AUXC_RIGHT]); |
330 | 337 | ||
331 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 338 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
332 | return 0; | 339 | return 0; |