Lines Matching +full:mode +full:- +full:switch
1 // SPDX-License-Identifier: GPL-2.0-or-later
59 /* Input - Gain, Select and Filter Registers */
72 /* Output - Gain, Select and Filter Registers */
245 u8 mode; /* 0 = slave, 1 = master */ member
250 /* for MASTER mode, fs = 44.1Khz and its harmonics */
260 /* for MASTER mode, fs = 48Khz and its harmonics */
270 /* for SLAVE mode with SRM */
289 0x0, 0x10, TLV_DB_SCALE_ITEM(-5400, 0, 0),
290 /* -54dB to 15dB */
291 0x11, 0x3f, TLV_DB_SCALE_ITEM(-5400, 150, 0)
296 /* -78dB to 12dB */
297 0x08, 0x7f, TLV_DB_SCALE_ITEM(-7800, 75, 0)
306 static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0);
307 static const DECLARE_TLV_DB_SCALE(mixin_gain_tlv, -450, 150, 0);
308 static const DECLARE_TLV_DB_SCALE(eq_gain_tlv, -1050, 150, 0);
309 static const DECLARE_TLV_DB_SCALE(hp_vol_tlv, -5700, 100, 0);
310 static const DECLARE_TLV_DB_SCALE(lineout_vol_tlv, -4800, 100, 0);
311 static const DECLARE_TLV_DB_SCALE(alc_threshold_tlv, -9450, 150, 0);
325 /* ADC and DAC voice mode (8kHz) high pass cutoff value */
484 if (ucontrol->value.integer.value[0]) { in da9055_put_alc_sw()
486 * While enabling ALC (or ALC sync mode), calibration of the DC in da9055_put_alc_sw()
519 offset_l = -avg_left_data; in da9055_put_alc_sw()
520 offset_r = -avg_right_data; in da9055_put_alc_sw()
570 SOC_SINGLE("DAC EQ Switch", DA9055_DAC_FILTERS4, 7, 1, 0),
582 /* High Pass Filter and Voice Mode controls */
583 SOC_SINGLE("ADC HPF Switch", DA9055_ADC_FILTERS1, 7, 1, 0),
585 SOC_SINGLE("ADC Voice Mode Switch", DA9055_ADC_FILTERS1, 3, 1, 0),
588 SOC_SINGLE("DAC HPF Switch", DA9055_DAC_FILTERS1, 7, 1, 0),
590 SOC_SINGLE("DAC Voice Mode Switch", DA9055_DAC_FILTERS1, 3, 1, 0),
594 SOC_DOUBLE_R("Mic Switch", DA9055_MIC_L_CTRL,
596 SOC_DOUBLE_R("Aux Switch", DA9055_AUX_L_CTRL,
598 SOC_DOUBLE_R("Mixin PGA Switch", DA9055_MIXIN_L_CTRL,
600 SOC_DOUBLE_R("ADC Switch", DA9055_ADC_L_CTRL,
602 SOC_DOUBLE_R("Headphone Switch", DA9055_HP_L_CTRL,
604 SOC_SINGLE("Lineout Switch", DA9055_LINE_CTRL, 6, 1, 0),
605 SOC_SINGLE("DAC Soft Mute Switch", DA9055_DAC_FILTERS5, 7, 1, 0),
609 SOC_DOUBLE_R("Aux ZC Switch", DA9055_AUX_L_CTRL,
611 SOC_DOUBLE_R("Mixin PGA ZC Switch", DA9055_MIXIN_L_CTRL,
613 SOC_DOUBLE_R("Headphone ZC Switch", DA9055_HP_L_CTRL,
615 SOC_SINGLE("Lineout ZC Switch", DA9055_LINE_CTRL, 4, 1, 0),
618 SOC_DOUBLE_R("Aux Gain Ramping Switch", DA9055_AUX_L_CTRL,
620 SOC_DOUBLE_R("Mixin Gain Ramping Switch", DA9055_MIXIN_L_CTRL,
622 SOC_DOUBLE_R("ADC Gain Ramping Switch", DA9055_ADC_L_CTRL,
624 SOC_DOUBLE_R("DAC Gain Ramping Switch", DA9055_DAC_L_CTRL,
626 SOC_DOUBLE_R("Headphone Gain Ramping Switch", DA9055_HP_L_CTRL,
628 SOC_SINGLE("Lineout Gain Ramping Switch", DA9055_LINE_CTRL, 5, 1, 0),
632 SOC_SINGLE("DAC NG Switch", DA9055_DAC_NG_CTRL, 7, 1, 0),
646 SOC_DOUBLE_R("DMIC Switch", DA9055_MIXIN_L_SELECT,
650 SOC_DOUBLE_EXT("ALC Switch", DA9055_ALC_CTRL1, 3, 7, 1, 0,
652 SOC_SINGLE_EXT("ALC Sync Mode Switch", DA9055_ALC_CTRL1, 1, 1, 0,
654 SOC_SINGLE("ALC Offset Switch", DA9055_ALC_CTRL1, 0, 1, 0),
655 SOC_SINGLE("ALC Anticlip Mode Switch", DA9055_ALC_ANTICLIP_CTRL,
702 SOC_DAPM_SINGLE("Aux Left Switch", DA9055_MIXIN_L_SELECT, 0, 1, 0),
703 SOC_DAPM_SINGLE("Mic Left Switch", DA9055_MIXIN_L_SELECT, 1, 1, 0),
704 SOC_DAPM_SINGLE("Mic Right Switch", DA9055_MIXIN_L_SELECT, 2, 1, 0),
709 SOC_DAPM_SINGLE("Aux Right Switch", DA9055_MIXIN_R_SELECT, 0, 1, 0),
710 SOC_DAPM_SINGLE("Mic Right Switch", DA9055_MIXIN_R_SELECT, 1, 1, 0),
711 SOC_DAPM_SINGLE("Mic Left Switch", DA9055_MIXIN_R_SELECT, 2, 1, 0),
712 SOC_DAPM_SINGLE("Mixin Left Switch", DA9055_MIXIN_R_SELECT, 3, 1, 0),
725 SOC_DAPM_SINGLE("Aux Left Switch", DA9055_MIXOUT_L_SELECT, 0, 1, 0),
726 SOC_DAPM_SINGLE("Mixin Left Switch", DA9055_MIXOUT_L_SELECT, 1, 1, 0),
727 SOC_DAPM_SINGLE("Mixin Right Switch", DA9055_MIXOUT_L_SELECT, 2, 1, 0),
728 SOC_DAPM_SINGLE("DAC Left Switch", DA9055_MIXOUT_L_SELECT, 3, 1, 0),
729 SOC_DAPM_SINGLE("Aux Left Invert Switch", DA9055_MIXOUT_L_SELECT,
731 SOC_DAPM_SINGLE("Mixin Left Invert Switch", DA9055_MIXOUT_L_SELECT,
733 SOC_DAPM_SINGLE("Mixin Right Invert Switch", DA9055_MIXOUT_L_SELECT,
739 SOC_DAPM_SINGLE("Aux Right Switch", DA9055_MIXOUT_R_SELECT, 0, 1, 0),
740 SOC_DAPM_SINGLE("Mixin Right Switch", DA9055_MIXOUT_R_SELECT, 1, 1, 0),
741 SOC_DAPM_SINGLE("Mixin Left Switch", DA9055_MIXOUT_R_SELECT, 2, 1, 0),
742 SOC_DAPM_SINGLE("DAC Right Switch", DA9055_MIXOUT_R_SELECT, 3, 1, 0),
743 SOC_DAPM_SINGLE("Aux Right Invert Switch", DA9055_MIXOUT_R_SELECT,
745 SOC_DAPM_SINGLE("Mixin Right Invert Switch", DA9055_MIXOUT_R_SELECT,
747 SOC_DAPM_SINGLE("Mixin Left Invert Switch", DA9055_MIXOUT_R_SELECT,
753 SOC_DAPM_SINGLE("Switch", DA9055_HP_L_CTRL, 3, 1, 0);
756 SOC_DAPM_SINGLE("Switch", DA9055_HP_R_CTRL, 3, 1, 0);
760 SOC_DAPM_SINGLE("Switch", DA9055_LINE_CTRL, 3, 1, 0);
867 {"In Mixer Left", "Mic Left Switch", "Mic Left"},
868 {"In Mixer Left", "Mic Right Switch", "Mic Right"},
869 {"In Mixer Left", "Aux Left Switch", "Aux Left"},
871 {"In Mixer Right", "Mic Right Switch", "Mic Right"},
872 {"In Mixer Right", "Mic Left Switch", "Mic Left"},
873 {"In Mixer Right", "Aux Right Switch", "Aux Right"},
874 {"In Mixer Right", "Mixin Left Switch", "MIXIN Left"},
902 {"Out Mixer Left", "Aux Left Switch", "Aux Left"},
903 {"Out Mixer Left", "Mixin Left Switch", "MIXIN Left"},
904 {"Out Mixer Left", "Mixin Right Switch", "MIXIN Right"},
905 {"Out Mixer Left", "Aux Left Invert Switch", "Aux Left"},
906 {"Out Mixer Left", "Mixin Left Invert Switch", "MIXIN Left"},
907 {"Out Mixer Left", "Mixin Right Invert Switch", "MIXIN Right"},
908 {"Out Mixer Left", "DAC Left Switch", "DAC Left"},
910 {"Out Mixer Right", "Aux Right Switch", "Aux Right"},
911 {"Out Mixer Right", "Mixin Right Switch", "MIXIN Right"},
912 {"Out Mixer Right", "Mixin Left Switch", "MIXIN Left"},
913 {"Out Mixer Right", "Aux Right Invert Switch", "Aux Right"},
914 {"Out Mixer Right", "Mixin Right Invert Switch", "MIXIN Right"},
915 {"Out Mixer Right", "Mixin Left Invert Switch", "MIXIN Left"},
916 {"Out Mixer Right", "DAC Right Switch", "DAC Right"},
919 {"Headphone Left Enable", "Switch", "MIXOUT Left"},
925 {"Headphone Right Enable", "Switch", "MIXOUT Right"},
931 {"Lineout Enable", "Switch", "MIXOUT Right"},
1023 switch (reg) { in da9055_volatile_register()
1051 struct snd_soc_component *component = dai->component; in da9055_hw_params()
1056 switch (params_width(params)) { in da9055_hw_params()
1070 return -EINVAL; in da9055_hw_params()
1077 switch (params_rate(params)) { in da9055_hw_params()
1119 return -EINVAL; in da9055_hw_params()
1122 if (da9055->mclk_rate) { in da9055_hw_params()
1123 /* PLL Mode, Write actual FS */ in da9055_hw_params()
1127 * Non-PLL Mode in da9055_hw_params()
1136 if (da9055->mclk_rate && (da9055->mclk_rate != sysclk)) { in da9055_hw_params()
1137 /* PLL Mode */ in da9055_hw_params()
1138 if (!da9055->master) { in da9055_hw_params()
1139 /* PLL slave mode, enable PLL and also SRM */ in da9055_hw_params()
1144 /* PLL master mode, only enable PLL */ in da9055_hw_params()
1149 /* Non PLL Mode, disable PLL */ in da9055_hw_params()
1156 /* Set DAI mode and Format */
1159 struct snd_soc_component *component = codec_dai->component; in da9055_set_dai_fmt()
1161 u8 aif_clk_mode, aif_ctrl, mode; in da9055_set_dai_fmt() local
1163 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { in da9055_set_dai_fmt()
1165 /* DA9055 in I2S Master Mode */ in da9055_set_dai_fmt()
1166 mode = 1; in da9055_set_dai_fmt()
1170 /* DA9055 in I2S Slave Mode */ in da9055_set_dai_fmt()
1171 mode = 0; in da9055_set_dai_fmt()
1175 return -EINVAL; in da9055_set_dai_fmt()
1178 /* Don't allow change of mode if PLL is enabled */ in da9055_set_dai_fmt()
1180 (da9055->master != mode)) in da9055_set_dai_fmt()
1181 return -EINVAL; in da9055_set_dai_fmt()
1183 da9055->master = mode; in da9055_set_dai_fmt()
1186 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in da9055_set_dai_fmt()
1200 return -EINVAL; in da9055_set_dai_fmt()
1216 struct snd_soc_component *component = dai->component; in da9055_mute()
1239 struct snd_soc_component *component = codec_dai->component; in da9055_set_dai_sysclk()
1242 switch (clk_id) { in da9055_set_dai_sysclk()
1244 switch (freq) { in da9055_set_dai_sysclk()
1254 da9055->mclk_rate = freq; in da9055_set_dai_sysclk()
1257 dev_err(codec_dai->dev, "Unsupported MCLK value %d\n", in da9055_set_dai_sysclk()
1259 return -EINVAL; in da9055_set_dai_sysclk()
1263 dev_err(codec_dai->dev, "Unknown clock source %d\n", clk_id); in da9055_set_dai_sysclk()
1264 return -EINVAL; in da9055_set_dai_sysclk()
1282 struct snd_soc_component *component = codec_dai->component; in da9055_set_dai_pll()
1290 /* In slave mode, there is only one set of divisors */ in da9055_set_dai_pll()
1291 if (!da9055->master && (fout != 2822400)) in da9055_set_dai_pll()
1296 /* Check fref, mode and fout */ in da9055_set_dai_pll()
1298 (da9055->master == da9055_pll_div[cnt].mode) && in da9055_set_dai_pll()
1317 dev_err(codec_dai->dev, "Error in setting up PLL\n"); in da9055_set_dai_pll()
1318 return -EINVAL; in da9055_set_dai_pll()
1332 .name = "da9055-hifi",
1356 switch (level) { in da9055_set_bias_level()
1426 if (da9055->pdata) { in da9055_probe()
1428 if (da9055->pdata->micbias_source) { in da9055_probe()
1437 switch (da9055->pdata->micbias) { in da9055_probe()
1444 (da9055->pdata->micbias) << 4); in da9055_probe()
1478 struct da9055_platform_data *pdata = dev_get_platdata(&i2c->dev); in da9055_i2c_probe()
1481 da9055 = devm_kzalloc(&i2c->dev, sizeof(struct da9055_priv), in da9055_i2c_probe()
1484 return -ENOMEM; in da9055_i2c_probe()
1487 da9055->pdata = pdata; in da9055_i2c_probe()
1491 da9055->regmap = devm_regmap_init_i2c(i2c, &da9055_regmap_config); in da9055_i2c_probe()
1492 if (IS_ERR(da9055->regmap)) { in da9055_i2c_probe()
1493 ret = PTR_ERR(da9055->regmap); in da9055_i2c_probe()
1494 dev_err(&i2c->dev, "regmap_init() failed: %d\n", ret); in da9055_i2c_probe()
1498 ret = devm_snd_soc_register_component(&i2c->dev, in da9055_i2c_probe()
1501 dev_err(&i2c->dev, "Failed to register da9055 component: %d\n", in da9055_i2c_probe()
1515 { "da9055-codec", 0 },
1522 { .compatible = "dlg,da9055-codec", },
1531 .name = "da9055-codec",