All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, Liam Girdwood <lgirdwood@gmail.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [PATCH 1/5 v2] ASoC: rsnd: control DVC_DVUCR under rsnd_dvc_volume_update()
Date: Thu, 30 Oct 2014 18:19:35 -0700 (PDT)	[thread overview]
Message-ID: <87d2992fyx.wl%kuninori.morimoto.gx@gmail.com> (raw)
In-Reply-To: <87egtp2g05.wl%kuninori.morimoto.gx@gmail.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

rsnd_dvc_volume_update() is main function to control
DVC feature like Digital Volume / Mute / Ramp etc.
DVC_DVUCR should be controlled under this function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

 - no change

 sound/soc/sh/rcar/dvc.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c
index deaf0fa..3952237 100644
--- a/sound/soc/sh/rcar/dvc.c
+++ b/sound/soc/sh/rcar/dvc.c
@@ -40,6 +40,7 @@ struct rsnd_dvc {
 static void rsnd_dvc_volume_update(struct rsnd_mod *mod)
 {
 	struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod);
+	u32 dvucr = 0;
 	u32 mute = 0;
 	int i;
 
@@ -47,10 +48,18 @@ static void rsnd_dvc_volume_update(struct rsnd_mod *mod)
 		mute |= (!!dvc->mute.val[i]) << i;
 	}
 
+	/* Enable Digital Volume */
+	dvucr = 0x100;
 	rsnd_mod_write(mod, DVC_VOL0R, dvc->volume.val[0]);
 	rsnd_mod_write(mod, DVC_VOL1R, dvc->volume.val[1]);
 
-	rsnd_mod_write(mod, DVC_ZCMCR, mute);
+	/*  Enable Mute */
+	if (mute) {
+		dvucr |= 0x1;
+		rsnd_mod_write(mod, DVC_ZCMCR, mute);
+	}
+
+	rsnd_mod_write(mod, DVC_DVUCR, dvucr);
 }
 
 static int rsnd_dvc_probe_gen2(struct rsnd_mod *mod,
@@ -103,9 +112,6 @@ static int rsnd_dvc_init(struct rsnd_mod *dvc_mod,
 
 	rsnd_mod_write(dvc_mod, DVC_ADINR, rsnd_get_adinr(dvc_mod));
 
-	/*  enable Volume / Mute */
-	rsnd_mod_write(dvc_mod, DVC_DVUCR, 0x101);
-
 	/* ch0/ch1 Volume */
 	rsnd_dvc_volume_update(dvc_mod);
 
-- 
1.7.9.5

  reply	other threads:[~2014-10-31  1:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31  1:18 [PATCH 0/5 v2] ASoC: rsnd: Add Volume Ramp support Kuninori Morimoto
2014-10-31  1:19 ` Kuninori Morimoto [this message]
2014-10-31  1:20 ` [PATCH 2/5 v2] ASoC: rsnd: move DVC_DVUER settings under rsnd_dvc_volume_update() Kuninori Morimoto
2014-10-31  1:20 ` [PATCH 3/5 v2] ASoC: rsnd: enable multiple DVC valume settings Kuninori Morimoto
2014-10-31  1:22 ` [PATCH 5/5 v2] ASoC: rsnd: Add Volume Ramp support Kuninori Morimoto
2014-11-05  4:26 ` [PATCH 0/6 v3] " Kuninori Morimoto
2014-11-05  4:26   ` [PATCH 1/6 v3] ASoC: rsnd: control DVC_DVUCR under rsnd_dvc_volume_update() Kuninori Morimoto
2014-11-06 17:04     ` Mark Brown
2014-11-05  4:27   ` [PATCH 2/6 v3] ASoC: rsnd: move DVC_DVUER settings " Kuninori Morimoto
2014-11-06 17:05     ` Mark Brown
2014-11-05  4:27   ` [PATCH 3/6 v3] ASoC: rsnd: enable multiple DVC valume settings Kuninori Morimoto
2014-11-06 17:05     ` Mark Brown
2014-11-05  4:28   ` [PATCH 4/6 v3] ASoC: rsnd: enable single " Kuninori Morimoto
2014-11-06 17:05     ` Mark Brown
2014-11-05  4:28   ` [PATCH 5/6 v3] ASoC: rsnd: enable enumerated " Kuninori Morimoto
2014-11-06 17:05     ` Mark Brown
2014-11-05  4:29   ` [PATCH 6/6 v3] ASoC: rsnd: Add Volume Ramp support Kuninori Morimoto
2014-11-06 16:58     ` Mark Brown
2014-11-07  0:11       ` Kuninori Morimoto
2014-11-07 10:45         ` Mark Brown
2014-11-10  3:52           ` [PATCH v4] " Kuninori Morimoto
2014-11-10 15:14             ` 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=87d2992fyx.wl%kuninori.morimoto.gx@gmail.com \
    --to=kuninori.morimoto.gx@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.