aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2016-02-11 07:18:27 -0500
committerMark Brown <broonie@kernel.org>2016-02-19 11:20:18 -0500
commitdad8061494d2a2ce6edc2ae5ab530b0d330b2685 (patch)
treeabced38fb197a0545117b6df8bad171f2c53ba53
parentec9e0ec84476954f971feb5e0422b48cb25dde58 (diff)
ASoC: qcom: apq8016: set the correct max register for regmap
Now that we are ready to access wrdma registers, set the max register and other regmap related configs to use correct values. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/qcom/lpass-cpu.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index e5101e0d2d37..91774fc87fcc 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -294,6 +294,17 @@ static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg)
294 return true; 294 return true;
295 } 295 }
296 296
297 for (i = 0; i < v->wrdma_channels; ++i) {
298 if (reg == LPAIF_WRDMACTL_REG(v, i + v->wrdma_channel_start))
299 return true;
300 if (reg == LPAIF_WRDMABASE_REG(v, i + v->wrdma_channel_start))
301 return true;
302 if (reg == LPAIF_WRDMABUFF_REG(v, i + v->wrdma_channel_start))
303 return true;
304 if (reg == LPAIF_WRDMAPER_REG(v, i + v->wrdma_channel_start))
305 return true;
306 }
307
297 return false; 308 return false;
298} 309}
299 310
@@ -327,6 +338,19 @@ static bool lpass_cpu_regmap_readable(struct device *dev, unsigned int reg)
327 return true; 338 return true;
328 } 339 }
329 340
341 for (i = 0; i < v->wrdma_channels; ++i) {
342 if (reg == LPAIF_WRDMACTL_REG(v, i + v->wrdma_channel_start))
343 return true;
344 if (reg == LPAIF_WRDMABASE_REG(v, i + v->wrdma_channel_start))
345 return true;
346 if (reg == LPAIF_WRDMABUFF_REG(v, i + v->wrdma_channel_start))
347 return true;
348 if (reg == LPAIF_WRDMACURR_REG(v, i + v->wrdma_channel_start))
349 return true;
350 if (reg == LPAIF_WRDMAPER_REG(v, i + v->wrdma_channel_start))
351 return true;
352 }
353
330 return false; 354 return false;
331} 355}
332 356
@@ -344,6 +368,10 @@ static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg)
344 if (reg == LPAIF_RDMACURR_REG(v, i)) 368 if (reg == LPAIF_RDMACURR_REG(v, i))
345 return true; 369 return true;
346 370
371 for (i = 0; i < v->wrdma_channels; ++i)
372 if (reg == LPAIF_WRDMACURR_REG(v, i + v->wrdma_channel_start))
373 return true;
374
347 return false; 375 return false;
348} 376}
349 377
@@ -398,8 +426,9 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
398 return PTR_ERR((void const __force *)drvdata->lpaif); 426 return PTR_ERR((void const __force *)drvdata->lpaif);
399 } 427 }
400 428
401 lpass_cpu_regmap_config.max_register = LPAIF_RDMAPER_REG(variant, 429 lpass_cpu_regmap_config.max_register = LPAIF_WRDMAPER_REG(variant,
402 variant->rdma_channels); 430 variant->wrdma_channels +
431 variant->wrdma_channel_start);
403 432
404 drvdata->lpaif_map = devm_regmap_init_mmio(&pdev->dev, drvdata->lpaif, 433 drvdata->lpaif_map = devm_regmap_init_mmio(&pdev->dev, drvdata->lpaif,
405 &lpass_cpu_regmap_config); 434 &lpass_cpu_regmap_config);