diff options
author | Pavel Hofman <dustin@seznam.cz> | 2008-03-17 03:45:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:25 -0400 |
commit | 841b23d4d7b554c8d74fc9c34a701f85abc04875 (patch) | |
tree | 64b7322112731405bcdd0c025b76514599e7d0b8 /sound/pci/ice1712 | |
parent | 5949d2443d96f054d9a32d31edddb0be836968c6 (diff) |
[ALSA] some fixes and cleanup for ICE1724 cards
* removing the hack with NON_AKM ak4xxx type
* support for card-specific flags in ak4114_stats
* definition of the flags for corresponding cards
Signed-off-by: Pavel Hofman <dustin@seznam.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r-- | sound/pci/ice1712/prodigy192.c | 33 | ||||
-rw-r--r-- | sound/pci/ice1712/revo.c | 4 |
2 files changed, 14 insertions, 23 deletions
diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index 48cf40a8f32a..25ceb67a9c16 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c | |||
@@ -319,12 +319,11 @@ static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol, | |||
319 | /* | 319 | /* |
320 | * Handler for setting correct codec rate - called when rate change is detected | 320 | * Handler for setting correct codec rate - called when rate change is detected |
321 | */ | 321 | */ |
322 | static void stac9460_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | 322 | static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate) |
323 | { | 323 | { |
324 | unsigned char old, new; | 324 | unsigned char old, new; |
325 | int idx; | 325 | int idx; |
326 | unsigned char changed[7]; | 326 | unsigned char changed[7]; |
327 | struct snd_ice1712 *ice = ak->private_data[0]; | ||
328 | struct prodigy192_spec *spec = ice->spec; | 327 | struct prodigy192_spec *spec = ice->spec; |
329 | 328 | ||
330 | if (rate == 0) /* no hint - S/PDIF input is master, simply return */ | 329 | if (rate == 0) /* no hint - S/PDIF input is master, simply return */ |
@@ -357,16 +356,6 @@ static void stac9460_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | |||
357 | mutex_unlock(&spec->mute_mutex); | 356 | mutex_unlock(&spec->mute_mutex); |
358 | } | 357 | } |
359 | 358 | ||
360 | /* using akm infrastructure for setting rate of the codec */ | ||
361 | static struct snd_akm4xxx akmlike_stac9460 __devinitdata = { | ||
362 | .type = NON_AKM, /* special value */ | ||
363 | .num_adcs = 6, /* not used in any way, just for completeness */ | ||
364 | .num_dacs = 2, | ||
365 | .ops = { | ||
366 | .set_rate_val = stac9460_set_rate_val | ||
367 | } | ||
368 | }; | ||
369 | |||
370 | 359 | ||
371 | static const DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0); | 360 | static const DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0); |
372 | static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0); | 361 | static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0); |
@@ -642,12 +631,19 @@ static int prodigy192_ak4114_init(struct snd_ice1712 *ice) | |||
642 | 0x41, 0x02, 0x2c, 0x00, 0x00 | 631 | 0x41, 0x02, 0x2c, 0x00, 0x00 |
643 | }; | 632 | }; |
644 | struct prodigy192_spec *spec = ice->spec; | 633 | struct prodigy192_spec *spec = ice->spec; |
634 | int err; | ||
645 | 635 | ||
646 | return snd_ak4114_create(ice->card, | 636 | err = snd_ak4114_create(ice->card, |
647 | prodigy192_ak4114_read, | 637 | prodigy192_ak4114_read, |
648 | prodigy192_ak4114_write, | 638 | prodigy192_ak4114_write, |
649 | ak4114_init_vals, ak4114_init_txcsb, | 639 | ak4114_init_vals, ak4114_init_txcsb, |
650 | ice, &spec->ak4114); | 640 | ice, &spec->ak4114); |
641 | if (err < 0) | ||
642 | return err; | ||
643 | /* AK4114 in Prodigy192 cannot detect external rate correctly. | ||
644 | * No reason to stop capture stream due to incorrect checks */ | ||
645 | spec->ak4114->check_flags = AK4114_CHECK_NO_RATE; | ||
646 | return 0; | ||
651 | } | 647 | } |
652 | 648 | ||
653 | static void stac9460_proc_regs_read(struct snd_info_entry *entry, | 649 | static void stac9460_proc_regs_read(struct snd_info_entry *entry, |
@@ -743,7 +739,6 @@ static int __devinit prodigy192_init(struct snd_ice1712 *ice) | |||
743 | }; | 739 | }; |
744 | const unsigned short *p; | 740 | const unsigned short *p; |
745 | int err = 0; | 741 | int err = 0; |
746 | struct snd_akm4xxx *ak; | ||
747 | struct prodigy192_spec *spec; | 742 | struct prodigy192_spec *spec; |
748 | 743 | ||
749 | /* prodigy 192 */ | 744 | /* prodigy 192 */ |
@@ -761,15 +756,7 @@ static int __devinit prodigy192_init(struct snd_ice1712 *ice) | |||
761 | p = stac_inits_prodigy; | 756 | p = stac_inits_prodigy; |
762 | for (; *p != (unsigned short)-1; p += 2) | 757 | for (; *p != (unsigned short)-1; p += 2) |
763 | stac9460_put(ice, p[0], p[1]); | 758 | stac9460_put(ice, p[0], p[1]); |
764 | /* reusing the akm codecs infrastructure, | 759 | ice->gpio.set_pro_rate = stac9460_set_rate_val; |
765 | * for setting rate on stac9460 */ | ||
766 | ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); | ||
767 | if (!ak) | ||
768 | return -ENOMEM; | ||
769 | ice->akm_codecs = 1; | ||
770 | err = snd_ice1712_akm4xxx_init(ak, &akmlike_stac9460, NULL, ice); | ||
771 | if (err < 0) | ||
772 | return err; | ||
773 | 760 | ||
774 | /* MI/ODI/O add on card with AK4114 */ | 761 | /* MI/ODI/O add on card with AK4114 */ |
775 | if (prodigy192_miodio_exists(ice)) { | 762 | if (prodigy192_miodio_exists(ice)) { |
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index 7c930cc05f1d..dba93d8efbe0 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c | |||
@@ -488,6 +488,10 @@ static int __devinit ap192_ak4114_init(struct snd_ice1712 *ice) | |||
488 | ap192_ak4114_write, | 488 | ap192_ak4114_write, |
489 | ak4114_init_vals, ak4114_init_txcsb, | 489 | ak4114_init_vals, ak4114_init_txcsb, |
490 | ice, &ak); | 490 | ice, &ak); |
491 | /* AK4114 in Revo cannot detect external rate correctly. | ||
492 | * No reason to stop capture stream due to incorrect checks */ | ||
493 | ak->check_flags = AK4114_CHECK_NO_RATE; | ||
494 | |||
491 | return 0; /* error ignored; it's no fatal error */ | 495 | return 0; /* error ignored; it's no fatal error */ |
492 | } | 496 | } |
493 | 497 | ||