Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8cba0b7 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge d5397f5c on remote branch

Change-Id: I664ca992203a6d8050bbd9c0bf466091588d686f
parents 0649e653 d5397f5c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2690,6 +2690,7 @@ static int tx_macro_tx_va_mclk_enable(struct tx_macro_priv *tx_priv,
			}
			bolero_clk_rsc_fs_gen_request(tx_priv->dev,
						  true);
			mutex_lock(&tx_priv->mclk_lock);
			if (tx_priv->tx_mclk_users == 0) {
				regmap_update_bits(regmap,
					BOLERO_CDC_TX_TOP_CSR_FREQ_MCLK,
@@ -2702,6 +2703,7 @@ static int tx_macro_tx_va_mclk_enable(struct tx_macro_priv *tx_priv,
					0x01, 0x01);
			}
			tx_priv->tx_mclk_users++;
			mutex_unlock(&tx_priv->mclk_lock);
		}
		if (tx_priv->swr_clk_users == 0) {
			dev_dbg(tx_priv->dev, "%s: reset_swr: %d\n",
@@ -2746,10 +2748,12 @@ static int tx_macro_tx_va_mclk_enable(struct tx_macro_priv *tx_priv,
		if (clk_type == TX_MCLK)
			tx_macro_mclk_enable(tx_priv, 0);
		if (clk_type == VA_MCLK) {
			mutex_lock(&tx_priv->mclk_lock);
			if (tx_priv->tx_mclk_users <= 0) {
				dev_err(tx_priv->dev, "%s: clock already disabled\n",
						__func__);
				tx_priv->tx_mclk_users = 0;
				mutex_unlock(&tx_priv->mclk_lock);
				goto tx_clk;
			}
			tx_priv->tx_mclk_users--;
@@ -2761,7 +2765,7 @@ static int tx_macro_tx_va_mclk_enable(struct tx_macro_priv *tx_priv,
					BOLERO_CDC_TX_CLK_RST_CTRL_MCLK_CONTROL,
					0x01, 0x00);
			}

			mutex_unlock(&tx_priv->mclk_lock);
			bolero_clk_rsc_fs_gen_request(tx_priv->dev,
						false);
			ret = bolero_clk_rsc_request_clock(tx_priv->dev,
+10 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -132,6 +132,8 @@ static int wsa883x_get_temperature(struct snd_soc_component *component,
enum {
	WSA8830 = 0,
	WSA8835,
	WSA8832,
	WSA8835_V2 = 5,
};

enum {
@@ -721,7 +723,11 @@ static ssize_t wsa883x_variant_read(struct snd_info_entry *entry,
	case WSA8830:
		len = snprintf(buffer, sizeof(buffer), "WSA8830\n");
		break;
	case WSA8832:
		len = snprintf(buffer, sizeof(buffer), "WSA8832\n");
		break;
	case WSA8835:
	case WSA8835_V2:
		len = snprintf(buffer, sizeof(buffer), "WSA8835\n");
		break;
	default:
@@ -1098,7 +1104,8 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w,
			snd_soc_component_update_bits(component,
						WSA883X_DRE_CTL_0,
						0xF0, 0x90);
			if (wsa883x->variant == WSA8830)
			if (wsa883x->variant == WSA8830 ||
				wsa883x->variant == WSA8832)
				snd_soc_component_update_bits(component,
						WSA883X_DRE_CTL_0,
						0x07, 0x03);
@@ -1218,7 +1225,7 @@ static void wsa883x_codec_init(struct snd_soc_component *component)
		snd_soc_component_update_bits(component, reg_init[i].reg,
					reg_init[i].mask, reg_init[i].val);

	if (wsa883x->variant == WSA8830)
	if (wsa883x->variant == WSA8830 || wsa883x->variant == WSA8832)
		snd_soc_component_update_bits(component, WSA883X_DRE_CTL_0,
					0x07, 0x03);
}
+6 −0
Original line number Diff line number Diff line
@@ -4325,6 +4325,9 @@ static const struct snd_kcontrol_new afe_dec_config_controls[] = {
	SOC_ENUM_EXT("AFE Output Bit Format", afe_bit_format_enum[0],
		     msm_dai_q6_afe_output_bit_format_get,
		     msm_dai_q6_afe_output_bit_format_put),
	SOC_ENUM_EXT("AFE Output Channels SLIM7", afe_chs_enum[0],
		     msm_dai_q6_afe_output_channel_get,
		     msm_dai_q6_afe_output_channel_put),
};

static const struct snd_kcontrol_new afe_ttp_config_controls[] = {
@@ -4570,6 +4573,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(&afe_dec_config_controls[0],
				 dai_data));
		rc = snd_ctl_add(dai->component->card->snd_card,
				 snd_ctl_new1(&afe_dec_config_controls[4],
				 dai_data));
		break;
	case SLIMBUS_9_TX:
		rc = snd_ctl_add(dai->component->card->snd_card,
+75 −22
Original line number Diff line number Diff line
@@ -205,6 +205,23 @@ static void event_handler(uint32_t opcode,
		prtd->in_frame_info[buf_index].offset = payload[5];
		/* assume data size = 0 during flushing */
		if (prtd->in_frame_info[buf_index].size) {
			if ((int)substream->runtime->control->appl_ptr == 0 && prtd->in_frame_info[buf_index].size < prtd->pcm_count) {
				pr_debug("%s:skip first buffer until get full buffer size=%d: prtd->pcm_count=%d\n",
						__func__, prtd->in_frame_info[buf_index].size, prtd->pcm_count);
				memset(&prtd->in_frame_info[buf_index], 0,
						sizeof(struct msm_audio_in_frame_info));
				if (q6asm_is_cpu_buf_avail_nolock(OUT, prtd->audio_client,&size, &idx) &&
						(substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING)) {
					ret = q6asm_read_nolock(prtd->audio_client);
					if (ret < 0) {
						pr_err("%s:q6asm read failed\n",__func__);
						ret = -EFAULT;
						q6asm_cpu_buf_release_nolock(OUT, prtd->audio_client);
					}
				}
			return;
			}

			prtd->pcm_irq_pos +=
				prtd->in_frame_info[buf_index].size;
			pr_debug("pcm_irq_pos=%d\n", prtd->pcm_irq_pos);
@@ -1870,6 +1887,8 @@ static int msm_pcm_chmap_ctl_put(struct snd_kcontrol *kcontrol,
	struct msm_pcm_channel_map *chmap;
	u64 fe_id = kcontrol->private_value & 0xFF;
	int session_type = (kcontrol->private_value >> 8) & 0xFF;
	bool reset_override_out_ch_map = false;
	bool reset_override_in_ch_map = false;

	pr_debug("%s: chmap ctl for fe_id: %d, session_type: %d\n",
			__func__, fe_id, session_type);
@@ -1922,20 +1941,33 @@ static int msm_pcm_chmap_ctl_put(struct snd_kcontrol *kcontrol,
				(char)(ucontrol->value.integer.value[i]);

		/* update chmixer_pspd chmap cached with routing driver as well */
		if (rtd) {
			if (component) {
		if (rtd && component) {
			fe_id = rtd->dai_link->id;
			chmixer_pspd = pdata ?
					pdata->chmixer_pspd[fe_id][SESSION_TYPE_RX] : NULL;
				pdata->chmixer_pspd[fe_id][session_type] : NULL;

			if (chmixer_pspd && chmixer_pspd->enable) {
				if (session_type == SESSION_TYPE_RX &&
					!chmixer_pspd->override_in_ch_map) {
					for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V8; i++)
						chmixer_pspd->in_ch_map[i] = prtd->channel_map[i];
					chmixer_pspd->override_in_ch_map = true;
					msm_pcm_routing_set_channel_mixer_cfg(fe_id,
							SESSION_TYPE_RX, chmixer_pspd);
					reset_override_in_ch_map = true;
				} else if (session_type == SESSION_TYPE_TX &&
							!chmixer_pspd->override_out_ch_map) {
					for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V8; i++)
						chmixer_pspd->out_ch_map[i] = prtd->channel_map[i];
					chmixer_pspd->override_out_ch_map = true;
					reset_override_out_ch_map = true;
				}
				msm_pcm_routing_set_channel_mixer_cfg(fe_id,
						session_type, chmixer_pspd);
				if (reset_override_out_ch_map)
					chmixer_pspd->override_out_ch_map = false;
				if (reset_override_in_ch_map)
					chmixer_pspd->override_in_ch_map = false;
			}

		}
	}
	mutex_unlock(&pdata->lock);
@@ -2264,6 +2296,7 @@ static int msm_pcm_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol,
	struct snd_pcm *pcm = NULL;
	struct snd_pcm_substream *substream = NULL;
	struct msm_pcm_channel_mixer *chmixer_pspd = NULL;
	struct msm_pcm_channel_map *chmap = NULL;
	u8 asm_ch_map[PCM_FORMAT_MAX_NUM_CHANNEL_V8] = {0};
	bool reset_override_out_ch_map = false;
	bool reset_override_in_ch_map = false;
@@ -2314,15 +2347,28 @@ static int msm_pcm_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol,
		return -EINVAL;
	}
	prtd = substream->runtime ? substream->runtime->private_data : NULL;
	if (chmixer_pspd->enable && prtd) {
	chmap = msm_pcm_get_chmap(fe_id, session_type);
	if (!chmap) {
		pr_err("%s: invalid chmap handle\n", __func__);
		mutex_unlock(&pdata->lock);
		return -EINVAL;
	}

	if (chmixer_pspd->enable) {
		if (session_type == SESSION_TYPE_RX &&
			!chmixer_pspd->override_in_ch_map) {
			if (prtd->set_channel_map) {
			if (chmap->set_channel_map) {
				for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V8; i++)
					chmixer_pspd->in_ch_map[i] = prtd->channel_map[i];
					chmixer_pspd->in_ch_map[i] = chmap->channel_map[i];
			} else {
				q6asm_map_channels(asm_ch_map,
				ret = q6asm_map_channels(asm_ch_map,
						chmixer_pspd->input_channel, false);
				if (ret) {
					pr_err("%s: unsupported chnum %d\n", __func__,
					chmixer_pspd->input_channel);
					mutex_unlock(&pdata->lock);
					return -EINVAL;
				}
				for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V8; i++)
					chmixer_pspd->in_ch_map[i] = asm_ch_map[i];
			}
@@ -2330,14 +2376,21 @@ static int msm_pcm_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol,
			reset_override_in_ch_map = true;
		} else if (session_type == SESSION_TYPE_TX &&
				!chmixer_pspd->override_out_ch_map) {
			/*
			 * Channel map set in prtd is for plyback only,
			 * hence always use default for capture path.
			 */
			q6asm_map_channels(asm_ch_map,
			if (chmap->set_channel_map) {
				for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V8; i++)
					chmixer_pspd->out_ch_map[i] = chmap->channel_map[i];
			} else {
				ret = q6asm_map_channels(asm_ch_map,
						chmixer_pspd->output_channel, false);
				if (ret) {
					pr_err("%s: unsupported chnum %d\n", __func__,
					chmixer_pspd->output_channel);
					mutex_unlock(&pdata->lock);
					return -EINVAL;
				}
				for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL_V8; i++)
					chmixer_pspd->out_ch_map[i] = asm_ch_map[i];
			}
			chmixer_pspd->override_out_ch_map = true;
			reset_override_out_ch_map = true;
		}

asoc/msm-pcm-routing-v2.c

100755 → 100644
+3537 −898

File changed.File mode changed from 100755 to 100644.

Preview size limit exceeded, changes collapsed.

Loading