• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/sound/soc/codecs/

Lines Matching refs:codec

2  * ad1980.c  --  ALSA Soc AD1980 codec support
36 static unsigned int ac97_read(struct snd_soc_codec *codec,
38 static int ac97_write(struct snd_soc_codec *codec,
105 static unsigned int ac97_read(struct snd_soc_codec *codec,
108 u16 *cache = codec->reg_cache;
117 return soc_ac97_ops.read(codec->ac97, reg);
128 static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
131 u16 *cache = codec->reg_cache;
133 soc_ac97_ops.write(codec->ac97, reg, val);
159 static int ad1980_reset(struct snd_soc_codec *codec, int try_warm)
165 soc_ac97_ops.warm_reset(codec->ac97);
166 if (ac97_read(codec, AC97_RESET) == 0x0090)
170 soc_ac97_ops.reset(codec->ac97);
174 ac97_write(codec, AC97_AD_SERIAL_CFG, 0x9900);
176 if (ac97_read(codec, AC97_RESET) != 0x0090)
191 struct snd_soc_codec *codec;
198 socdev->card->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
199 if (socdev->card->codec == NULL)
201 codec = socdev->card->codec;
202 mutex_init(&codec->mutex);
204 codec->reg_cache =
206 if (codec->reg_cache == NULL) {
210 memcpy(codec->reg_cache, ad1980_reg, sizeof(u16) * \
212 codec->reg_cache_size = sizeof(u16) * ARRAY_SIZE(ad1980_reg);
213 codec->reg_cache_step = 2;
214 codec->name = "AD1980";
215 codec->owner = THIS_MODULE;
216 codec->dai = &ad1980_dai;
217 codec->num_dai = 1;
218 codec->write = ac97_write;
219 codec->read = ac97_read;
220 INIT_LIST_HEAD(&codec->dapm_widgets);
221 INIT_LIST_HEAD(&codec->dapm_paths);
223 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
225 printk(KERN_ERR "ad1980: failed to register AC97 codec\n");
235 ret = ad1980_reset(codec, 0);
242 if (ac97_read(codec, AC97_VENDOR_ID1) != 0x4144)
245 vendor_id2 = ac97_read(codec, AC97_VENDOR_ID2);
257 ac97_write(codec, AC97_MASTER, 0x0000);
258 ac97_write(codec, AC97_PCM, 0x0000);
259 ac97_write(codec, AC97_REC_GAIN, 0x0000);
260 ac97_write(codec, AC97_CENTER_LFE_MASTER, 0x0000);
261 ac97_write(codec, AC97_SURROUND_MASTER, 0x0000);
264 ext_status = ac97_read(codec, AC97_EXTENDED_STATUS);
265 ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);
267 snd_soc_add_controls(codec, ad1980_snd_ac97_controls,
276 snd_soc_free_ac97_codec(codec);
279 kfree(codec->reg_cache);
282 kfree(socdev->card->codec);
283 socdev->card->codec = NULL;
290 struct snd_soc_codec *codec = socdev->card->codec;
292 if (codec == NULL)
297 snd_soc_free_ac97_codec(codec);
298 kfree(codec->reg_cache);
299 kfree(codec);