From patchwork Wed Nov 5 04:26:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5232271 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9AF7BC11AC for ; Wed, 5 Nov 2014 04:28:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA1F72017A for ; Wed, 5 Nov 2014 04:28:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0AB1520173 for ; Wed, 5 Nov 2014 04:28:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 16126261A60; Wed, 5 Nov 2014 05:28:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 9B1082619FF; Wed, 5 Nov 2014 05:27:18 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 529E2261A3B; Wed, 5 Nov 2014 05:27:17 +0100 (CET) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by alsa0.perex.cz (Postfix) with ESMTP id 30B24261785 for ; Wed, 5 Nov 2014 05:26:55 +0100 (CET) Received: by mail-pd0-f173.google.com with SMTP id v10so15130607pde.32 for ; Tue, 04 Nov 2014 20:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:mime-version:to:cc :in-reply-to:references:content-type; bh=SXg0pwBPVwT4KdYQeyYzNPHPfzvC+91Penv0IFxGh4Y=; b=Ji+DIcsaEJQgRpzCnVpft26HmUlywcqepqbIFg0O03nFcbURyVUs4aSi1z8mXxpF3B qjfvgoGfl9T4akGZJcPUtPv4edbkXloOI0rAh8uodqFXxvIBn/WFyObtubg0pAO04OCX E1Ou1L3gV37lv+Wyo/5tn/3N1K46TdUUco9ju4/oc/ahqvrrrnfRMCKbfbFs+Y0Vqj+q gCXbNpPY2BV/Ri+EKooAfwk4ny5jkJTVFoOZAyGntK3sZZDrc1PdT9jCZ6ikdYie0MV0 T1rhVRITzia7L2IocgOR1i/kh+9RNdW26Vwn7HgeylqtWMNfePBQ92XPC9d2S8VOlNrD ol+w== X-Received: by 10.67.12.236 with SMTP id et12mr50648442pad.31.1415161613794; Tue, 04 Nov 2014 20:26:53 -0800 (PST) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id xr10sm1800691pab.35.2014.11.04.20.26.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 20:26:53 -0800 (PST) Date: Tue, 04 Nov 2014 20:26:53 -0800 (PST) Message-ID: <87d29246hz.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") To: Mark Brown In-Reply-To: <87egti46j7.wl%kuninori.morimoto.gx@gmail.com> References: <87egtp2g05.wl%kuninori.morimoto.gx@gmail.com> <87egti46j7.wl%kuninori.morimoto.gx@gmail.com> Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto Subject: [alsa-devel] [PATCH 1/6 v3] ASoC: rsnd: control DVC_DVUCR under rsnd_dvc_volume_update() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP 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 --- v2 -> v3 - 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);