Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1a1c3d7

Browse files
rfvirgilbroonie
authored andcommitted
ASoC: cs35l56: Use PCI SSID as the firmware UID
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 <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d8b3875 commit 1a1c3d7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sound/soc/codecs/cs35l56.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,9 +772,20 @@ static int cs35l56_component_probe(struct snd_soc_component *component)
772772
{
773773
struct cs35l56_private *cs35l56 = snd_soc_component_get_drvdata(component);
774774
struct dentry *debugfs_root = component->debugfs_root;
775+
unsigned short vendor, device;
775776

776777
BUILD_BUG_ON(ARRAY_SIZE(cs35l56_tx_input_texts) != ARRAY_SIZE(cs35l56_tx_input_values));
777778

779+
if (!cs35l56->dsp.system_name &&
780+
(snd_soc_card_get_pci_ssid(component->card, &vendor, &device) == 0)) {
781+
cs35l56->dsp.system_name = devm_kasprintf(cs35l56->base.dev,
782+
GFP_KERNEL,
783+
"%04x%04x",
784+
vendor, device);
785+
if (!cs35l56->dsp.system_name)
786+
return -ENOMEM;
787+
}
788+
778789
if (!wait_for_completion_timeout(&cs35l56->init_completion,
779790
msecs_to_jiffies(5000))) {
780791
dev_err(cs35l56->base.dev, "%s: init_completion timed out\n", __func__);

0 commit comments

Comments
 (0)