From patchwork Wed Nov 22 06:35:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1867162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SZs3M42H5z1yRg for ; Wed, 22 Nov 2023 17:36:47 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1r5gqa-00023V-5L; Wed, 22 Nov 2023 06:36:29 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1r5gpz-0001yO-Ld for kernel-team@lists.ubuntu.com; Wed, 22 Nov 2023 06:35:51 +0000 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 6978B3F878 for ; Wed, 22 Nov 2023 06:35:50 +0000 (UTC) Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3b8339b27e4so2033791b6e.3 for ; Tue, 21 Nov 2023 22:35:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700634949; x=1701239749; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lhhSZihAa35CLMKXejiIuXA6JvK2c4iMfsc63wqEbcM=; b=LoiGrfE13RWvcn2cZ0xp59bo8V8E/ywQD81sJ6amEnrAmTIeJl003I59SxMUI2tPv4 MTQwE2BSyOGJ0b45Lt1LdB+c1sFnBwGqva8wesIvqYBklbtLBodXBHyzHFBUxy/7dWKb pxQJJkzkjhLIm4c48Ae3AJXx2EtPxgFk66ORhrxBMJNe0VBAKhZ/3JgSoK1LFaJfagfm rzFXS735pl1d8yKaym+e7z4gxSQgU+PpkgTj/4mjuJnC2gKIGmTXkLPD8BDhayN0tXNA oE8nxc28cOPdSnFvr0OZxBBrN8mRfeSfT9jR1CARmqG5edfujnXgoxdwilq4DZ0bIRgZ OHxw== X-Gm-Message-State: AOJu0YzQh/gT8YI7PKVNVA/Wm6N1ApDSbKtLq231I9rHpRoW1ZA2mtyT iogdFaiU/Ce1lXbMgf7KA8jzk9ijjSEU6Mi8MJlWnfxViLjUgSemN1hj8QDkjK1Ao4Uz3LwC3Bk afPmUW9L0DWS4wPDfd+d4h7InTuFq2yofIex00rRZM3et1eWMLw== X-Received: by 2002:a05:6808:16a0:b0:3b2:ee79:c0fd with SMTP id bb32-20020a05680816a000b003b2ee79c0fdmr1833129oib.1.1700634949003; Tue, 21 Nov 2023 22:35:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEP8S0f1M3u/3cGtl4vb/8C8lpe13L+XKz2mxnMko8uxYyWpTv45G2qXESHp6cHSDcPV/prtg== X-Received: by 2002:a05:6808:16a0:b0:3b2:ee79:c0fd with SMTP id bb32-20020a05680816a000b003b2ee79c0fdmr1833055oib.1.1700634947096; Tue, 21 Nov 2023 22:35:47 -0800 (PST) Received: from localhost.localdomain (114-36-219-155.dynamic-ip.hinet.net. [114.36.219.155]) by smtp.gmail.com with ESMTPSA id z10-20020a056a00240a00b006c31c0dfb69sm8966360pfh.188.2023.11.21.22.35.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 22:35:46 -0800 (PST) From: Chris Chiu To: kernel-team@lists.ubuntu.com Subject: [PATCH 02/10][SRU][M] ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type Date: Wed, 22 Nov 2023 14:35:33 +0800 Message-Id: <20231122063541.11346-3-chris.chiu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231122063541.11346-1-chris.chiu@canonical.com> References: <20231122063541.11346-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Stefan Binding BugLink: https://bugs.launchpad.net/bugs/2042060 CS35L41 HDA driver requires ACPI to contain correct _DSD properties to correctly configure the device. Whilst the HP Zbook Fury 17 G9 contains valid _DSD properties, the boost type has been configured incorrectly in the _DSD for this laptop. We can override these properties to fix the boost type. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230823143956.755758-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai (cherry picked from commit 581523ee3652ea6c1012b2ccbb8588c9c77ef4bb) Signed-off-by: Chris Chiu --- sound/pci/hda/cs35l41_hda_property.c | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c index 673f23257a09..f8f213a5dbdd 100644 --- a/sound/pci/hda/cs35l41_hda_property.c +++ b/sound/pci/hda/cs35l41_hda_property.c @@ -43,6 +43,37 @@ static int lenovo_legion_no_acpi(struct cs35l41_hda *cs35l41, struct device *phy return 0; } +/* + * Device 103C89C6 does have _DSD, however it is setup to use the wrong boost type. + * We can override the _DSD to correct the boost type here. + * Since this laptop has valid ACPI, we do not need to handle cs-gpios, since that already exists + * in the ACPI. + */ +static int hp_vision_acpi_fix(struct cs35l41_hda *cs35l41, struct device *physdev, int id, + const char *hid) +{ + struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; + + dev_info(cs35l41->dev, "Adding DSD properties for %s\n", cs35l41->acpi_subsystem_id); + + cs35l41->index = id; + cs35l41->channel_index = 0; + cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 1, GPIOD_OUT_HIGH); + cs35l41->speaker_id = -ENOENT; + hw_cfg->spk_pos = cs35l41->index ? 1 : 0; // right:left + 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 = 4500; + hw_cfg->bst_cap = 24; + hw_cfg->valid = true; + + return 0; +} + struct cs35l41_prop_model { const char *hid; const char *ssid; @@ -53,6 +84,7 @@ struct cs35l41_prop_model { 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 }, {} };