From f064edbb48f0f04324c35e69cac56f9d893db9ef Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Thu, 27 Aug 2020 20:21:27 +0530 Subject: [PATCH] ASoC: shima: Resolve noise during amic record Change shima master port params same as slave to resolve noise during amic record. Change-Id: I3c26c51413d104720ffd063cb5b9fc50f287c06a Signed-off-by: Vatsal Bucha --- asoc/lahaina-port-config.h | 21 +++++++++++++++++++-- asoc/lahaina.c | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/asoc/lahaina-port-config.h b/asoc/lahaina-port-config.h index dbfa9fbc19..2b78ab205a 100644 --- a/asoc/lahaina-port-config.h +++ b/asoc/lahaina-port-config.h @@ -53,8 +53,8 @@ static struct port_params tx_frame_params_default[SWR_MSTR_PORT_LEN] = { /* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */ static struct port_params tx_frame_params_shima[SWR_MSTR_PORT_LEN] = { - {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */ - {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX2 */ + {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */ + {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */ {7, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */ }; @@ -71,6 +71,21 @@ static struct port_params tx_frame_params_0p6MHz[SWR_MSTR_PORT_LEN] = { {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */ {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */ }; + +/* 4.8 MHz clock */ +static struct port_params tx_frame_params_shima_4p8MHz[SWR_MSTR_PORT_LEN] = { + {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */ + {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */ + {7, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */ +}; + +/* 0.6 MHz clock */ +static struct port_params tx_frame_params_shima_0p6MHz[SWR_MSTR_PORT_LEN] = { + {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */ + {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */ + {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */ +}; + static struct swr_mstr_port_map sm_port_map[] = { {TX_MACRO, SWR_UC0, tx_frame_params_default}, {TX_MACRO, SWR_UC1, tx_frame_params_4p8MHz}, @@ -82,6 +97,8 @@ static struct swr_mstr_port_map sm_port_map[] = { static struct swr_mstr_port_map sm_port_map_shima[] = { {TX_MACRO, SWR_UC0, tx_frame_params_shima}, + {TX_MACRO, SWR_UC1, tx_frame_params_shima_4p8MHz}, + {TX_MACRO, SWR_UC2, tx_frame_params_shima_0p6MHz}, {RX_MACRO, SWR_UC0, rx_frame_params_default}, {RX_MACRO, SWR_UC1, rx_frame_params_dsd}, {WSA_MACRO, SWR_UC0, wsa_frame_params_default}, diff --git a/asoc/lahaina.c b/asoc/lahaina.c index 7e403b1ee1..c3b342005c 100644 --- a/asoc/lahaina.c +++ b/asoc/lahaina.c @@ -7735,7 +7735,7 @@ static int msm_int_audrx_init(struct snd_soc_pcm_runtime *rtd) card = rtd->card->snd_card; - if (strnstr(rtd->card->name, "shima", 5) != NULL) + if (strnstr(rtd->card->name, "shima", strlen(rtd->card->name)) != NULL) bolero_set_port_map(component, ARRAY_SIZE(sm_port_map_shima), sm_port_map_shima); else