Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp466358imm; Mon, 21 May 2018 08:53:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoaqgo6C1tZj4wgSkQrNYFuYmUFJ+lXOPXqZtVm5nJLJVvhyAbkg3WGP0hCkLeRC+t1qLpp X-Received: by 2002:a63:384d:: with SMTP id h13-v6mr16106635pgn.209.1526917991825; Mon, 21 May 2018 08:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526917991; cv=none; d=google.com; s=arc-20160816; b=UirX8mS328SBSS6oqI9zm42+wMFLjb7w1F34h29+a3qlMc/zM9w0tm6JiYPxbkNc9w XC2Wqkm/L6OXtVvEveUCZycKt+smMwakZNAJ09gJkIbEfZovCGrg1tcyvuzBTSHVlQOm SWmo4WxeayEuc1STHuyEJQKNwu6QkvDDgL3sro+iujSTqvC5rEFlhPpeDFKkppJN13O/ 21DIJKXZgq0KQFkON/BxGlmy8sGQNX1KxXm1SUsGAqUkrJyTdiUKakxAAiLsRs6nY0ev 6fyZkJGzaU864q2nge00rnPPRooTO/vTvjc/E4c0/RbIRc9fhrBLilf6qGMKCZhVYlRl 5L/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=tONF2QQeUafvXJpiTqpgcDfBR3Kaw7sUirGC/uHa1Y8=; b=c1pJxPWrXUJyO9vRJ0uRIh4flBLGBTVy7gQkboSR0xYDzMWEJG7MWKa19gaEtiUeLk HNCT85EqFg5Xb/L4IlqgIdFhimb7tKrpGvG/YkCm4yAuwrngirzz4IaQPxNwKK+AsGrS weFy7eMUVsAaTsq/drkBVVD5qkraTcyD6sjYc4NywVTzsN5/MEW5ZFxszuaOj7X0QC0y +j6jqINITU5IElZTOwj+rnKKiR74VNJ8kaT+OjCTo5O1XUWnr/MuAd0nmDNrzywNjhRT TxHK16ZoiuDFsewo0JPwH5udweZyjO8k5fCLOqAxbzU1v0frEa7CVYqiPTrLu0bfK8x7 ehMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=q7FfdYOe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v190-v6si14300456pfb.324.2018.05.21.08.52.57; Mon, 21 May 2018 08:53:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=q7FfdYOe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbeEUPsm (ORCPT + 99 others); Mon, 21 May 2018 11:48:42 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:55292 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753274AbeEUPsf (ORCPT ); Mon, 21 May 2018 11:48:35 -0400 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=tONF2QQeUafvXJpiTqpgcDfBR3Kaw7sUirGC/uHa1Y8=; b=q7FfdYOeLSXE peqWsOcazkQstHwQ2CszRhGkJ7d8TPLmfKBK5PFHFxF4Cm4pjSqoy9P4BLQhlMfeI9hPdNjoHCTBD UQo97rpccBLndx7GChT+8To+0/DDpSDa981Z26j+qirwmzMK+YDa7Y/7qVRr0KP5RHT6RaOmE1CGJ pL4aM=; 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 1fKn33-00012s-7b; Mon, 21 May 2018 15:48:33 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fKn32-0007IT-Qu; Mon, 21 May 2018 16:48:32 +0100 From: Mark Brown To: Akshu Agrawal Cc: Vijendar Mukunda , Mark Brown , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , Liam Girdwood , open list , Takashi Iwai , Mark Brown , Wei Yongjun , Vijendar Mukunda , Alex Deucher , alsa-devel@alsa-project.org Subject: Applied "ASoC: AMD: Move clk enable from hw_params/free to startup/shutdown" to the asoc tree In-Reply-To: <1524741374-13523-8-git-send-email-Vijendar.Mukunda@amd.com> Message-Id: Date: Mon, 21 May 2018 16:48:32 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: AMD: Move clk enable from hw_params/free to startup/shutdown 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 e9716ff3dcd052d8640047860a78c948629c6c70 Mon Sep 17 00:00:00 2001 From: Akshu Agrawal Date: Tue, 8 May 2018 10:17:50 +0530 Subject: [PATCH] ASoC: AMD: Move clk enable from hw_params/free to startup/shutdown hw_param can be called multiple times and thus we can have more clk enable. The clk may not get diabled due to refcounting. startup/shutdown ensures single clk enable/disable call. Signed-off-by: Akshu Agrawal Signed-off-by: Vijendar Mukunda Reviewed-by: Daniel Kurtz Signed-off-by: Mark Brown --- sound/soc/amd/acp-da7219-max98357a.c | 49 ++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index 215b06bf2039..6495eedc3d4c 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -91,8 +91,7 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd) return 0; } -static int cz_da7219_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) +static int da7219_clk_enable(struct snd_pcm_substream *substream) { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -106,11 +105,9 @@ static int cz_da7219_hw_params(struct snd_pcm_substream *substream, return ret; } -static int cz_da7219_hw_free(struct snd_pcm_substream *substream) +static void da7219_clk_disable(void) { clk_disable_unprepare(da7219_dai_clk); - - return 0; } static const unsigned int channels[] = { @@ -133,7 +130,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = { .mask = 0, }; -static int cz_fe_startup(struct snd_pcm_substream *substream) +static int cz_da7219_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -147,23 +144,47 @@ static int cz_fe_startup(struct snd_pcm_substream *substream) snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); - return 0; + return da7219_clk_enable(substream); +} + +static void cz_da7219_shutdown(struct snd_pcm_substream *substream) +{ + da7219_clk_disable(); +} + +static int cz_max_startup(struct snd_pcm_substream *substream) +{ + return da7219_clk_enable(substream); +} + +static void cz_max_shutdown(struct snd_pcm_substream *substream) +{ + da7219_clk_disable(); +} + +static int cz_dmic_startup(struct snd_pcm_substream *substream) +{ + return da7219_clk_enable(substream); +} + +static void cz_dmic_shutdown(struct snd_pcm_substream *substream) +{ + da7219_clk_disable(); } static struct snd_soc_ops cz_da7219_cap_ops = { - .hw_params = cz_da7219_hw_params, - .hw_free = cz_da7219_hw_free, - .startup = cz_fe_startup, + .startup = cz_da7219_startup, + .shutdown = cz_da7219_shutdown, }; static struct snd_soc_ops cz_max_play_ops = { - .hw_params = cz_da7219_hw_params, - .hw_free = cz_da7219_hw_free, + .startup = cz_max_startup, + .shutdown = cz_max_shutdown, }; static struct snd_soc_ops cz_dmic_cap_ops = { - .hw_params = cz_da7219_hw_params, - .hw_free = cz_da7219_hw_free, + .startup = cz_dmic_startup, + .shutdown = cz_dmic_shutdown, }; static struct snd_soc_dai_link cz_dai_7219_98357[] = { -- 2.17.0