Lines Matching +full:mute +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) ST-Ericsson SA 2012
8 * for ST-Ericsson.
14 * for ST-Ericsson.
29 #include <linux/mfd/abx500/ab8500-sysctrl.h>
30 #include <linux/mfd/abx500/ab8500-codec.h>
39 #include <sound/soc-dapm.h>
42 #include "ab8500-codec.h"
56 /* Nr of FIR/IIR-coeff banks in ANC-block */
114 /* Private data for AB8500 device-driver */
157 /* Read a register from the audio-bank of AB8500 */
172 /* Write to a register in the audio-bank of AB8500 */
188 * Controls - DAPM
215 /* Speaker Left - ANC selector */
223 /* Speaker Right - ANC selector */
232 /* Mic 1 - Mic 1a or 1b selector */
240 /* Mic 1 - AD3 - Mic 1 or DMic 3 selector */
248 /* Mic 1 - AD6 - Mic 1 or DMic 6 selector */
258 /* Mic 2 - AD5 - Mic 2 or DMic 5 selector */
268 /* LineIn left - AD1 - LineIn Left or DMic 1 selector */
276 /* LineIn right - Mic 2 or LineIn Right selector */
284 /* LineIn right - AD2 - LineIn Right or DMic2 selector */
303 /* ANC - Enable/Disable */
309 /* ANC to Earpiece - Mute */
319 /* Sidetone left - Input selector */
331 /* Sidetone right - Input selector */
360 * DAPM-widgets
369 SND_SOC_DAPM_REGULATOR_SUPPLY("V-AUD", 0, 0),
370 SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC1", 0, 0),
371 SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC2", 0, 0),
372 SND_SOC_DAPM_REGULATOR_SUPPLY("V-DMIC", 0, 0),
412 SND_SOC_DAPM_DAC("DA1 Enable", "ab8500_0p",
414 SND_SOC_DAPM_DAC("DA2 Enable", "ab8500_0p",
426 SND_SOC_DAPM_MIXER("HSL DAC Mute", AB8500_MUTECONF,
429 SND_SOC_DAPM_MIXER("HSR DAC Mute", AB8500_MUTECONF,
437 SND_SOC_DAPM_MIXER("HSL Mute",
440 SND_SOC_DAPM_MIXER("HSR Mute",
443 SND_SOC_DAPM_MIXER("HSL Enable",
446 SND_SOC_DAPM_MIXER("HSR Enable",
471 SND_SOC_DAPM_MIXER("LOL Enable",
474 SND_SOC_DAPM_MIXER("LOR Enable",
488 SND_SOC_DAPM_MIXER("EAR Mute",
491 SND_SOC_DAPM_MIXER("EAR Enable",
521 SND_SOC_DAPM_MIXER("HFL Enable",
524 SND_SOC_DAPM_MIXER("HFR Enable",
552 SND_SOC_DAPM_MIXER("VIB1 Enable",
555 SND_SOC_DAPM_MIXER("VIB2 Enable",
568 SND_SOC_DAPM_MIXER("MIC1 Mute",
571 SND_SOC_DAPM_MIXER("MIC1A V-AMICx Enable",
574 SND_SOC_DAPM_MIXER("MIC1B V-AMICx Enable",
585 SND_SOC_DAPM_MIXER("AD3 Enable",
593 SND_SOC_DAPM_MIXER("MIC2 Mute",
596 SND_SOC_DAPM_MIXER("MIC2 V-AMICx Enable", AB8500_ANACONF2,
605 SND_SOC_DAPM_MIXER("LINL Mute",
608 SND_SOC_DAPM_MIXER("LINR Mute",
611 SND_SOC_DAPM_MIXER("LINL Enable", AB8500_ANACONF2,
614 SND_SOC_DAPM_MIXER("LINR Enable", AB8500_ANACONF2,
646 SND_SOC_DAPM_MIXER("AD12 Enable",
662 SND_SOC_DAPM_MIXER("AD57 Enable",
665 SND_SOC_DAPM_MIXER("AD68 Enable",
699 SND_SOC_DAPM_MIXER("AD4 Enable",
741 * DAPM-routes
744 /* Power AB8500 audio-block when AD/DA is active */
745 {"Main Supply", NULL, "V-AUD"},
772 {"DA1 Enable", NULL, "DA_IN1"},
773 {"DA2 Enable", NULL, "DA_IN2"},
775 {"HSL Digital Volume", NULL, "DA1 Enable"},
776 {"HSR Digital Volume", NULL, "DA2 Enable"},
781 {"HSL DAC Mute", NULL, "HSL DAC"},
782 {"HSR DAC Mute", NULL, "HSR DAC"},
784 {"HSL DAC Driver", NULL, "HSL DAC Mute"},
785 {"HSR DAC Driver", NULL, "HSR DAC Mute"},
787 {"HSL Mute", NULL, "HSL DAC Driver"},
788 {"HSR Mute", NULL, "HSR DAC Driver"},
790 {"HSL Enable", NULL, "HSL Mute"},
791 {"HSR Enable", NULL, "HSR Mute"},
793 {"HSL Volume", NULL, "HSL Enable"},
794 {"HSR Volume", NULL, "HSR Enable"},
817 {"HFL Enable", NULL, "HFL DAC"},
818 {"HFR Enable", NULL, "HFR DAC"},
820 {"Speaker Left", NULL, "HFL Enable"},
821 {"Speaker Right", NULL, "HFR Enable"},
832 {"EAR Mute", NULL, "EAR DAC"},
834 {"EAR Enable", NULL, "EAR Mute"},
836 {"Earpiece", NULL, "EAR Enable"},
852 {"LOL Enable", NULL, "LOL Disable HFL"},
853 {"LOR Enable", NULL, "LOR Disable HFR"},
855 {"LineOut Left", NULL, "LOL Enable"},
856 {"LineOut Right", NULL, "LOR Enable"},
873 {"VIB1 Enable", NULL, "Vibra 1 Controller"},
874 {"VIB2 Enable", NULL, "Vibra 2 Controller"},
876 {"Vibra 1", NULL, "VIB1 Enable"},
877 {"Vibra 2", NULL, "VIB2 Enable"},
882 {"MIC2 V-AMICx Enable", NULL, "Mic 2"},
885 {"LINL Mute", NULL, "LineIn Left"},
886 {"LINR Mute", NULL, "LineIn Right"},
888 {"LINL Enable", NULL, "LINL Mute"},
889 {"LINR Enable", NULL, "LINR Mute"},
892 {"Mic 2 or LINR Select", "LineIn Right", "LINR Enable"},
893 {"Mic 2 or LINR Select", "Mic 2", "MIC2 V-AMICx Enable"},
895 {"LINL ADC", NULL, "LINL Enable"},
904 {"AD12 Enable", NULL, "AD1 Channel Volume"},
905 {"AD12 Enable", NULL, "AD2 Channel Volume"},
908 {"AD_OUT1", NULL, "AD12 Enable"},
910 {"AD_OUT2", NULL, "AD12 Enable"},
914 {"MIC1 Mute", NULL, "Mic 1"},
916 {"MIC1A V-AMICx Enable", NULL, "MIC1 Mute"},
917 {"MIC1B V-AMICx Enable", NULL, "MIC1 Mute"},
919 {"Mic 1a or 1b Select", "Mic 1a", "MIC1A V-AMICx Enable"},
920 {"Mic 1a or 1b Select", "Mic 1b", "MIC1B V-AMICx Enable"},
928 {"AD3 Enable", NULL, "AD3 Channel Volume"},
931 {"AD_OUT3", NULL, "AD3 Enable"},
941 {"AD57 Enable", NULL, "AD5 Channel Volume"},
942 {"AD68 Enable", NULL, "AD6 Channel Volume"},
945 {"AD_OUT57", NULL, "AD57 Enable"},
947 {"AD_OUT68", NULL, "AD68 Enable"},
951 {"DMic 1", NULL, "V-DMIC"},
952 {"DMic 2", NULL, "V-DMIC"},
953 {"DMic 3", NULL, "V-DMIC"},
954 {"DMic 4", NULL, "V-DMIC"},
955 {"DMic 5", NULL, "V-DMIC"},
956 {"DMic 6", NULL, "V-DMIC"},
965 {"AD4 Enable", NULL, "AD4 Channel Volume"},
968 {"AD_OUT4", NULL, "AD4 Enable"},
972 {"LINL to HSL Volume", NULL, "LINL Enable"},
973 {"LINR to HSR Volume", NULL, "LINR Enable"},
993 {"Sidetone Left Source", "LineIn Left", "AD12 Enable"},
994 {"Sidetone Left Source", "LineIn Right", "AD12 Enable"},
995 {"Sidetone Left Source", "Mic 1", "AD3 Enable"},
997 {"Sidetone Right Source", "LineIn Right", "AD12 Enable"},
998 {"Sidetone Right Source", "Mic 1", "AD3 Enable"},
999 {"Sidetone Right Source", "DMic 4", "AD4 Enable"},
1008 {"DA1 Enable", NULL, "STFIR1 Volume"},
1009 {"DA2 Enable", NULL, "STFIR2 Volume"},
1013 {"MIC1A V-AMICx Enable", NULL, "V-AMIC1"},
1014 {"MIC1A V-AMICx Enable", NULL, "V-AMIC2"},
1018 {"MIC1B V-AMICx Enable", NULL, "V-AMIC1"},
1019 {"MIC1B V-AMICx Enable", NULL, "V-AMIC2"},
1023 {"MIC2 V-AMICx Enable", NULL, "V-AMIC1"},
1024 {"MIC2 V-AMICx Enable", NULL, "V-AMIC2"},
1027 /* ANC FIR-coefficients configuration sequence */
1039 if (par == AB8500_ANC_FIR_COEFFS - 1 && bnk == 1) in anc_fir()
1044 /* ANC IIR-coefficients configuration sequence */
1070 if (par == AB8500_ANC_IIR_COEFFS - 1 && bnk == 1) in anc_iir()
1075 /* ANC IIR-/FIR-coefficients configuration sequence */
1079 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(component->dev); in anc_configure()
1082 dev_dbg(component->dev, "%s: Enter.\n", __func__); in anc_configure()
1095 drvdata->anc_fir_values[par]); in anc_configure()
1103 drvdata->anc_iir_values[par]); in anc_configure()
1107 dev_dbg(component->dev, "%s: Exit.\n", __func__); in anc_configure()
1111 * Control-events
1118 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(component->dev); in sid_status_control_get()
1120 mutex_lock(&drvdata->ctrl_lock); in sid_status_control_get()
1121 ucontrol->value.enumerated.item[0] = drvdata->sid_status; in sid_status_control_get()
1122 mutex_unlock(&drvdata->ctrl_lock); in sid_status_control_get()
1127 /* Write sidetone FIR-coefficients configuration sequence */
1132 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(component->dev); in sid_status_control_put()
1136 dev_dbg(component->dev, "%s: Enter\n", __func__); in sid_status_control_put()
1138 if (ucontrol->value.enumerated.item[0] != SID_APPLY_FIR) { in sid_status_control_put()
1139 dev_err(component->dev, in sid_status_control_put()
1142 return -EIO; in sid_status_control_put()
1145 mutex_lock(&drvdata->ctrl_lock); in sid_status_control_put()
1150 dev_err(component->dev, "%s: Sidetone busy while off!\n", in sid_status_control_put()
1152 status = -EPERM; in sid_status_control_put()
1154 status = -EBUSY; in sid_status_control_put()
1162 val = snd_soc_component_read(component, drvdata->sid_fir_values[param]); in sid_status_control_put()
1173 drvdata->sid_status = SID_FIR_CONFIGURED; in sid_status_control_put()
1176 mutex_unlock(&drvdata->ctrl_lock); in sid_status_control_put()
1178 dev_dbg(component->dev, "%s: Exit\n", __func__); in sid_status_control_put()
1187 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(component->dev); in anc_status_control_get()
1189 mutex_lock(&drvdata->ctrl_lock); in anc_status_control_get()
1190 ucontrol->value.enumerated.item[0] = drvdata->anc_status; in anc_status_control_get()
1191 mutex_unlock(&drvdata->ctrl_lock); in anc_status_control_get()
1201 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(component->dev); in anc_status_control_put()
1202 struct device *dev = component->dev; in anc_status_control_put()
1209 mutex_lock(&drvdata->ctrl_lock); in anc_status_control_put()
1211 req = ucontrol->value.enumerated.item[0]; in anc_status_control_put()
1213 status = -EINVAL; in anc_status_control_put()
1220 status = -EINVAL; in anc_status_control_put()
1229 "%s: ERROR: Failed to enable power (status = %d)!\n", in anc_status_control_put()
1238 if (drvdata->anc_status == ANC_IIR_CONFIGURED) in anc_status_control_put()
1239 drvdata->anc_status = ANC_FIR_IIR_CONFIGURED; in anc_status_control_put()
1240 else if (drvdata->anc_status != ANC_FIR_IIR_CONFIGURED) in anc_status_control_put()
1241 drvdata->anc_status = ANC_FIR_CONFIGURED; in anc_status_control_put()
1244 if (drvdata->anc_status == ANC_FIR_CONFIGURED) in anc_status_control_put()
1245 drvdata->anc_status = ANC_FIR_IIR_CONFIGURED; in anc_status_control_put()
1246 else if (drvdata->anc_status != ANC_FIR_IIR_CONFIGURED) in anc_status_control_put()
1247 drvdata->anc_status = ANC_IIR_CONFIGURED; in anc_status_control_put()
1254 mutex_unlock(&drvdata->ctrl_lock); in anc_status_control_put()
1269 (struct filter_control *)kcontrol->private_value; in filter_control_info()
1271 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in filter_control_info()
1272 uinfo->count = fc->count; in filter_control_info()
1273 uinfo->value.integer.min = fc->min; in filter_control_info()
1274 uinfo->value.integer.max = fc->max; in filter_control_info()
1285 (struct filter_control *)kcontrol->private_value; in filter_control_get()
1288 mutex_lock(&drvdata->ctrl_lock); in filter_control_get()
1289 for (i = 0; i < fc->count; i++) in filter_control_get()
1290 ucontrol->value.integer.value[i] = fc->value[i]; in filter_control_get()
1291 mutex_unlock(&drvdata->ctrl_lock); in filter_control_get()
1302 (struct filter_control *)kcontrol->private_value; in filter_control_put()
1305 mutex_lock(&drvdata->ctrl_lock); in filter_control_put()
1306 for (i = 0; i < fc->count; i++) in filter_control_put()
1307 fc->value[i] = ucontrol->value.integer.value[i]; in filter_control_put()
1308 mutex_unlock(&drvdata->ctrl_lock); in filter_control_put()
1314 * Controls - Non-DAPM ASoC
1317 static DECLARE_TLV_DB_SCALE(adx_dig_gain_tlv, -3200, 100, 1);
1318 /* -32dB = Mute */
1320 static DECLARE_TLV_DB_SCALE(dax_dig_gain_tlv, -6300, 100, 1);
1321 /* -63dB = Mute */
1323 static DECLARE_TLV_DB_SCALE(hs_ear_dig_gain_tlv, -100, 100, 1);
1324 /* -1dB = Mute */
1327 0, 3, TLV_DB_SCALE_ITEM(-3200, 400, 0),
1328 4, 15, TLV_DB_SCALE_ITEM(-1800, 200, 0)
1333 static DECLARE_TLV_DB_SCALE(lin_gain_tlv, -1000, 200, 0);
1335 static DECLARE_TLV_DB_SCALE(lin2hs_gain_tlv, -3800, 200, 1);
1336 /* -38dB = Mute */
1410 /* Digital interface - DA from slot mapping */
1468 /* Digital interface - AD to slot mapping */
1582 /* Digital interface - Burst mode */
1772 /* Digital interface - DA from slot mapping */
1782 /* Digital interface - AD to slot mapping */
1816 /* Digital interface - Loopback */
1842 /* Digital interface - Burst FIFO */
1843 SOC_SINGLE("Digital Interface 0 FIFO Enable Switch",
1847 SOC_ENUM("Burst FIFO Bit-clock Frequency", soc_enum_bfifo19m2),
1857 SOC_SINGLE("Burst FIFO FS Extra Bit-clocks",
1914 * Extended interface for codec-driver
1921 dev_dbg(component->dev, "%s: Enter.\n", __func__); in ab8500_audio_init_audioblock()
1923 /* Reset audio-registers and disable 32kHz-clock output 2 */ in ab8500_audio_init_audioblock()
1943 dev_dbg(component->dev, "%s: Enter.\n", __func__); in ab8500_audio_setup_mics()
1945 /* Set DMic-clocks to outputs */ in ab8500_audio_setup_mics()
1946 status = abx500_get_register_interruptible(component->dev, AB8500_MISC, in ab8500_audio_setup_mics()
1953 status = abx500_set_register_interruptible(component->dev, in ab8500_audio_setup_mics()
1960 /* Attach regulators to AMic DAPM-paths */ in ab8500_audio_setup_mics()
1961 dev_dbg(component->dev, "%s: Mic 1a regulator: %s\n", __func__, in ab8500_audio_setup_mics()
1962 amic_micbias_str(amics->mic1a_micbias)); in ab8500_audio_setup_mics()
1963 route = &ab8500_dapm_routes_mic1a_vamicx[amics->mic1a_micbias]; in ab8500_audio_setup_mics()
1965 dev_dbg(component->dev, "%s: Mic 1b regulator: %s\n", __func__, in ab8500_audio_setup_mics()
1966 amic_micbias_str(amics->mic1b_micbias)); in ab8500_audio_setup_mics()
1967 route = &ab8500_dapm_routes_mic1b_vamicx[amics->mic1b_micbias]; in ab8500_audio_setup_mics()
1969 dev_dbg(component->dev, "%s: Mic 2 regulator: %s\n", __func__, in ab8500_audio_setup_mics()
1970 amic_micbias_str(amics->mic2_micbias)); in ab8500_audio_setup_mics()
1971 route = &ab8500_dapm_routes_mic2_vamicx[amics->mic2_micbias]; in ab8500_audio_setup_mics()
1974 dev_err(component->dev, in ab8500_audio_setup_mics()
1975 "%s: Failed to add AMic-regulator DAPM-routes (%d).\n", in ab8500_audio_setup_mics()
1980 /* Set AMic-configuration */ in ab8500_audio_setup_mics()
1981 dev_dbg(component->dev, "%s: Mic 1 mic-type: %s\n", __func__, in ab8500_audio_setup_mics()
1982 amic_type_str(amics->mic1_type)); in ab8500_audio_setup_mics()
1984 amics->mic1_type == AMIC_TYPE_DIFFERENTIAL ? in ab8500_audio_setup_mics()
1986 dev_dbg(component->dev, "%s: Mic 2 mic-type: %s\n", __func__, in ab8500_audio_setup_mics()
1987 amic_type_str(amics->mic2_type)); in ab8500_audio_setup_mics()
1989 amics->mic2_type == AMIC_TYPE_DIFFERENTIAL ? in ab8500_audio_setup_mics()
2014 dev_err(component->dev, in ab8500_audio_set_ear_cmv()
2015 "%s: Unknown earpiece CM-voltage (%d)!\n", in ab8500_audio_set_ear_cmv()
2017 return -EINVAL; in ab8500_audio_set_ear_cmv()
2019 dev_dbg(component->dev, "%s: Earpiece CM-voltage: %s\n", __func__, in ab8500_audio_set_ear_cmv()
2031 struct snd_soc_component *component = dai->component; in ab8500_audio_set_bit_delay()
2043 dev_err(dai->component->dev, in ab8500_audio_set_bit_delay()
2044 "%s: ERROR: Unsupported bit-delay (0x%x)!\n", in ab8500_audio_set_bit_delay()
2046 return -EINVAL; in ab8500_audio_set_bit_delay()
2049 dev_dbg(dai->component->dev, "%s: IF0 Bit-delay: %d bits.\n", in ab8500_audio_set_bit_delay()
2070 dev_dbg(component->dev, "%s: IF0 Clock is continuous.\n", in ab8500_codec_set_dai_clock_gate()
2075 dev_dbg(component->dev, "%s: IF0 Clock is gated.\n", in ab8500_codec_set_dai_clock_gate()
2079 dev_err(component->dev, in ab8500_codec_set_dai_clock_gate()
2082 return -EINVAL; in ab8500_codec_set_dai_clock_gate()
2094 struct snd_soc_component *component = dai->component; in ab8500_codec_set_dai_fmt()
2097 dev_dbg(component->dev, "%s: Enter (fmt = 0x%x)\n", __func__, fmt); in ab8500_codec_set_dai_fmt()
2107 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2108 "%s: IF0 Master-mode: AB8500 provider.\n", __func__); in ab8500_codec_set_dai_fmt()
2112 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2113 "%s: IF0 Master-mode: AB8500 consumer.\n", __func__); in ab8500_codec_set_dai_fmt()
2117 dev_err(dai->component->dev, in ab8500_codec_set_dai_fmt()
2122 dev_err(dai->component->dev, in ab8500_codec_set_dai_fmt()
2125 return -EINVAL; in ab8500_codec_set_dai_fmt()
2133 dev_err(dai->component->dev, in ab8500_codec_set_dai_fmt()
2149 dev_dbg(dai->component->dev, "%s: IF0 Protocol: I2S\n", __func__); in ab8500_codec_set_dai_fmt()
2155 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2162 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2169 dev_err(dai->component->dev, in ab8500_codec_set_dai_fmt()
2172 return -EINVAL; in ab8500_codec_set_dai_fmt()
2177 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2182 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2188 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2194 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_fmt()
2201 dev_err(dai->component->dev, in ab8500_codec_set_dai_fmt()
2204 return -EINVAL; in ab8500_codec_set_dai_fmt()
2216 struct snd_soc_component *component = dai->component; in ab8500_codec_set_dai_tdm_slot()
2237 dev_err(dai->component->dev, "%s: Unsupported slot-width 0x%x\n", in ab8500_codec_set_dai_tdm_slot()
2239 return -EINVAL; in ab8500_codec_set_dai_tdm_slot()
2242 dev_dbg(dai->component->dev, "%s: IF0 slot-width: %d bits.\n", in ab8500_codec_set_dai_tdm_slot()
2247 dev_dbg(dai->component->dev, "%s: Slots, total: %d\n", __func__, slots); in ab8500_codec_set_dai_tdm_slot()
2265 dev_err(dai->component->dev, in ab8500_codec_set_dai_tdm_slot()
2268 return -EINVAL; in ab8500_codec_set_dai_tdm_slot()
2275 return -EINVAL; in ab8500_codec_set_dai_tdm_slot()
2281 dev_dbg(dai->component->dev, "%s: Slots, active, TX: %d\n", __func__, in ab8500_codec_set_dai_tdm_slot()
2303 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_tdm_slot()
2304 "%s: In 8-channel mode DA-from-slot mapping is set manually.", in ab8500_codec_set_dai_tdm_slot()
2308 dev_err(dai->component->dev, in ab8500_codec_set_dai_tdm_slot()
2309 "%s: Unsupported number of active TX-slots (%d)!\n", in ab8500_codec_set_dai_tdm_slot()
2311 return -EINVAL; in ab8500_codec_set_dai_tdm_slot()
2314 /* Setup TDM AD according to active RX-slots */ in ab8500_codec_set_dai_tdm_slot()
2317 return -EINVAL; in ab8500_codec_set_dai_tdm_slot()
2322 dev_dbg(dai->component->dev, "%s: Slots, active, RX: %d\n", __func__, in ab8500_codec_set_dai_tdm_slot()
2347 dev_dbg(dai->component->dev, in ab8500_codec_set_dai_tdm_slot()
2348 "%s: In 8-channel mode AD-to-slot mapping is set manually.", in ab8500_codec_set_dai_tdm_slot()
2352 dev_err(dai->component->dev, in ab8500_codec_set_dai_tdm_slot()
2353 "%s: Unsupported number of active RX-slots (%d)!\n", in ab8500_codec_set_dai_tdm_slot()
2355 return -EINVAL; in ab8500_codec_set_dai_tdm_slot()
2368 .name = "ab8500-codec-dai.0",
2381 .name = "ab8500-codec-dai.1",
2400 if (of_property_read_bool(np, "stericsson,amic1-type-single-ended")) in ab8500_codec_of_probe()
2401 codec->amics.mic1_type = AMIC_TYPE_SINGLE_ENDED; in ab8500_codec_of_probe()
2403 codec->amics.mic1_type = AMIC_TYPE_DIFFERENTIAL; in ab8500_codec_of_probe()
2405 if (of_property_read_bool(np, "stericsson,amic2-type-single-ended")) in ab8500_codec_of_probe()
2406 codec->amics.mic2_type = AMIC_TYPE_SINGLE_ENDED; in ab8500_codec_of_probe()
2408 codec->amics.mic2_type = AMIC_TYPE_DIFFERENTIAL; in ab8500_codec_of_probe()
2410 /* Has a non-standard Vamic been requested? */ in ab8500_codec_of_probe()
2411 if (of_property_read_bool(np, "stericsson,amic1a-bias-vamic2")) in ab8500_codec_of_probe()
2412 codec->amics.mic1a_micbias = AMIC_MICBIAS_VAMIC2; in ab8500_codec_of_probe()
2414 codec->amics.mic1a_micbias = AMIC_MICBIAS_VAMIC1; in ab8500_codec_of_probe()
2416 if (of_property_read_bool(np, "stericsson,amic1b-bias-vamic2")) in ab8500_codec_of_probe()
2417 codec->amics.mic1b_micbias = AMIC_MICBIAS_VAMIC2; in ab8500_codec_of_probe()
2419 codec->amics.mic1b_micbias = AMIC_MICBIAS_VAMIC1; in ab8500_codec_of_probe()
2421 if (of_property_read_bool(np, "stericsson,amic2-bias-vamic1")) in ab8500_codec_of_probe()
2422 codec->amics.mic2_micbias = AMIC_MICBIAS_VAMIC1; in ab8500_codec_of_probe()
2424 codec->amics.mic2_micbias = AMIC_MICBIAS_VAMIC2; in ab8500_codec_of_probe()
2426 if (!of_property_read_u32(np, "stericsson,earpeice-cmv", &value)) { in ab8500_codec_of_probe()
2429 codec->ear_cmv = EAR_CMV_0_95V; in ab8500_codec_of_probe()
2432 codec->ear_cmv = EAR_CMV_1_10V; in ab8500_codec_of_probe()
2435 codec->ear_cmv = EAR_CMV_1_27V; in ab8500_codec_of_probe()
2438 codec->ear_cmv = EAR_CMV_1_58V; in ab8500_codec_of_probe()
2441 codec->ear_cmv = EAR_CMV_UNKNOWN; in ab8500_codec_of_probe()
2445 dev_warn(dev, "No earpiece voltage found in DT - using default\n"); in ab8500_codec_of_probe()
2446 codec->ear_cmv = EAR_CMV_0_95V; in ab8500_codec_of_probe()
2453 struct device *dev = component->dev; in ab8500_codec_probe()
2454 struct device_node *np = dev->of_node; in ab8500_codec_probe()
2471 pr_err("%s: Failed to set earpiece CM-voltage (%d)!\n", in ab8500_codec_probe()
2478 dev_err(dev, "%s: failed to init audio-block (%d)!\n", in ab8500_codec_probe()
2483 /* Override HW-defaults */ in ab8500_codec_probe()
2500 drvdata->anc_fir_values = (long *)fc->value; in ab8500_codec_probe()
2503 drvdata->anc_iir_values = (long *)fc->value; in ab8500_codec_probe()
2506 drvdata->sid_fir_values = (long *)fc->value; in ab8500_codec_probe()
2510 mutex_init(&drvdata->ctrl_lock); in ab8500_codec_probe()
2533 dev_dbg(&pdev->dev, "%s: Enter.\n", __func__); in ab8500_codec_driver_probe()
2535 /* Create driver private-data struct */ in ab8500_codec_driver_probe()
2536 drvdata = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_codec_drvdata), in ab8500_codec_driver_probe()
2539 return -ENOMEM; in ab8500_codec_driver_probe()
2540 drvdata->sid_status = SID_UNCONFIGURED; in ab8500_codec_driver_probe()
2541 drvdata->anc_status = ANC_UNCONFIGURED; in ab8500_codec_driver_probe()
2542 dev_set_drvdata(&pdev->dev, drvdata); in ab8500_codec_driver_probe()
2544 drvdata->regmap = devm_regmap_init(&pdev->dev, NULL, &pdev->dev, in ab8500_codec_driver_probe()
2546 if (IS_ERR(drvdata->regmap)) { in ab8500_codec_driver_probe()
2547 status = PTR_ERR(drvdata->regmap); in ab8500_codec_driver_probe()
2548 dev_err(&pdev->dev, "%s: Failed to allocate regmap: %d\n", in ab8500_codec_driver_probe()
2553 dev_dbg(&pdev->dev, "%s: Register codec.\n", __func__); in ab8500_codec_driver_probe()
2554 status = devm_snd_soc_register_component(&pdev->dev, in ab8500_codec_driver_probe()
2559 dev_err(&pdev->dev, in ab8500_codec_driver_probe()
2568 .name = "ab8500-codec",