From patchwork Fri Feb 16 10:11:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Rodionov X-Patchwork-Id: 202065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp413644dyb; Fri, 16 Feb 2024 02:13:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUKYqSkt70oXXFF0/KaRwyscct2MRzo/Ev9s5pi2zJ4DF1YLunsYOO+WrW4LTXZrY6K4rG8myvmv/q6Iwxm1PAyUe1Iuw== X-Google-Smtp-Source: AGHT+IEzXHoaLoYveUuPqbHILMu1CYIoT/qHUQeqFcAkt53giv44yiubELbw5nuYHqnoV8A0EGtD X-Received: by 2002:a05:6870:56a8:b0:218:c918:a06d with SMTP id p40-20020a05687056a800b00218c918a06dmr5123637oao.32.1708078406688; Fri, 16 Feb 2024 02:13:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708078406; cv=pass; d=google.com; s=arc-20160816; b=j0PD4wx/BDg+5VXi3q0gXaqJ5DleGAk0NF9YyoI10FO8eUZBE2f6OtA7IH5OdvsW22 GulH7AKn5Hq86sfbFmImBG5jxKy4ZIKvO0g7ajpBRQ0FQRk4teIq5q8ettTA5dJnMuDN iNsBe/SWuEKZBCwxHtgOcI38fBRaQLL1oNNXXkIlLfJmlbi4cxOF5uGSVnb7uduODH2o FbK/QZhEtlZPMb4RMitD6bZRMoV/2uRx3OFiv20+96oelGv0oZE6hvQ2nZxFFV9SQrTM sxS9Y9fIBwfDP0F3SCTF0da7J1EOf3fw4EHcZKdsnDLipDxqCulsoX91hzdKnfvnFGAD 5ffw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=yBl3sKU+2L8E6Xmqeuy6j40kaWR7Rwcru9wjT8+Wxww=; fh=burN6xTHcnghXHYyVb+cSH0RpS4pQbq7wKpUW+bbWbQ=; b=OgQgRm3YAXaoytVf4wtYc1dtwUcbHcU9dbfwqC1/BMaVJzODrTW14UXClzakaCTRez YpNlc2SH+qQSPImvrDYTqdRbiK/tFtYcSqb08y+SV2P+HB9Yg7MWK2DzHpfD2YZLGW8s eCJ7kNCNjrSePR/zOnrV39XPTnfw465dHlV+9RfMEWVNWbqCc94QpJjGegU7H7h2C6l8 YGA81tpJ1rj6rFc6/OHdu/+aNYL6UzDt9apibTalUQzNj9jpKgOFj4qVMJQdM0kRowIY 4Zyc3LGFlVfO4gjT+RzCOglKI5dxHftG6kal+cXtHmooH6D6+wymU6SDWar3Fy4MACBO VK0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=cCCU8feS; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-68426-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68426-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k25-20020a635a59000000b005d3fad648d9si2738034pgm.296.2024.02.16.02.13.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 02:13:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68426-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=cCCU8feS; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-68426-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68426-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2CC4E2858D0 for ; Fri, 16 Feb 2024 10:13:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5047A1CD0A; Fri, 16 Feb 2024 10:13:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="cCCU8feS" Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B599F1CAAC for ; Fri, 16 Feb 2024 10:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708078387; cv=none; b=RzoB0+JUfs+8v9sWGsUjfqFStUXolqJ13eIQTrEgq8Il+Yj17TNOWBn6dR4hMo1unR7RIWG58WQzW2rr++huP1d0Yqj64kPqHflNJsc+nPXcrTlMaA/5ybt7/ylsCJVhdXv6gtLzeOrz8a1JT+THbUxcUEHFze4C1iLysyLPZqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708078387; c=relaxed/simple; bh=ddSHJRLWu0hndL+TKATWxu/fkQ5Cgt2wZVl4XXmBDmc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jIeGs3dObUk7YcxjBzz6eT4FbE2YTVGELde+nCofyDkOqv4gn+vJDV+2oMF/WUR3qZODlbSdDb0whWpMqqq+9UsSX4hI7cdajuiDgyu8pWo0/rEsm+o/TKDWb5MjauV6Ob4pGwf1Rrkod8jSFFidXialFTGvQwpdOX8LoOUQdIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=cCCU8feS; arc=none smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41G7jo54008245; Fri, 16 Feb 2024 04:12:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=y Bl3sKU+2L8E6Xmqeuy6j40kaWR7Rwcru9wjT8+Wxww=; b=cCCU8feS682LwGXVU IhIxI/WXeHUTfJbWYlekatdSIv9LSdHNPSjZaPs5IouL3/mrjG71XQXkplkPcC+t IkgXebFAcKHC3cVmRZh3fUvEcHMV4rAajVR95R7HBJhUAoX1g3kjDba1blEy1Njk At5AJffR2hPIdDB7cW6NMPVQAqmNcDDY9xOYP7mfdJ14TJ6a8dVHqwkKtCX+7ood 4oLP9d78pfl0fBFKgo2bBA80DrvHRYiN9aDNwhruDg0dCzZ0dr7c6Bd7XwDoNuqy GAuaNuQFN4NmuUsiIGCXA2Y9NcyFFsL/WWc+0lQQF7V830IHhpiUpXvFTrWhOup2 3KwVw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3w67e26w8k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 04:12:34 -0600 (CST) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 16 Feb 2024 10:12:32 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Fri, 16 Feb 2024 10:12:32 +0000 Received: from lon-bigdaddy.ad.cirrus.com (unknown [198.61.65.28]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 4C923820242; Fri, 16 Feb 2024 10:12:32 +0000 (UTC) From: Vitaly Rodionov To: Mark Brown CC: Jaroslav Kysela , , , , "Vitaly Rodionov" Subject: [PATCH] ASoC: cs42l42: Remove redundant delays in suspend(). Date: Fri, 16 Feb 2024 10:11:57 +0000 Message-ID: <20240216101157.23176-1-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: SPHtKxswNvwdYnim-ycZigmdJQrTo97J X-Proofpoint-GUID: SPHtKxswNvwdYnim-ycZigmdJQrTo97J X-Proofpoint-Spam-Reason: safe X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791050022998397565 X-GMAIL-MSGID: 1791050022998397565 This patch will remove redundant delay and minimise total suspend() function call time. Signed-off-by: Vitaly Rodionov --- include/sound/cs42l42.h | 5 ++--- sound/soc/codecs/cs42l42.c | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/sound/cs42l42.h b/include/sound/cs42l42.h index 3994e933db19..1bd8eee54f66 100644 --- a/include/sound/cs42l42.h +++ b/include/sound/cs42l42.h @@ -809,8 +809,7 @@ #define CS42L42_PLL_LOCK_TIMEOUT_US 1250 #define CS42L42_HP_ADC_EN_TIME_US 20000 #define CS42L42_PDN_DONE_POLL_US 1000 -#define CS42L42_PDN_DONE_TIMEOUT_US 200000 -#define CS42L42_PDN_DONE_TIME_MS 100 -#define CS42L42_FILT_DISCHARGE_TIME_MS 46 +#define CS42L42_PDN_DONE_TIMEOUT_US 235000 +#define CS42L42_PDN_DONE_TIME_MS 65 #endif /* __CS42L42_H */ diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 2d11c5125f73..60d366e53526 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -2195,7 +2195,6 @@ int cs42l42_suspend(struct device *dev) /* Discharge FILT+ */ regmap_update_bits(cs42l42->regmap, CS42L42_PWR_CTL2, CS42L42_DISCHARGE_FILT_MASK, CS42L42_DISCHARGE_FILT_MASK); - msleep(CS42L42_FILT_DISCHARGE_TIME_MS); regcache_cache_only(cs42l42->regmap, true); gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);