From patchwork Wed Oct 22 01:13:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5129081 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 A3C17C11AC for ; Wed, 22 Oct 2014 01:14:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4B872021B for ; Wed, 22 Oct 2014 01:14:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 95954201FE for ; Wed, 22 Oct 2014 01:14:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3D1C7262632; Wed, 22 Oct 2014 03:14:56 +0200 (CEST) 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, NO_DNS_FOR_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 53A9D2625EA; Wed, 22 Oct 2014 03:14:12 +0200 (CEST) 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 957A22625EE; Wed, 22 Oct 2014 03:14:10 +0200 (CEST) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by alsa0.perex.cz (Postfix) with ESMTP id A6105261692 for ; Wed, 22 Oct 2014 03:13:58 +0200 (CEST) Received: by mail-pd0-f181.google.com with SMTP id w10so2442252pde.40 for ; Tue, 21 Oct 2014 18:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=ersfkLAw8gmX1sCgZct1oaMEEICnHrLpuPTYMtAZ9gQ=; b=JRZOOs5z7ka10nsOOnOnMluIurqdIwQhghfz5t0v5p5f1/Xi/BNYOqGuU/wC0hqTCE MiLBfViDolzhFaunaDeSVyzHrQ9Uq4M2UFElpXp6Bf1tmz2QHZhmUIoe0+GTTmv2CO9J XdcU4TCN63wBO0GZAcX/pk65oQHvx7UZ0Y/PyUwQ989Zd75ISKd2AW8lb+KlIFtifziZ QiY3rg2GZm3gc7xDOTQWBXOajYPQ8bwpwLn+2va2vT7wDJiggQsELSRH+YhSbJHOCbQT gJx7+9qvyGmfljYLuyumgEx7jDJatceEd7w+xyQgT8G1T062ygFppDA4+rZOnR+uVV9J WXkA== X-Received: by 10.68.65.34 with SMTP id u2mr39615802pbs.6.1413940437223; Tue, 21 Oct 2014 18:13:57 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id dg5sm12977905pdb.54.2014.10.21.18.13.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 Oct 2014 18:13:56 -0700 (PDT) Date: Tue, 21 Oct 2014 18:13:56 -0700 (PDT) Message-ID: <8738ag7vou.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <8761fc7vpx.wl%kuninori.morimoto.gx@gmail.com> References: <8761fc7vpx.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto Subject: [alsa-devel] [PATCH 2/8] ASoC: rsnd: tidyup RSND_DVC_VOLUME_NUM to RSND_DVC_CHANNELS 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_NUM means DVC channel number. This patch tidyups this un-understandable naming Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/dvc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 3f44393..b5f95ad4 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -12,7 +12,7 @@ #define RSND_DVC_NAME_SIZE 16 #define RSND_DVC_VOLUME_MAX 100 -#define RSND_DVC_VOLUME_NUM 2 +#define RSND_DVC_CHANNELS 2 #define DVC_NAME "dvc" @@ -20,8 +20,8 @@ struct rsnd_dvc { struct rsnd_dvc_platform_info *info; /* rcar_snd.h */ struct rsnd_mod mod; struct clk *clk; - u8 volume[RSND_DVC_VOLUME_NUM]; - u8 mute[RSND_DVC_VOLUME_NUM]; + u8 volume[RSND_DVC_CHANNELS]; + u8 mute[RSND_DVC_CHANNELS]; }; #define rsnd_mod_to_dvc(_mod) \ @@ -37,11 +37,11 @@ static void rsnd_dvc_volume_update(struct rsnd_mod *mod) { struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); u32 max = (0x00800000 - 1); - u32 vol[RSND_DVC_VOLUME_NUM]; + u32 vol[RSND_DVC_CHANNELS]; u32 mute = 0; int i; - for (i = 0; i < RSND_DVC_VOLUME_NUM; i++) { + for (i = 0; i < RSND_DVC_CHANNELS; i++) { vol[i] = max / RSND_DVC_VOLUME_MAX * dvc->volume[i]; mute |= (!!dvc->mute[i]) << i; } @@ -150,7 +150,7 @@ static int rsnd_dvc_volume_info(struct snd_kcontrol *kctrl, struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); u8 *val = (u8 *)kctrl->private_value; - uinfo->count = RSND_DVC_VOLUME_NUM; + uinfo->count = RSND_DVC_CHANNELS; uinfo->value.integer.min = 0; if (val == dvc->volume) { @@ -170,7 +170,7 @@ static int rsnd_dvc_volume_get(struct snd_kcontrol *kctrl, u8 *val = (u8 *)kctrl->private_value; int i; - for (i = 0; i < RSND_DVC_VOLUME_NUM; i++) + for (i = 0; i < RSND_DVC_CHANNELS; i++) ucontrol->value.integer.value[i] = val[i]; return 0; @@ -183,7 +183,7 @@ static int rsnd_dvc_volume_put(struct snd_kcontrol *kctrl, u8 *val = (u8 *)kctrl->private_value; int i, change = 0; - for (i = 0; i < RSND_DVC_VOLUME_NUM; i++) { + for (i = 0; i < RSND_DVC_CHANNELS; i++) { change |= (ucontrol->value.integer.value[i] != val[i]); val[i] = ucontrol->value.integer.value[i]; }