Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp42311rdb; Wed, 20 Dec 2023 05:59:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGW/SbbPc4mWrfGKFZvH3qDSHTUKhrFebiBYHa18755YaVzMbmqQ0fLLGa/pUIxnBf0HFxP X-Received: by 2002:a17:90a:5e09:b0:280:cc73:4c79 with SMTP id w9-20020a17090a5e0900b00280cc734c79mr9047798pjf.7.1703080784029; Wed, 20 Dec 2023 05:59:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703080784; cv=none; d=google.com; s=arc-20160816; b=AsAc+TSC7of9XXeeMdGVrNFdhYenfa3PojYo/xq5hlhME9uO9wrV7j3x88hwzExbiy A/1p6S+hBsimfb2p6DLx7L6AQ0ncVnJXeCHGM6xppdW4Fspb1ccocpx7w8/bJU4f21M3 nSzwFy1jbK3VJBXepBAEcRLLi7rQlTxBZT53Ru7RrnL+3HhWYlkAV1Co6csTRN9iqyGt WRL3CZxLMzh1wtuslye1tyPhxGF5EGt0hyCRgnLJAEcTmnFirmA0QXcmDhEqAt3OJuIi JQLN3OX8Xb50w03kVWXWzEA849sJZbWRrWjzcxxe5h5VS4TETjfkn8xBmFCqllho/tR7 ykIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=2RaUXeYR8pBokcfoFMpjl40DICG+UU/c3Xv71HcDNpI=; fh=s/9OHbh1yx/EfOJyYfqJ5Sgp2PGQCsxmEjUNsgqC810=; b=H6W02bZmLHjlfOcqmsi7WiKO60mRrV41h4GQ3qnND9rfoNoYtngSWZSkGZyxsoFa0D 2YWPI6KgKbo1KNls4FpYmRHU8yMCpKvQc2LL2az/4OqrrVG+XB8zcRZkUsrFIFYLb1A/ stPKOEMSSdp+b7ed+CpA6PaeZWw9AglPvwBHXltak/WzblBy5mtc+wZ7pbHr2SrIFouT +sYEAN77Mtc+FUGr2ZCs99F89cBc2kmJHtovABzxcsQYDJ1Gvtcbtir/5FYezUZXUg11 G1SqIFFImR8IK+Cua+iuyzQz5H9DBFGV6+/ixsH4Nqr0t3H6bFd3Ginu3taN7OUL1sST qWrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ZFAQ4NF2; spf=pass (google.com: domain of linux-kernel+bounces-7007-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id gj22-20020a17090b109600b0028bc575e78csi2056486pjb.189.2023.12.20.05.59.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 05:59:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7007-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ZFAQ4NF2; spf=pass (google.com: domain of linux-kernel+bounces-7007-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7007-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CCB69281EB2 for ; Wed, 20 Dec 2023 13:59:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1445B3AC02; Wed, 20 Dec 2023 13:58:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="ZFAQ4NF2" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 A39E93AC06; Wed, 20 Dec 2023 13:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BK4mAWx007661; Wed, 20 Dec 2023 07:58:21 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= PODMain02222019; bh=2RaUXeYR8pBokcfoFMpjl40DICG+UU/c3Xv71HcDNpI=; b= ZFAQ4NF2p4wZFry81X1lDf0eDCF3IXECNJyUoc0sTJKNh+nsHP8PVx3jS7B+3Hrk 7QhRfSTT94V8GkA1UPaeEY3oCpLfVb6lQpXPq0SItQGSbgqV12IbMoFkBa6NeyGO MgVFt3GzrY4ZnVaWEbfC8qLHoYZzQidwbrAbnHZGi7mn0xf+OvMrcwccep07s96f hDELUnTUcBlmrrRkwn7Q8NM3iTs94rxmvqJyUG95nwqkKHHA5+vs2Lu9HTW+m6+4 dWPbqkCmjFW9L7uuuS80rtbNSHhW6CMNdyCTLRQ1YvVjKHGNlSKjPjJwBvXdDmd9 GYtnSW5lQznrlK+trgnyww== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3v1a625ger-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 07:58:21 -0600 (CST) 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_256_GCM_SHA384) id 15.2.1118.40; Wed, 20 Dec 2023 13:58:19 +0000 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.2.1118.40 via Frontend Transport; Wed, 20 Dec 2023 13:58:19 +0000 Received: from [198.61.64.132] (LONN2DGDQ73.ad.cirrus.com [198.61.64.132]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id BB12511AB; Wed, 20 Dec 2023 13:58:18 +0000 (UTC) Message-ID: <97da898a-b747-44f3-87a7-021aea8ca4ac@opensource.cirrus.com> Date: Wed, 20 Dec 2023 13:58:18 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ALSA: hda: cs35l41: Add HP override Content-Language: en-GB To: Lorenz Brun , James Schulman , David Rhodes , Richard Fitzgerald , Jaroslav Kysela , Takashi Iwai CC: , , , References: <20231219201513.2172580-1-lorenz@brun.one> From: Stefan Binding In-Reply-To: <20231219201513.2172580-1-lorenz@brun.one> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: Xo9-pVIn1eM0HVOy6K49lfXuUYburjHR X-Proofpoint-ORIG-GUID: Xo9-pVIn1eM0HVOy6K49lfXuUYburjHR X-Proofpoint-Spam-Reason: safe Hi, I recently pushed up some changes that allow you to add laptops into a configuration table, these laptops should be added into that instead of creating a new function. I don't have the configuration of some of these laptops right now to be able to review it, but hopefully I should be able to obtain them. Thanks, Stefan On 19/12/2023 20:15, Lorenz Brun wrote: > This adds an override for a series of notebooks using a common config > taken from HP's proprietary Windows driver (csaudioext). > > This has been tested on a HP 15-ey0xxxx device (subsystem 103C8A31) > together with another Realtek quirk and the calibration files from the > proprietary driver. > > Signed-off-by: Lorenz Brun > --- > sound/pci/hda/cs35l41_hda_property.c | 59 ++++++++++++++++++++++++++++ > 1 file changed, 59 insertions(+) > > diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c > index c83328971728..8135ea532a94 100644 > --- a/sound/pci/hda/cs35l41_hda_property.c > +++ b/sound/pci/hda/cs35l41_hda_property.c > @@ -6,6 +6,7 @@ > // > // Author: Stefan Binding > > +#include > #include > #include > #include "cs35l41_hda_property.h" > @@ -81,6 +82,42 @@ static int hp_vision_acpi_fix(struct cs35l41_hda *cs35l41, struct device *physde > return 0; > } > > +/* > + * HP 2-channel I2C configuration with internal boost (4.1A inductor current) with no _DSD, > + * reset GPIO can still be extracted from ACPI by index. Covers HP configurations 251, 252, > + * 253, 254, 351, 352 and 353 in the proprietary driver (csaudioext). > + */ > +static int hp_i2c_2ch_vbst_ipk41(struct cs35l41_hda *cs35l41, struct device *physdev, int id, > + const char *hid) > +{ > + // In case a valid _DSD exists, use that instead of the override. This stops applying > + // the override in case HP ever fixes their firmware. > + if (device_property_count_u32(physdev, "cirrus,dev-index") > 0) > + return -ENOENT; > + > + struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; > + > + cs35l41->index = id == 0x40 ? 0 : 1; > + cs35l41->channel_index = 0; > + // Get reset GPIO (shared for both instances) from ACPI GpioIo at index 0. > + cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH); > + // Speaker ID GPIO is ACPI GpioIo index 1. > + cs35l41->speaker_id = cs35l41_get_speaker_id(physdev, 0, 0, 1); > + > + hw_cfg->spk_pos = cs35l41->index ? 1 : 0; // left:right > + hw_cfg->gpio1.func = CS35L41_NOT_USED; > + hw_cfg->gpio1.valid = true; > + hw_cfg->gpio2.func = CS35L41_INTERRUPT; > + hw_cfg->gpio2.valid = true; > + hw_cfg->bst_type = CS35L41_INT_BOOST; > + hw_cfg->bst_ind = 1000; > + hw_cfg->bst_ipk = 4100; > + hw_cfg->bst_cap = 10; // Exact value unknown, maps into correct range > + hw_cfg->valid = true; > + > + return 0; > +} > + > struct cs35l41_prop_model { > const char *hid; > const char *ssid; > @@ -92,6 +129,28 @@ static const struct cs35l41_prop_model cs35l41_prop_model_table[] = { > { "CLSA0100", NULL, lenovo_legion_no_acpi }, > { "CLSA0101", NULL, lenovo_legion_no_acpi }, > { "CSC3551", "103C89C6", hp_vision_acpi_fix }, > + { "CSC3551", "103C8A28", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A29", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A2A", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A2B", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A2C", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A2D", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A2E", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A30", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8A31", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BB3", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BB4", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BDF", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BE0", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BE1", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BE2", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BE9", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BDD", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BDE", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BE3", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BE5", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8BE6", hp_i2c_2ch_vbst_ipk41 }, > + { "CSC3551", "103C8B3A", hp_i2c_2ch_vbst_ipk41 }, > {} > }; >