Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp640200pxb; Sat, 6 Mar 2021 11:25:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTp7o5uHFOMtIP1+quDOHvsf25p+XD/tKEwumUy3AxbKyBHSl3i2/5y+cM/RrRfLyew7kK X-Received: by 2002:a17:907:a042:: with SMTP id gz2mr4472004ejc.174.1615058741004; Sat, 06 Mar 2021 11:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615058740; cv=none; d=google.com; s=arc-20160816; b=Opo6FkG987tKMvao2Y2DRdDKCgn50rVWzLHXfzm77LvFCdVqOiGq7BPxZO6ht6//zd JwhXUfKCNZW/AuBjlVof/yPJ+sEZAo+0vY5ONpKjCce6s2NZRhk6qp5LLX5Usx2tgS0H 5994BOFU3gC3VbFAP3uzMvGVZT7ffI/dOAotaun0lgw17S+Aa2oHBpUHsqRZAL7Uq0bG D62m3T6+q6P/icKcX4I7fvXzuI77e2Hq/71HVPH5DBWqWYl2prhNAomjLoCU5wEO/o56 OIP9OaIzpzi1THxZ3yK0eUc4to42VffP3nvC0OCW8eIMqIq5uadB22ZlIH5Y0ZllFqt9 f2OA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3+mEvs73up6nUSnS6x/qDcB4A4e6/5agXr3vE8x766o=; b=Dcaxdus6ykIVrnSiUt62yQvW9rS+GVQr0opVnbvUbnrlMnIU7qeylS4K5oJrymtWGM EQa9SHutBusyhi0UPyQceCPUFjjmP9gIKS3DHszNzQm2yUXFrIQP9PdN3zQsRtQq1Tv1 5hVc/ItPbPnQ0Qc1kkhR+c9L0kYFfF+BS9Th1zeyn+mx7hcP4eUGuThy/RY8XYElXwBf 0Z/vqd4Z3CrsO2WgXVdrQZ4oRWv5VvsASCviaSXW4kg4OTsMbaTzj2pdpA5CEUdSos5c 0pCrCW0x2mLaApxE5WKo6UuQRKMR/EsDIzwkyYQFBQxaqHsBr7eVv7V6Iw2BrN4RFQT/ BhSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ClLMUdRS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fi16si3745247ejb.239.2021.03.06.11.25.17; Sat, 06 Mar 2021 11:25:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ClLMUdRS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231417AbhCFTOA (ORCPT + 99 others); Sat, 6 Mar 2021 14:14:00 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:48340 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231359AbhCFTNp (ORCPT ); Sat, 6 Mar 2021 14:13:45 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 126J6uDN011401; Sat, 6 Mar 2021 13:13:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=3+mEvs73up6nUSnS6x/qDcB4A4e6/5agXr3vE8x766o=; b=ClLMUdRS7Dg+bc9dNfW0N8jFTXFTwoOAfR3gKbqLoAp4DUqgfgTXC5U6G3yJB5ZWR9jT Aw51PmO3lX32regdM3LULuQSBJTWxZB4UArcOuhBCHVOKZc0r/P8KsvYaNI/a+PcN4Ln Pps7zISpauOOng/iHpSyXHzrG41htatOye+z0qemIVLzzSJfWDlHw506DvXuiOd+rAjj KzOe5ghugSs6NrLCG1o7oT++ZolyvL08ZEFKobSmcjfxfaWkoF/hq3QVMURMcWjGjVsB 5bq9PEltSpXUU/9WUaSyE0v8Jl7YkDyzy/vlWGLp1tUkSTYqJlwHatmvl6TZf0lYQIiN gA== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 3748198d06-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sat, 06 Mar 2021 13:13:35 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 6 Mar 2021 18:56:29 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Sat, 6 Mar 2021 18:56:29 +0000 Received: from mail1.cirrus.com (unknown [198.61.64.35]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A4C0F11CB; Sat, 6 Mar 2021 18:56:29 +0000 (UTC) From: Lucas Tanure To: James Schulman , David Rhodes , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , , Richard Fitzgerald , Lucas Tanure Subject: [PATCH v3 14/15] ASoC: cs42l42: Only start PLL if it is needed Date: Sat, 6 Mar 2021 18:55:52 +0000 Message-ID: <20210306185553.62053-15-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210306185553.62053-1-tanureal@opensource.cirrus.com> References: <20210306185553.62053-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 suspectscore=0 phishscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103060119 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Fitzgerald The PLL is only needed for sclk < 11289600 Hz and cs42l42_pll_config() will not configure it for higher rates. So it must only be enabled when it is needed. Signed-off-by: Richard Fitzgerald Signed-off-by: Lucas Tanure --- Changes in v3: - No changes Changes in v2: - Lucas signed-off added sound/soc/codecs/cs42l42.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 08718fd10fb9b..d7a314aa59b73 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -887,8 +887,9 @@ static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) } else { if (!cs42l42->stream_use) { /* SCLK must be running before codec unmute */ - snd_soc_component_update_bits(component, CS42L42_PLL_CTL1, - CS42L42_PLL_START_MASK, 1); + if ((cs42l42->bclk < 11289600) && (cs42l42->sclk < 11289600)) + snd_soc_component_update_bits(component, CS42L42_PLL_CTL1, + CS42L42_PLL_START_MASK, 1); /* Mark SCLK as present, turn off internal oscillator */ regmap_multi_reg_write(cs42l42->regmap, cs42l42_to_sclk_seq, -- 2.30.1