alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	Miguel Aguilar <miguel.aguilar@ridgerun.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, linaro-kernel@lists.linaro.org,
	davinci-linux-open-source@linux.davincidsp.com,
	Mark Brown <broonie@linaro.org>
Subject: [PATCH 2/5] mfd: davinci_voicecodec: Provide a regmap for register I/O
Date: Sat, 31 Aug 2013 14:08:56 +0100	[thread overview]
Message-ID: <1377954539-7532-2-git-send-email-broonie@kernel.org> (raw)
In-Reply-To: <1377954539-7532-1-git-send-email-broonie@kernel.org>

From: Mark Brown <broonie@linaro.org>

This will be used to support refactoring of the ASoC CODEC driver to use
a regmap.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/mfd/davinci_voicecodec.c       | 14 ++++++++++++++
 include/linux/mfd/davinci_voicecodec.h |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index a292d71..013ba81 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -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;
@@ -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");
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
index 13a1ee9..5166935 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -30,6 +30,8 @@
 
 #include <mach/hardware.h>
 
+struct regmap;
+
 /*
  * Register values.
  */
@@ -113,6 +115,7 @@ struct davinci_vc {
 
 	/* Memory resources */
 	void __iomem *base;
+	struct regmap *regmap;
 
 	/* MFD cells */
 	struct mfd_cell cells[DAVINCI_VC_CELLS];
-- 
1.8.4.rc3

  reply	other threads:[~2013-08-31 13:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-31 13:07 [PATCH 0/5] Remove ASoC-level I/O functions from cq93vc Mark Brown
2013-08-31 13:08 ` [PATCH 1/5] mfd: davinci_voicecodec: Remove unused read and write functions Mark Brown
2013-08-31 13:08   ` Mark Brown [this message]
2013-08-31 13:08   ` [PATCH 4/5] ASoC: cq93vc: Don't use control data for core driver data Mark Brown
     [not found]   ` <1377954539-7532-1-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-31 13:08     ` [PATCH 3/5] ASoC: cq93vc: Use core I/O functions Mark Brown
2013-08-31 13:08     ` [PATCH 5/5] ASoC: cq93vc: Use regmap for I/O Mark Brown
2013-09-01 14:48 ` [PATCH 0/5] Remove ASoC-level I/O functions from cq93vc Samuel Ortiz
2013-09-01 15:08   ` Mark Brown
     [not found]     ` <20130901150853.GG3084-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-09-02  8:55       ` Samuel Ortiz
2013-09-02  9:48         ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377954539-7532-2-git-send-email-broonie@kernel.org \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@linaro.org \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=miguel.aguilar@ridgerun.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).