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

Commit cd5eb95e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: Add support for tx data lane3 for lito v2"

parents e7ca2c92 71e0b484
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -50,6 +50,15 @@ static struct port_params tx_frame_params_default[SWR_MSTR_PORT_LEN] = {
	{3,  0,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1},  /* TX4 */
};

/* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */
static struct port_params tx_frame_params_v2[SWR_MSTR_PORT_LEN] = {
	{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},/* PCM OUT */
	{1,  0,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1},  /* TX1 */
	{1,  0,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2},  /* TX2 */
	{3,  2,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0},  /* TX3 */
	{3,  0,  0,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2},  /* TX4 */
};

static struct swr_mstr_port_map sm_port_map[] = {
	{TX_MACRO, SWR_UC0, tx_frame_params_default},
	{RX_MACRO, SWR_UC0, rx_frame_params_default},
@@ -57,4 +66,11 @@ static struct swr_mstr_port_map sm_port_map[] = {
	{WSA_MACRO, SWR_UC0, wsa_frame_params_default},
};

static struct swr_mstr_port_map sm_port_map_v2[] = {
	{TX_MACRO, SWR_UC0, tx_frame_params_v2},
	{RX_MACRO, SWR_UC0, rx_frame_params_default},
	{RX_MACRO, SWR_UC1, rx_frame_params_dsd},
	{WSA_MACRO, SWR_UC0, wsa_frame_params_default},
};

#endif /* _KONA_PORT_CONFIG */
+16 −2
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ enum {
struct msm_asoc_mach_data {
	struct snd_info_entry *codec_root;
	int usbc_en2_gpio; /* used by gpio driver API */
	int lito_v2_enabled;
	struct device_node *dmic01_gpio_p; /* used by pinctrl API */
	struct device_node *dmic23_gpio_p; /* used by pinctrl API */
	struct device_node *dmic45_gpio_p; /* used by pinctrl API */
@@ -5288,9 +5289,18 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd)
						WSA_MACRO_GAIN_OFFSET_M1P5_DB);
			}
		}
		if (pdata->lito_v2_enabled) {
			/*
			 * Enable tx data line3 for saipan version v2 amd
			 * write corresponding lpi register.
			 */
			bolero_set_port_map(component, ARRAY_SIZE(sm_port_map_v2),
					sm_port_map_v2);
		} else {
			bolero_set_port_map(component, ARRAY_SIZE(sm_port_map),
					sm_port_map);
		}
	}
	card = rtd->card->snd_card;
	if (!pdata->codec_root) {
		entry = snd_info_create_subdir(card->module, "codecs",
@@ -7898,6 +7908,10 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
	if (!pdata)
		return -ENOMEM;

	of_property_read_u32(pdev->dev.of_node,
				"qcom,lito-is-v2-enabled",
				&pdata->lito_v2_enabled);

	card = populate_snd_card_dailinks(&pdev->dev);
	if (!card) {
		dev_err(&pdev->dev, "%s: Card uninitialized\n", __func__);