Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5255169pxv; Wed, 28 Jul 2021 06:49:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF6bD7TYMFFR+29454DF7jC4Ii6tDM9TALJ8F3JukHBP4mCSx2D+MFbIjhWAbRQDadniPt X-Received: by 2002:a02:380c:: with SMTP id b12mr85383jaa.68.1627480168999; Wed, 28 Jul 2021 06:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627480168; cv=none; d=google.com; s=arc-20160816; b=iYxLmQxJiENIAXuxOMMhBkVxvuZSfVfFyVVdAtrOoYLCDpzmfh1b1AhMESLltLWgZt De+S4hCQ01Mgw7mZtLz23cy+MXZyNkgIqEZ8Mx8jo2trwXSgmL9RbmOQQp3+XbCsqIeZ 9yQ8Q3Zww1LZPtb70aU+OnAGorizzd4euPbgQspFiKnWBzQzvolLixbhsH0oWe2kGMeI qaLoCuzu9skSXtrAhAgsS0NS9Bxia2+mmlFLCl5LIhCaJ3jI7q9kg9Gr7QYR3KTYzO1e 3pF3ueRAHGA9eAZRp0KprcO3rPYxjwEyREANyKtnvxTAAn2NHZQ3GSqmuB1RHI0U0EJf haMQ== 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=5vyRKpHWzUCIxKnuzL8uynmnpCsZb66b8Ukt92ISVS0=; b=K7moqSNCRI1UwJZGpX1IK8l6AJUjCz7ni71Lxr0/hWOmTbsiqdRKhtggXjtGOQayIQ 9dUVefKrYNp8WvCGTDX4BQCIoi9O6KP6NbaGeirMg2B74OLliS2xjPlk8alPkQkqg3Hl y+cOGzJmmBI/gGmsJps8zcWKv+WBKvmhaeFCVFEeoWdIVQ8zp8meHQtSRyeC7U4r5c4I wZ1k77xdjvq4zHpIvMcS0C2ZBzO5TlCZehdacn2WVtgXT1ryQNtYohR5VGtk0mIo3mBC qeGkLaoE9WuISOSH/hQ5YCw8coMMJPMvHUHbzic+kOzez/n/ESJbHJDH601nRdmPrYU3 8P9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lzOB0E2T; 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 d12si8050337ilg.4.2021.07.28.06.49.17; Wed, 28 Jul 2021 06:49:28 -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=lzOB0E2T; 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 S237059AbhG1Nr3 (ORCPT + 99 others); Wed, 28 Jul 2021 09:47:29 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:28110 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236642AbhG1No4 (ORCPT ); Wed, 28 Jul 2021 09:44:56 -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 16S5XUr3014335; Wed, 28 Jul 2021 08:44:44 -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=5vyRKpHWzUCIxKnuzL8uynmnpCsZb66b8Ukt92ISVS0=; b=lzOB0E2TqNLBRmaCuTjmrKmJ8s3ZK1Q5fFvr1kaskUm4GwlsEJg0opOgfzFzmczvgcA6 2LUJ3g9R7zINGtjULtn7LV/HXoNglDHjbf637cYqgoQP0OlJr3a3rR6oPiMfKBm8dD1C 0uS6EUP7PKUmt8M5oUo7Lqdhnt8Z8ew1lbMFkFr9FmfnamRa5zTj9UJgdGeM1UI25vDe XKY5+nvn87rK91cSxrk8LaOUJQe3dp0/l+YYR5M1TjeCfei3eDgfWnxsx1TFXcSnQiRx ziqYYteK42rZthu+XdX1ZSAt8ZyuJAzSPmbJnWmZsBOiJqFHe9Ru1BPmtE+0tWAnOEwp Tg== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 3a30q20fx9-17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 28 Jul 2021 08:44:44 -0500 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.2242.4; Wed, 28 Jul 2021 14:44:38 +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.4 via Frontend Transport; Wed, 28 Jul 2021 14:44:38 +0100 Received: from vitaly-Inspiron-5415.ad.cirrus.com (unknown [198.90.238.32]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id E3DF846E; Wed, 28 Jul 2021 13:44:37 +0000 (UTC) From: Vitaly Rodionov To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v2 25/27] ALSA: hda/cs8409: Remove unnecessary delays Date: Wed, 28 Jul 2021 14:44:06 +0100 Message-ID: <20210728134408.369396-26-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210728134408.369396-1-vitalyr@opensource.cirrus.com> References: <20210728134408.369396-1-vitalyr@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: KUQgfGSsemspQDaebE0JBlq8oVSEp-hb X-Proofpoint-GUID: KUQgfGSsemspQDaebE0JBlq8oVSEp-hb X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 adultscore=0 clxscore=1015 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107280077 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 --- 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 422381913bc6..1e48337b782b 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -520,12 +520,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) @@ -632,6 +630,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)); @@ -899,7 +898,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; @@ -1094,10 +1092,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