|
@@ -800,9 +800,19 @@ static int swrm_pcm_port_config(struct swr_mstr_ctrl *swrm, u8 port_num,
|
|
|
reg_addr = ((dir) ? SWRM_DIN_DP_PCM_PORT_CTRL(port_num) : \
|
|
|
SWRM_DOUT_DP_PCM_PORT_CTRL(port_num));
|
|
|
reg_val = enable ? 0x3 : 0x0;
|
|
|
- swr_master_write(swrm, reg_addr, reg_val);
|
|
|
- dev_dbg(swrm->dev, "%s : pcm port %s, reg_val = %d, for addr %x\n",
|
|
|
- __func__, enable ? "Enabled" : "disabled", reg_val, reg_addr);
|
|
|
+ if (enable) {
|
|
|
+ if (swrm->pcm_enable_count == 0)
|
|
|
+ swr_master_write(swrm, reg_addr, reg_val);
|
|
|
+ swrm->pcm_enable_count++;
|
|
|
+ } else {
|
|
|
+ if (swrm->pcm_enable_count > 0)
|
|
|
+ swrm->pcm_enable_count--;
|
|
|
+ if (swrm->pcm_enable_count == 0)
|
|
|
+ swr_master_write(swrm, reg_addr, reg_val);
|
|
|
+ }
|
|
|
+ dev_dbg(swrm->dev, "%s : pcm port %s, reg_val = %d, for addr %x, pcm_enable_cnt:%d\n",
|
|
|
+ __func__, enable ? "Enabled" : "disabled", reg_val, reg_addr,
|
|
|
+ swrm->pcm_enable_count);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -2836,7 +2846,7 @@ static int swrm_probe(struct platform_device *pdev)
|
|
|
dev_err(swrm->dev, "missing port mapping\n");
|
|
|
goto err_pdata_fail;
|
|
|
}
|
|
|
-
|
|
|
+ swrm->pcm_enable_count = 0;
|
|
|
map_length = map_size / (3 * sizeof(u32));
|
|
|
if (num_ports > SWR_MSTR_PORT_LEN) {
|
|
|
dev_err(&pdev->dev, "%s:invalid number of swr ports\n",
|