From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Miguel Aguilar
<miguel.aguilar-9uBrGCPFOa1Wk0Htik3J/w@public.gmane.org>,
Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org,
Mark Brown <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: [PATCH 5/5] ASoC: cq93vc: Use regmap for I/O
Date: Sat, 31 Aug 2013 14:08:59 +0100 [thread overview]
Message-ID: <1377954539-7532-5-git-send-email-broonie@kernel.org> (raw)
In-Reply-To: <1377954539-7532-1-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
From: Mark Brown <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Avoid use of the ASoC-specific register I/O functions by converting to
use the MMIO regmap provided the core MFD.
Signed-off-by: Mark Brown <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
sound/soc/codecs/cq93vc.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
index 2cbb584..43737a27 100644
--- a/sound/soc/codecs/cq93vc.c
+++ b/sound/soc/codecs/cq93vc.c
@@ -38,24 +38,6 @@
#include <sound/soc.h>
#include <sound/initval.h>
-static inline unsigned int cq93vc_read(struct snd_soc_codec *codec,
- unsigned int reg)
-{
- struct davinci_vc *davinci_vc = codec->control_data;
-
- return readl(davinci_vc->base + reg);
-}
-
-static inline int cq93vc_write(struct snd_soc_codec *codec, unsigned int reg,
- unsigned int value)
-{
- struct davinci_vc *davinci_vc = codec->control_data;
-
- writel(value, davinci_vc->base + reg);
-
- return 0;
-}
-
static const struct snd_kcontrol_new cq93vc_snd_controls[] = {
SOC_SINGLE("PGA Capture Volume", DAVINCI_VC_REG05, 0, 0x03, 0),
SOC_SINGLE("Mono DAC Playback Volume", DAVINCI_VC_REG09, 0, 0x3f, 0),
@@ -156,7 +138,9 @@ static int cq93vc_probe(struct snd_soc_codec *codec)
struct davinci_vc *davinci_vc = codec->dev->platform_data;
davinci_vc->cq93vc.codec = codec;
- codec->control_data = davinci_vc;
+ codec->control_data = davinci_vc->regmap;
+
+ snd_soc_codec_set_cache_io(codec, 32, 32, SND_SOC_REGMAP);
/* Off, with power on */
cq93vc_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
@@ -172,8 +156,6 @@ static int cq93vc_remove(struct snd_soc_codec *codec)
}
static struct snd_soc_codec_driver soc_codec_dev_cq93vc = {
- .read = cq93vc_read,
- .write = cq93vc_write,
.set_bias_level = cq93vc_set_bias_level,
.probe = cq93vc_probe,
.remove = cq93vc_remove,
--
1.8.4.rc3
next prev parent reply other threads:[~2013-08-31 13:08 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 ` [PATCH 2/5] mfd: davinci_voicecodec: Provide a regmap for register I/O 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 ` 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
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-5-git-send-email-broonie@kernel.org \
--to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
--cc=miguel.aguilar-9uBrGCPFOa1Wk0Htik3J/w@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
/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).