From patchwork Wed Oct 4 11:28:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 114772 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2997481qgn; Wed, 4 Oct 2017 04:28:37 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAcEDOnfq+R/PqoSooDdyGofsFW4/Z2Vk9n0FJ1j0v4/iTOvtrz2F3hN9l2L8OLHoGbjK1G X-Received: by 10.28.62.65 with SMTP id l62mr15445987wma.47.1507116517665; Wed, 04 Oct 2017 04:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507116517; cv=none; d=google.com; s=arc-20160816; b=hLdEWIyQI5Nl2NEGCfQd/G1sB2z6I48enN3dsKdofT9auJdSOIaUmtGWmLazYm9sS6 j4TWeWO3vzemkxuhQ5vf6Xobb2IxjNxTqR3xOmL+FmR/AwB2FHivfQldf+akXQUW74Za U1pqTTTXhZaPpvygRC4icZMebNMvHUcINsjnPMGvnWCPDi2FVX0EmDeEp5F3cLEJiTmc JKurmdmcmrIBhi0Ub7XZKJRh36qtnrP+OdR2Dik4pigkHz4QSvRh4GwgYSI2rp8f294F pIkLj8bz6ZQasp2ddubYNpwO/G9R5y3oTwL3WGaeOiIxqhUBhYKm35raCXtsNFIQsI4j UYYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=6g5f+AaGcgiC/XT5m+rHRLKpvCui8iW4IhI+cjKx8vs=; b=E21OptK+M2a80MF1gNWoc9VcRcK4cl9qiW+TrdDipKUZ7P2uv+lrzAdcpZWuB19rjH Kop5PVoP6Z68yk0j6FyfyrDcg3GhXRk8b60zA2A4P6DdYhCOAcryLmEQhnObymRqjbdw KPSdoeeJ65eACiFhQiknx6uWtDL0r9x2rTtZNmVEe9Wj85ASACDgv2Cahb/X78Aq+xFV E/zIc7dHqQ8oaKY34s1RjrVHri+RHjF2HuKvOTfE9HodalKIEC+rkgR0Rm5H1C3XWJvn lwo4TVDAffZ7l/trdjwYbAjGzQo49alQlwMvBGc71kupyKZz0NQHTjJEVBXJgBMlThUF +U6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=I+UodGfm; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id 75si11494789wma.61.2017.10.04.04.28.37; Wed, 04 Oct 2017 04:28:37 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=I+UodGfm; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6666E267409; Wed, 4 Oct 2017 13:28:32 +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 AB25E267411; Wed, 4 Oct 2017 13:28:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_NEUTRAL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 101CB2673E5 for ; Wed, 4 Oct 2017 13:28:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=SmOa3ap85xhNRbM1ooVEgxRfPQUQj+31fwKv96FxABM=; b=I+UodGfmgCUh EzJxK00lh4YHkO3adFDus3yHvp4B7nUqIqeyg11Jp6P4UiwHZSvSKpJCsvEQX+ArJkX4iWmN5V475 8Jp7q85vGRfOge2pYENFGSoqtV6mOscALJ+IzWIfv9ls4Y08WChYvg2ghGPk9x/ysSx1vK9FfTbUI 8iz1A=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dzhqT-0006Xt-KW; Wed, 04 Oct 2017 11:28:09 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dzhqT-0004Hm-6G; Wed, 04 Oct 2017 12:28:09 +0100 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <877ewigrcv.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Wed, 04 Oct 2017 12:28:09 +0100 Cc: linux-renesas-soc@vger.kernel.org, alsa-devel@alsa-project.org, Mark Brown , Hiroyuki Yokoyama , Simon Subject: [alsa-devel] Applied "ASoC: rsnd: makes volume ramp rate list generic" to the asoc tree 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: rsnd: makes volume ramp rate list generic has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From f3c26ac61c09862f0037fe484a98da0364f02ec3 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Sun, 1 Oct 2017 23:49:03 +0000 Subject: [PATCH] ASoC: rsnd: makes volume ramp rate list generic DVC is supporting Volume Ramp Rate, and MIX has Volume Ramp but not yet supported. To support MIX Volume Ramp, we want to share Rate List since DVC/MIX are using almost same list. This patch move DVC specific Volume Ramp Rate List to core.c. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 27 +++++++++++++++++++++++++++ sound/soc/sh/rcar/dvc.c | 33 ++++----------------------------- sound/soc/sh/rcar/rsnd.h | 7 +++++-- 3 files changed, 36 insertions(+), 31 deletions(-) -- 2.14.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 107133297e8d..2d94b3d4519c 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1242,6 +1242,33 @@ struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg) return &cfg->cfg; } +const char * const volume_ramp_rate[] = { + "128 dB/1 step", /* 00000 */ + "64 dB/1 step", /* 00001 */ + "32 dB/1 step", /* 00010 */ + "16 dB/1 step", /* 00011 */ + "8 dB/1 step", /* 00100 */ + "4 dB/1 step", /* 00101 */ + "2 dB/1 step", /* 00110 */ + "1 dB/1 step", /* 00111 */ + "0.5 dB/1 step", /* 01000 */ + "0.25 dB/1 step", /* 01001 */ + "0.125 dB/1 step", /* 01010 */ + "0.125 dB/2 steps", /* 01011 */ + "0.125 dB/4 steps", /* 01100 */ + "0.125 dB/8 steps", /* 01101 */ + "0.125 dB/16 steps", /* 01110 */ + "0.125 dB/32 steps", /* 01111 */ + "0.125 dB/64 steps", /* 10000 */ + "0.125 dB/128 steps", /* 10001 */ + "0.125 dB/256 steps", /* 10010 */ + "0.125 dB/512 steps", /* 10011 */ + "0.125 dB/1024 steps", /* 10100 */ + "0.125 dB/2048 steps", /* 10101 */ + "0.125 dB/4096 steps", /* 10110 */ + "0.125 dB/8192 steps", /* 10111 = VOLUME_RAMP_MAX_DVC */ +}; + int rsnd_kctrl_new(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct snd_soc_pcm_runtime *rtd, diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index bb22850e8fe6..4ef318ac73d5 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -61,33 +61,6 @@ struct rsnd_dvc { ((pos) = (struct rsnd_dvc *)(priv)->dvc + i); \ i++) -static const char * const dvc_ramp_rate[] = { - "128 dB/1 step", /* 00000 */ - "64 dB/1 step", /* 00001 */ - "32 dB/1 step", /* 00010 */ - "16 dB/1 step", /* 00011 */ - "8 dB/1 step", /* 00100 */ - "4 dB/1 step", /* 00101 */ - "2 dB/1 step", /* 00110 */ - "1 dB/1 step", /* 00111 */ - "0.5 dB/1 step", /* 01000 */ - "0.25 dB/1 step", /* 01001 */ - "0.125 dB/1 step", /* 01010 */ - "0.125 dB/2 steps", /* 01011 */ - "0.125 dB/4 steps", /* 01100 */ - "0.125 dB/8 steps", /* 01101 */ - "0.125 dB/16 steps", /* 01110 */ - "0.125 dB/32 steps", /* 01111 */ - "0.125 dB/64 steps", /* 10000 */ - "0.125 dB/128 steps", /* 10001 */ - "0.125 dB/256 steps", /* 10010 */ - "0.125 dB/512 steps", /* 10011 */ - "0.125 dB/1024 steps", /* 10100 */ - "0.125 dB/2048 steps", /* 10101 */ - "0.125 dB/4096 steps", /* 10110 */ - "0.125 dB/8192 steps", /* 10111 */ -}; - static void rsnd_dvc_activation(struct rsnd_mod *mod) { rsnd_mod_write(mod, DVC_SWRSR, 0); @@ -298,7 +271,8 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, rsnd_kctrl_accept_anytime, rsnd_dvc_volume_update, &dvc->rup, - dvc_ramp_rate); + volume_ramp_rate, + VOLUME_RAMP_MAX_DVC); if (ret < 0) return ret; @@ -308,7 +282,8 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, rsnd_kctrl_accept_anytime, rsnd_dvc_volume_update, &dvc->rdown, - dvc_ramp_rate); + volume_ramp_rate, + VOLUME_RAMP_MAX_DVC); if (ret < 0) return ret; diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index beffbec42404..9d66a15000fa 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -656,9 +656,12 @@ int rsnd_kctrl_new(struct rsnd_mod *mod, rsnd_kctrl_new(mod, io, rtd, name, accept, update, rsnd_kctrl_init_s(cfg), \ NULL, 1, max) -#define rsnd_kctrl_new_e(mod, io, rtd, name, accept, update, cfg, texts) \ +#define rsnd_kctrl_new_e(mod, io, rtd, name, accept, update, cfg, texts, size) \ rsnd_kctrl_new(mod, io, rtd, name, accept, update, rsnd_kctrl_init_s(cfg), \ - texts, 1, ARRAY_SIZE(texts)) + texts, 1, size) + +extern const char * const volume_ramp_rate[]; +#define VOLUME_RAMP_MAX_DVC (0x17 + 1) /* * R-Car SSI