aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJochen Voss <voss@seehuhn.de>2006-08-08 15:12:44 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:40:18 -0400
commit683fe1537e660c322c8af953773921e814791193 (patch)
treefda0252e756a3b276a7cacad778e795c49739006
parentf5a5ffad072ec3c1fd636174c30f0ba52fe0259f (diff)
[ALSA] Revolution 5.1 - add AK5365 ADC support
Add support for the AK5365 ADC. Signed-off-by: Jochen Voss <voss@seehuhn.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--include/sound/ak4xxx-adda.h3
-rw-r--r--sound/i2c/other/ak4xxx-adda.c25
2 files changed, 27 insertions, 1 deletions
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index 3d9888492026..65ddfa3cac1f 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -53,7 +53,8 @@ struct snd_akm4xxx {
53 unsigned int idx_offset; /* control index offset */ 53 unsigned int idx_offset; /* control index offset */
54 enum { 54 enum {
55 SND_AK4524, SND_AK4528, SND_AK4529, 55 SND_AK4524, SND_AK4528, SND_AK4529,
56 SND_AK4355, SND_AK4358, SND_AK4381 56 SND_AK4355, SND_AK4358, SND_AK4381,
57 SND_AK5365
57 } type; 58 } type;
58 unsigned int *num_stereo; /* array of combined counts 59 unsigned int *num_stereo; /* array of combined counts
59 * for the mixer 60 * for the mixer
diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c
index dc7cc2001b74..7d562f084207 100644
--- a/sound/i2c/other/ak4xxx-adda.c
+++ b/sound/i2c/other/ak4xxx-adda.c
@@ -598,6 +598,31 @@ int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak)
598 if (err < 0) 598 if (err < 0)
599 goto __error; 599 goto __error;
600 } 600 }
601
602 if (ak->type == SND_AK5365) {
603 memset(ctl, 0, sizeof(*ctl));
604 if (ak->channel_names == NULL)
605 strcpy(ctl->id.name, "Capture Volume");
606 else
607 strcpy(ctl->id.name, ak->channel_names[0]);
608 ctl->id.index = ak->idx_offset * 2;
609 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
610 ctl->count = 1;
611 ctl->info = snd_akm4xxx_stereo_volume_info;
612 ctl->get = snd_akm4xxx_stereo_volume_get;
613 ctl->put = snd_akm4xxx_stereo_volume_put;
614 /* Registers 4 & 5 (see AK5365 data sheet, pages 34 and 35):
615 * valid values are from 0x00 (mute) to 0x98 (+12dB). */
616 ctl->private_value =
617 AK_COMPOSE(0, 4, 0, 0x98);
618 ctl->private_data = ak;
619 err = snd_ctl_add(ak->card,
620 snd_ctl_new(ctl, SNDRV_CTL_ELEM_ACCESS_READ|
621 SNDRV_CTL_ELEM_ACCESS_WRITE));
622 if (err < 0)
623 goto __error;
624 }
625
601 if (ak->type == SND_AK4355 || ak->type == SND_AK4358) 626 if (ak->type == SND_AK4355 || ak->type == SND_AK4358)
602 num_emphs = 1; 627 num_emphs = 1;
603 else 628 else