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