diff options
Diffstat (limited to 'drivers/mfd/davinci_voicecodec.c')
-rw-r--r-- | drivers/mfd/davinci_voicecodec.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c index fb64398506e9..013ba8159dcd 100644 --- a/drivers/mfd/davinci_voicecodec.c +++ b/drivers/mfd/davinci_voicecodec.c | |||
@@ -27,21 +27,16 @@ | |||
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 | ||
35 | u32 davinci_vc_read(struct davinci_vc *davinci_vc, int reg) | 36 | static struct regmap_config davinci_vc_regmap = { |
36 | { | 37 | .reg_bits = 32, |
37 | return __raw_readl(davinci_vc->base + reg); | 38 | .val_bits = 32, |
38 | } | 39 | }; |
39 | |||
40 | void davinci_vc_write(struct davinci_vc *davinci_vc, | ||
41 | int reg, u32 val) | ||
42 | { | ||
43 | __raw_writel(val, davinci_vc->base + reg); | ||
44 | } | ||
45 | 40 | ||
46 | static int __init davinci_vc_probe(struct platform_device *pdev) | 41 | static int __init davinci_vc_probe(struct platform_device *pdev) |
47 | { | 42 | { |
@@ -74,6 +69,14 @@ static int __init davinci_vc_probe(struct platform_device *pdev) | |||
74 | goto fail; | 69 | goto fail; |
75 | } | 70 | } |
76 | 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 | |||
77 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 80 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
78 | if (!res) { | 81 | if (!res) { |
79 | dev_err(&pdev->dev, "no DMA resource\n"); | 82 | dev_err(&pdev->dev, "no DMA resource\n"); |