From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto 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) Message-ID: <87d2992fyx.wl%kuninori.morimoto.gx@gmail.com> References: <87egtp2g05.wl%kuninori.morimoto.gx@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id 8078E2654CD for ; Fri, 31 Oct 2014 02:19:37 +0100 (CET) Received: by mail-pa0-f54.google.com with SMTP id rd3so6651509pab.27 for ; Thu, 30 Oct 2014 18:19:36 -0700 (PDT) In-Reply-To: <87egtp2g05.wl%kuninori.morimoto.gx@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto List-Id: alsa-devel@alsa-project.org From: Kuninori Morimoto 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 --- 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