* [PATCH v1 0/2] Support reading Subsystem ID from Device Tree
@ 2025-09-12 10:45 Stefan Binding
2025-09-12 10:45 ` [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property Stefan Binding
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Stefan Binding @ 2025-09-12 10:45 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-sound, devicetree, linux-kernel, patches, Stefan Binding
In PC systems using ACPI, the driver is able to read back an SSID from
the _SUB property. This SSID uniquely identifies the system, which
enables the driver to read the correct firmware and tuning for that
system from linux-firmware. Currently there is no way of reading this
property from device tree. Add an equivalent property in device tree
to perform the same role.
Stefan Binding (2):
ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id
property
ASoC: cs35l41: Fallback to reading Subsystem ID property if not ACPI
.../bindings/sound/cirrus,cs35l41.yaml | 6 ++
sound/soc/codecs/cs35l41.c | 77 +++++++++++--------
2 files changed, 50 insertions(+), 33 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property 2025-09-12 10:45 [PATCH v1 0/2] Support reading Subsystem ID from Device Tree Stefan Binding @ 2025-09-12 10:45 ` Stefan Binding 2025-09-12 14:23 ` Rob Herring (Arm) 2025-09-12 21:41 ` Rob Herring 2025-09-12 10:45 ` [PATCH v1 2/2] ASoC: cs35l41: Fallback to reading Subsystem ID property if not ACPI Stefan Binding 2025-09-26 12:49 ` [PATCH v1 0/2] Support reading Subsystem ID from Device Tree Mark Brown 2 siblings, 2 replies; 7+ messages in thread From: Stefan Binding @ 2025-09-12 10:45 UTC (permalink / raw) To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-sound, devicetree, linux-kernel, patches, Stefan Binding Add new property: cirrus,subsystem-id This new property is used to uniquely identify the system if device tree is used, to allow the driver to select the correct firmware and tuning for the system. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> --- Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml b/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml index 14dea1feefc5..a9eb9bd7ad9c 100644 --- a/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml +++ b/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml @@ -151,6 +151,12 @@ properties: minimum: 0 maximum: 5 + cirrus,subsystem-id: + description: + Subsystem ID. If this property is present, it sets the system name, + used to identify the firmware and tuning to load. + type: string + required: - compatible - reg -- 2.43.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property 2025-09-12 10:45 ` [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property Stefan Binding @ 2025-09-12 14:23 ` Rob Herring (Arm) 2025-09-12 21:41 ` Rob Herring 1 sibling, 0 replies; 7+ messages in thread From: Rob Herring (Arm) @ 2025-09-12 14:23 UTC (permalink / raw) To: Stefan Binding Cc: devicetree, Krzysztof Kozlowski, Mark Brown, Conor Dooley, linux-kernel, patches, linux-sound On Fri, 12 Sep 2025 11:45:37 +0100, Stefan Binding wrote: > Add new property: cirrus,subsystem-id > This new property is used to uniquely identify the system if device > tree is used, to allow the driver to select the correct firmware and > tuning for the system. > > Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> > --- > Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml: cirrus,subsystem-id: missing type definition /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml: properties:cirrus,subsystem-id:type: 'string' is not one of ['boolean', 'object'] from schema $id: http://devicetree.org/meta-schemas/core.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml: properties:cirrus,subsystem-id:type: 'boolean' was expected hint: A vendor boolean property can use "type: boolean" from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250912104612.361125-2-sbinding@opensource.cirrus.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property 2025-09-12 10:45 ` [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property Stefan Binding 2025-09-12 14:23 ` Rob Herring (Arm) @ 2025-09-12 21:41 ` Rob Herring 2025-09-15 13:49 ` Stefan Binding 1 sibling, 1 reply; 7+ messages in thread From: Rob Herring @ 2025-09-12 21:41 UTC (permalink / raw) To: Stefan Binding Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, linux-sound, devicetree, linux-kernel, patches On Fri, Sep 12, 2025 at 11:45:37AM +0100, Stefan Binding wrote: > Add new property: cirrus,subsystem-id > This new property is used to uniquely identify the system if device > tree is used, to allow the driver to select the correct firmware and > tuning for the system. > > Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> > --- > Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml b/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml > index 14dea1feefc5..a9eb9bd7ad9c 100644 > --- a/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml > +++ b/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml > @@ -151,6 +151,12 @@ properties: > minimum: 0 > maximum: 5 > > + cirrus,subsystem-id: > + description: > + Subsystem ID. If this property is present, it sets the system name, > + used to identify the firmware and tuning to load. > + type: string Why not use standard 'firmware-name' to just say exactly what firmware to load? Rob ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property 2025-09-12 21:41 ` Rob Herring @ 2025-09-15 13:49 ` Stefan Binding 0 siblings, 0 replies; 7+ messages in thread From: Stefan Binding @ 2025-09-15 13:49 UTC (permalink / raw) To: Rob Herring Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, linux-sound, devicetree, linux-kernel, patches On 12/09/2025 22:41, Rob Herring wrote: > On Fri, Sep 12, 2025 at 11:45:37AM +0100, Stefan Binding wrote: >> Add new property: cirrus,subsystem-id >> This new property is used to uniquely identify the system if device >> tree is used, to allow the driver to select the correct firmware and >> tuning for the system. >> >> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> >> --- >> Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml b/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml >> index 14dea1feefc5..a9eb9bd7ad9c 100644 >> --- a/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml >> +++ b/Documentation/devicetree/bindings/sound/cirrus,cs35l41.yaml >> @@ -151,6 +151,12 @@ properties: >> minimum: 0 >> maximum: 5 >> >> + cirrus,subsystem-id: >> + description: >> + Subsystem ID. If this property is present, it sets the system name, >> + used to identify the firmware and tuning to load. >> + type: string > Why not use standard 'firmware-name' to just say exactly what firmware > to load? The DSP driver searches for a compatible firmware (and tuning) based on what it is able to read from the hardware. However, the SSID is based on the system, and cannot be read from the hardware, therefore it needs to be read from the Device Tree. On ACPI-based systems, it is able to read this from the ACPI _SUB property, and to maintain compatibility with the driver between ACPI and Device Tree systems we need an equivalent property. In addition, the driver actually loads 2 files, firmware and tuning, and the SSID is used to determine the file name of both files. Thanks, Stefan > > Rob ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v1 2/2] ASoC: cs35l41: Fallback to reading Subsystem ID property if not ACPI 2025-09-12 10:45 [PATCH v1 0/2] Support reading Subsystem ID from Device Tree Stefan Binding 2025-09-12 10:45 ` [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property Stefan Binding @ 2025-09-12 10:45 ` Stefan Binding 2025-09-26 12:49 ` [PATCH v1 0/2] Support reading Subsystem ID from Device Tree Mark Brown 2 siblings, 0 replies; 7+ messages in thread From: Stefan Binding @ 2025-09-12 10:45 UTC (permalink / raw) To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-sound, devicetree, linux-kernel, patches, Stefan Binding If ACPI is not used, then there is currently no way of reading a Subsystem ID property used for a system name to uniquely identify the system in order to load the correct firmware and tuning. Add a new property which can be read from device tree to be able to set the system name. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> --- sound/soc/codecs/cs35l41.c | 77 ++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c index 224d65987a8d..d7e3d89de652 100644 --- a/sound/soc/codecs/cs35l41.c +++ b/sound/soc/codecs/cs35l41.c @@ -7,6 +7,7 @@ // Author: David Rhodes <david.rhodes@cirrus.com> #include <linux/acpi.h> +#include <acpi/acpi_bus.h> #include <linux/delay.h> #include <linux/err.h> #include <linux/init.h> @@ -1147,45 +1148,55 @@ static int cs35l41_dsp_init(struct cs35l41_private *cs35l41) return ret; } -#ifdef CONFIG_ACPI -static int cs35l41_acpi_get_name(struct cs35l41_private *cs35l41) +static int cs35l41_get_system_name(struct cs35l41_private *cs35l41) { struct acpi_device *adev = ACPI_COMPANION(cs35l41->dev); - acpi_handle handle = acpi_device_handle(adev); - const char *hid; - const char *sub; - - /* If there is no acpi_device, there is no ACPI for this system, return 0 */ - if (!adev) - return 0; + const char *sub = NULL; + const char *tmp; + int ret = 0; - sub = acpi_get_subsystem_id(handle); - if (IS_ERR(sub)) { - /* If no _SUB, fallback to _HID, otherwise fail */ - if (PTR_ERR(sub) == -ENODATA) { - hid = acpi_device_hid(adev); - /* If dummy hid, return 0 and fallback to legacy firmware path */ - if (!strcmp(hid, "device")) - return 0; - sub = kstrdup(hid, GFP_KERNEL); - if (!sub) - sub = ERR_PTR(-ENOMEM); - - } else - return PTR_ERR(sub); + /* If there is no acpi_device, there is no ACPI for this system, skip checking ACPI */ + if (adev) { + acpi_handle handle = acpi_device_handle(adev); + + sub = acpi_get_subsystem_id(handle); + ret = PTR_ERR(sub); + if (ret) { + sub = NULL; + /* If no _SUB, fallback to _HID, otherwise fail */ + if (ret == -ENODATA) { + tmp = acpi_device_hid(adev); + /* If dummy hid, return 0 and fallback to legacy firmware path */ + if (!strcmp(tmp, "device")) { + ret = 0; + goto err; + } + sub = kstrdup(tmp, GFP_KERNEL); + if (!sub) { + ret = -ENOMEM; + goto err; + } + } + } + } else { + if (!device_property_read_string(cs35l41->dev, "cirrus,subsystem-id", &tmp)) { + sub = kstrdup(tmp, GFP_KERNEL); + if (!sub) { + ret = -ENOMEM; + goto err; + } + } } - cs35l41->dsp.system_name = sub; - dev_dbg(cs35l41->dev, "Subsystem ID: %s\n", cs35l41->dsp.system_name); +err: + if (sub) { + cs35l41->dsp.system_name = sub; + dev_info(cs35l41->dev, "Subsystem ID: %s\n", cs35l41->dsp.system_name); + } else + dev_warn(cs35l41->dev, "Subsystem ID not found\n"); - return 0; -} -#else -static int cs35l41_acpi_get_name(struct cs35l41_private *cs35l41) -{ - return 0; + return ret; } -#endif /* CONFIG_ACPI */ int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *hw_cfg) { @@ -1317,7 +1328,7 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg * goto err; } - ret = cs35l41_acpi_get_name(cs35l41); + ret = cs35l41_get_system_name(cs35l41); if (ret < 0) goto err; -- 2.43.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1 0/2] Support reading Subsystem ID from Device Tree 2025-09-12 10:45 [PATCH v1 0/2] Support reading Subsystem ID from Device Tree Stefan Binding 2025-09-12 10:45 ` [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property Stefan Binding 2025-09-12 10:45 ` [PATCH v1 2/2] ASoC: cs35l41: Fallback to reading Subsystem ID property if not ACPI Stefan Binding @ 2025-09-26 12:49 ` Mark Brown 2 siblings, 0 replies; 7+ messages in thread From: Mark Brown @ 2025-09-26 12:49 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stefan Binding Cc: linux-sound, devicetree, linux-kernel, patches On Fri, 12 Sep 2025 11:45:36 +0100, Stefan Binding wrote: > In PC systems using ACPI, the driver is able to read back an SSID from > the _SUB property. This SSID uniquely identifies the system, which > enables the driver to read the correct firmware and tuning for that > system from linux-firmware. Currently there is no way of reading this > property from device tree. Add an equivalent property in device tree > to perform the same role. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property commit: f8673e4069b2032bf9f854bae818a7bdbdca7520 [2/2] ASoC: cs35l41: Fallback to reading Subsystem ID property if not ACPI commit: 46c8b4d2a693eca69a2191436cffa44f489e98c7 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-09-26 12:49 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-09-12 10:45 [PATCH v1 0/2] Support reading Subsystem ID from Device Tree Stefan Binding 2025-09-12 10:45 ` [PATCH v1 1/2] ASoC: dt-bindings: cirrus,cs35l41: Document the cirrus,subsystem-id property Stefan Binding 2025-09-12 14:23 ` Rob Herring (Arm) 2025-09-12 21:41 ` Rob Herring 2025-09-15 13:49 ` Stefan Binding 2025-09-12 10:45 ` [PATCH v1 2/2] ASoC: cs35l41: Fallback to reading Subsystem ID property if not ACPI Stefan Binding 2025-09-26 12:49 ` [PATCH v1 0/2] Support reading Subsystem ID from Device Tree Mark Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox