Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7028425pxv; Fri, 30 Jul 2021 08:21:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC2f76MauSf1vlkT0bx9MKvYznzW8ps2ZaUbPe7BsDSIUF7mN0UVjrV/5jE1yIPwnRQuk0 X-Received: by 2002:a17:907:1c92:: with SMTP id nb18mr3153121ejc.191.1627658475353; Fri, 30 Jul 2021 08:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627658475; cv=none; d=google.com; s=arc-20160816; b=e/DoDo25jmVUg1A5QCu6+jH+2WaRkbw8cae3SHL2jkqXKSX4equJHQ+iHHxKJ5vKwC VEN0IirggcRYYrF1OhdCcs2PWYRr04E93VqBDZPkr+k0yVn9ND4oKle6ynUK3xQQdd/Q D+EXKmZopllaLhweN4iRT2khFJ5X6t1lfwL7XEVD3wsQXZYcnPy7vLFgbYxlGDnYbuHF i46CGdvC5UsKLYn43skHnFLOTLIfQXbhsxrjDtX4vJrBCo2l/E5hJW/1Byfm0Pf1a3aN SDpwT8lYhX2PkFQwihxx25emGkD4i3fxlgSAtR9nijlaCAryvRGPRbY5XHCJT3gfTLp1 Hkow== 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=GyuBDKCyV1SaoYri8Dc97gkB/CeJ6cBI4M+5dF98PXM=; b=kwZPk6wr2QfVVQ23GdZZq+iBlZG6vBFYsKPMfFoYvz5WNvSvN9ZgR4w0sN9PcPcVVR Z1JRyS8O8gvwxnQBGOxVtr7qWFglf275eSOfvdH7DruMrEKhI+NNK54m96WRIi9ZCN6d QEjxp/X/pBqctL+MF2kpdBRM9H3hODEU0fDhpmReY273WJC+QWdUxaeLEoK5y3CetV4B XuH+TnpKwI/0fJyrxkrmUi/6OdtsVZVZIfXYTFcKNQ4bQg4gXKqAoZhhUNg4wci8p8P1 8tc9Mj8aKabwbAZq71KYKORkX2bYYr5UHejAfosDsikilr+l7vV1j9YR7PS5bCLCbWW2 7i6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=cC7nR0O4; 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 kl9si1713425ejc.603.2021.07.30.08.20.51; Fri, 30 Jul 2021 08:21:15 -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=cC7nR0O4; 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 S239585AbhG3PTc (ORCPT + 99 others); Fri, 30 Jul 2021 11:19:32 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:7414 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239387AbhG3PTa (ORCPT ); Fri, 30 Jul 2021 11:19:30 -0400 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 16UELBKc004490; Fri, 30 Jul 2021 10:19:17 -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=GyuBDKCyV1SaoYri8Dc97gkB/CeJ6cBI4M+5dF98PXM=; b=cC7nR0O41CDT9JX3QVu9FpLpodBgYCqkfV2T/SfJYB3zMWTpV7PWg9/rFTv93Ou9O31X KShqcZYmTeqSer6B7DjJQbZJmf0qHlN/mCgx1wCWYywVrlLEShgp2f6F0DkWqahBLGnF o3aPmqfsISnkq54AJx9PCsYNxMJHGa9uKbYNsdFkWuFXRgYvpra3AsF3Mo3xjpKJ9uPf RGfEuB3l/oKlE87rgjL7Pll8EP9s0+6Nb2b9jB+Si+kfAVaTdq8ADh2jut5oZYKHZ5LB R3vlpKNBL4hSjWzQps/4H/YsmBMNQ+/hZFZqhoIK5RTRAFYXowS3ks5W8LDg3Ofr1K7l hw== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 3a41wd181m-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 30 Jul 2021 10:19:17 -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.4; Fri, 30 Jul 2021 16:19:08 +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; Fri, 30 Jul 2021 16:19:08 +0100 Received: from vitaly-Inspiron-5415.ad.cirrus.com (unknown [198.90.238.32]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 3509245D; Fri, 30 Jul 2021 15:19:08 +0000 (UTC) From: Vitaly Rodionov To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v3 07/27] ALSA: hda/cs8409: Disable unsolicited responses during suspend Date: Fri, 30 Jul 2021 16:18:24 +0100 Message-ID: <20210730151844.7873-8-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730151844.7873-1-vitalyr@opensource.cirrus.com> References: <20210730151844.7873-1-vitalyr@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: zFd4Bgtw-Iwn67I9jovgG-GMJAn_fMlw X-Proofpoint-ORIG-GUID: zFd4Bgtw-Iwn67I9jovgG-GMJAn_fMlw X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 impostorscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107300102 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Binding Ensure unsolicited responses cannot occur whilst the sub codecs are being disabled. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov --- Changes in v2: - No changes Changes in v3: - No changes sound/pci/hda/patch_cs8409.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/sound/pci/hda/patch_cs8409.c b/sound/pci/hda/patch_cs8409.c index 1745f8b188c6..4906d2913603 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -563,12 +563,26 @@ static void cs8409_jack_unsol_event(struct hda_codec *codec, unsigned int res) } } +/* Enable/Disable Unsolicited Response for gpio(s) 3,4 */ +static void cs8409_enable_ur(struct hda_codec *codec, int flag) +{ + /* GPIO4 INT# and GPIO3 WAKE# */ + snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, + flag ? CS8409_CS42L42_INT : 0); + + snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_UNSOLICITED_ENABLE, + flag ? AC_UNSOL_ENABLED : 0); + +} + #ifdef CONFIG_PM /* Manage PDREF, when transition to D3hot */ static int cs8409_suspend(struct hda_codec *codec) { struct cs8409_spec *spec = codec->spec; + cs8409_enable_ur(codec, 0); + mutex_lock(&spec->cs8409_i2c_mux); /* Power down CS42L42 ASP/EQ/MIX/HP */ cs8409_i2c_write(codec, CS42L42_I2C_ADDR, 0x1101, 0xfe, 1); @@ -582,18 +596,6 @@ static int cs8409_suspend(struct hda_codec *codec) } #endif -/* Enable/Disable Unsolicited Response for gpio(s) 3,4 */ -static void cs8409_enable_ur(struct hda_codec *codec, int flag) -{ - /* GPIO4 INT# and GPIO3 WAKE# */ - snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, - flag ? CS8409_CS42L42_INT : 0); - - snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_UNSOLICITED_ENABLE, - flag ? AC_UNSOL_ENABLED : 0); - -} - /* Vendor specific HW configuration * PLL, ASP, I2C, SPI, GPIOs, DMIC etc... */ -- 2.25.1