From 5f428b091de6d527a179318757ef4ef1e19fbdc4 Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Thu, 17 Sep 2020 04:07:13 +0530 Subject: [PATCH 1/2] ASoC: lahaina: Update soundwire frame shape configuration Update soundwire frame shape configuration for native audio playback usecase. Change-Id: I2e80589c8f2ae9d1cc3ad02e8864922300db97bb Signed-off-by: Sudheer Papothi --- asoc/holi-port-config.h | 12 ++++++++++++ asoc/lahaina-port-config.h | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/asoc/holi-port-config.h b/asoc/holi-port-config.h index abc23596a6a3..7aed45e9e194 100644 --- a/asoc/holi-port-config.h +++ b/asoc/holi-port-config.h @@ -33,6 +33,16 @@ static struct port_params rx_frame_params_default[SWR_MSTR_PORT_LEN] = { {0x18F, 0, 0, 0x8, 0x8, 0x0F, 0x00, 0, 0, 0x00, 0x01}, /* PCM_OUT */ }; +/* Headset(44.1K) + PCM Haptics */ +static struct port_params rx_frame_params_44p1KHz[SWR_MSTR_PORT_LEN] = { + {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1, 0x00, 0x00}, /* HPH/EAR */ + {63, 0, 0, 3, 6, 7, 0, 0xFF, 0, 0x00, 0x00}, /* HPH_CLH */ + {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0, 0x00, 0x00}, /* HPH_CMP */ + {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0, 0x00, 0x00}, /* LO/AUX */ + {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0x00, 0x00}, /* DSD */ + {0x1FF, 0, 0, 0x8, 0x8, 0x0F, 0, 0, 0, 0x00, 0x01}, /* PCM_OUT */ +}; + /* 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, 0x00, 0x00}, /* TX1 */ @@ -50,12 +60,14 @@ static struct swr_mstr_port_map sm_port_map[] = { {VA_MACRO, SWR_UC0, tx_frame_params_default}, {RX_MACRO, SWR_UC0, rx_frame_params_default}, {RX_MACRO, SWR_UC1, rx_frame_params_dsd}, + {RX_MACRO, SWR_UC2, rx_frame_params_44p1KHz}, }; static struct swr_mstr_port_map sm_port_map_wcd937x[] = { {VA_MACRO, SWR_UC0, tx_frame_params_wcd937x}, {RX_MACRO, SWR_UC0, rx_frame_params_default}, {RX_MACRO, SWR_UC1, rx_frame_params_dsd}, + {RX_MACRO, SWR_UC2, rx_frame_params_44p1KHz}, }; #endif /* _HOLI_PORT_CONFIG */ diff --git a/asoc/lahaina-port-config.h b/asoc/lahaina-port-config.h index d02813d67632..5f508691c8c9 100644 --- a/asoc/lahaina-port-config.h +++ b/asoc/lahaina-port-config.h @@ -44,6 +44,16 @@ static struct port_params rx_frame_params_default[SWR_MSTR_PORT_LEN] = { {0x18F, 0, 0, 0x8, 0x8, 0x0F, 0x00, 0, 0, 0x00, 0x01}, /* PCM_OUT */ }; +/* Headset(44.1K) + PCM Haptics */ +static struct port_params rx_frame_params_44p1KHz[SWR_MSTR_PORT_LEN] = { + {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1, 0x00, 0x00}, /* HPH/EAR */ + {63, 0, 0, 3, 6, 7, 0, 0xFF, 0, 0x00, 0x00}, /* HPH_CLH */ + {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0, 0x00, 0x00}, /* HPH_CMP */ + {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0, 0x00, 0x00}, /* LO/AUX */ + {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0x00, 0x00}, /* DSD */ + {0x1FF, 0, 0, 0x8, 0x8, 0x0F, 0, 0, 0, 0x00, 0x01}, /* PCM_OUT */ +}; + /* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */ static struct port_params tx_frame_params_default[SWR_MSTR_PORT_LEN] = { {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */ @@ -92,6 +102,7 @@ static struct swr_mstr_port_map sm_port_map[] = { {TX_MACRO, SWR_UC2, tx_frame_params_0p6MHz}, {RX_MACRO, SWR_UC0, rx_frame_params_default}, {RX_MACRO, SWR_UC1, rx_frame_params_dsd}, + {RX_MACRO, SWR_UC2, rx_frame_params_44p1KHz}, {WSA_MACRO, SWR_UC0, wsa_frame_params_default}, }; @@ -101,6 +112,7 @@ static struct swr_mstr_port_map sm_port_map_shima[] = { {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}, + {RX_MACRO, SWR_UC2, rx_frame_params_44p1KHz}, {WSA_MACRO, SWR_UC0, wsa_frame_params_default}, }; From 001b64815061db57a2dd2ec509fffd06d2306dc0 Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Thu, 17 Sep 2020 04:05:02 +0530 Subject: [PATCH 2/2] soc: soundwire: Update frame configuration for native audio playback Update frame shape configuration for native audio playback for better performance during native audio playback. Change-Id: I2d7c22e1cb69e73e4f474be020931d74715a1a60 Signed-off-by: Sudheer Papothi --- include/soc/soundwire.h | 2 +- soc/swr-mstr-ctrl.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/soc/soundwire.h b/include/soc/soundwire.h index 2d9b64aaaaca..a8c5ec83e9e2 100644 --- a/include/soc/soundwire.h +++ b/include/soc/soundwire.h @@ -17,7 +17,7 @@ #define SWR_CLK_RATE_2P4MHZ 2400000 #define SWR_CLK_RATE_4P8MHZ 4800000 #define SWR_CLK_RATE_9P6MHZ 9600000 -#define SWR_CLK_RATE_11P2896MHZ 1128960 +#define SWR_CLK_RATE_11P2896MHZ 11289600 extern struct bus_type soundwire_type; struct swr_device; diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index 12b263c9c22c..2044277bd046 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -752,6 +752,9 @@ static int swrm_get_port_config(struct swr_mstr_ctrl *swrm) if (swrm->mport_cfg[SWRM_DSD_PARAMS_PORT].port_en && (swrm->master_id == MASTER_ID_RX)) usecase = 1; + else if ((swrm->master_id == MASTER_ID_RX) && + (swrm->bus_clk == SWR_CLK_RATE_11P2896MHZ)) + usecase = 2; if (swrm->bus_clk == SWR_CLK_RATE_4P8MHZ) usecase = 1;