Lines Matching defs:codec

5  * HD audio interface patch for Silicon Labs 3054/5 modem codec
63 /* si3054 codec registers (nodes) access macros */
64 #define GET_REG(codec,reg) (snd_hda_codec_read(codec,reg,0,SI3054_VERB_READ_NODE,0))
65 #define SET_REG(codec,reg,val) (snd_hda_codec_write(codec,reg,0,SI3054_VERB_WRITE_NODE,val))
66 #define SET_REG_CACHE(codec,reg,val) \
67 snd_hda_codec_write_cache(codec,reg,0,SI3054_VERB_WRITE_NODE,val)
88 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
91 uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0 ;
98 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
102 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) | mask);
104 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) & ~mask);
125 static int si3054_build_controls(struct hda_codec *codec)
127 return snd_hda_add_new_ctls(codec, si3054_modem_mixer);
136 struct hda_codec *codec,
143 SET_REG(codec, SI3054_LINE_RATE, substream->runtime->rate);
144 val = GET_REG(codec, SI3054_LINE_LEVEL);
147 SET_REG(codec, SI3054_LINE_LEVEL, val);
149 snd_hda_codec_setup_stream(codec, hinfo->nid,
155 struct hda_codec *codec,
185 static int si3054_build_pcms(struct hda_codec *codec)
189 info = snd_hda_codec_pcm_new(codec, "Si3054 Modem");
194 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = codec->core.mfg;
195 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = codec->core.mfg;
205 static int si3054_init(struct hda_codec *codec)
207 struct si3054_spec *spec = codec->spec;
211 if (snd_hdac_regmap_add_vendor_verb(&codec->core,
215 snd_hda_codec_write(codec, AC_NODE_ROOT, 0, AC_VERB_SET_CODEC_RESET, 0);
216 snd_hda_codec_write(codec, codec->core.mfg, 0, AC_VERB_SET_STREAM_FORMAT, 0);
217 SET_REG(codec, SI3054_LINE_RATE, 9600);
218 SET_REG(codec, SI3054_LINE_LEVEL, SI3054_DTAG_MASK|SI3054_ATAG_MASK);
219 SET_REG(codec, SI3054_EXTENDED_MID, 0);
224 val = GET_REG(codec, SI3054_EXTENDED_MID);
228 codec_err(codec, "si3054: cannot initialize. EXT MID = %04x\n", val);
233 SET_REG(codec, SI3054_GPIO_POLARITY, 0xffff);
234 SET_REG(codec, SI3054_GPIO_CFG, 0x0);
235 SET_REG(codec, SI3054_MISC_AFE, 0);
236 SET_REG(codec, SI3054_LINE_CFG1,0x200);
238 if((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) {
239 codec_dbg(codec,
241 GET_REG(codec,SI3054_LINE_STATUS));
244 spec->international = GET_REG(codec, SI3054_CHIPID) & SI3054_CHIPID_INTERNATIONAL;
249 static void si3054_free(struct hda_codec *codec)
251 kfree(codec->spec);
265 static int patch_si3054(struct hda_codec *codec)
270 codec->spec = spec;
271 codec->patch_ops = si3054_patch_ops;
298 MODULE_DESCRIPTION("Si3054 HD-audio modem codec");