Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2706282rdb; Tue, 12 Sep 2023 09:37:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrH57WOMUGXetpy/HWlQO6N3Cjc3ffA8oH2mwt/vv06Jm6nx2w7Eu8t8fH983rittMG5gR X-Received: by 2002:a05:6a00:c87:b0:68f:dfe2:9f03 with SMTP id a7-20020a056a000c8700b0068fdfe29f03mr332298pfv.11.1694536637413; Tue, 12 Sep 2023 09:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694536637; cv=none; d=google.com; s=arc-20160816; b=zDYSadtTjoE5zlJs8TW2tDpiP3mI013xwc2RGN/P5YpjoSSrOxN7FdjLBWpoSTgfvZ BMrYBe/sR5Cr4x9V7S9qYiKL5tZ0nSuFIwASpPhnMnZcJMfWUhT7nfHJkSBPdkHG50cR El5RRGeRcMaOnam9WoMlAPWGxAnFLzcK0ITUgTB6wZgv6i3IiUqC8sXOzKVVjV3YzhNe NLoZL5qyQ1IFvevLPuMl+ZRimLrCFsYNfUTrqEATOtawzgnaoCfpNvOXfz6Rbc+7C1px AoDAN0pE2jzKuyiXNRrpBYFHKOij9T8qEBw/4DE/iHIdZYax6NOvK/gaJfrJlyzbn9Fo 68xg== 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=zuTD6xUOqe5ttLHRaL7ledsFp6jAZIFBIzNeGgXzKvE=; fh=BVyRkeWQgbLHHjD2wsZRKNYbtMse/+APTjljLzZQ3qo=; b=g+f7dqDP/xRG+A6n/aDQstG3gQT6k6uKmLDUSQ1Fve2CzGATYLYjqvMhGU6zRJDmcb A23PYYAOwV8SZpj6Q3wkh9isGoVb4xton0oIpOFyTFkCqFXC60vfQTThh7BRxPyBRk2u nWkRB2aa2X3OKltPLiqCAfRjE0Py7+22ZrGvme7iGj48CbZsSNh3l25eZJnEOHuwrxlJ KMgUnJSYMMb5KrjoDjXKYGXKqEsVw7+rnmTbyvo5FL03Lq055ogwN6CGtePBt6ULIzvx jWky6DLBxqBHXDvaT1PVVkcN6QVoCIlwG6eK9kRqwa2/yPQba0Coa8mvZRV4sSsMurUb gRJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=mOg3F+2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id eh14-20020a056a00808e00b0068e3c6a9e95si8335391pfb.19.2023.09.12.09.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 09:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=mOg3F+2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4DD3A81DDD13; Tue, 12 Sep 2023 09:32:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236920AbjILQcj (ORCPT + 99 others); Tue, 12 Sep 2023 12:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229833AbjILQc3 (ORCPT ); Tue, 12 Sep 2023 12:32:29 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD70115 for ; Tue, 12 Sep 2023 09:32:25 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38CFSmvB002448; Tue, 12 Sep 2023 11:32:12 -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=zuTD6xUOqe5ttLHRaL7ledsFp6jAZIFBIzNeGgXzKvE=; b= mOg3F+2qsNELUfeanFVa1JWQI/QI5yLIsitAFFHbQq305NxzzHM0O1gmS9m0sCph 6bBYKrWXMhOuVn3WOwQVUXDGUMGeOBYyeUHogp0GWauI1PkRO4i3vatt/JGvyleA eRZfOP6QNciZTgOsrbkXQJnQL20Xajv52GeHWQZTmw8q3IHZ+QOtw/B/APLMr6Ee CQ/2wyGqCS6UyB0u3CPb8nf6HZR+93gt8y3DsG1MBduRCwKDyIfT7rpXfzbHnCVg yGyeQt8k3ukSpPrNHoNhD/dzSy7Ae4DjDR0eIzdWZXXKAmiApskWeNc9Xq93kVpI IxdA15J465rIjgg3/mcFIA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3t0p3xkxdb-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 11:32:12 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Tue, 12 Sep 2023 17:32:08 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Tue, 12 Sep 2023 17:32:08 +0100 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.125]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 1CAD9357E; Tue, 12 Sep 2023 16:32:08 +0000 (UTC) From: Richard Fitzgerald To: , , , , CC: , , , Richard Fitzgerald Subject: [PATCH 4/4] ASoC: cs35l56: Use PCI SSID as the firmware UID Date: Tue, 12 Sep 2023 17:32:07 +0100 Message-ID: <20230912163207.3498161-5-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230912163207.3498161-1-rf@opensource.cirrus.com> References: <20230912163207.3498161-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 7hYpPUTJ90bkPvCtkdDOjw6LX3fN5cDL X-Proofpoint-GUID: 7hYpPUTJ90bkPvCtkdDOjw6LX3fN5cDL X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 09:32:50 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email If the driver properties do not define a cirrus,firmware-uid try to get the PCI SSID as the UID. On PCI-based systems the PCI SSID is used to uniquely identify the specific sound hardware. This is the standard mechanism for x86 systems and is the way to get a unique system identifier for systems that use the CS35L56 on SoundWire. For non-SoundWire systems there is no Windows equivalent of the ASoC driver in I2C/SPI mode. These would be: 1. HDA systems, which are handled by the HDA subsystem. 2. Linux-specific systems. 3. Composite devices where the cs35l56 is not present in ACPI and is configured using software nodes. Case 2 can use the firmware-uid property, though the PCI SSID is supported as an alternative, as it is the standard PCI mechanism. Case 3 is a SoundWire system where some other codec is the SoundWire bridge device and CS35L56 is not listed in ACPI. As these are SoundWire systems they will normally use the PCI SSID. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/cs35l56.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c index f2e7c6d0be46..e6e366333a47 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -772,9 +772,20 @@ static int cs35l56_component_probe(struct snd_soc_component *component) { struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component); struct dentry *debugfs_root = component->debugfs_root; + unsigned short vendor, device; BUILD_BUG_ON(ARRAY_SIZE(cs35l56_tx_input_texts) != ARRAY_SIZE(cs35l56_tx_input_values)); + if (!cs35l56->dsp.system_name && + (snd_soc_card_get_pci_ssid(component->card, &vendor, &device) == 0)) { + cs35l56->dsp.system_name = devm_kasprintf(cs35l56->base.dev, + GFP_KERNEL, + "%04x%04x", + vendor, device); + if (!cs35l56->dsp.system_name) + return -ENOMEM; + } + if (!wait_for_completion_timeout(&cs35l56->init_completion, msecs_to_jiffies(5000))) { dev_err(cs35l56->base.dev, "%s: init_completion timed out\n", __func__); -- 2.30.2