Lines Matching +full:modem +full:- +full:init

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * HD audio interface patch for Silicon Labs 3054/5 modem codec
7 * Copyright (c) 2005 Sasha Khapyorsky <sashak@alsa-project.org>
11 #include <linux/init.h>
76 * Modem mixer
89 u16 reg = PRIVATE_REG(kcontrol->private_value); in si3054_switch_get()
90 u16 mask = PRIVATE_MASK(kcontrol->private_value); in si3054_switch_get()
91 uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0 ; in si3054_switch_get()
99 u16 reg = PRIVATE_REG(kcontrol->private_value); in si3054_switch_put()
100 u16 mask = PRIVATE_MASK(kcontrol->private_value); in si3054_switch_put()
101 if (uvalue->value.integer.value[0]) in si3054_switch_put()
120 SI3054_KCONTROL("Off-hook Switch", SI3054_GPIO_CONTROL, SI3054_GPIO_OH),
143 SET_REG(codec, SI3054_LINE_RATE, substream->runtime->rate); in si3054_pcm_prepare()
145 val &= 0xff << (8 * (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)); in si3054_pcm_prepare()
146 val |= ((stream_tag & 0xf) << 4) << (8 * (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); in si3054_pcm_prepare()
149 snd_hda_codec_setup_stream(codec, hinfo->nid, in si3054_pcm_prepare()
164 substream->runtime->hw.period_bytes_min = 80; in si3054_pcm_open()
165 return snd_pcm_hw_constraint_list(substream->runtime, 0, in si3054_pcm_open()
189 info = snd_hda_codec_pcm_new(codec, "Si3054 Modem"); in si3054_build_pcms()
191 return -ENOMEM; in si3054_build_pcms()
192 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = si3054_pcm; in si3054_build_pcms()
193 info->stream[SNDRV_PCM_STREAM_CAPTURE] = si3054_pcm; 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()
196 info->pcm_type = HDA_PCM_TYPE_MODEM; in si3054_build_pcms()
202 * Init part
207 struct si3054_spec *spec = codec->spec; in si3054_init()
211 if (snd_hdac_regmap_add_vendor_verb(&codec->core, in si3054_init()
213 return -ENOMEM; in si3054_init()
216 snd_hda_codec_write(codec, codec->core.mfg, 0, AC_VERB_SET_STREAM_FORMAT, 0); in si3054_init()
225 } while ((val & SI3054_MEI_READY) != SI3054_MEI_READY && wait_count--); in si3054_init()
230 /* return -EACCES; */ in si3054_init()
244 spec->international = GET_REG(codec, SI3054_CHIPID) & SI3054_CHIPID_INTERNATIONAL; in si3054_init()
251 kfree(codec->spec); in si3054_free()
261 .init = si3054_init,
269 return -ENOMEM; in patch_si3054()
270 codec->spec = spec; in patch_si3054()
271 codec->patch_ops = si3054_patch_ops; in patch_si3054()
289 /* Asus A8J Modem (SM56) */
291 /* LG LW20 modem */
298 MODULE_DESCRIPTION("Si3054 HD-audio modem codec");