soc: swr-mstr: Update default val of comp_cfg

for PCM_OUT/IN dataport, update enable bit logic
using default value based on SWR version.

Change-Id: Ibfd342d9046834d074a12003f15e868c5336798c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
Laxminath Kasam
2020-11-03 19:00:03 +05:30
committed by Gerrit - the friendly Code Review server
parent b3cfeef661
commit 38adb70f3c
3 changed files with 11 additions and 3 deletions

View File

@@ -771,6 +771,7 @@ static int swrm_pcm_port_config(struct swr_mstr_ctrl *swrm, u8 port_num,
bool dir, bool enable)
{
u16 reg_addr = 0;
u32 reg_val = SWRM_COMP_FEATURE_CFG_DEFAULT_VAL;
if (!port_num || port_num > 6) {
dev_err(swrm->dev, "%s: invalid port: %d\n",
@@ -781,10 +782,12 @@ static int swrm_pcm_port_config(struct swr_mstr_ctrl *swrm, u8 port_num,
SWRM_DOUT_DP_PCM_PORT_CTRL(port_num));
swr_master_write(swrm, reg_addr, enable);
if (swrm->version >= SWRM_VERSION_1_7)
reg_val = SWRM_COMP_FEATURE_CFG_DEFAULT_VAL_V1P7;
if (enable)
swr_master_write(swrm, SWRM_COMP_FEATURE_CFG, 0x1E);
else
swr_master_write(swrm, SWRM_COMP_FEATURE_CFG, 0x6);
reg_val |= SWRM_COMP_FEATURE_CFG_PCM_EN_MASK;
swr_master_write(swrm, SWRM_COMP_FEATURE_CFG, reg_val);
return 0;
}

View File

@@ -40,6 +40,7 @@
#define SWRM_VERSION_1_5 0x01050000
#define SWRM_VERSION_1_5_1 0x01050001
#define SWRM_VERSION_1_6 0x01060000
#define SWRM_VERSION_1_7 0x01070000
#define SWR_MAX_CH_PER_PORT 8

View File

@@ -111,4 +111,8 @@
#define SWRM_COMP_PARAMS_WR_FIFO_DEPTH 0x00007C00
#define SWRM_COMP_PARAMS_RD_FIFO_DEPTH 0x000F8000
#define SWRM_COMP_FEATURE_CFG_DEFAULT_VAL 0x06
#define SWRM_COMP_FEATURE_CFG_DEFAULT_VAL_V1P7 0x406
#define SWRM_COMP_FEATURE_CFG_PCM_EN_MASK 0x18
#endif /* _SWRM_REGISTERS_H */