Переглянути джерело

Merge "asoc: Add xt logging disable mixer control"

qctecmdr 5 роки тому
батько
коміт
7f8cef00df
1 змінених файлів з 50 додано та 2 видалено
  1. 50 2
      asoc/msm-dai-q6-v2.c

+ 50 - 2
asoc/msm-dai-q6-v2.c

@@ -231,6 +231,7 @@ struct msm_dai_q6_dai_data {
 	struct afe_dec_config dec_config;
 	union afe_port_config port_config;
 	u16 vi_feed_mono;
+	u32 xt_logging_disable;
 };
 
 struct msm_dai_q6_spdif_dai_data {
@@ -345,6 +346,15 @@ static const struct soc_enum sb_config_enum[] = {
 	SOC_ENUM_SINGLE_EXT(3, sb_format),
 };
 
+static const char * const xt_logging_disable_text[] = {
+	"FALSE",
+	"TRUE",
+};
+
+static const struct soc_enum xt_logging_disable_enum[] = {
+	SOC_ENUM_SINGLE_EXT(2, xt_logging_disable_text),
+};
+
 static const char *const tdm_data_format[] = {
 	"LPCM",
 	"Compr",
@@ -2729,8 +2739,9 @@ static int msm_dai_q6_spk_digital_mute(struct snd_soc_dai *dai,
 				       int mute)
 {
 	int port_id = dai->id;
+	struct msm_dai_q6_dai_data *dai_data = dev_get_drvdata(dai->dev);
 
-	if (mute)
+	if (mute && !dai_data->xt_logging_disable)
 		afe_get_sp_xt_logging_data(port_id);
 
 	return 0;
@@ -2777,6 +2788,27 @@ static int msm_dai_q6_cal_info_get(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
+static int msm_dai_q6_xt_logging_disable_put(struct snd_kcontrol *kcontrol,
+				    struct snd_ctl_elem_value *ucontrol)
+{
+	struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
+
+	dai_data->xt_logging_disable = ucontrol->value.integer.value[0];
+	pr_debug("%s: setting xt logging disable to %d\n",
+		__func__, dai_data->xt_logging_disable);
+
+	return 0;
+}
+
+static int msm_dai_q6_xt_logging_disable_get(struct snd_kcontrol *kcontrol,
+				    struct snd_ctl_elem_value *ucontrol)
+{
+	struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data;
+
+	ucontrol->value.integer.value[0] = dai_data->xt_logging_disable;
+	return 0;
+}
+
 static int msm_dai_q6_sb_format_put(struct snd_kcontrol *kcontrol,
 				    struct snd_ctl_elem_value *ucontrol)
 {
@@ -3636,7 +3668,10 @@ static const struct snd_kcontrol_new sb_config_controls[] = {
 		     msm_dai_q6_cal_info_put),
 	SOC_ENUM_EXT("SLIM_2_RX Format", sb_config_enum[0],
 		     msm_dai_q6_sb_format_get,
-		     msm_dai_q6_sb_format_put)
+		     msm_dai_q6_sb_format_put),
+	SOC_ENUM_EXT("SLIM_0_RX XTLoggingDisable", xt_logging_disable_enum[0],
+		     msm_dai_q6_xt_logging_disable_get,
+		     msm_dai_q6_xt_logging_disable_put),
 };
 
 static const struct snd_kcontrol_new rt_proxy_config_controls[] = {
@@ -3827,6 +3862,9 @@ static int msm_dai_q6_dai_probe(struct snd_soc_dai *dai)
 		rc = snd_ctl_add(dai->component->card->snd_card,
 				snd_ctl_new1(&avd_drift_config_controls[0],
 					dai));
+		rc = snd_ctl_add(dai->component->card->snd_card,
+				 snd_ctl_new1(&sb_config_controls[3],
+				 dai_data));
 		break;
 	case SLIMBUS_6_RX:
 		rc = snd_ctl_add(dai->component->card->snd_card,
@@ -11189,10 +11227,15 @@ static int msm_dai_q6_cdc_dma_format_get(struct snd_kcontrol *kcontrol,
 		dai_data->port_config.cdc_dma.data_format;
 	return 0;
 }
+
 static const struct snd_kcontrol_new cdc_dma_config_controls[] = {
 	SOC_ENUM_EXT("WSA_CDC_DMA_0 TX Format", cdc_dma_config_enum[0],
 		     msm_dai_q6_cdc_dma_format_get,
 		     msm_dai_q6_cdc_dma_format_put),
+	SOC_ENUM_EXT("WSA_CDC_DMA_0 RX XTLoggingDisable",
+		     xt_logging_disable_enum[0],
+		     msm_dai_q6_xt_logging_disable_get,
+		     msm_dai_q6_xt_logging_disable_put),
 };
 
 /* SOC probe for codec DMA interface */
@@ -11219,6 +11262,11 @@ static int msm_dai_q6_dai_cdc_dma_probe(struct snd_soc_dai *dai)
 				 snd_ctl_new1(&cdc_dma_config_controls[0],
 				 dai_data));
 		break;
+	case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
+		rc = snd_ctl_add(dai->component->card->snd_card,
+				 snd_ctl_new1(&cdc_dma_config_controls[1],
+				 dai_data));
+		break;
 	default:
 		break;
 	}