Lines Matching +full:4 +full:- +full:switch
1 // SPDX-License-Identifier: GPL-2.0-only
3 * isabelle.c - Low power high fidelity audio codec driver
22 #include <sound/soc-dapm.h>
36 { 4, 0x00 },
147 SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4,
194 ISABELLE_AMIC_CFG_REG, 4,
233 SOC_DAPM_SINGLE("DAC1L Playback Switch", ISABELLE_HSDRV_CFG1_REG, 7, 1, 0),
234 SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 6, 1, 0),
238 SOC_DAPM_SINGLE("DAC1R Playback Switch", ISABELLE_HSDRV_CFG1_REG, 5, 1, 0),
239 SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 4, 1, 0),
243 SOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_HFLPGA_CFG_REG, 7, 1, 0),
244 SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HFLPGA_CFG_REG, 6, 1, 0),
248 SOC_DAPM_SINGLE("DAC2R Playback Switch", ISABELLE_HFRPGA_CFG_REG, 7, 1, 0),
249 SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HFRPGA_CFG_REG, 6, 1, 0),
253 SOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_EARDRV_CFG1_REG, 7, 1, 0),
254 SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_EARDRV_CFG1_REG, 6, 1, 0),
258 SOC_DAPM_SINGLE("DAC3L Playback Switch", ISABELLE_LINEAMP_CFG_REG, 7, 1, 0),
259 SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 6, 1, 0),
263 SOC_DAPM_SINGLE("DAC3R Playback Switch", ISABELLE_LINEAMP_CFG_REG, 5, 1, 0),
264 SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 4, 1, 0),
268 SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 7, 1, 0),
269 SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 6, 1, 0),
270 SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 5, 1, 0),
274 SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 3, 1, 0),
275 SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 2, 1, 0),
276 SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 1, 1, 0),
280 SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 7, 1, 0),
281 SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 6, 1, 0),
282 SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 5, 1, 0),
283 SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 4, 1, 0),
284 SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 3, 1, 0),
285 SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 2, 1, 0),
289 SOC_DAPM_SINGLE("USNC Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 7, 1, 0),
290 SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 3, 1, 0),
291 SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 2, 1, 0),
292 SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 1, 1, 0),
296 SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 7, 1, 0),
297 SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 6, 1, 0),
298 SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 5, 1, 0),
302 SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 3, 1, 0),
303 SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 2, 1, 0),
304 SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 1, 1, 0),
308 SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 7, 1, 0),
309 SOC_DAPM_SINGLE("DL1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 6, 1, 0),
313 SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 5, 1, 0),
314 SOC_DAPM_SINGLE("DL2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 4, 1, 0),
318 SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 3, 1, 0),
319 SOC_DAPM_SINGLE("DL3 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 2, 1, 0),
323 SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 1, 1, 0),
324 SOC_DAPM_SINGLE("DL4 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 0, 1, 0),
328 SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 7, 1, 0),
329 SOC_DAPM_SINGLE("DL5 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 6, 1, 0),
333 SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 5, 1, 0),
334 SOC_DAPM_SINGLE("DL6 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 4, 1, 0),
338 SOC_DAPM_SINGLE("Switch", ISABELLE_EARDRV_CFG2_REG, 0, 1, 0);
342 static const DECLARE_TLV_DB_SCALE(afm_amp_tlv, -3300, 300, 0);
343 static const DECLARE_TLV_DB_SCALE(dac_tlv, -1200, 200, 0);
344 static const DECLARE_TLV_DB_SCALE(hf_tlv, -5000, 200, 0);
346 /* from -63 to 0 dB in 1 dB steps */
347 static const DECLARE_TLV_DB_SCALE(dpga_tlv, -6300, 100, 1);
349 /* from -63 to 9 dB in 1 dB steps */
350 static const DECLARE_TLV_DB_SCALE(rx_tlv, -6300, 100, 1);
352 static const DECLARE_TLV_DB_SCALE(st_tlv, -2700, 300, 1);
353 static const DECLARE_TLV_DB_SCALE(tx_tlv, -600, 100, 0);
357 4, 0, 0xF, 0, dac_tlv),
362 4, 0, 0xF, 0, dac_tlv),
366 SOC_DOUBLE_TLV("Aux FM Volume", ISABELLE_APGA_GAIN_REG, 4, 0, 0xF, 0,
389 SOC_SINGLE_TLV("Audio TX1 Volume", ISABELLE_ATX1_DPGA_REG, 4, 0xF, 0,
391 SOC_SINGLE_TLV("Audio TX2 Volume", ISABELLE_ATX2_DPGA_REG, 4, 0xF, 0,
393 SOC_SINGLE_TLV("Voice TX1 Volume", ISABELLE_VTX1_DPGA_REG, 4, 0xF, 0,
395 SOC_SINGLE_TLV("Voice TX2 Volume", ISABELLE_VTX2_DPGA_REG, 4, 0xF, 0,
414 SOC_SINGLE("ATX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
416 SOC_SINGLE("ATX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
418 SOC_SINGLE("ARX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
420 SOC_SINGLE("ARX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
421 4, 1, 0),
422 SOC_SINGLE("ARX3 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
424 SOC_SINGLE("ARX4 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
426 SOC_SINGLE("ARX5 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
428 SOC_SINGLE("ARX6 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
430 SOC_SINGLE("VRX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
432 SOC_SINGLE("VRX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
435 SOC_SINGLE("ATX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
437 SOC_SINGLE("ATX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
439 SOC_SINGLE("VTX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
441 SOC_SINGLE("VTX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
442 4, 1, 0),
443 SOC_SINGLE("RX1 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
445 SOC_SINGLE("RX2 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
446 4, 1, 0),
447 SOC_SINGLE("RX3 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
449 SOC_SINGLE("RX4 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
451 SOC_SINGLE("RX5 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
453 SOC_SINGLE("RX6 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
456 SOC_SINGLE("ULATX12 Capture Switch", ISABELLE_ULATX12_INTF_CFG_REG,
459 SOC_SINGLE("DL12 Playback Switch", ISABELLE_DL12_INTF_CFG_REG,
461 SOC_SINGLE("DL34 Playback Switch", ISABELLE_DL34_INTF_CFG_REG,
463 SOC_SINGLE("DL56 Playback Switch", ISABELLE_DL56_INTF_CFG_REG,
466 /* DMIC Switch */
467 SOC_SINGLE("DMIC Switch", ISABELLE_DMIC_CFG_REG, 0, 1, 0),
511 SND_SOC_DAPM_AIF_OUT("INTF2_SDO", NULL, 0, ISABELLE_INTF_EN_REG, 4, 0),
520 SND_SOC_DAPM_PGA("MicAmp2", ISABELLE_AMIC_CFG_REG, 4, 0, NULL, 0),
607 4, 0),
632 SND_SOC_DAPM_MUX("RX2 Playback", ISABELLE_ALU_RX_EN_REG, 4, 0,
664 { "DL1", "DL12 Playback Switch", "INTF1_SDI" },
665 { "DL2", "DL12 Playback Switch", "INTF1_SDI" },
666 { "DL3", "DL34 Playback Switch", "INTF1_SDI" },
667 { "DL4", "DL34 Playback Switch", "INTF1_SDI" },
668 { "DL5", "DL56 Playback Switch", "INTF1_SDI" },
669 { "DL6", "DL56 Playback Switch", "INTF1_SDI" },
671 { "DL1", "DL12 Playback Switch", "INTF2_SDI" },
672 { "DL2", "DL12 Playback Switch", "INTF2_SDI" },
673 { "DL3", "DL34 Playback Switch", "INTF2_SDI" },
674 { "DL4", "DL34 Playback Switch", "INTF2_SDI" },
675 { "DL5", "DL56 Playback Switch", "INTF2_SDI" },
676 { "DL6", "DL56 Playback Switch", "INTF2_SDI" },
682 { "RX1 Mixer", "ST1 Playback Switch", "Sidetone Audio PGA" },
684 { "RX1 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
685 { "RX1 Mixer", "DL1 Playback Switch", "DL1" },
687 { "RX2 Mixer", "ST2 Playback Switch", "Sidetone Audio PGA" },
689 { "RX2 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
690 { "RX2 Mixer", "DL2 Playback Switch", "DL2" },
692 { "RX3 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
693 { "RX3 Mixer", "DL3 Playback Switch", "DL3" },
695 { "RX4 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
696 { "RX4 Mixer", "DL4 Playback Switch", "DL4" },
698 { "RX5 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
699 { "RX5 Mixer", "DL5 Playback Switch", "DL5" },
701 { "RX6 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
702 { "RX6 Mixer", "DL6 Playback Switch", "DL6" },
726 { "ULATX1", "ATX1 Filter Enable Switch", "ATX Select" },
727 { "ULATX1", "ATX1 Filter Bypass Switch", "ATX Select" },
728 { "ULATX2", "ATX2 Filter Enable Switch", "ATX Select" },
729 { "ULATX2", "ATX2 Filter Bypass Switch", "ATX Select" },
731 { "ULVTX1", "VTX1 Filter Enable Switch", "VTX Select" },
732 { "ULVTX1", "VTX1 Filter Bypass Switch", "VTX Select" },
733 { "ULVTX2", "VTX2 Filter Enable Switch", "VTX Select" },
734 { "ULVTX2", "VTX2 Filter Bypass Switch", "VTX Select" },
736 { "INTF1_SDO", "ULATX12 Capture Switch", "ULATX1" },
737 { "INTF1_SDO", "ULATX12 Capture Switch", "ULATX2" },
738 { "INTF2_SDO", "ULATX12 Capture Switch", "ULATX1" },
739 { "INTF2_SDO", "ULATX12 Capture Switch", "ULATX2" },
750 { "RX1 Playback", "VRX1 Filter Bypass Switch", "RX1 Mixer" },
751 { "RX1 Playback", "ARX1 Filter Bypass Switch", "RX1 Mixer" },
752 { "RX1 Playback", "RX1 Filter Enable Switch", "RX1 Mixer" },
754 { "RX2 Playback", "VRX2 Filter Bypass Switch", "RX2 Mixer" },
755 { "RX2 Playback", "ARX2 Filter Bypass Switch", "RX2 Mixer" },
756 { "RX2 Playback", "RX2 Filter Enable Switch", "RX2 Mixer" },
758 { "RX3 Playback", "ARX3 Filter Bypass Switch", "RX3 Mixer" },
759 { "RX3 Playback", "RX3 Filter Enable Switch", "RX3 Mixer" },
761 { "RX4 Playback", "ARX4 Filter Bypass Switch", "RX4 Mixer" },
762 { "RX4 Playback", "RX4 Filter Enable Switch", "RX4 Mixer" },
764 { "RX5 Playback", "ARX5 Filter Bypass Switch", "RX5 Mixer" },
765 { "RX5 Playback", "RX5 Filter Enable Switch", "RX5 Mixer" },
767 { "RX6 Playback", "ARX6 Filter Bypass Switch", "RX6 Mixer" },
768 { "RX6 Playback", "RX6 Filter Enable Switch", "RX6 Mixer" },
770 { "DPGA1L Mixer", "RX1 Playback Switch", "RX1 Playback" },
771 { "DPGA1L Mixer", "RX3 Playback Switch", "RX3 Playback" },
772 { "DPGA1L Mixer", "RX5 Playback Switch", "RX5 Playback" },
774 { "DPGA1R Mixer", "RX2 Playback Switch", "RX2 Playback" },
775 { "DPGA1R Mixer", "RX4 Playback Switch", "RX4 Playback" },
776 { "DPGA1R Mixer", "RX6 Playback Switch", "RX6 Playback" },
784 { "DPGA2L Mixer", "RX1 Playback Switch", "RX1 Playback" },
785 { "DPGA2L Mixer", "RX2 Playback Switch", "RX2 Playback" },
786 { "DPGA2L Mixer", "RX3 Playback Switch", "RX3 Playback" },
787 { "DPGA2L Mixer", "RX4 Playback Switch", "RX4 Playback" },
788 { "DPGA2L Mixer", "RX5 Playback Switch", "RX5 Playback" },
789 { "DPGA2L Mixer", "RX6 Playback Switch", "RX6 Playback" },
791 { "DPGA2R Mixer", "RX2 Playback Switch", "RX2 Playback" },
792 { "DPGA2R Mixer", "RX4 Playback Switch", "RX4 Playback" },
793 { "DPGA2R Mixer", "RX6 Playback Switch", "RX6 Playback" },
801 { "DPGA3L Mixer", "RX1 Playback Switch", "RX1 Playback" },
802 { "DPGA3L Mixer", "RX3 Playback Switch", "RX3 Playback" },
803 { "DPGA3L Mixer", "RX5 Playback Switch", "RX5 Playback" },
805 { "DPGA3R Mixer", "RX2 Playback Switch", "RX2 Playback" },
806 { "DPGA3R Mixer", "RX4 Playback Switch", "RX4 Playback" },
807 { "DPGA3R Mixer", "RX6 Playback Switch", "RX6 Playback" },
815 { "Headset Left Mixer", "DAC1L Playback Switch", "DAC1L" },
816 { "Headset Left Mixer", "APGA1 Playback Switch", "APGA1" },
818 { "Headset Right Mixer", "DAC1R Playback Switch", "DAC1R" },
819 { "Headset Right Mixer", "APGA2 Playback Switch", "APGA2" },
828 { "Earphone Mixer", "DAC2L Playback Switch", "DAC2L" },
829 { "Earphone Mixer", "APGA1 Playback Switch", "APGA1" },
831 { "Earphone Playback", "Switch", "Earphone Mixer" },
835 { "Handsfree Left Mixer", "DAC2L Playback Switch", "DAC2L" },
836 { "Handsfree Left Mixer", "APGA1 Playback Switch", "APGA1" },
838 { "Handsfree Right Mixer", "DAC2R Playback Switch", "DAC2R" },
839 { "Handsfree Right Mixer", "APGA2 Playback Switch", "APGA2" },
850 { "LINEOUT1 Mixer", "DAC3L Playback Switch", "DAC3L" },
851 { "LINEOUT1 Mixer", "APGA1 Playback Switch", "APGA1" },
853 { "LINEOUT2 Mixer", "DAC3R Playback Switch", "DAC3R" },
854 { "LINEOUT2 Mixer", "APGA2 Playback Switch", "APGA2" },
865 snd_soc_component_update_bits(dai->component, ISABELLE_DAC1_SOFTRAMP_REG, in isabelle_hs_mute()
866 BIT(4), (mute ? BIT(4) : 0)); in isabelle_hs_mute()
873 snd_soc_component_update_bits(dai->component, ISABELLE_DAC2_SOFTRAMP_REG, in isabelle_hf_mute()
874 BIT(4), (mute ? BIT(4) : 0)); in isabelle_hf_mute()
881 snd_soc_component_update_bits(dai->component, ISABELLE_DAC3_SOFTRAMP_REG, in isabelle_line_mute()
882 BIT(4), (mute ? BIT(4) : 0)); in isabelle_line_mute()
890 switch (level) { in isabelle_set_bias_level()
914 struct snd_soc_component *component = dai->component; in isabelle_hw_params()
918 switch (params_rate(params)) { in isabelle_hw_params()
947 return -EINVAL; in isabelle_hw_params()
954 switch (params_width(params)) { in isabelle_hw_params()
962 return -EINVAL; in isabelle_hw_params()
973 struct snd_soc_component *component = codec_dai->component; in isabelle_set_dai_fmt()
976 switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { in isabelle_set_dai_fmt()
984 return -EINVAL; in isabelle_set_dai_fmt()
987 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in isabelle_set_dai_fmt()
998 return -EINVAL; in isabelle_set_dai_fmt()
1043 .name = "isabelle-dl1",
1054 .name = "isabelle-dl2",
1065 .name = "isabelle-lineout",
1076 .name = "isabelle-ul",
1118 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", in isabelle_i2c_probe()
1124 ret = devm_snd_soc_register_component(&i2c->dev, in isabelle_i2c_probe()
1128 dev_err(&i2c->dev, "Failed to register component: %d\n", ret); in isabelle_i2c_probe()