Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp411019ioo; Sat, 21 May 2022 02:54:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziNGENjchK9/A0ljkBbXhVLmlCZC0tItUStXxBIpvxi/W0+oQ+ccpjIgodzm0ia/YwY/Ic X-Received: by 2002:aa7:8e0b:0:b0:50d:6d7f:54d with SMTP id c11-20020aa78e0b000000b0050d6d7f054dmr14114562pfr.29.1653126896179; Sat, 21 May 2022 02:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653126896; cv=none; d=google.com; s=arc-20160816; b=g5op1R+Q0CCd5p46ogih1Alw0ZAs0caxoakp6qHbHm9tmcXib1CHhvr6cRopTYmQSG IDztsWcbCBgHJc2CTw206gB34kArs3/lGg2dOMMzzF3GTPwKbjB/gkgtYp+eWucPdoxa 1Vl23vK0cSLGU6oCOpiEi5m0xycxuw6COmQZr/SO1U9Lfz4l8xztY7Fd5qS4ouAQiORb Ye2nzcyX7xgDmL973+K0LwQqeUM88BjBDE5LvvA3xVWfug0R4Aue92h11uXkNiKd42os 9IjdpgWGRnUIFvdKobuOBnEUhB38zqnWFk4jYM9bY6+ulDSoZYfTw2xySgBLU+JGbWUP hUuQ== 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=07+bKshMN2pjy5EaaFU01+r/kDzygXVIRxpW/EeZQew=; b=FInzjovf1aZG+GJHAijG2G94fAr6cv54joEHhdg0HtdthwJ23Tj49O0BraPXz9FdHd mtkZiUT0EYHlS4E77Mgv3kkkDbtkswWDfQAdQmBnViafIwKD7wJsvoJztL6hPZar2oE6 8iw3fpsNdGKDBVNl20bG/cY2tcIHo5B3kD1ztkR0dbx6o4RR3qI8oGZ7go1W/m1HvvtP 2uS3M/mbFEOBsBbDlRKFCjUZqSWEtVYJJhl/Kao4Go/1gndTE2lt+VCrbl9HpMGp0mTQ RcbNd2EMn5PLoN1hl+xv6AidkgrOq6y474zwHfF0kh9xqMVMvhJMDMjeMlHRZnqNlJL7 0LRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Mij9nwrO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020aa788c4000000b00510769162f7si6344015pff.208.2022.05.21.02.54.42; Sat, 21 May 2022 02:54:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Mij9nwrO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242595AbiESRtX (ORCPT + 99 others); Thu, 19 May 2022 13:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243164AbiESRsM (ORCPT ); Thu, 19 May 2022 13:48:12 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7580B226D for ; Thu, 19 May 2022 10:48:09 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24J5MiMr023727; Thu, 19 May 2022 12:47:54 -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=07+bKshMN2pjy5EaaFU01+r/kDzygXVIRxpW/EeZQew=; b=Mij9nwrOem4k/tea26fTA1hxlddlnPnwpn3l8i+bgk/7z8E5CK+KX9J9nIXj3wAkG4mH I5eI+7x8FTGdOE5nJZ7ViWnEClLo8jHAm8TPYgg3BW+JTivzkGxbMyOEhCLjTCfhGScO EF0rW4fFjQMQPrbnTVSQZEUTRuKRbuKlZPcpiyAumPXW25P+j6WPBeb0hopRmIGZLfQ7 KhceJxoNsF1voRHcAJlxHutnJAeA3K0qj+9F1CTRXbRWraJ1255OIGA7sB2lusNWAWJU EnPJQ69rZPFLBOQCXpmlvrGM0MtB1Y52FRhHPksFFu26yZGTjV3bft5Gn9pVhP6YkJIi 5g== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3g29u37tee-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 19 May 2022 12:47:53 -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.2375.24; Thu, 19 May 2022 18:47:51 +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.2375.24 via Frontend Transport; Thu, 19 May 2022 18:47:51 +0100 Received: from vitaly-Legion-7-16ACHg6.ad.cirrus.com (unknown [198.90.238.59]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 680AC476; Thu, 19 May 2022 17:47:51 +0000 (UTC) From: Vitaly Rodionov To: Jaroslav Kysela , Takashi Iwai , Mark Brown CC: , , , Stefan Binding Subject: [PATCH v3 05/17] ALSA: hda: cs35l41: Save Subsystem ID inside CS35L41 Driver Date: Thu, 19 May 2022 18:47:37 +0100 Message-ID: <20220519174749.15459-6-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220519174749.15459-1-vitalyr@opensource.cirrus.com> References: <20220519174749.15459-1-vitalyr@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 5vTZPxJuW46DRyu6jD-TbryyME5WnkqK X-Proofpoint-ORIG-GUID: 5vTZPxJuW46DRyu6jD-TbryyME5WnkqK X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Binding The Subsystem ID is read from the HDA driver, and will be used by the CS35L41 driver to be able to uniquely identify the laptop, which is required to be able to define firmware to be used by specific models. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov --- Changes since v2: - No change sound/pci/hda/cs35l41_hda.c | 3 +++ sound/pci/hda/cs35l41_hda.h | 1 + sound/pci/hda/hda_component.h | 1 + sound/pci/hda/patch_realtek.c | 1 + 4 files changed, 6 insertions(+) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index fe2ba03e602b..c235b899aa04 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -346,6 +346,9 @@ static int cs35l41_hda_bind(struct device *dev, struct device *master, void *mas return -EBUSY; comps->dev = dev; + if (!cs35l41->acpi_subsystem_id) + cs35l41->acpi_subsystem_id = devm_kasprintf(dev, GFP_KERNEL, + "%.8x", comps->subsystem_id); cs35l41->codec = comps->codec; strscpy(comps->name, dev_name(dev), sizeof(comps->name)); comps->playback_hook = cs35l41_hda_playback_hook; diff --git a/sound/pci/hda/cs35l41_hda.h b/sound/pci/hda/cs35l41_hda.h index 03c5f14631dd..b8352088a5cb 100644 --- a/sound/pci/hda/cs35l41_hda.h +++ b/sound/pci/hda/cs35l41_hda.h @@ -42,6 +42,7 @@ struct cs35l41_hda { int channel_index; unsigned volatile long irq_errors; const char *amp_name; + const char *acpi_subsystem_id; struct regmap_irq_chip_data *irq_data; bool firmware_running; bool halo_initialized; diff --git a/sound/pci/hda/hda_component.h b/sound/pci/hda/hda_component.h index 534e845b9cd1..fa6df52e7855 100644 --- a/sound/pci/hda/hda_component.h +++ b/sound/pci/hda/hda_component.h @@ -14,6 +14,7 @@ struct hda_component { struct device *dev; char name[HDA_MAX_NAME_SIZE]; + int subsystem_id; struct hda_codec *codec; void (*playback_hook)(struct device *dev, int action); }; diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 261b6ca6e85d..ef716f0b0052 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6629,6 +6629,7 @@ static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char if (!name) return; spec->comps[i].codec = cdc; + spec->comps[i].subsystem_id = cdc->core.subsystem_id; component_match_add(dev, &spec->match, component_compare_dev_name, name); } ret = component_master_add_with_match(dev, &comp_master_ops, spec->match); -- 2.34.1