Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3752948pxv; Mon, 26 Jul 2021 11:04:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz85zQDg5RICmC2pZryRM6pTzwk2iFg76PM4eIhm7Q5FrOK7437Rs1E7Q/OzfsZU9ksY+rj X-Received: by 2002:a02:cab9:: with SMTP id e25mr17445853jap.25.1627322683058; Mon, 26 Jul 2021 11:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627322683; cv=none; d=google.com; s=arc-20160816; b=rmfJ0l0iR7nJQuXZlW8hDtcycGyETzGK25VOnoym334uLmN7buKkdyqt/O0DLVsl10 TNTePzi7Z+swK6d65Vx6NOHeLDAsEjilTBA1J+fS1uhv8st5iCilwdrpjBj1cb5YiqG5 ZOk01ARNO4zOi8qVB+6+gUIgEp1ZoioDqigqff7hnFAIfijPF5hL0VEHiRiDF4vFcAsE nKM9YJYPy5/3wdZPQPakRLf3ZHhqfbdrO9hESodWLv8L6JGMytP0FWUf8t0Z0c/XA5bq Y+l7rUzhdj1+IxNTiH3F9j0bf7NUOW50lLQYisyYwfigP7qCzLOB3Igy8HR7xT8mehto s7eg== 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=7uxELiRj0vSzoeh0nh4naiKwY8l14XF1YIbCyCAT5YQ=; b=qY55b2W5xyDNHQ2cVT9aMOPT2mhbfEXiVSk/aKHUCwIBgdw0dotvrWfXeA6wCaR/rj v+l9Zuu5jeQBn+iwo+TigiONXjhLdfqnhXM0E85TQlXERaXCTF6nYUyqs7axSxxnshNP 7PggAHMdhZ4c6LI+IArk+rbI93m6rkYTibVdotwTDtPTRQyIkCWRs4P9ioS77mfz1bJ2 Gpi1TDCpwIN+buLF0ETW0afw5bxXcm+a03wCMbXFFBLLiPam3+dwI7X9RQGaOmmlOb5P 3n7uoNOKVjNdmbioL8SKqoPQ5jT3UQEoJ8IokrX4RvDwfii2Lcmu0Oq4K0c1NkFrvrW2 0u1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ep2byc1L; 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 m8si551132jat.55.2021.07.26.11.04.32; Mon, 26 Jul 2021 11:04:43 -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=ep2byc1L; 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 S233060AbhGZRXA (ORCPT + 99 others); Mon, 26 Jul 2021 13:23:00 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:13104 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232825AbhGZRWx (ORCPT ); Mon, 26 Jul 2021 13:22:53 -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 16Q2DYd3012545; Mon, 26 Jul 2021 13:03:08 -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=7uxELiRj0vSzoeh0nh4naiKwY8l14XF1YIbCyCAT5YQ=; b=ep2byc1LO4xn6fk6b2RKcOYo8N0ghNyJUkPa2ukzUy3JOnEe4M5UqEKLeF9txDqIIb+s pxcvWvngjOOdhhtU2mYMfHOdBnmkdM49rIJz6Ab0qVYFdTO6hzFhbmBI0F1SSNlq0UBz aWUWNENo//1IPc64cEZHYtAAoUFcFA0VCQV3gAwdxT/xPOcQhfwF3HaJhYNtcmP/TX+C BbAY4DKEAyxY9+GFwILKWx0I9hR6s+3UtBG3EB0wHD79Qz6jz9ITzBL9MHiV6hlC3pyI YEBEtwWvHNQhpAho0WI0PLVhnWDUr1YdKEtWPznLdCJ5++PUruyJMeqqB9fonN7SSOmY HA== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 3a17cvhhau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 26 Jul 2021 13:03:07 -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; Mon, 26 Jul 2021 18:47:02 +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; Mon, 26 Jul 2021 18:47:02 +0100 Received: from vitaly-Inspiron-5415.ad.cirrus.com (unknown [198.90.238.32]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 251B02BA; Mon, 26 Jul 2021 17:47:01 +0000 (UTC) From: Vitaly Rodionov To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH 07/27] ALSA: hda/cs8409: Disable unsolicited responses during suspend Date: Mon, 26 Jul 2021 18:46:20 +0100 Message-ID: <20210726174640.6390-8-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210726174640.6390-1-vitalyr@opensource.cirrus.com> References: <20210726174640.6390-1-vitalyr@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: yzWnhJj5hKzUYs0wxNUShzNkZwA0X59K X-Proofpoint-ORIG-GUID: yzWnhJj5hKzUYs0wxNUShzNkZwA0X59K X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 adultscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107260105 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 --- 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