Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3225782rdb; Wed, 13 Sep 2023 06:08:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFqGbpDgR3nAvDK4D21wsBnX9h0M6x4857fXLI9IAWDu7vqf6SlEUu8n/jQd778ZdviuDF X-Received: by 2002:a05:6a20:549f:b0:148:97d9:4a71 with SMTP id i31-20020a056a20549f00b0014897d94a71mr2489694pzk.39.1694610532899; Wed, 13 Sep 2023 06:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694610532; cv=none; d=google.com; s=arc-20160816; b=WUwtJ1++Q6I0A+ohKguPHdc2lliHoxM43nEuU0SpeQCNvmZDPU4QfE/Sn8C2JiEjo4 WclIXAGk6p73fno/e2qNqTdJcpCPXYyX2ljC6wzUwQ7jV/T2H8neeZcHIh0uNJ+dSNCc ByF9nuIKpsmbA3OM3s7z2ZzzTbALua88fHWC1nvio86i8oCH0WPkuZG5022TwERbSGSq Kg4uulk/yixgOQSohk6g/maPAEzEupbgU9IAPSoQ9xPT0/MrLSv4NnsaMObOyMuaSSCj XnygROs11n+uF97iMmb36SiE7oYQh9/N9RNc3sp42whLm0OXaKYQvD6SyX4lUco1wWRm XudA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3RKyAZA7MEKpEP3MlSRWrx4OReU6QHarxzK0hrpDFtE=; fh=aaAuW0BtTbnd0r37/J02gRf3PabakXIbOOwMxbb+xlY=; b=VvvxHeBSu6HspognwQlC5htbYjpOA5CMViHb+wS8YHaMWLqjjJ/9wRJyuHcR4ohEU4 daA4kr6FZNfGGZvXEtWzlVGFbjY1rll87k9I/Yu2LHoD0XtT1a4XdKxDxCwL7bRsnGSU u36RF+1BaeZKv9vZcwn0Rg+XHXceFm5Fkox0ztpviRmdwXOZqH1YfcFLUhepaYo8CDle Grbw+YVMlruYJT6iMKSpo+fsx/PjdS0ltU2uTv+KuaGprKy7mManwSftTJoIFBdr6ww4 S9aNCEu1IjUhS3uQJKHLYbPCbORjRLuJL7VFPw44oRZQRgPLHERng6aZ0oqZRYmFNVuW i/CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="TBicL/mA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id eb10-20020a056a004c8a00b0068fb75d68dcsi6736441pfb.206.2023.09.13.06.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 06:08:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="TBicL/mA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 80FA880DB9CF; Wed, 13 Sep 2023 03:56:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239793AbjIMK4N (ORCPT + 99 others); Wed, 13 Sep 2023 06:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239820AbjIMK4M (ORCPT ); Wed, 13 Sep 2023 06:56:12 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB83119AD for ; Wed, 13 Sep 2023 03:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694602568; x=1726138568; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7zKWllqNpufIGQKkp3M02DaPOPfaIyuVruYujMZGUaI=; b=TBicL/mAeNx1CoK8V4Lh0lotIXBzAy7nEGWnnMAH/gWFwm9GmiRDcCWu qM/EQPZSokebmMIMd3B60Cs78f1vQrhm6V44tIJJ9jHGk7gJhX2a4g2zh +o0i4VhuiXE5Z+YVtP5OwTiz6KT4rKNNKFBFU7tRJ3zeu88NzoKWL+Zmc 3Ro8+Qj78I+ACOPhVT+2zI5PjPnyktZzyUPoPW1o8oeT32XXVy7URXti1 Io1rV+8uAAzFmyALSu9/09UvEUlsH5P8l7nu4BQx8etjYkKdV41afaPhj piVLjl7zS/dUBGig5b0Freh/hcn5Poqc48Ljk/P3xhx95BkNf8hq+v471 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="464996430" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="464996430" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 03:56:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="693810585" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="693810585" Received: from aslawinx-mobl.ger.corp.intel.com (HELO [10.94.0.91]) ([10.94.0.91]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 03:56:05 -0700 Message-ID: <92b2b69e-3175-651f-45bb-d9ae11eaec82@linux.intel.com> Date: Wed, 13 Sep 2023 12:56:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH 1/4] ASoC: soc-card: Add storage for PCI SSID Content-Language: en-US To: Richard Fitzgerald , broonie@kernel.org, pierre-louis.bossart@linux.intel.com, yung-chuan.liao@linux.intel.com, kai.vehmanen@linux.intel.com, peter.ujfalusi@linux.intel.com Cc: alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Cezary Rojewski References: <20230912163207.3498161-1-rf@opensource.cirrus.com> <20230912163207.3498161-2-rf@opensource.cirrus.com> From: =?UTF-8?Q?Amadeusz_S=c5=82awi=c5=84ski?= In-Reply-To: <20230912163207.3498161-2-rf@opensource.cirrus.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 03:56:35 -0700 (PDT) X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 pete.vger.email On 9/12/2023 6:32 PM, Richard Fitzgerald wrote: > Add members to struct snd_soc_card to store the PCI subsystem ID (SSID) > of the soundcard. > > The PCI specification provides two registers to store a vendor-specific > SSID that can be read by drivers to uniquely identify a particular > "soundcard". This is defined in the PCI specification to distinguish > products that use the same silicon (and therefore have the same silicon > ID) so that product-specific differences can be applied. > > PCI only defines 0xFFFF as an invalid value. 0x0000 is not defined as > invalid. So the usual pattern of zero-filling the struct and then > assuming a zero value unset will not work. A flag is included to > indicate when the SSID information has been filled in. > > Unlike DMI information, which has a free-format entirely up to the vendor, > the PCI SSID has a strictly defined format and a registry of vendor IDs. > > It is usual in Windows drivers that the SSID is used as the sole identifier > of the specific end-product and the Windows driver contains tables mapping > that to information about the hardware setup, rather than using ACPI > properties. > > This SSID is important information for ASoC components that need to apply > hardware-specific configuration on PCI-based systems. > > As the SSID is a generic part of the PCI specification and is treated as > identifying the "soundcard", it is reasonable to include this information > in struct snd_soc_card, instead of components inventing their own custom > ways to pass this information around. > > Signed-off-by: Richard Fitzgerald > --- > include/sound/soc-card.h | 37 +++++++++++++++++++++++++++++++++++++ > include/sound/soc.h | 11 +++++++++++ > 2 files changed, 48 insertions(+) > > diff --git a/include/sound/soc-card.h b/include/sound/soc-card.h > index fc94dfb0021f..e8ff2e089cd0 100644 > --- a/include/sound/soc-card.h > +++ b/include/sound/soc-card.h ... > diff --git a/include/sound/soc.h b/include/sound/soc.h > index 509386ff5212..81ed08c5c67d 100644 > --- a/include/sound/soc.h > +++ b/include/sound/soc.h > @@ -929,6 +929,17 @@ struct snd_soc_card { > #ifdef CONFIG_DMI > char dmi_longname[80]; > #endif /* CONFIG_DMI */ > + > +#ifdef CONFIG_PCI > + /* > + * PCI does not define 0 as invalid, so pci_subsystem_set indicates > + * whether a value has been written to these fields. > + */ > + unsigned short pci_subsystem_vendor; > + unsigned short pci_subsystem_device; > + bool pci_subsystem_set; > +#endif /* CONFIG_PCI */ > + > char topology_shortname[32]; > > struct device *dev; This looks bit weird to me, snd_soc_card is _generic_ struct which is not device specific in any way, and now you add fields for PCI, can't this somehow be done using drvdata or something?