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

Commit 6580d442 authored by Kunlei Zhang's avatar Kunlei Zhang Committed by Gerrit - the friendly Code Review server
Browse files

asoc: Parse wcd-datalane-mismatch property to update rx frame config for khaje



Due to datalane mismatch, update rx frame config to use DATA_LANE0 for
khaje qrd.

Change-Id: I0f5720ab1d7b7c585f7df986481c28568385f09d
Signed-off-by: default avatarKunlei Zhang <kunleiz@codeaurora.org>
parent 659f37f7
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
 */

#ifndef _BENGAL_PORT_CONFIG
@@ -38,6 +38,14 @@ static struct port_params rx_frame_params_dsd[SWR_MSTR_PORT_LEN] = {
	{3,  1,  0,  0xFF, 0xFF, 0xFF, 0xFF, 3,    0},
};

static struct port_params rx_frame_params_khaje[SWR_MSTR_PORT_LEN] = {
	{3,  1,  0,  0xFF, 0xFF, 1,    0xFF, 0xFF, 0},
	{31, 0,  0,  3,    6,    7,    0,    0xFF, 0},
	{31, 11, 11, 0xFF, 0xFF, 4,    1,    0xFF, 0},
	{7,  1,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0},
	{0,  0,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0,    0},
};

/* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */
static struct port_params tx_frame_params_default[SWR_MSTR_PORT_LEN] = {
	{3,  1,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0},  /* TX1 */
@@ -56,4 +64,10 @@ static struct swr_mstr_port_map sm_port_map_rouleur[] = {
	{RX_MACRO, SWR_UC0, rx_frame_params_rouleur},
	{RX_MACRO, SWR_UC1, rx_frame_params_dsd},
};

static struct swr_mstr_port_map sm_port_map_khaje[] = {
	{VA_MACRO, SWR_UC0, tx_frame_params_default},
	{RX_MACRO, SWR_UC0, rx_frame_params_khaje},
	{RX_MACRO, SWR_UC1, rx_frame_params_dsd},
};
#endif /* _BENGAL_PORT_CONFIG */
+10 −1
Original line number Diff line number Diff line
@@ -551,6 +551,7 @@ static struct snd_soc_codec_conf *msm_codec_conf;
static struct snd_soc_card snd_soc_card_bengal_msm;
static int dmic_0_1_gpio_cnt;
static int dmic_2_3_gpio_cnt;
static u32 wcd_datalane_mismatch;

static void *def_wcd_mbhc_cal(void);
static void *def_rouleur_mbhc_cal(void);
@@ -4354,7 +4355,11 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
	snd_soc_dapm_ignore_suspend(dapm, "AMIC4");
	snd_soc_dapm_sync(dapm);

	if (!strncmp(component->driver->name, ROULEUR_DRV_NAME,
	if (wcd_datalane_mismatch) {
		bolero_set_port_map(component,
				ARRAY_SIZE(sm_port_map_khaje),
				sm_port_map_khaje);
	} else if (!strncmp(component->driver->name, ROULEUR_DRV_NAME,
						strlen(ROULEUR_DRV_NAME))) {
		rouleur_info_create_codec_entry(pdata->codec_root, component);
		bolero_set_port_map(bolero_component, ARRAY_SIZE(sm_port_map_rouleur), sm_port_map_rouleur);
@@ -6108,6 +6113,10 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
		goto err;
	}

	ret = of_property_read_u32(pdev->dev.of_node,
			"qcom,wcd-datalane-mismatch",
			&wcd_datalane_mismatch);

	ret = devm_snd_soc_register_card(&pdev->dev, card);
	if (ret == -EPROBE_DEFER) {
		if (codec_reg_done)