All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: HDA: intel-sdw-acpi: add kernel parameter to select alternate controller
@ 2024-02-08 16:37 Pierre-Louis Bossart
  2024-02-09 10:23 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre-Louis Bossart @ 2024-02-08 16:37 UTC (permalink / raw)
  To: linux-sound
  Cc: alsa-devel, tiwai, broonie, vkoul, Pierre-Louis Bossart,
	Rander Wang, Bard Liao

Existing DSDT or SSDT platforms hard-code clock and frame shape
configurations. For validation, we'd like to use alternate
configurations. It's not always possible to generate new tables due to
missing symbols, and modifying existing objects usually leads to
AE_OBJECT_EXIST errors.

The mechanism suggested in this patch is to add a NEW ACPI controller
device with a different _ADR value. e.g.

 Scope (_SB_.PC00.RP08.PXSX.HDAS) {

  	Device (SDWP)
            {
                Name (_ADR, 0x40000001)  // _ADR: Address

The desired _ADR can be passed as a parameter with

options snd-intel-sdw-acpi sdw_ctrl_addr=0x40000001

This solution leads to minimal tables with just what the developers or
validation engineers need, and without overriding any of the existing
firmware definitions. It's consistent with the recommendation to
extend ACPI definitions and not redefine them with a risk of conflict.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 sound/hda/intel-sdw-acpi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/hda/intel-sdw-acpi.c b/sound/hda/intel-sdw-acpi.c
index b57d72ea4503..5f60658c6051 100644
--- a/sound/hda/intel-sdw-acpi.c
+++ b/sound/hda/intel-sdw-acpi.c
@@ -23,6 +23,10 @@ static int ctrl_link_mask;
 module_param_named(sdw_link_mask, ctrl_link_mask, int, 0444);
 MODULE_PARM_DESC(sdw_link_mask, "Intel link mask (one bit per link)");
 
+static ulong ctrl_addr = 0x40000000;
+module_param_named(sdw_ctrl_addr, ctrl_addr, ulong, 0444);
+MODULE_PARM_DESC(sdw_ctrl_addr, "Intel SoundWire Controller _ADR");
+
 static bool is_link_enabled(struct fwnode_handle *fw_node, u8 idx)
 {
 	struct fwnode_handle *link;
@@ -141,6 +145,9 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
 	if (FIELD_GET(GENMASK(31, 28), adr) != SDW_LINK_TYPE)
 		return AE_OK; /* keep going */
 
+	if (adr != ctrl_addr)
+		return AE_OK; /* keep going */
+
 	/* found the correct SoundWire controller */
 	info->handle = handle;
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: HDA: intel-sdw-acpi: add kernel parameter to select alternate controller
  2024-02-08 16:37 [PATCH] ALSA: HDA: intel-sdw-acpi: add kernel parameter to select alternate controller Pierre-Louis Bossart
@ 2024-02-09 10:23 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2024-02-09 10:23 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: linux-sound, alsa-devel, broonie, vkoul, Rander Wang, Bard Liao

On Thu, 08 Feb 2024 17:37:50 +0100,
Pierre-Louis Bossart wrote:
> 
> Existing DSDT or SSDT platforms hard-code clock and frame shape
> configurations. For validation, we'd like to use alternate
> configurations. It's not always possible to generate new tables due to
> missing symbols, and modifying existing objects usually leads to
> AE_OBJECT_EXIST errors.
> 
> The mechanism suggested in this patch is to add a NEW ACPI controller
> device with a different _ADR value. e.g.
> 
>  Scope (_SB_.PC00.RP08.PXSX.HDAS) {
> 
>   	Device (SDWP)
>             {
>                 Name (_ADR, 0x40000001)  // _ADR: Address
> 
> The desired _ADR can be passed as a parameter with
> 
> options snd-intel-sdw-acpi sdw_ctrl_addr=0x40000001
> 
> This solution leads to minimal tables with just what the developers or
> validation engineers need, and without overriding any of the existing
> firmware definitions. It's consistent with the recommendation to
> extend ACPI definitions and not redefine them with a risk of conflict.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Rander Wang <rander.wang@intel.com>
> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-09 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 16:37 [PATCH] ALSA: HDA: intel-sdw-acpi: add kernel parameter to select alternate controller Pierre-Louis Bossart
2024-02-09 10:23 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.