Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1709057rwb; Fri, 13 Jan 2023 16:45:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXusKBZxR+6d8rrasVJnqwJVTIQRXCTWhfAhz4/T7YTE0+xgNnh2LJTEPUUiRnTsRvtU0TMN X-Received: by 2002:a17:90b:3004:b0:227:24d0:41b9 with SMTP id hg4-20020a17090b300400b0022724d041b9mr328710pjb.26.1673657118005; Fri, 13 Jan 2023 16:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673657117; cv=none; d=google.com; s=arc-20160816; b=vaQvzy9RuJfKzqGUmW97/S86uqu5jBJO0uMKfsBw7pd4Bq7HRNjWBwaHgPw0OkB/gb QzzlcBSCMwc9y11mCEfjykDobVbp4aGMYZOtyk7iM+GifMKRcGYO/sZjRuNjCWHV81xz Gd4XuwQdtfrctb3eGqjMB85ptJ82L1m37an2SbjDD66HqcxpQnAMq9P5jBElCByaLaqV k4sI3ElItsgw/173G6xxpB3eM28/+THi95zQWA9GjkwdNxZEHUpQrZqFR48OniOcv+PU VK9gFK+WpW7Iu41AQUbRRfdJqpTHcREh4+GkskEaC+pqwOFQGGUzIjBZpFdXtE8VGck4 YBUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=06oSer/hbIX+e8ixGpELbsOVts3pi8H+tRTjkc7QSco=; b=cF2TcIDm8bJGs+uOPzHqpklP5fIxcZByAyp5EtiYruINRRF/sKJDb5y2w1OYWmxE6r U20Qw9ew/b/0xWMR6/eHwxl7sCFfqfdUvOH6Ca2Hx4tJiZcibqXLhDx+DWv4AN3nzVQH 6F917ZMQNZ0kmUewZ1YEkicWbKMUYfLw72X8vJ3Cyb1phiZVWryQsSK5oiREHBIgMBIQ T60lxCsB467Yz0C0yVXUGEg+21ybEuSjb+sRIyF45tn2tk7l98Y9lTHOalVtOqLuAWuA dUdf0kvmMAwmc7Dy6qKB+GuJzR2up5QWdMBLvgoxhAfab6THpehQFowmldRiujGF/RlC lD6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@undef.tools header.s=fm3 header.b=d2NkJzL1; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OgLKE3xT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=undef.tools Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a17090a2c0900b0022645e2a88csi19978413pjd.56.2023.01.13.16.45.11; Fri, 13 Jan 2023 16:45:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@undef.tools header.s=fm3 header.b=d2NkJzL1; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OgLKE3xT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=undef.tools Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230515AbjANAb0 (ORCPT + 55 others); Fri, 13 Jan 2023 19:31:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbjANAbY (ORCPT ); Fri, 13 Jan 2023 19:31:24 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F5D46C06F; Fri, 13 Jan 2023 16:31:22 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 140455C00A7; Fri, 13 Jan 2023 19:31:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 13 Jan 2023 19:31:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undef.tools; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1673656279; x=1673742679; bh=06oSer/hbIX+e8ixGpELbsOVt s3pi8H+tRTjkc7QSco=; b=d2NkJzL1JwBETuvfrCBMhHNw91k9PEmBfKLJc81Gn qZBJ/dTpzWX1uNkywAsErH1obEYD6+W3XSqpb0SjEQ0Re87mW2jYm3HKyRARU6XR DLsVNRsz6Lr8fsIGxuILrXSShPJ+3XoJ7I4pvTtY+A46Xrkzd3TibguPUoEerSAu 6nw80dJmRNexmL6rg3TJndYhU0eE/OK3MSLjZ+gaw8T03AjcHKLKfyUt/sXMICkc 9O252C5oFKxYQg1l0HH0ADUg7NaS/l7YINW6WRPUJHfpS8bG+83999h1vjMQzjaq UKON3SmPXQgiqT9hwnVCcngTvQx6gxLj/e5iXm350gvvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1673656279; x=1673742679; bh=06oSer/hbIX+e8ixGpELbsOVts3pi8H+tRT jkc7QSco=; b=OgLKE3xTvIREhVSDtMWTJj5enSFDb9I41shZnityxl7dkfv+vao 9KNQr8Y7gP/O2mJwSuoE4qsfrOBtZGVjVx/9cb4iUu1G0eAQRx1AfpQI3lBLov5D ynETmT3m1ZHdsCtNED6wYkfReHJ+OQ26uZc6t3Q7pVjjHtWm8uVN8WxTCyZl0rMr tdDa5y3ZlqKpjYyecAZbKo5mczg6d4MJRC9LdwmL2HGNEiRdA0MAGDi7ecgGYiKu E8TahxaMd4uFYBGqJ+J8yXVHU+fA+3uzibiGf4P+GZc1Kg4MRjo3xnytaxXsL5iI mLYUsvgrra2J3Byfkt4pREX7lvLn4yaXUow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleelgddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflrghrrhgrhhcu ifhoshgsvghllhcuoehkvghrnhgvlhesuhhnuggvfhdrthhoohhlsheqnecuggftrfgrth htvghrnhepjeeuvefgjeefgefhhfefhedvffelteehkeekvdefheeiteeutdehveeghfeg kefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkh gvrhhnvghlsehunhguvghfrdhtohholhhs X-ME-Proxy: Feedback-ID: id76147eb:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Jan 2023 19:31:14 -0500 (EST) From: Jarrah Gosbell To: Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: phone-devel@vger.kernel.org, Ondrej Jirman , Jarrah Gosbell Subject: [PATCH] ASoC: codec: rt5640: Resolve failure to set DMIC clock after playback Date: Sat, 14 Jan 2023 00:30:54 +0000 Message-Id: <20230114003053.401274-1-kernel@undef.tools> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ondrej Jirman rt5640_set_dai_sysclk is called with freq == 0 when playback stops. This causes DMIC setup code to fail. I2S interface doesn't need to be active for codec to work, so don't clear rt5640->sysclk after rt5640_set_dai_sysclk is called with freq == 0. Signed-off-by: Ondrej Jirman Signed-off-by: Jarrah Gosbell --- sound/soc/codecs/rt5640.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 18e01949f20e..054de41ceccb 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -1839,6 +1839,9 @@ static int rt5640_set_dai_sysclk(struct snd_soc_dai *dai, unsigned int reg_val = 0; unsigned int pll_bit = 0; + if (freq == 0) + return 0; + switch (clk_id) { case RT5640_SCLK_S_MCLK: reg_val |= RT5640_SCLK_SRC_MCLK; -- 2.39.0