Skip to content

Commit

Permalink
mfd: davinci_voicecodec: Provide a regmap for register I/O
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Sep 2, 2013
1 parent 6a01766 commit 921a2c8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/mfd/davinci_voicecodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/regmap.h>

#include <sound/pcm.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)
{
struct davinci_vc *davinci_vc;
Expand Down Expand Up @@ -63,6 +69,14 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
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);
if (!res) {
dev_err(&pdev->dev, "no DMA resource\n");
Expand Down
3 changes: 3 additions & 0 deletions include/linux/mfd/davinci_voicecodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

#include <mach/hardware.h>

struct regmap;

/*
* Register values.
*/
Expand Down Expand Up @@ -113,6 +115,7 @@ struct davinci_vc {

/* Memory resources */
void __iomem *base;
struct regmap *regmap;

/* MFD cells */
struct mfd_cell cells[DAVINCI_VC_CELLS];
Expand Down

0 comments on commit 921a2c8

Please sign in to comment.