Commit 921a2c87 authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

mfd: davinci_voicecodec: Provide a regmap for register I/O

This will be used to support refactoring of the ASoC CODEC driver to use
a regmap.
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 6a017660
...@@ -27,11 +27,17 @@ ...@@ -27,11 +27,17 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/regmap.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <linux/mfd/davinci_voicecodec.h> #include <linux/mfd/davinci_voicecodec.h>
static struct regmap_config davinci_vc_regmap = {
.reg_bits = 32,
.val_bits = 32,
};
static int __init davinci_vc_probe(struct platform_device *pdev) static int __init davinci_vc_probe(struct platform_device *pdev)
{ {
struct davinci_vc *davinci_vc; struct davinci_vc *davinci_vc;
...@@ -63,6 +69,14 @@ static int __init davinci_vc_probe(struct platform_device *pdev) ...@@ -63,6 +69,14 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
goto fail; goto fail;
} }
davinci_vc->regmap = devm_regmap_init_mmio(&pdev->dev,
davinci_vc->base,
&davinci_vc_regmap);
if (IS_ERR(davinci_vc->regmap)) {
ret = PTR_ERR(davinci_vc->regmap);
goto fail;
}
res = platform_get_resource(pdev, IORESOURCE_DMA, 0); res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!res) { if (!res) {
dev_err(&pdev->dev, "no DMA resource\n"); dev_err(&pdev->dev, "no DMA resource\n");
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <mach/hardware.h> #include <mach/hardware.h>
struct regmap;
/* /*
* Register values. * Register values.
*/ */
...@@ -113,6 +115,7 @@ struct davinci_vc { ...@@ -113,6 +115,7 @@ struct davinci_vc {
/* Memory resources */ /* Memory resources */
void __iomem *base; void __iomem *base;
struct regmap *regmap;
/* MFD cells */ /* MFD cells */
struct mfd_cell cells[DAVINCI_VC_CELLS]; struct mfd_cell cells[DAVINCI_VC_CELLS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment