aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-31 09:08:56 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-09-02 04:27:49 -0400
commit921a2c870faa0a88c34e5c8c2afbd898fe8d325d (patch)
tree2950eec417ebf3b2ec72ef6e842bced7e55fac0f
parent6a017660768f8aca6ebf513cfb0c7ac241547deb (diff)
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: Mark Brown <broonie@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/davinci_voicecodec.c14
-rw-r--r--include/linux/mfd/davinci_voicecodec.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index a292d71c397c..013ba8159dcd 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -27,11 +27,17 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/clk.h> 29#include <linux/clk.h>
30#include <linux/regmap.h>
30 31
31#include <sound/pcm.h> 32#include <sound/pcm.h>
32 33
33#include <linux/mfd/davinci_voicecodec.h> 34#include <linux/mfd/davinci_voicecodec.h>
34 35
36static struct regmap_config davinci_vc_regmap = {
37 .reg_bits = 32,
38 .val_bits = 32,
39};
40
35static int __init davinci_vc_probe(struct platform_device *pdev) 41static int __init davinci_vc_probe(struct platform_device *pdev)
36{ 42{
37 struct davinci_vc *davinci_vc; 43 struct davinci_vc *davinci_vc;
@@ -63,6 +69,14 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
63 goto fail; 69 goto fail;
64 } 70 }
65 71
72 davinci_vc->regmap = devm_regmap_init_mmio(&pdev->dev,
73 davinci_vc->base,
74 &davinci_vc_regmap);
75 if (IS_ERR(davinci_vc->regmap)) {
76 ret = PTR_ERR(davinci_vc->regmap);
77 goto fail;
78 }
79
66 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 80 res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
67 if (!res) { 81 if (!res) {
68 dev_err(&pdev->dev, "no DMA resource\n"); 82 dev_err(&pdev->dev, "no DMA resource\n");
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
index 13a1ee95a233..5166935ce66d 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -30,6 +30,8 @@
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32 32
33struct regmap;
34
33/* 35/*
34 * Register values. 36 * Register values.
35 */ 37 */
@@ -113,6 +115,7 @@ struct davinci_vc {
113 115
114 /* Memory resources */ 116 /* Memory resources */
115 void __iomem *base; 117 void __iomem *base;
118 struct regmap *regmap;
116 119
117 /* MFD cells */ 120 /* MFD cells */
118 struct mfd_cell cells[DAVINCI_VC_CELLS]; 121 struct mfd_cell cells[DAVINCI_VC_CELLS];