From dc9756fa77434d5a3c85ce44a82565c2fe6b89ab Mon Sep 17 00:00:00 2001 From: Weiguang Kong Date: Fri, 11 May 2018 12:34:10 +0800 Subject: MLK-18279: ASoC: fsl_dsp: get the information of reserved memory from dts The reserved memory for dsp is defined in dts file, however, the dsp driver has also defined the address and size of this reserved memory, which is repeated and inflexible. So by cancelling the definition in dsp driver and use system API to get the information of reserved memory from dts dynamically to fix this problem. Signed-off-by: Weiguang Kong --- sound/soc/fsl/fsl_dsp_proxy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/soc/fsl/fsl_dsp_proxy.c') diff --git a/sound/soc/fsl/fsl_dsp_proxy.c b/sound/soc/fsl/fsl_dsp_proxy.c index f9a226d1f577..0eb0605018c8 100644 --- a/sound/soc/fsl/fsl_dsp_proxy.c +++ b/sound/soc/fsl/fsl_dsp_proxy.c @@ -281,7 +281,7 @@ irqreturn_t fsl_dsp_mu_isr(int irq, void *dev_id) /* ...NULL-address specification */ #define XF_PROXY_NULL (~0U) -#define XF_PROXY_BADADDR SDRAM_SCRATCH_BUF_SIZE +#define XF_PROXY_BADADDR (dsp_priv->scratch_buf_size) /* ...shared memory translation - kernel virtual address to shared address */ u32 xf_proxy_b2a(struct xf_proxy *proxy, void *b) @@ -292,7 +292,7 @@ u32 xf_proxy_b2a(struct xf_proxy *proxy, void *b) if (b == NULL) return XF_PROXY_NULL; else if ((u32)(b - dsp_priv->scratch_buf_virt) < - SDRAM_SCRATCH_BUF_SIZE) + dsp_priv->scratch_buf_size) return (u32)(b - dsp_priv->scratch_buf_virt); else return XF_PROXY_BADADDR; @@ -304,7 +304,7 @@ void *xf_proxy_a2b(struct xf_proxy *proxy, u32 address) struct fsl_dsp *dsp_priv = container_of(proxy, struct fsl_dsp, proxy); - if (address < SDRAM_SCRATCH_BUF_SIZE) + if (address < dsp_priv->scratch_buf_size) return dsp_priv->scratch_buf_virt + address; else if (address == XF_PROXY_NULL) return NULL; -- cgit v1.2.3