Lines Matching +full:boost +full:- +full:bypass
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
24 #include "adau-utils.h"
323 0, 7, TLV_DB_SCALE_ITEM(-7900, 400, 1),
324 8, 15, TLV_DB_SCALE_ITEM(-4700, 300, 0),
325 16, 23, TLV_DB_SCALE_ITEM(-2300, 200, 0),
326 24, 31, TLV_DB_SCALE_ITEM(-700, 100, 0)
329 static const DECLARE_TLV_DB_MINMAX(adau1373_digital_tlv, -9563, 0);
330 static const DECLARE_TLV_DB_SCALE(adau1373_in_pga_tlv, -1300, 100, 1);
331 static const DECLARE_TLV_DB_SCALE(adau1373_ep_tlv, -600, 600, 1);
383 0, 2, TLV_DB_SCALE_ITEM(-600, 600, 1),
416 1, 7, TLV_DB_LINEAR_ITEM(-1800, -120)
477 SOC_DOUBLE_TLV("AIF3 Boost Playback Volume", ADAU1373_VOL_GAIN1, 4, 5,
479 SOC_DOUBLE_TLV("AIF2 Boost Playback Volume", ADAU1373_VOL_GAIN1, 2, 3,
481 SOC_DOUBLE_TLV("AIF1 Boost Playback Volume", ADAU1373_VOL_GAIN1, 0, 1,
483 SOC_DOUBLE_TLV("AIF3 Boost Capture Volume", ADAU1373_VOL_GAIN2, 4, 5,
485 SOC_DOUBLE_TLV("AIF2 Boost Capture Volume", ADAU1373_VOL_GAIN2, 2, 3,
487 SOC_DOUBLE_TLV("AIF1 Boost Capture Volume", ADAU1373_VOL_GAIN2, 0, 1,
489 SOC_DOUBLE_TLV("DMIC Boost Capture Volume", ADAU1373_VOL_GAIN3, 6, 7,
491 SOC_DOUBLE_TLV("ADC Boost Capture Volume", ADAU1373_VOL_GAIN3, 4, 5,
493 SOC_DOUBLE_TLV("DAC2 Boost Playback Volume", ADAU1373_VOL_GAIN3, 2, 3,
495 SOC_DOUBLE_TLV("DAC1 Boost Playback Volume", ADAU1373_VOL_GAIN3, 0, 1,
498 SOC_DOUBLE_TLV("Input 1 Boost Capture Volume", ADAU1373_ADC_GAIN, 0, 4,
500 SOC_DOUBLE_TLV("Input 2 Boost Capture Volume", ADAU1373_ADC_GAIN, 1, 5,
502 SOC_DOUBLE_TLV("Input 3 Boost Capture Volume", ADAU1373_ADC_GAIN, 2, 6,
504 SOC_DOUBLE_TLV("Input 4 Boost Capture Volume", ADAU1373_ADC_GAIN, 3, 7,
507 SOC_DOUBLE_TLV("Speaker Boost Playback Volume", ADAU1373_LS_CTRL, 2, 3,
550 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in adau1373_pll_event()
552 unsigned int pll_id = w->name[3] - '1'; in adau1373_pll_event()
560 regmap_update_bits(adau1373->regmap, ADAU1373_PLL_CTRL6(pll_id), in adau1373_pll_event()
602 SOC_DAPM_SINGLE("Input 4 Bypass Switch", _reg, 3, 1, 0), \
603 SOC_DAPM_SINGLE("Input 3 Bypass Switch", _reg, 2, 1, 0), \
604 SOC_DAPM_SINGLE("Input 2 Bypass Switch", _reg, 1, 1, 0), \
605 SOC_DAPM_SINGLE("Input 1 Bypass Switch", _reg, 0, 1, 0), \
626 SOC_DAPM_SINGLE("Input 4 Bypass Switch", ADAU1373_LHP_MIX, 3, 1, 0),
627 SOC_DAPM_SINGLE("Input 3 Bypass Switch", ADAU1373_LHP_MIX, 2, 1, 0),
628 SOC_DAPM_SINGLE("Input 2 Bypass Switch", ADAU1373_LHP_MIX, 1, 1, 0),
629 SOC_DAPM_SINGLE("Input 1 Bypass Switch", ADAU1373_LHP_MIX, 0, 1, 0),
635 SOC_DAPM_SINGLE("Input 4 Bypass Switch", ADAU1373_RHP_MIX, 3, 1, 0),
636 SOC_DAPM_SINGLE("Input 3 Bypass Switch", ADAU1373_RHP_MIX, 2, 1, 0),
637 SOC_DAPM_SINGLE("Input 2 Bypass Switch", ADAU1373_RHP_MIX, 1, 1, 0),
638 SOC_DAPM_SINGLE("Input 1 Bypass Switch", ADAU1373_RHP_MIX, 0, 1, 0),
822 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in adau1373_check_aif_clk()
827 dai = sink->name[3] - '1'; in adau1373_check_aif_clk()
829 if (!adau1373->dais[dai].clock_provider) in adau1373_check_aif_clk()
832 if (adau1373->dais[dai].clk_src == ADAU1373_CLK_SRC_PLL1) in adau1373_check_aif_clk()
843 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in adau1373_check_src()
847 dai = sink->name[3] - '1'; in adau1373_check_src()
849 return adau1373->dais[dai].enable_src; in adau1373_check_src()
873 { _sink, "Input 1 Bypass Switch", "IN1PGA" }, \
874 { _sink, "Input 2 Bypass Switch", "IN2PGA" }, \
875 { _sink, "Input 3 Bypass Switch", "IN3PGA" }, \
876 { _sink, "Input 4 Bypass Switch", "IN4PGA" }
883 { _sink, "Input 1 Bypass Switch", "IN1PGA" }, \
884 { _sink, "Input 2 Bypass Switch", "IN2PGA" }, \
885 { _sink, "Input 3 Bypass Switch", "IN3PGA" }, \
886 { _sink, "Input 4 Bypass Switch", "IN4PGA" }
937 { "Left Headphone Mixer", "Input 1 Bypass Switch", "IN1PGA" },
938 { "Left Headphone Mixer", "Input 2 Bypass Switch", "IN2PGA" },
939 { "Left Headphone Mixer", "Input 3 Bypass Switch", "IN3PGA" },
940 { "Left Headphone Mixer", "Input 4 Bypass Switch", "IN4PGA" },
943 { "Right Headphone Mixer", "Input 1 Bypass Switch", "IN1PGA" },
944 { "Right Headphone Mixer", "Input 2 Bypass Switch", "IN2PGA" },
945 { "Right Headphone Mixer", "Input 3 Bypass Switch", "IN3PGA" },
946 { "Right Headphone Mixer", "Input 4 Bypass Switch", "IN4PGA" },
955 { "Earpiece Mixer", "Input 1 Bypass Switch", "IN1PGA" },
956 { "Earpiece Mixer", "Input 2 Bypass Switch", "IN2PGA" },
957 { "Earpiece Mixer", "Input 3 Bypass Switch", "IN3PGA" },
958 { "Earpiece Mixer", "Input 4 Bypass Switch", "IN4PGA" },
1032 struct snd_soc_component *component = dai->component; in adau1373_hw_params()
1034 struct adau1373_dai *adau1373_dai = &adau1373->dais[dai->id]; in adau1373_hw_params()
1039 freq = adau1373_dai->sysclk; in adau1373_hw_params()
1042 return -EINVAL; in adau1373_hw_params()
1067 return -EINVAL; in adau1373_hw_params()
1070 adau1373_dai->enable_src = (div != 0); in adau1373_hw_params()
1072 regmap_update_bits(adau1373->regmap, ADAU1373_BCLKDIV(dai->id), in adau1373_hw_params()
1090 return -EINVAL; in adau1373_hw_params()
1093 return regmap_update_bits(adau1373->regmap, ADAU1373_DAI(dai->id), in adau1373_hw_params()
1099 struct snd_soc_component *component = dai->component; in adau1373_set_dai_fmt()
1101 struct adau1373_dai *adau1373_dai = &adau1373->dais[dai->id]; in adau1373_set_dai_fmt()
1107 adau1373_dai->clock_provider = true; in adau1373_set_dai_fmt()
1111 adau1373_dai->clock_provider = false; in adau1373_set_dai_fmt()
1114 return -EINVAL; in adau1373_set_dai_fmt()
1131 return -EINVAL; in adau1373_set_dai_fmt()
1147 return -EINVAL; in adau1373_set_dai_fmt()
1150 regmap_update_bits(adau1373->regmap, ADAU1373_DAI(dai->id), in adau1373_set_dai_fmt()
1159 struct adau1373 *adau1373 = snd_soc_component_get_drvdata(dai->component); in adau1373_set_dai_sysclk()
1160 struct adau1373_dai *adau1373_dai = &adau1373->dais[dai->id]; in adau1373_set_dai_sysclk()
1167 return -EINVAL; in adau1373_set_dai_sysclk()
1170 adau1373_dai->sysclk = freq; in adau1373_set_dai_sysclk()
1171 adau1373_dai->clk_src = clk_id; in adau1373_set_dai_sysclk()
1173 regmap_update_bits(adau1373->regmap, ADAU1373_BCLKDIV(dai->id), in adau1373_set_dai_sysclk()
1191 .name = "adau1373-aif1",
1211 .name = "adau1373-aif2",
1231 .name = "adau1373-aif3",
1264 return -EINVAL; in adau1373_set_pll()
1282 return -EINVAL; in adau1373_set_pll()
1286 return -EINVAL; in adau1373_set_pll()
1289 return -EINVAL; in adau1373_set_pll()
1300 return -EINVAL; in adau1373_set_pll()
1303 dpll_div = 11 - dpll_div; in adau1373_set_pll()
1304 regmap_update_bits(adau1373->regmap, ADAU1373_PLL_CTRL6(pll_id), in adau1373_set_pll()
1307 regmap_update_bits(adau1373->regmap, ADAU1373_PLL_CTRL6(pll_id), in adau1373_set_pll()
1312 regmap_write(adau1373->regmap, ADAU1373_DPLL_CTRL(pll_id), in adau1373_set_pll()
1314 regmap_write(adau1373->regmap, ADAU1373_PLL_CTRL1(pll_id), pll_regs[0]); in adau1373_set_pll()
1315 regmap_write(adau1373->regmap, ADAU1373_PLL_CTRL2(pll_id), pll_regs[1]); in adau1373_set_pll()
1316 regmap_write(adau1373->regmap, ADAU1373_PLL_CTRL3(pll_id), pll_regs[2]); in adau1373_set_pll()
1317 regmap_write(adau1373->regmap, ADAU1373_PLL_CTRL4(pll_id), pll_regs[3]); in adau1373_set_pll()
1318 regmap_write(adau1373->regmap, ADAU1373_PLL_CTRL5(pll_id), pll_regs[4]); in adau1373_set_pll()
1321 regmap_update_bits(adau1373->regmap, ADAU1373_CLK_SRC_DIV(pll_id), 0x3f, 0x09); in adau1373_set_pll()
1332 regmap_write(adau1373->regmap, ADAU1373_DRC(nr) + i, drc[i]); in adau1373_load_drc_settings()
1352 struct adau1373_platform_data *pdata = component->dev->platform_data; in adau1373_probe()
1358 if (pdata->num_drc > ARRAY_SIZE(pdata->drc_setting)) in adau1373_probe()
1359 return -EINVAL; in adau1373_probe()
1361 if (!adau1373_valid_micbias(pdata->micbias1) || in adau1373_probe()
1362 !adau1373_valid_micbias(pdata->micbias2)) in adau1373_probe()
1363 return -EINVAL; in adau1373_probe()
1365 for (i = 0; i < pdata->num_drc; ++i) { in adau1373_probe()
1367 pdata->drc_setting[i]); in adau1373_probe()
1371 pdata->num_drc); in adau1373_probe()
1375 if (pdata->input_differential[i]) in adau1373_probe()
1378 regmap_write(adau1373->regmap, ADAU1373_INPUT_MODE, val); in adau1373_probe()
1381 if (pdata->lineout_differential) in adau1373_probe()
1383 if (pdata->lineout_ground_sense) in adau1373_probe()
1385 regmap_write(adau1373->regmap, ADAU1373_OUTPUT_CTRL, val); in adau1373_probe()
1387 lineout_differential = pdata->lineout_differential; in adau1373_probe()
1389 regmap_write(adau1373->regmap, ADAU1373_EP_CTRL, in adau1373_probe()
1390 (pdata->micbias1 << ADAU1373_EP_CTRL_MICBIAS1_OFFSET) | in adau1373_probe()
1391 (pdata->micbias2 << ADAU1373_EP_CTRL_MICBIAS2_OFFSET)); in adau1373_probe()
1399 regmap_write(adau1373->regmap, ADAU1373_ADC_CTRL, in adau1373_probe()
1416 regmap_update_bits(adau1373->regmap, ADAU1373_PWDN_CTRL3, in adau1373_set_bias_level()
1420 regmap_update_bits(adau1373->regmap, ADAU1373_PWDN_CTRL3, in adau1373_set_bias_level()
1431 regcache_sync(adau1373->regmap); in adau1373_resume()
1479 adau1373 = devm_kzalloc(&client->dev, sizeof(*adau1373), GFP_KERNEL); in adau1373_i2c_probe()
1481 return -ENOMEM; in adau1373_i2c_probe()
1483 adau1373->regmap = devm_regmap_init_i2c(client, in adau1373_i2c_probe()
1485 if (IS_ERR(adau1373->regmap)) in adau1373_i2c_probe()
1486 return PTR_ERR(adau1373->regmap); in adau1373_i2c_probe()
1488 regmap_write(adau1373->regmap, ADAU1373_SOFT_RESET, 0x00); in adau1373_i2c_probe()
1490 dev_set_drvdata(&client->dev, adau1373); in adau1373_i2c_probe()
1492 ret = devm_snd_soc_register_component(&client->dev, in adau1373_i2c_probe()
1515 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");