Lines Matching +full:alc +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0
3 // ak4642.c -- AK4642/AK4643 ALSA Soc Audio driver
23 #include <linux/clk-provider.h>
102 #define LOPS (1 << 6) /* Stero Line-out Power Save Mode */
105 #define ZTM(param) ((param & 0x3) << 4) /* ALC Zero Crossing TimeOut */
109 #define ALC (1 << 5) /* ALC Enable */ macro
110 #define LMTH0 (1 << 0) /* ALC Limiter / Recovery Level */
153 * min : 0xFE : -115.0 dB
156 static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1);
162 SOC_SINGLE("ALC Capture Switch", ALC_CTL1, 5, 1, 0),
163 SOC_SINGLE("ALC Capture ZC Switch", ALC_CTL1, 4, 1, 1),
177 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in ak4642_lout_event()
205 SND_SOC_DAPM_SWITCH("Headphone Enable", SND_SOC_NOPM, 0, 0,
228 {"HPL Out", NULL, "Headphone Enable"},
229 {"HPR Out", NULL, "Headphone Enable"},
231 {"Headphone Enable", "Switch", "DACH"},
280 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in ak4642_dai_startup()
281 struct snd_soc_component *component = dai->component; in ak4642_dai_startup()
304 * ALC setting:Refer to Table 35 in ak4642_dai_startup()
305 * ALC bit=“1” in ak4642_dai_startup()
312 snd_soc_component_write(component, ALC_CTL1, ALC | LMTH0); in ak4642_dai_startup()
323 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in ak4642_dai_shutdown()
324 struct snd_soc_component *component = dai->component; in ak4642_dai_shutdown()
331 snd_soc_component_update_bits(component, ALC_CTL1, ALC, 0); in ak4642_dai_shutdown()
338 struct snd_soc_component *component = codec_dai->component; in ak4642_dai_set_sysclk()
375 return -EINVAL; in ak4642_dai_set_sysclk()
378 if (extended_freq && !priv->drvdata->extended_frequencies) in ak4642_dai_set_sysclk()
379 return -EINVAL; in ak4642_dai_set_sysclk()
388 struct snd_soc_component *component = dai->component; in ak4642_dai_set_fmt()
404 return -EINVAL; in ak4642_dai_set_fmt()
422 return -EINVAL; in ak4642_dai_set_fmt()
471 struct snd_soc_component *component = dai->component; in ak4642_dai_hw_params()
473 u32 rate = clk_get_rate(priv->mcko); in ak4642_dai_hw_params()
505 .name = "ak4642-hifi",
524 struct regmap *regmap = dev_get_regmap(component->dev, NULL); in ak4642_suspend()
533 struct regmap *regmap = dev_get_regmap(component->dev, NULL); in ak4642_resume()
543 if (priv->mcko) in ak4642_probe()
544 ak4642_set_mcko(component, clk_get_rate(priv->mcko)); in ak4642_probe()
607 struct device_node *np = dev->of_node; in ak4642_of_parse_mcko()
609 const char *clk_name = np->name; in ak4642_of_parse_mcko()
613 if (of_property_read_u32(np, "clock-frequency", &rate)) in ak4642_of_parse_mcko()
619 of_property_read_string(np, "clock-output-names", &clk_name); in ak4642_of_parse_mcko()
633 struct device *dev = &i2c->dev; in ak4642_i2c_probe()
647 return dev_err_probe(dev, -EINVAL, "Unknown device type\n"); in ak4642_i2c_probe()
651 return -ENOMEM; in ak4642_i2c_probe()
653 priv->drvdata = drvdata; in ak4642_i2c_probe()
654 priv->mcko = mcko; in ak4642_i2c_probe()
658 regmap = devm_regmap_init_i2c(i2c, drvdata->regmap_config); in ak4642_i2c_probe()
667 { .compatible = "asahi-kasei,ak4642", .data = &ak4642_drvdata},
668 { .compatible = "asahi-kasei,ak4643", .data = &ak4643_drvdata},
669 { .compatible = "asahi-kasei,ak4648", .data = &ak4648_drvdata},
684 .name = "ak4642-codec",