From patchwork Wed Nov 28 16:05:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 152310 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1269025ljp; Wed, 28 Nov 2018 08:06:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/X0NK2OuUkJbgTjKjpqy/NK4o3s2vocUVbmrMrkO2j8Hx1Z7fPiNtui+1vaOz13zSu/BEjX X-Received: by 2002:a7b:c404:: with SMTP id k4mr3370092wmi.144.1543421199372; Wed, 28 Nov 2018 08:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543421199; cv=none; d=google.com; s=arc-20160816; b=x+qKxIVTwMp4W86KzNc6EnZPkhrwcskEVae8vMBu1Ds/8SdB45sX15tMvFsyHCmxww X2I1+L+k5dDrbAODrgPoASVn+3HPEaI6uxlUr57Cj22vrlzUEeCmM0EWsU/TQ0/rUx6Z lUAin8CZN9L4q0pRg9mgUbCyyDbN5ZS+6GEXq2Mn450agmJZk4TmR4K/QIZCy7rJDALC cBWwXBKRJ2y3kaolCHwffKZixZuLFWDQ4hOSVd7kl9xGS+M8PgBmCt7BNb6Imj/pPdYx wSqe49pM8G2R1G1ete2gQ6HSPy/NpgJskEZyNshxYLKos+ekPpts72RGbalDZyG1uHab 0Fkw== 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; bh=KE/WBpQpgS01Dl/15NWxbuGTzoGLi/FEA7FAmxjO29Y=; b=IFVM65tsR2EpyHzXPSY9136siOaeFrNG/p6cKyJnbUgL3XdfErQu1249BZswHZeO7c at56ZqfLkJgRrNQ0xGxCq2eOjD7knigWTt03OqhTTcpY3XSbupUZB2Mh8D2n3+B/RyuX jdRu6ZdKZ0Hu1I+m9TJzIn/1CFJSBUH/zfvdZPfPjT14yAPPmJAAFx7nz4iTZzQSVNTk rRjCLp2FiucnHJ8Hrh9H2SJyho3IxF2eRdl879LKN7FrF2GU0eybXUpD/b+20J5bOB+R pWkpS8u2Oc03x4nnXP1tiqc3yM4ui/CcEbuPvKqLsaUvT3PK1Wz3UJwl2bMS4TbzPztR Kkqw== 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=SZXMnGmw; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id x10si6439507wre.236.2018.11.28.08.06.38; Wed, 28 Nov 2018 08:06:39 -0800 (PST) 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=SZXMnGmw; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0CD53267B8F; Wed, 28 Nov 2018 17:05:37 +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 BAC8E267B80; Wed, 28 Nov 2018 17:05:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE 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 05263267B78 for ; Wed, 28 Nov 2018 17:05:29 +0100 (CET) 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=iThvgGTUzdvMGiB7+pDx0+d/CPRplQtoFXe/OEfI9+I=; b=SZXMnGmwhkl6 DHc1s6AsU9bxCpW9QprD4T7ZDp+TFsxRLE6cfxYqCX71282zEm95zUhfd+ijJL1fhQSi3jPZx8bdM EvmAYvX4Ucqcp1f8KMukp6NWzMkvWehWP8uxIslaivNHzKA5GJ/ipxJElCaiQcWgrSkKwbHjzt/qN zHwZQ=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gS2LA-0005xA-Fj; Wed, 28 Nov 2018 16:05:28 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 35923112521B; Wed, 28 Nov 2018 16:05:28 +0000 (GMT) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87lg5f0yni.wl-kuninori.morimoto.gx@renesas.com> Message-Id: <20181128160528.35923112521B@debutante.sirena.org.uk> Date: Wed, 28 Nov 2018 16:05:28 +0000 (GMT) Cc: Mark Brown , DUNG NGUYEN , HIROYUKI YOKOYAMA , alsa-devel@alsa-project.org, Yoshihiro Shimoda Subject: [alsa-devel] Applied "ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()" 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: tidyup registering method for rsnd_kctrl_new() has been applied to the asoc tree at https://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 9c698e8481a15237a5b1db5f8391dd66d59e42a4 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 27 Nov 2018 07:35:34 +0000 Subject: [PATCH] ASoC: rsnd: tidyup registering method for rsnd_kctrl_new() Current rsnd dvc.c is using flags to avoid duplicating register for MIXer case. OTOH, commit e894efef9ac7 ("ASoC: core: add support to card rebind") allows to rebind sound card without rebinding all drivers. Because of above patch and dvc.c flags, it can't re-register kctrl if only sound card was rebinded, because dvc is keeping old flags. (Of course it will be no problem if rsnd driver also be rebinded, but it is not purpose of above patch). This patch checks current card registered kctrl when registering. In MIXer case, it can avoid duplicate register if card already has same kctrl. In rebind case, it can re-register kctrl because card registered kctl had been removed when unbinding. This patch is updated version of commit b918f1bc7f1ce ("ASoC: rsnd: DVC kctrl sets once") Reported-by: Nguyen Viet Dung Signed-off-by: Kuninori Morimoto Tested-by: Nguyen Viet Dung Cc: Hiroyuki Yokoyama Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 12 ++++++++++++ sound/soc/sh/rcar/dvc.c | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-) -- 2.19.0.rc2 _______________________________________________ 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 f930f51b686f..114f8f233764 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1339,6 +1339,18 @@ int rsnd_kctrl_new(struct rsnd_mod *mod, }; int ret; + /* + * 1) Avoid duplicate register (ex. MIXer case) + * 2) re-register if card was rebinded + */ + list_for_each_entry(kctrl, &card->controls, list) { + struct rsnd_kctrl_cfg *c = kctrl->private_data; + + if (strcmp(kctrl->id.name, name) == 0 && + c->mod == mod) + return 0; + } + if (size > RSND_MAX_CHANNELS) return -EINVAL; diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 2b16e0ce6bc5..024ece46bf68 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -40,11 +40,8 @@ struct rsnd_dvc { struct rsnd_kctrl_cfg_s ren; /* Ramp Enable */ struct rsnd_kctrl_cfg_s rup; /* Ramp Rate Up */ struct rsnd_kctrl_cfg_s rdown; /* Ramp Rate Down */ - u32 flags; }; -#define KCTRL_INITIALIZED (1 << 0) - #define rsnd_dvc_get(priv, id) ((struct rsnd_dvc *)(priv->dvc) + id) #define rsnd_dvc_nr(priv) ((priv)->dvc_nr) @@ -227,9 +224,6 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, int channels = rsnd_rdai_channels_get(rdai); int ret; - if (rsnd_flags_has(dvc, KCTRL_INITIALIZED)) - return 0; - /* Volume */ ret = rsnd_kctrl_new_m(mod, io, rtd, is_play ? @@ -285,8 +279,6 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, if (ret < 0) return ret; - rsnd_flags_set(dvc, KCTRL_INITIALIZED); - return 0; }