Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp173109lqo; Tue, 7 May 2024 16:37:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXS/tYFngryPIxgvnuRZ2U9QtZyDoNG5jg0fjDttE3FLgcn4sdT38/AzaVxQeer8KguOHo/LUBy3j+iNNRVLPBrPzt8ljP+F+7KUJRg/g== X-Google-Smtp-Source: AGHT+IECiaQOJyFxaiFezP7hU65JSuq4PCQCXy2MWjOsXTAl90ex+FzqzQDqvnz4vDVtw/j68k60 X-Received: by 2002:a05:6214:29c2:b0:6a0:c922:5014 with SMTP id 6a1803df08f44-6a151528bbamr15243766d6.21.1715125034584; Tue, 07 May 2024 16:37:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715125034; cv=pass; d=google.com; s=arc-20160816; b=b2m3FccKK09ZHCoChMG0Rz2zmxIz4fX0ESWr5Jz8zYUheviZ3RoTZt+4bUXPsyxvAV OHEJWIQeMXzqtMaGejlN/faXvIgM/MbEbIxrEGO1pOMd7NfcKDMlexpzXMAsl2DKzN7O VIDLBhtrvA9BcPnwvUg3SvXAXr1SLH7/pgNSWJIFQBY+QhaFYUF9FNBxzTTAmkXd0dqS Tj4WYMjSQ8F9pXCtzgbq++pQl1lo8PLkJDihhQrtpVGf43IyFW76xoty9xo2xjBBO97k rl9m63tFrPYJFDeeTS1z+/1kbHJEv1jXye6Oloc4PnqHbTr4knBYOESPiQZRh0VWv2Ae 6WOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FhO6eirxcZA2b43HPCUc9k9Cw88LwFrPAEYU6oNbFZk=; fh=CL9T5IU3cyk3BqPmaWbfpo3+d1IboHBgSMTrmJzto98=; b=isJb5PU3cOTNzTeG5t6GY5sYbSo7SRcF+pmmoatpDzjtFWlE5lYP52F+g1O1uEFEiA XTe7W0EswnxDcm/dXrxjBLL5YBgixRA98PYCQGiqXv1YzbEjYH8UeiMmd4J63I7NPmtt 28mZgL8GzV/CXySgVKmzQwtsDHLSJ5H9s4M6/BuwxIuv3U+fK7dNyDVIndrBdumdtCAu sQVrA5KVMDTc6YHMmBBbEN6OwZdMRf6hUrMF2PaJyLjACQjUfgRM+1F1CWUlgbC4d4/l mzJ/vXVcs90ZAO1UUbbBSo6GQqBYyxMHZ9Am008YqbLVXSffN2PEU6c6OWaxD6Ni8/hn mmCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M+NQxlV3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172404-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iy10-20020a0562140f6a00b006a0c5959e83si13155752qvb.208.2024.05.07.16.37.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:37:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172404-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M+NQxlV3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172404-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B26B01C237D4 for ; Tue, 7 May 2024 23:37:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D00DD149C4E; Tue, 7 May 2024 23:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M+NQxlV3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F297E1494D9; Tue, 7 May 2024 23:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123451; cv=none; b=HKJRxddKsosWW1le6CerdOqB4aX0NNnFnhIRYjk6VijOT6IAqlWiAciOSHoep8N21imExNw/ONM03tXi0HgevpuDdlSc0G1v+8Pb41RLhpP1lNsnz8n2k5kBD0miugmnl4gjeOyrwwwCekqIMaph0gjspVo6y2EWMqNuKyubXeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123451; c=relaxed/simple; bh=8flEoGuR5cknPXB6dawqgRqhe1hzDJzH/am2PZMz4Cg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DjoPoyDgHwlBtUcXqpohP+7xNKAon41c8Hy8lyWJonHAdJzDlcqIBzb/pwKJj6UN8kXEhru6B6D43tVl0F3k+oJXHri0nRwigMA/FeHLMa/0D48pn/U+80j9u0w1JLKPdEvZE7W6Rr69ep80ZvD+yxOW7wr9qmTXNoOTHhSBvhs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M+NQxlV3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBBECC4AF63; Tue, 7 May 2024 23:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123450; bh=8flEoGuR5cknPXB6dawqgRqhe1hzDJzH/am2PZMz4Cg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M+NQxlV334yFa5vdIs02SeyZDRr7+TdiG5CM0iv+lTLIxIm7fU4uBoINI727efDy6 +eMI0JfmYo3Pto9Xg5XcnCR+nsQHL71vsUA+zUJ6Fqu1LuQDOGEmCnQLqOWS0VrV3V a4JfV/G+49lT828Fal1rCdW3fgA0t1hp7MMMybaYOB2CsQ4dmJDGXofIFG7mPoOVxC n57AWx9tlLSqNITqLuYDJTfKIGIrp6X5j8P31Uu3cSmr0sLg5IZOPvRY1+xQAIfe6W TPBpfn6lt0bDFW5X72oqgyU5eL9STDJ/OooRpb5vCe9IcCRdwsZ3HeJWt+Y0gVau+s bqb17uuGg70FA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jack Yu , Mark Brown , Sasha Levin , oder_chiou@realtek.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 09/43] ASoC: rt722-sdca: add headset microphone vrefo setting Date: Tue, 7 May 2024 19:09:30 -0400 Message-ID: <20240507231033.393285-9-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507231033.393285-1-sashal@kernel.org> References: <20240507231033.393285-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.30 Content-Transfer-Encoding: 8bit From: Jack Yu [ Upstream commit 140e0762ca055d1aa84b17847cde5d9e47f56f76 ] Add vrefo settings to fix jd and headset mic recording issue. Signed-off-by: Jack Yu Link: https://msgid.link/r/727219ed45d3485ba8f4646700aaa8a8@realtek.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt722-sdca.c | 25 +++++++++++++++++++------ sound/soc/codecs/rt722-sdca.h | 3 +++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/rt722-sdca.c b/sound/soc/codecs/rt722-sdca.c index 4338cdb3a7917..9ff607984ea19 100644 --- a/sound/soc/codecs/rt722-sdca.c +++ b/sound/soc/codecs/rt722-sdca.c @@ -1438,9 +1438,12 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722) int loop_check, chk_cnt = 100, ret; unsigned int calib_status = 0; - /* Read eFuse */ - rt722_sdca_index_write(rt722, RT722_VENDOR_SPK_EFUSE, RT722_DC_CALIB_CTRL, - 0x4808); + /* Config analog bias */ + rt722_sdca_index_write(rt722, RT722_VENDOR_REG, RT722_ANALOG_BIAS_CTL3, + 0xa081); + /* GE related settings */ + rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_GE_RELATED_CTL2, + 0xa009); /* Button A, B, C, D bypass mode */ rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_UMP_HID_CTL4, 0xcf00); @@ -1474,9 +1477,6 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722) if ((calib_status & 0x0040) == 0x0) break; } - /* Release HP-JD, EN_CBJ_TIE_GL/R open, en_osw gating auto done bit */ - rt722_sdca_index_write(rt722, RT722_VENDOR_REG, RT722_DIGITAL_MISC_CTRL4, - 0x0010); /* Set ADC09 power entity floating control */ rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_ADC0A_08_PDE_FLOAT_CTL, 0x2a12); @@ -1489,8 +1489,21 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722) /* Set DAC03 and HP power entity floating control */ rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_DAC03_HP_PDE_FLOAT_CTL, 0x4040); + rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_ENT_FLOAT_CTRL_1, + 0x4141); + rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_FLOAT_CTRL_1, + 0x0101); /* Fine tune PDE40 latency */ regmap_write(rt722->regmap, 0x2f58, 0x07); + regmap_write(rt722->regmap, 0x2f03, 0x06); + /* MIC VRefo */ + rt722_sdca_index_update_bits(rt722, RT722_VENDOR_REG, + RT722_COMBO_JACK_AUTO_CTL1, 0x0200, 0x0200); + rt722_sdca_index_update_bits(rt722, RT722_VENDOR_REG, + RT722_VREFO_GAT, 0x4000, 0x4000); + /* Release HP-JD, EN_CBJ_TIE_GL/R open, en_osw gating auto done bit */ + rt722_sdca_index_write(rt722, RT722_VENDOR_REG, RT722_DIGITAL_MISC_CTRL4, + 0x0010); } int rt722_sdca_io_init(struct device *dev, struct sdw_slave *slave) diff --git a/sound/soc/codecs/rt722-sdca.h b/sound/soc/codecs/rt722-sdca.h index 44af8901352eb..2464361a7958c 100644 --- a/sound/soc/codecs/rt722-sdca.h +++ b/sound/soc/codecs/rt722-sdca.h @@ -69,6 +69,7 @@ struct rt722_sdca_dmic_kctrl_priv { #define RT722_COMBO_JACK_AUTO_CTL2 0x46 #define RT722_COMBO_JACK_AUTO_CTL3 0x47 #define RT722_DIGITAL_MISC_CTRL4 0x4a +#define RT722_VREFO_GAT 0x63 #define RT722_FSM_CTL 0x67 #define RT722_SDCA_INTR_REC 0x82 #define RT722_SW_CONFIG1 0x8a @@ -127,6 +128,8 @@ struct rt722_sdca_dmic_kctrl_priv { #define RT722_UMP_HID_CTL6 0x66 #define RT722_UMP_HID_CTL7 0x67 #define RT722_UMP_HID_CTL8 0x68 +#define RT722_FLOAT_CTRL_1 0x70 +#define RT722_ENT_FLOAT_CTRL_1 0x76 /* Parameter & Verb control 01 (0x1a)(NID:20h) */ #define RT722_HIDDEN_REG_SW_RESET (0x1 << 14) -- 2.43.0