Lines Matching +full:pre +full:- +full:determined

1 // SPDX-License-Identifier: GPL-2.0-only
3 * alc5623.c -- alc562[123] ALSA Soc Audio driver
8 * Copyright 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
53 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in amp_mixer_event()
55 /* to power-on/off class-d amp generators/speaker */ in amp_mixer_event()
56 /* need to write to 'index-46h' register : */ in amp_mixer_event()
77 static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0);
78 static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0);
79 static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0);
205 "RN/-R", "RP/+R", "LN/-R", "Vmid" };
311 SND_SOC_DAPM_PGA("MIC1 Pre Amp", ALC5623_PWR_MANAG_ADD3, 1, 0, NULL, 0),
312 SND_SOC_DAPM_PGA("MIC2 Pre Amp", ALC5623_PWR_MANAG_ADD3, 0, 0, NULL, 0),
341 SND_SOC_DAPM_MUX("AB-D Amp Mux", SND_SOC_NOPM, 0, 0,
346 /* virtual mixer - mixes left & right channels */
386 {"Left Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"},
387 {"Left Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"},
395 {"Right Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"},
396 {"Right Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"},
434 {"MIC1 Pre Amp", NULL, "MIC1"},
435 {"MIC2 Pre Amp", NULL, "MIC2"},
436 {"MIC1 PGA", NULL, "MIC1 Pre Amp"},
437 {"MIC2 PGA", NULL, "MIC2 Pre Amp"},
445 {"SpeakerOut N Mux", "RN/-R", "SpeakerOut"},
447 {"SpeakerOut N Mux", "LN/-R", "SpeakerOut"},
461 {"AB-D Amp Mux", "AB Amp", "AB Amp"},
462 {"AB-D Amp Mux", "D Amp", "D Amp"},
463 {"SpeakerOut", NULL, "AB-D Amp Mux"},
524 struct snd_soc_component *component = codec_dai->component; in alc5623_set_dai_pll()
529 return -ENODEV; in alc5623_set_dai_pll()
567 return -EINVAL; in alc5623_set_dai_pll()
571 return -EINVAL; in alc5623_set_dai_pll()
608 if (coeff_div[i].fs * rate == alc5623->sysclk) in get_coeff()
611 return -EINVAL; in get_coeff()
620 struct snd_soc_component *component = codec_dai->component; in alc5623_set_dai_sysclk()
632 alc5623->sysclk = freq; in alc5623_set_dai_sysclk()
635 return -EINVAL; in alc5623_set_dai_sysclk()
641 struct snd_soc_component *component = codec_dai->component; in alc5623_set_dai_fmt()
653 return -EINVAL; in alc5623_set_dai_fmt()
674 return -EINVAL; in alc5623_set_dai_fmt()
690 return -EINVAL; in alc5623_set_dai_fmt()
699 struct snd_soc_component *component = dai->component; in alc5623_pcm_hw_params()
722 return -EINVAL; in alc5623_pcm_hw_params()
730 return -EINVAL; in alc5623_pcm_hw_params()
733 dev_dbg(component->dev, "%s: sysclk=%d,rate=%d,coeff=0x%04x\n", in alc5623_pcm_hw_params()
734 __func__, alc5623->sysclk, rate, coeff); in alc5623_pcm_hw_params()
742 struct snd_soc_component *component = dai->component; in alc5623_mute()
786 if (alc5623->id == 0x22) in enable_power_depop()
840 .name = "alc5623-hifi",
865 regcache_cache_only(alc5623->regmap, true); in alc5623_suspend()
876 regcache_cache_only(alc5623->regmap, false); in alc5623_resume()
877 ret = regcache_sync(alc5623->regmap); in alc5623_resume()
879 dev_err(component->dev, "Failed to sync register cache: %d\n", in alc5623_resume()
881 regcache_cache_only(alc5623->regmap, true); in alc5623_resume()
895 if (alc5623->add_ctrl) { in alc5623_probe()
897 alc5623->add_ctrl); in alc5623_probe()
900 if (alc5623->jack_det_ctrl) { in alc5623_probe()
902 alc5623->jack_det_ctrl); in alc5623_probe()
905 switch (alc5623->id) { in alc5623_probe()
919 return -EINVAL; in alc5623_probe()
931 switch (alc5623->id) { in alc5623_probe()
944 return -EINVAL; in alc5623_probe()
972 * ALC5623 2 wire address is determined by A1 pin
987 alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv), in alc5623_i2c_probe()
990 return -ENOMEM; in alc5623_i2c_probe()
992 alc5623->regmap = devm_regmap_init_i2c(client, &alc5623_regmap); in alc5623_i2c_probe()
993 if (IS_ERR(alc5623->regmap)) { in alc5623_i2c_probe()
994 ret = PTR_ERR(alc5623->regmap); in alc5623_i2c_probe()
995 dev_err(&client->dev, "Failed to initialise I/O: %d\n", ret); in alc5623_i2c_probe()
999 ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID1, &vid1); in alc5623_i2c_probe()
1001 dev_err(&client->dev, "failed to read vendor ID1: %d\n", ret); in alc5623_i2c_probe()
1005 ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID2, &vid2); in alc5623_i2c_probe()
1007 dev_err(&client->dev, "failed to read vendor ID2: %d\n", ret); in alc5623_i2c_probe()
1012 if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) { in alc5623_i2c_probe()
1013 dev_err(&client->dev, "unknown or wrong codec\n"); in alc5623_i2c_probe()
1014 dev_err(&client->dev, "Expected %x:%lx, got %x:%x\n", in alc5623_i2c_probe()
1015 0x10ec, id->driver_data, in alc5623_i2c_probe()
1017 return -ENODEV; in alc5623_i2c_probe()
1020 dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); in alc5623_i2c_probe()
1022 pdata = client->dev.platform_data; in alc5623_i2c_probe()
1024 alc5623->add_ctrl = pdata->add_ctrl; in alc5623_i2c_probe()
1025 alc5623->jack_det_ctrl = pdata->jack_det_ctrl; in alc5623_i2c_probe()
1027 if (client->dev.of_node) { in alc5623_i2c_probe()
1028 np = client->dev.of_node; in alc5623_i2c_probe()
1029 ret = of_property_read_u32(np, "add-ctrl", &val32); in alc5623_i2c_probe()
1031 alc5623->add_ctrl = val32; in alc5623_i2c_probe()
1032 ret = of_property_read_u32(np, "jack-det-ctrl", &val32); in alc5623_i2c_probe()
1034 alc5623->jack_det_ctrl = val32; in alc5623_i2c_probe()
1038 alc5623->id = vid2; in alc5623_i2c_probe()
1039 switch (alc5623->id) { in alc5623_i2c_probe()
1041 alc5623_dai.name = "alc5621-hifi"; in alc5623_i2c_probe()
1044 alc5623_dai.name = "alc5622-hifi"; in alc5623_i2c_probe()
1047 alc5623_dai.name = "alc5623-hifi"; in alc5623_i2c_probe()
1050 return -EINVAL; in alc5623_i2c_probe()
1055 ret = devm_snd_soc_register_component(&client->dev, in alc5623_i2c_probe()
1058 dev_err(&client->dev, "Failed to register codec: %d\n", ret); in alc5623_i2c_probe()
1080 .name = "alc562x-codec",
1090 MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");