Lines Matching +full:digital +full:- +full:output

1 // SPDX-License-Identifier: GPL-2.0-only
22 #define DVOL_CTL_DVMUTE_ON BIT(4) /* Digital volume MUTE On */
23 #define DVOL_CTL_DVMUTE_OFF 0 /* Digital volume MUTE Off */
53 static const DECLARE_TLV_DB_SCALE(digital_tlv, -7150, 50, 0);
55 static const DECLARE_TLV_DB_SCALE(alclvl, -2250, 150, 0);
56 static const DECLARE_TLV_DB_SCALE(mingain, -1200, 600, 0);
57 static const DECLARE_TLV_DB_SCALE(maxgain, -675, 600, 0);
58 static const DECLARE_TLV_DB_SCALE(boost_vol, -1200, 75, 0);
60 static const char * const ml26124_companding[] = {"16bit PCM", "u-law",
61 "A-law"};
70 SOC_SINGLE_TLV("Capture Digital Volume", ML26124_RECORD_DIG_VOL, 0,
72 SOC_SINGLE_TLV("Playback Digital Volume", ML26124_PLBAK_DIG_VOL, 0,
74 SOC_SINGLE_TLV("Digital Boost Volume", ML26124_DIGI_BOOST_VOL, 0,
109 SOC_SINGLE("Digital Volume Fade Switch", ML26124_DVOL_CTL, 3, 1, 0),
110 SOC_SINGLE("Digital Switch", ML26124_DVOL_CTL, 4, 1, 0),
124 "Digital MIC in", "Analog MIC Differential in"};
140 SND_SOC_DAPM_MIXER("Output Mixer", SND_SOC_NOPM, 0, 0,
166 /* output mixer */
167 {"Output Mixer", "DAC Switch", "DAC"},
168 {"Output Mixer", "Line in loopback Switch", "LIN"},
171 {"LOUT", NULL, "Output Mixer"},
172 {"SPOUT", NULL, "Output Mixer"},
198 {0x0e, 0x00}, /* CLK Input/Output Control */
203 {0x14, 0x00}, /* Mic Input/Output control */
209 {0x26, 0x00}, /* SP-AMP Power Management */
212 {0x2e, 0x00}, /* AC-CMP Power Management */
217 /* Input/Output Amplifier Control Register */
225 {0x54, 0x00}, /* Speaker AMP Output Control */
230 {0x60, 0x00}, /* SAI-Trans Control */
231 {0x62, 0x00}, /* SAI-Receive Control */
238 {0x6C, 0xff}, /* Record Digital Volume */
239 {0x70, 0xff}, /* Playback Digital Volume */
240 {0x72, 0x10}, /* Digital Boost Volume */
308 return -EINVAL; in get_srate()
321 return -EINVAL; in get_coeff()
328 struct snd_soc_component *component = dai->component; in ml26124_hw_params()
330 int i = get_coeff(priv->mclk, params_rate(hw_params)); in ml26124_hw_params()
335 priv->substream = substream; in ml26124_hw_params()
336 priv->rate = params_rate(hw_params); in ml26124_hw_params()
338 if (priv->clk_in) { in ml26124_hw_params()
339 switch (priv->mclk / params_rate(hw_params)) { in ml26124_hw_params()
353 dev_err(component->dev, "Unsupported MCLKI\n"); in ml26124_hw_params()
377 struct snd_soc_component *component = dai->component; in ml26124_mute()
380 switch (priv->substream->stream) { in ml26124_mute()
403 struct snd_soc_component *component = codec_dai->component; in ml26124_set_dai_fmt()
413 return -EINVAL; in ml26124_set_dai_fmt()
422 return -EINVAL; in ml26124_set_dai_fmt()
430 return -EINVAL; in ml26124_set_dai_fmt()
439 struct snd_soc_component *component = codec_dai->component; in ml26124_set_dai_sysclk()
444 priv->clk_in = ML26124_USE_PLLOUT; in ml26124_set_dai_sysclk()
447 priv->clk_in = ML26124_USE_MCLKI; in ml26124_set_dai_sysclk()
450 return -EINVAL; in ml26124_set_dai_sysclk()
453 priv->mclk = freq; in ml26124_set_dai_sysclk()
480 regcache_sync(priv->regmap); in ml26124_set_bias_level()
501 .name = "ml26124-hifi",
557 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); in ml26124_i2c_probe()
559 return -ENOMEM; in ml26124_i2c_probe()
563 priv->regmap = devm_regmap_init_i2c(i2c, &ml26124_i2c_regmap); in ml26124_i2c_probe()
564 if (IS_ERR(priv->regmap)) { in ml26124_i2c_probe()
565 ret = PTR_ERR(priv->regmap); in ml26124_i2c_probe()
566 dev_err(&i2c->dev, "regmap_init_i2c() failed: %d\n", ret); in ml26124_i2c_probe()
570 return devm_snd_soc_register_component(&i2c->dev, in ml26124_i2c_probe()