Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp641057pxb; Sat, 6 Mar 2021 11:27:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz9jbTEbSeVnKmOCgKqfdH4YEBtWVdoh6BFz85DkFfi5dw5rv0nE12reEHEC0GB5156mHT X-Received: by 2002:a17:906:c099:: with SMTP id f25mr8160016ejz.141.1615058864036; Sat, 06 Mar 2021 11:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615058864; cv=none; d=google.com; s=arc-20160816; b=QslojfkGarWyl9r2XcDo1/D/wAs8tw9TA4RfwGouswbyGA8infFpZuN8EfrX+93YNY +JYusYshp5tMd+Z2Xy4tV/omSW7MyFxlKXQBPweUCUGEieayHGf08OibGTZ/CSArgABI sE6KUccfrkI7E2BTgFnf1H6csTIaQjq+ng7YXJgZscbcUF9MbNmxePjBBNyy8WoMqJNz BDK3tsF+Y1lQJNFLh/3JximGzgh+i+bgs2p5HL01SmMwEHlO4oLokVV2kV9Ti2WFGU6C 7xwe2KNc08QGbqj1YfbUFKdRPZcFMW6orEG9eubFL3gBlNPnP4I3EgQPAOJ2QmnzVB3k 3mbQ== 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=d+V+AdeQnaNziweHIhgdOCFIfRu42h0lzdFTdJWQ4TQ=; b=NjMsVvsshI/FFFiGQMIJyoK5l3z3LHupKDEYWWv6bmuO8oMHExOSiQvSYYoyQhpc69 GA2UbQ7nFHNJ4cqdy5o2b7YYOMagfPaJSkWh5VN3Oj/SGLzSQjX9JAfm12bVCS/VJ9rH yTfxp4/mJJ2af1Jfo71spIfyj0nhXYvwhS4Luhf2H7CYv0ARMRAajdFtQhSaEG7n/vRY BcUgZwUXwKGkQKJWF2RT+dOHF2cVnDw5yVuPCEw0U42Spbg/FNEredIS9cJOjz9QUhwJ x+rEH7gvdTQNTR/pTa0V4kuHPbItNmMq5ENpCzR1EE/67K8kGN/AwIxyTp3qcWTUCm/0 yYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=W2Di5q4z; 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 x6si3761270ejb.380.2021.03.06.11.27.20; Sat, 06 Mar 2021 11:27:44 -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=W2Di5q4z; 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 S231431AbhCFTOB (ORCPT + 99 others); Sat, 6 Mar 2021 14:14:01 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:32698 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231366AbhCFTNr (ORCPT ); Sat, 6 Mar 2021 14:13:47 -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 126J6uDJ011401; Sat, 6 Mar 2021 13:13:32 -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=d+V+AdeQnaNziweHIhgdOCFIfRu42h0lzdFTdJWQ4TQ=; b=W2Di5q4zGeV7rCkSwLuCcrBmP4NezQoOSzpm6M+TK+yhEuFSA+JyDoTfZdF45J6zyieA 7NVuGEcadiWbgjDnOZLw9lwQ6GfDKjeb/berN97r2sjIb1ux39IPoZixOoOzMga/PmEB RoMvPzM/lWUoZ8JKOdfY1YBewY9IaVl3Ty4Pnr16SL45DgZOrWR8fbqthtEiTiekMeme cyzu4F1CngdJ4/hiQx+JuBkR8b7D0mCuyALHrKWr/o7DPi4WbiLBkNQISNa0FB8Rv6DL lnthQapyR3E/iae1NUIEOW7wgK+AvVDHrzePetpmL3VeiLU3Xe0WbYGLHFEEKs42162p Vg== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 3748198d06-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sat, 06 Mar 2021 13:13:32 -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:27 +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:27 +0000 Received: from mail1.cirrus.com (unknown [198.61.64.35]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id F29AC11CF; Sat, 6 Mar 2021 18:56:26 +0000 (UTC) From: Lucas Tanure To: James Schulman , David Rhodes , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , , Lucas Tanure Subject: [PATCH v3 05/15] ASoC: cs42l42: Always wait at least 3ms after reset Date: Sat, 6 Mar 2021 18:55:43 +0000 Message-ID: <20210306185553.62053-6-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=990 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 This delay is part of the power-up sequence defined in the datasheet. A runtime_resume is a power-up so must also include the delay. Signed-off-by: Lucas Tanure --- Changes in v3: - No changes Changes in v2: - No changes sound/soc/codecs/cs42l42.c | 3 ++- sound/soc/codecs/cs42l42.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index eee3fc3200308..811b7b1c9732e 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -1756,7 +1756,7 @@ static int cs42l42_i2c_probe(struct i2c_client *i2c_client, dev_dbg(&i2c_client->dev, "Found reset GPIO\n"); gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); } - mdelay(3); + usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2); /* Request IRQ */ ret = devm_request_threaded_irq(&i2c_client->dev, @@ -1881,6 +1881,7 @@ static int cs42l42_runtime_resume(struct device *dev) } gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); + usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2); regcache_cache_only(cs42l42->regmap, false); regcache_sync(cs42l42->regmap); diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h index 9b017b76828a4..866d7c873e3c9 100644 --- a/sound/soc/codecs/cs42l42.h +++ b/sound/soc/codecs/cs42l42.h @@ -740,6 +740,7 @@ #define CS42L42_FRAC2_VAL(val) (((val) & 0xff0000) >> 16) #define CS42L42_NUM_SUPPLIES 5 +#define CS42L42_BOOT_TIME_US 3000 static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = { "VA", -- 2.30.1