Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4712023pxt; Wed, 11 Aug 2021 12:15:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCRl0DfaMmbUl7sryzyhesNkhcZ1WsXh9UrKV1sorfnoYlj563JgSHQZyMR4HKhR0Ah7ea X-Received: by 2002:a17:906:4810:: with SMTP id w16mr33429ejq.167.1628709311836; Wed, 11 Aug 2021 12:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628709311; cv=none; d=google.com; s=arc-20160816; b=zRhP8nKEORQjc4MLMRMMFWf6RFvjC1Vo5kPFXMkv7E5fjKFuZWd1vgwaOHRuFWlHI8 WUY8OiwrXx63G5GFTM9XaSjWUO7Dj3blJ0bWkJKbZeMOGPseudKXg+F9p/NWsNZeSWyh 5ENUxUGWT7DyIwL+8y8tv6zqOQ0ObN9PnjyiXtQKwJ32rigaXAavPHZ8nU0GX4hbPSpj USyiUPc4CVH0oSleSEVsBE8Amm2lOeOtmmNaTyD7kVOZZR7LQxaInwNeF79PLAni1Ut9 zw3PpJQkqIoivG+GO6NN6NhH8KFL5++AcA+20XftZu0ikw+c7sVmAgUCfeGDQEou/WKW 9OIw== 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=tAGn6pVi9o1qiLueUKyeFz8u0HK0oeRoruIzeE+wL8k=; b=fTUdiUK+Wq1Fc+xmzzX3zLjbnsJNLgsmCbWUqnwyt2urLss2mk/+N/anuHpv2vH6s4 YOKK7FWHHf37Ogm6IBtc605KSpYVnKqSX187fKVlKD4X7i5V7BFwXkrw54hfbL+12eBx vFvRQ3gMpVlojL7yelVwyixONlHOo2NcsIHVItp5H2L7NrPnNVp/ZFYA9rYGXFvwEAHm 0ViUUXPldg5OR8InKinXsfpzXt52YdAboi7opmbf5+/DVN64SXq6ORvhgJb7Cq03wzMZ JGbCrOY+uR/rr5h6ALyYIHMm4VzcAeN8HhqOonwXdk6OHE6WRnG+LRd16c5sanaOBLWL bAwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ab7ToA32; 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 cy28si207617edb.406.2021.08.11.12.14.47; Wed, 11 Aug 2021 12:15:11 -0700 (PDT) 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=ab7ToA32; 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 S231653AbhHKTNQ (ORCPT + 99 others); Wed, 11 Aug 2021 15:13:16 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:63730 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231605AbhHKTNP (ORCPT ); Wed, 11 Aug 2021 15:13:15 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 17B9hd05013981; Wed, 11 Aug 2021 14:12:43 -0500 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=tAGn6pVi9o1qiLueUKyeFz8u0HK0oeRoruIzeE+wL8k=; b=ab7ToA32u/5HdCb7atyoE95I00O0l+3eMo5bFX4U2dCFZ2AKlibotv0rlw2/Ii/d+/SR FTV05w3RLfTfVeLvZRfKjffu/DShuP2R1Y66M/ra84RMAw/ElPz+s34vH6okyLPYkAFq 8SrjhITFGTr600uaOw27qkn7uTFJ54Wc4IstAEGeshpwkUWtHk88uud4KnjAjXjoCPxt qDA9bZf0gcQYvMR/AbiF93+4XG8Hi/DQ7vsoji3HEyH4mckc9ObZufSUYAl+0hjJuM3h YC3uIGkgmXrrV+NXvttLsrDCI9ac/GWzYCrSsQy/xAxzP1KfqA+EUGhmfkT2PprBFJu1 zA== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 3acc5ngpgw-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 11 Aug 2021 14:12:42 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 11 Aug 2021 19:57:32 +0100 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.2242.12 via Frontend Transport; Wed, 11 Aug 2021 19:57:32 +0100 Received: from vitaly-Inspiron-5415.ad.cirrus.com (unknown [198.90.238.180]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 98CBB45D; Wed, 11 Aug 2021 18:57:32 +0000 (UTC) From: Vitaly Rodionov To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v4 25/27] ALSA: hda/cs8409: Remove unnecessary delays Date: Wed, 11 Aug 2021 19:56:52 +0100 Message-ID: <20210811185654.6837-26-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811185654.6837-1-vitalyr@opensource.cirrus.com> References: <20210811185654.6837-1-vitalyr@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Fps13D_fBALcbtnv7soQyb5kmhrWW5oh X-Proofpoint-GUID: Fps13D_fBALcbtnv7soQyb5kmhrWW5oh X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 phishscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=982 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108110132 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Binding Since delays when starting jack detection after initialization have been reduced/removed, it is necessary to add back in an extra 20ms delay after the init sequence to allow the CS42L42 to power up correctly. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov --- Changes in v2: - No changes Changes in v3: - No changes Changes in v4: - No changes sound/pci/hda/patch_cs8409.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/pci/hda/patch_cs8409.c b/sound/pci/hda/patch_cs8409.c index 9f6c51a5835a..b528c8353b3c 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -541,12 +541,10 @@ static void cs42l42_run_jack_detect(struct sub_codec *cs42l42) cs8409_i2c_write(cs42l42, 0x1b74, 0x07); cs8409_i2c_write(cs42l42, 0x131b, 0xFD); cs8409_i2c_write(cs42l42, 0x1120, 0x80); - /* Wait ~110ms*/ - usleep_range(110000, 200000); + /* Wait ~100us*/ + usleep_range(100, 200); cs8409_i2c_write(cs42l42, 0x111f, 0x77); cs8409_i2c_write(cs42l42, 0x1120, 0xc0); - /* Wait ~10ms */ - usleep_range(10000, 25000); } static int cs42l42_handle_tip_sense(struct sub_codec *cs42l42, unsigned int reg_ts_status) @@ -653,6 +651,7 @@ static void cs42l42_resume(struct sub_codec *cs42l42) /* Initialize CS42L42 companion codec */ cs8409_i2c_bulk_write(cs42l42, cs42l42->init_seq, cs42l42->init_seq_num); + usleep_range(20000, 25000); /* Clear interrupts, by reading interrupt status registers */ cs8409_i2c_bulk_read(cs42l42, irq_regs, ARRAY_SIZE(irq_regs)); @@ -927,7 +926,6 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, const struct hda_fixup *fix, * Run immediately after init. */ cs42l42_run_jack_detect(spec->scodecs[CS8409_CODEC0]); - usleep_range(100000, 150000); break; default: break; @@ -1122,10 +1120,8 @@ void dolphin_fixups(struct hda_codec *codec, const struct hda_fixup *fix, int ac * been already plugged in. * Run immediately after init. */ - for (i = 0; i < spec->num_scodecs; i++) { + for (i = 0; i < spec->num_scodecs; i++) cs42l42_run_jack_detect(spec->scodecs[i]); - usleep_range(100000, 150000); - } break; default: -- 2.25.1