From 03357c3d523b5b38a0a7c4e4a80e8cc692f4a023 Mon Sep 17 00:00:00 2001 From: "Vangala, Amarnath" Date: Sat, 29 Aug 2020 06:31:34 +0530 Subject: [PATCH] soc: soundwire: fix for headset mic recording issue with wcd937x. Add slave device address for wcd937x in soundwire master. Update slave port configuration for wcd937x for holi. Change-Id: I1f953e47b1520efd99b6f400593242ae5fc6158a Signed-off-by: Vangala, Amarnath --- soc/swr-mstr-ctrl.c | 9 +++++++++ soc/swr-slave-port-config.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index 049266c9fdee..e2def45763e2 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -2578,6 +2578,7 @@ static int swrm_probe(struct platform_device *pdev) int ret = 0; struct clk *lpass_core_hw_vote = NULL; struct clk *lpass_core_audio = NULL; + u32 is_wcd937x = 0; /* Allocate soundwire master driver structure */ swrm = devm_kzalloc(&pdev->dev, sizeof(struct swr_mstr_ctrl), @@ -2610,6 +2611,14 @@ static int swrm_probe(struct platform_device *pdev) dev_err(&pdev->dev, "%s: failed to get master id\n", __func__); goto err_pdata_fail; } + /* update the physical device address if wcd937x. */ + ret = of_property_read_u32(pdev->dev.of_node, "qcom,is_wcd937x", + &is_wcd937x); + if (ret) + dev_dbg(&pdev->dev, "%s: failed to get wcd info\n", __func__); + else if (is_wcd937x) + swrm_phy_dev[1] = 0xa01170223; + ret = of_property_read_u32(pdev->dev.of_node, "qcom,dynamic-port-map-supported", &swrm->dynamic_port_map_supported); if (ret) { diff --git a/soc/swr-slave-port-config.h b/soc/swr-slave-port-config.h index 3c70d795a10e..c8124d88b1cd 100644 --- a/soc/swr-slave-port-config.h +++ b/soc/swr-slave-port-config.h @@ -23,12 +23,21 @@ static struct port_params tx_dummy[SWR_MSTR_PORT_LEN] = { }; /* AMIC 9.6 MHz clock */ +#ifdef CONFIG_SND_SOC_HOLI +static struct port_params tx_wcd_9p6MHz[SWR_MSTR_PORT_LEN] = { + {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */ + {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */ + {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */ + {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX4 */ +}; +#else static struct port_params tx_wcd_9p6MHz[SWR_MSTR_PORT_LEN] = { {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */ {7, 5, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */ {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */ {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX4 */ }; +#endif /* AMIC 4.8 MHz clock */ static struct port_params tx_wcd_4p8MHz[SWR_MSTR_PORT_LEN] = {