Received: by 10.192.165.148 with SMTP id m20csp3865316imm; Mon, 7 May 2018 21:49:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq8ry9dIB/7ac9foCOz9DrB11D14HTm5lQT+HyAoq0pH99nZyM0OQZS0UzLvtf5Nv2FkIuO X-Received: by 2002:a17:902:265:: with SMTP id 92-v6mr38817454plc.368.1525754969395; Mon, 07 May 2018 21:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525754969; cv=none; d=google.com; s=arc-20160816; b=M/fSttBsoNoyJniNQGOzWzavseuHwXUpnyDCIkyYb1TPyS6ClGLFHIHm0F22mroTBQ m1qnJKsD5WS6zo6pDihXnK4MLzZewjYUTUy8I9EkC5d8/cju5b3HlSTmhb2ek+uoBRs3 GkGJUZiYV+v9LT94hALDTNrFX1ALHPPy6scomNTJRH8b0s5vEvYA1EcP1bpE7WREOim8 syJXjLmL4lZr1e70QzMi1tV56M+Xvo6DKwlETCCQo7sMuO+rC/i2pZghmiGScXXW+o8b pYbUh0HQRxGzEUB4AriOUe1fN9flQAeRXQrBcVST/UDE9pokuUI2QOA21IY7YP6oIWqX zd4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:from:dkim-signature:arc-authentication-results; bh=29MEB9XeSMspTBn8VfmlC2vppgoE38xv44dPYTnNrCI=; b=zMwc2ESPJTPFzcAviPrH2oj8Mcyq9aYAPWp5OTcpqHfKs8++aBpkfkeB/LWLECKuMs HisnWYrtt0PUCik+BUtlGz1jewWebEWkVbf0Zk3RTOIWCAUFgk21v1M7FDsUGUykWvvY iXkbH3PY5Ho/wgvdUdKBWpIExKwX8ShO4OYIfuv7QsoVGL6h4qnfRr/HOFc2zPJVP14Y iJYsxgUaSoDIYUtdyTvARKvT6IUTPUEZpRkAi8gLeHQGZk3q/00zpSXgqOu84++h+RP+ 7BCim31Y9Rh6b3aQtL7q/3FIbxV8f3rj8ldGsBP/oTF+MJWhjnGop9zMsyIRr7NkZGVq C2Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=uNr1BfJi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20-v6si24289854plp.7.2018.05.07.21.49.15; Mon, 07 May 2018 21:49:29 -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=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=uNr1BfJi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753529AbeEHEra (ORCPT + 99 others); Tue, 8 May 2018 00:47:30 -0400 Received: from mail-bl2nam02on0066.outbound.protection.outlook.com ([104.47.38.66]:40050 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751092AbeEHEr2 (ORCPT ); Tue, 8 May 2018 00:47:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=29MEB9XeSMspTBn8VfmlC2vppgoE38xv44dPYTnNrCI=; b=uNr1BfJiJeb8tkS/FS+LizEjlmwj6fWIO7j8OzUcLAkbatpmm6hKeIN2FNglIJlutyY0yr8lLBiXDRqmwRLrVwg2io7Xj40JSo/ccxHdTSsW2MsI+sC8LF+5iwaqYxl0yJ2O54i2NdBmmcVbm8SFNtoC7jDgp0QfzGBb5hp7iJ0= Received: from CY4PR1201CA0003.namprd12.prod.outlook.com (2603:10b6:910:16::13) by BN4PR12MB0754.namprd12.prod.outlook.com (2a01:111:e400:59bc::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.735.17; Tue, 8 May 2018 04:47:25 +0000 Received: from DM3NAM03FT028.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by CY4PR1201CA0003.outlook.office365.com (2603:10b6:910:16::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.653.12 via Frontend Transport; Tue, 8 May 2018 04:47:23 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT028.mail.protection.outlook.com (10.152.82.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.735.16 via Frontend Transport; Tue, 8 May 2018 04:47:22 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Mon, 7 May 2018 23:47:21 -0500 From: Vijendar Mukunda CC: Akshu Agrawal , Vijendar Mukunda , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Daniel Kurtz , Kuninori Morimoto , Wei Yongjun , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH 07/10] ASoC: AMD: Move clk enable from hw_params/free to startup/shutdown Date: Tue, 8 May 2018 10:17:50 +0530 Message-ID: <1525754888-14124-7-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525754888-14124-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1525754888-14124-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(39860400002)(39380400002)(2980300002)(428003)(189003)(199004)(105586002)(77096007)(109986005)(4326008)(47776003)(36756003)(336012)(68736007)(54906003)(305945005)(50226002)(53936002)(426003)(39060400002)(16586007)(316002)(2616005)(26005)(486006)(186003)(11346002)(72206003)(5660300001)(476003)(126002)(446003)(478600001)(8936002)(97736004)(76176011)(51416003)(106466001)(8676002)(81166006)(6666003)(7696005)(48376002)(81156014)(1671002)(356003)(50466002)(53416004)(2906002)(104016004)(86362001)(266003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN4PR12MB0754;H:SATLEXCHOV02.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM03FT028;1:uts+4SqUlNrkMlu2FDQUku9vh8aLd3eYnU6UL/art0z2Hk9m+i1zpV71Gf6s404T01yp5P/I3Of/+alWevtX4aWghKP2Ty5FGlMmomJA2IwocfQjpeg03j2SWROSzD3u X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060);SRVR:BN4PR12MB0754; X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0754;3:LjV515WZGuPIlmB2tDOW2rTRhf0VwyDzuUjTIiqD+dNNJsXUN6sCqls9ccOzwXMKpoLVsMoiqWUcey6rfowrD2ojtKvR4BQ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Gv4djXgz+QYD5l0ewTRXpyZqDb2pi5gAKyZklcO/ozUxo+WvM3A0A0VdZS3h00k2G/AOFZ/sm0GeEovc/VqK2uqBQtOG8vTIQ6dnE6mpch9K4o8HdU9QLr+9Dnv/FVzzrt2oCfcFqywmlHqDHA4X1Nkuy2uI7zyxPWGtpWEAnGUIqn9yEVJaC5scy4C34wP9O0T7u69H/YNFuxw2/fPpCPNqF81HAYrb2EdzrDR6sCWLM5ookVgfHETiwOdXmn6IfYNZI2S10j2d0T0mG3bFg/8D0QF3x9JSneNcNLwayNGiBg6Wg5E+HxOYTRLleZfi/OZbA6VDx7OyHUontdivlC111cjopJvwj7I X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93003095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:BN4PR12MB0754;BCL:0;PCL:0;RULEID:;SRVR:BN4PR12MB0754; X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0754;4:XftzHJWWMpGWnibiQwKqNLALWZhEbn1j8Nkxm/Uh4S6NDm5xYL3WDdVDYllUW6DdzQGWImN3wwahavn63olZvsvmxw4eBYes5DQa+xjkaOMqeaExJGTEqBDkC383h11EcsPmMnAddNquT4JANG0nDUGbo1EspTUuypxDnLsUkuKCMV8mlvFRgvNx/vfK3RJy4m4g/JuS65lyuKrL3bDFbYtSj5EsU7aOvcSSxDABFroavycm5VVhPR9TBKWobAtWr+QNh4Tn684V5oIPn9slXYCC5msYPI1hqHM2qvyA7infrrhe8D8cSOIVjNfCBJwl X-Forefront-PRVS: 0666E15D35 X-Microsoft-Exchange-Diagnostics: =?us-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PzgCgTZ+xA355HK9qyxlwu?= =?us-ascii?Q?p04cy2QKampVKcXM9olcY23faEsZNeW5vsDIJCRyGwnuk5tylP0jylubGYrp?= =?us-ascii?Q?Nyour/3OqDiJ56yYmkTD0ZFRjvg3tNazZEMs98EDkc2Rd8z/02x6vdFmFjuY?= =?us-ascii?Q?tEQIywXw5OB+7PvliJGse2KMPd/Y97OjtFV8P2eWrU07t/xrbG5HhOTtEZQd?= =?us-ascii?Q?ikWwbcBl4seCyJazj5VwfBIJvr1XWUpyfDUazvaBzApBWCupzo3qR/doQ4nw?= =?us-ascii?Q?QkVmBHXDYyrw9m+aKauDVhhbgRPmGIShk3wAy9Ok+QQahdMV9zw7s5+sc0ca?= =?us-ascii?Q?XdWTkH/54vwcM0eBSDZZq6sNQOmhCD/E1n7Kisa+w6FKbCnIoXoYHcYyA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: VjwL+5NnIzdkSPefQfMuQdTm5XXKJpo3byvivmsfiCYgHGcEVseDOIO7mD9GbBN3RjQLUWdbSNIg/59pxfLfbFmPXY+qJKMBH8IjmLzkvXo7+EvyaaGXMZiUKBMozif/fDugyYK7ZVV9GtFf9x6SUPi5jqKs2BGyRj7bnBdZpZ2N11sB4rocl9hLLsfWT2eB X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0754;6:9bYU23IMGywHPGviL8eZr/n01KRAhcWeQAv6qv18CitOMmw75KBPulWQoYzRSN+0SAbWKb/0EFVbd6p3M+HMkLAj07qHsoc3yeW98iAmltgGKkshylmLQ8pglJK1BoT6DNsKhqVR7wiz0BAAMAavzZbSsKDXmesO/gZNGfU+hQuwOiqONAeiuFpDp3wxnuWabCi60xKTQre14MksG5SpZDzWIH1hmOb0FpdPt3N++HS+evhRmWTK7Gj1G0bFNFwF5eBjTR8Cp0gaweXzeGoQ2VPnzH+iG8STWTwNHuRDokSxoqGUUfkg1os8pt5LTUQGAzzy4hCBIDaWZQhvFfV72o26vnlwChzX3OcYntr/5PseSZlZKm11PZZxu0Orr4HluRzUqYZ4+dPtb3+l8kTZZd3wwrfzC/6E2Di3CNbNPrkTkKBQ5HBCSx26/TJJBQrC62Ak3q+72N7AtoadpQc4Xw==;5:TcK3RbhDUM6PEBUxUDXtDjBrwBBCst3KO16QOqT/6lkyxQOukcnX5eNp7y1EB25F/BmgJG2ZdwWmVRJPSTVt0i9fn0vo8xsPXPm0NLn4lXrL67aYyLGdeqeJFmdHS2kI6s61rygwf8YEYTB36Y4eqznSn0pdjc9mNnDqs+ntR1o=;24:O4PaFH55C2jTQyBJy3vftmGaZcmSo4WBk11CKFzPlP7ElTyWkJ6jQ5c9l6OAXRG2u35wJVQd4xEeoXnHHXyBvfscgGYueojaYfBcnhAc/9c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN4PR12MB0754;7:RwJKYGF+DCNDMXYBg3bu7k3V67P0W3R1LEiizi3dLsMS4YUJcVqysHeuPRqc/4G3OTZe4jJugEtdh8TRbeEg38YQ32fot7MHr4DFQT1+ktabMLoL7LOsymkUVn0FCWQ7WketgZA39IVi4uj12HSGMihC1KlIkWitGXU8p/2DhuQR2ax7EtAU8MmARraT8gZndrfYOp68/8F9BZfLTb+BB2UTVMpiivhapQu7kMc1E4RDS0r8AobEeDrSb39z94Hy;20:/2ZyusGqnCI4KOTOF7WVkacluosk4Uc8Lu2ba2GJESR1duSg0qFvTtinu9mJmlteFiKajrJhx+RBiidZW2PbKEvI7RGNlOcihXEQnBYyYwxD0jvR2a7CHxYFeaMS2ZmJgQxTu1LxUQ97qOhumNYrrBJTyMQVzV6lbFg381QldWwzWgPJ0vHG9HNBkbYwOYpbyOYvROdaqZ9sM6Cjg8Swh+LY0tEGZ2lfE9AfCVngVXid4QK0oADPpgX8kt+gbIUW X-MS-Office365-Filtering-Correlation-Id: ddac14fd-7dd9-4108-0bcb-08d5b49ec9fd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 04:47:22.4117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ddac14fd-7dd9-4108-0bcb-08d5b49ec9fd X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0754 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Akshu Agrawal 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 --- 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 215b06b..6495eed 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.7.4