MLK-20095-4: ASoC: fsl: Use hardwired system address offset source select for QM
authorDaniel Baluta <daniel.baluta@nxp.com>
Fri, 14 Dec 2018 17:19:15 +0000 (19:19 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Thu, 18 Apr 2019 00:00:38 +0000 (03:00 +0300)
We set system address offset select to 0 on QM because of the following reasons:
* SC_C_OFS_PERIPH, it is not available for QM
* SC_C_OFS_AUDIO, it is not used
* SC_C_OFS_IRQ, needs to get outside of the VPU.

A simplified version of the code is:

if (dsp_priv->dsp_board_type == DSP_IMX8QXP_TYPE) {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 1);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_PERIPH, 0x5A);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_IRQ, 0x51);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_AUDIO, 0x80);
}
} else {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 0);
}

Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 1607309080dca31c75f1cb7a2577afcb184fc291)

sound/soc/fsl/fsl_dsp.c

index 61321eb..25673b9 100644 (file)
@@ -831,32 +831,42 @@ static int fsl_dsp_probe(struct platform_device *pdev)
                return sciErr;
        };
 
-       sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
-                               SC_C_OFS_SEL, 1);
-       if (sciErr != SC_ERR_NONE) {
-               dev_err(&pdev->dev, "Error system address offset source select\n");
-               return -EIO;
-       }
+       if (dsp_priv->dsp_board_type == DSP_IMX8QXP_TYPE) {
+               sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
+                                       SC_C_OFS_SEL, 1);
+               if (sciErr != SC_ERR_NONE) {
+                       dev_err(&pdev->dev, "Error system address offset source select\n");
+                       return -EIO;
+               }
 
-       sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
-                               SC_C_OFS_AUDIO, 0x80);
-       if (sciErr != SC_ERR_NONE) {
-               dev_err(&pdev->dev, "Error system address offset of AUDIO\n");
-               return -EIO;
-       }
+               sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
+                                       SC_C_OFS_PERIPH, 0x5A);
+               if (sciErr != SC_ERR_NONE) {
+                       dev_err(&pdev->dev, "Error system address offset of PERIPH %d\n",
+                               sciErr);
+                       return -EIO;
+               }
 
-       sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
-                               SC_C_OFS_PERIPH, 0x5A);
-       if (sciErr != SC_ERR_NONE) {
-               dev_err(&pdev->dev, "Error system address offset of PERIPH %d\n",
-                       sciErr);
-       }
+               sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
+                                       SC_C_OFS_IRQ, 0x51);
+               if (sciErr != SC_ERR_NONE) {
+                       dev_err(&pdev->dev, "Error system address offset of IRQ\n");
+                       return -EIO;
+               }
 
-       sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
-                               SC_C_OFS_IRQ, 0x51);
-       if (sciErr != SC_ERR_NONE) {
-               dev_err(&pdev->dev, "Error system address offset of IRQ\n");
-               return -EIO;
+               sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
+                                       SC_C_OFS_AUDIO, 0x80);
+               if (sciErr != SC_ERR_NONE) {
+                       dev_err(&pdev->dev, "Error system address offset of AUDIO\n");
+                       return -EIO;
+               }
+       } else {
+               sciErr = sc_misc_set_control(dsp_priv->dsp_ipcHandle, SC_R_DSP,
+                                       SC_C_OFS_SEL, 0);
+               if (sciErr != SC_ERR_NONE) {
+                       dev_err(&pdev->dev, "Error system address offset source select\n");
+                       return -EIO;
+               }
        }
 
        ret = dsp_mu_init(dsp_priv);