ASoC: SOF: Intel: SoundWire initial integration
Subsystems (3)
cover ASoC: SOF: Intel: SoundWire initial integration
This RFC is the companion of the other RFC 'soundwire: intel: simplify DAI/PDI handling'. Our purpose at this point is to gather feedback on the interfaces between the Intel SOF parts and the SoundWire code.
The suggested solution is a simple init/release inserted at probe/remove and resume/suspend, as well as two callbacks for the SOF driver to generate IPC configurations with the firmware. That level of separation completely hides the details of the SoundWire DAIs and will allow for 'transparent' multi-cpu DAI support, which will be handled in the machine driver and the soundwire DAIs.
This solution was tested on IceLake and CometLake, and captures the feedback from SOF contributors on an initial integration that was deemed too complicated (and rightly so).
Pierre-Louis Bossart (5):
ASoC: SOF: IPC: dai-intel: move ALH declarations in header file
ASoC: SOF: Intel: hda: add helper to initialize SoundWire IP
ASoC: SOF: Intel: hda: add SoundWire IP support
ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
ASoC: SOF: Intel: add support for SoundWire suspend/resume
include/sound/sof/dai-intel.h | 18 ++-- sound/soc/sof/intel/hda-dsp.c | 11 +++ sound/soc/sof/intel/hda.c | 157 ++++++++++++++++++++++++++++++++++ sound/soc/sof/intel/hda.h | 11 +++ 4 files changed, 188 insertions(+), 9 deletions(-)
base-commit: 3b3aaa017e8072b1bfddda92be296b3463d870be
Signature · 1 line
2.20.1
RFC PATCH 1/5 ASoC: SOF: IPC: dai-intel: move ALH declarations in header file
ALH was inserted in the wrong place during integration, add after DMIC to mirror the file used by SOF firmware.
No functional change, just text move in the same file to better track changes, if any.
--- include/sound/sof/dai-intel.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
include/sound/sof/dai-intel.h +9 -9
@@ -87,6 +87,15 @@ struct sof_ipc_dai_hda_params {uint32_t link_dma_ch; } __packed; +/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */ +struct sof_ipc_dai_alh_params { +struct sof_ipc_hdr hdr; +uint32_t stream_id; + +/* reserved for future use */ +uint32_t reserved[15 ]; +} __packed; +/* DMIC Configuration Request - SOF_IPC_DAI_DMIC_CONFIG */ /* This struct is defined per 2ch PDM controller available in the platform.
@@ -179,13 +188,4 @@ struct sof_ipc_dai_dmic_params { struct sof_ipc_dai_dmic_pdm_ctrl pdm[0]; } __packed; -/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */ -struct sof_ipc_dai_alh_params { -struct sof_ipc_hdr hdr; -uint32_t stream_id; - -/* reserved for future use */ -uint32_t reserved[15 ]; -} __packed; -#endif
Signature · 1 line
2.20.1
RFC PATCH 2/5 ASoC: SOF: Intel: hda: add helper to initialize SoundWire IP
In reply to Pierre-Louis BossartThe helper calls the SoundWire initializations and sets the resource structure defined as an interface with the platform driver. The resource deals with PCI base address, interrupts and the callback for the stream configuration.
The interrupts are gated/ungated at the top-level with the ADSPIPC2.SNDW field
--- sound/soc/sof/intel/hda.c | 63 +++++++++++++++++++++++++++++++++++++++ sound/soc/sof/intel/hda.h | 1 + 2 files changed, 64 insertions(+)
sound/soc/sof/intel/hda.c +63 -0
@@ -18,7 +18,9 @@#include <sound/hdaudio_ext.h> #include <sound/hda_register.h> +#include <linux/acpi.h> #include <linux/module.h> +#include <linux/soundwire/sdw_intel.h> #include <sound/intel-nhlt.h> #include <sound/sof.h> #include <sound/sof/xtensa.h>
@@ -35,6 +37,67 @@#define IS_CFL (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)#define IS_CNL (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9dc8) +#if IS_ENABLED (CONFIG_SOUNDWIRE_INTEL ) + +static void hda_sdw_int_enable (struct snd_sof_dev *sdev,bool enable) +{ +if (enable) +snd_sof_dsp_update_bits (sdev,HDA_DSP_BAR , +HDA_DSP_REG_ADSPIC2 , +HDA_DSP_ADSPIC2_SNDW , +HDA_DSP_ADSPIC2_SNDW ); +else +snd_sof_dsp_update_bits (sdev,HDA_DSP_BAR , +HDA_DSP_REG_ADSPIC2 , +HDA_DSP_ADSPIC2_SNDW , +0 ); +} + +static int hda_sdw_init (struct snd_sof_dev *sdev) +{ +acpi_handle handle; +struct sdw_intel_res res; + + handle =ACPI_HANDLE (sdev->dev); + +memset (&res,0 ,sizeof (res)); + + res.mmio_base = sdev->bar[HDA_DSP_BAR ]; + res.irq = sdev->ipc_irq; + res.parent = sdev->dev; + +hda_sdw_int_enable (sdev, true); + + sdev->sdw =sdw_intel_init (handle, &res); +if (!sdev->sdw) { +dev_err (sdev->dev,"SDW Init failed\n" ); +return -EIO ; + } + +return 0 ; +} + +static int hda_sdw_exit (struct snd_sof_dev *sdev) +{ +hda_sdw_int_enable (sdev, false); + +if (sdev->sdw) +sdw_intel_exit (sdev->sdw); + +return 0 ; +} +#else +static int hda_sdw_init (struct snd_sof_dev *sdev) +{ +return 0 ; +} + +static int hda_sdw_exit (struct snd_sof_dev *sdev) +{ +return 0 ; +} +#endif +/* * Debug */
sound/soc/sof/intel/hda.h +1 -0
@@ -211,6 +211,7 @@#define HDA_DSP_ADSPIC_IPC 1#define HDA_DSP_ADSPIS_IPC 1 +#define HDA_DSP_ADSPIC2_SNDW BIT(5)/* Intel HD Audio General DSP Registers */ #define HDA_DSP_GEN_BASE 0x0
Signature · 1 line
2.20.1
RFC PATCH 3/5 ASoC: SOF: Intel: hda: add SoundWire IP support
In reply to Pierre-Louis BossartThe Core0 needs to be powered before the SoundWire IP is initialized.
Call sdw_intel_init/exit and store the context. We only have one context, but depending on the hardware capabilities and BIOS settings may enable multiple SoundWire links.
--- sound/soc/sof/intel/hda.c | 40 +++++++++++++++++++++++++++++++++------ sound/soc/sof/intel/hda.h | 5 +++++ 2 files changed, 39 insertions(+), 6 deletions(-)
sound/soc/sof/intel/hda.c +34 -6
@@ -57,6 +57,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) {acpi_handle handle;struct sdw_intel_res res; +struct sof_intel_hda_dev *hdev; +void *sdw; handle =ACPI_HANDLE (sdev->dev);
@@ -66,23 +68,32 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.irq = sdev->ipc_irq; res.parent = sdev->dev; -hda_sdw_int_enable (sdev, true); - - sdev->sdw =sdw_intel_init (handle, &res); -if (!sdev->sdw) { + sdw =sdw_intel_init (handle, &res); +if (!sdw) {dev_err (sdev->dev,"SDW Init failed\n" );return -EIO ; } +hda_sdw_int_enable (sdev, true); + +/* save context */ + hdev = sdev->pdata->hw_pdata; + hdev->sdw = sdw; +return 0 ; }static int hda_sdw_exit (struct snd_sof_dev *sdev) { +struct sof_intel_hda_dev *hdev; + + hdev = sdev->pdata->hw_pdata; +hda_sdw_int_enable (sdev, false); -if (sdev->sdw) -sdw_intel_exit (sdev->sdw); +if (hdev->sdw) +sdw_intel_exit (hdev->sdw); + hdev->sdw =NULL ;return 0 ; }
@@ -713,6 +724,21 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)/* set default mailbox offset for FW ready message */ sdev->dsp_box.offset =HDA_DSP_MBOX_UPLINK_OFFSET ; +/* need to power-up core before setting-up capabilities */ + ret =hda_dsp_core_power_up (sdev,HDA_DSP_CORE_MASK (0 )); +if (ret <0 ) { +dev_err (sdev->dev,"error: could not power-up DSP subsystem\n" ); + goto free_ipc_irq; + } + +/* initialize SoundWire capabilities */ + ret =hda_sdw_init (sdev); +if (ret <0 ) { +dev_err (sdev->dev,"error: SoundWire get caps error\n" ); +hda_dsp_core_power_down (sdev,HDA_DSP_CORE_MASK (0 )); + goto free_ipc_irq; + } +return 0 ; free_ipc_irq:
@@ -744,6 +770,8 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)snd_hdac_ext_bus_device_remove (bus);#endif +hda_sdw_exit (sdev); +if (!IS_ERR_OR_NULL (hda->dmic_dev))platform_device_unregister (hda->dmic_dev);
sound/soc/sof/intel/hda.h +5 -0
@@ -399,6 +399,11 @@ struct sof_intel_hda_dev {/* DMIC device */ struct platform_device *dmic_dev; + +#if IS_ENABLED (CONFIG_SOUNDWIRE_INTEL ) +/* sdw context */ +void *sdw; +#endif };static inline struct hdac_bus *sof_to_bus (struct snd_sof_dev *s)
Signature · 1 line
2.20.1
Re: [RFC PATCH 3/5] ASoC: SOF: Intel: hda: add SoundWire IP support
Quoted 26 lines · Pierre-Louis Bossart
The Core0 needs to be powered before the SoundWire IP is initialized.
Call sdw_intel_init/exit and store the context. We only have one context, but depending on the hardware capabilities and BIOS settings may enable multiple SoundWire links.
Signed-off-by Pierre-Louis Bossart <[email protected]>--- sound/soc/sof/intel/hda.c | 40 +++++++++++++++++++++++++++++++++------ sound/soc/sof/intel/hda.h | 5 +++++ 2 files changed, 39 insertions(+), 6 deletions(-)sound/soc/sof/intel/hda.c +2
-0@@ -57,6 +57,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) {acpi_handle handle;struct sdw_intel_res res; +struct sof_intel_hda_dev *hdev; +void *sdw; handle =ACPI_HANDLE (sdev->dev);
sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 71
Quoted 8 lines
sound/soc/sof/intel/hda.c +1
-4@@ -66,23 +68,32 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.irq = sdev->ipc_irq; res.parent = sdev->dev; -hda_sdw_int_enable (sdev, true); - - sdev->sdw =sdw_intel_init (handle, &res); -if (!sdev->sdw) { + sdw =sdw_intel_init (handle, &res);
should this be called for platforms without sdw, I was hoping that some checks would be performed.. For example how would skl deal with this?
Quoted 14 lines
sound/soc/sof/intel/hda.c +7
-0+if (!sdw) {dev_err (sdev->dev,"SDW Init failed\n" );return -EIO ; } +hda_sdw_int_enable (sdev, true); + +/* save context */ + hdev = sdev->pdata->hw_pdata; + hdev->sdw = sdw; +return 0 ; }
sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 85
Quoted 10 lines
sound/soc/sof/intel/hda.c +4
-2static int hda_sdw_exit (struct snd_sof_dev *sdev) { +struct sof_intel_hda_dev *hdev; + + hdev = sdev->pdata->hw_pdata; +hda_sdw_int_enable (sdev, false); -if (sdev->sdw) -sdw_intel_exit (sdev->sdw);
this looks suspect, you are adding sdw calls here so how is this getting removed? Did I miss something...
Quoted 42 lines
sound/soc/sof/intel/hda.c +20
-0+if (hdev->sdw) +sdw_intel_exit (hdev->sdw); + hdev->sdw =NULL ;return 0 ; }@@ -713,6 +724,21 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)/* set default mailbox offset for FW ready message */ sdev->dsp_box.offset =HDA_DSP_MBOX_UPLINK_OFFSET ; +/* need to power-up core before setting-up capabilities */ + ret =hda_dsp_core_power_up (sdev,HDA_DSP_CORE_MASK (0 )); +if (ret <0 ) { +dev_err (sdev->dev,"error: could not power-up DSP subsystem\n" ); + goto free_ipc_irq; + } + +/* initialize SoundWire capabilities */ + ret =hda_sdw_init (sdev); +if (ret <0 ) { +dev_err (sdev->dev,"error: SoundWire get caps error\n" ); +hda_dsp_core_power_down (sdev,HDA_DSP_CORE_MASK (0 )); + goto free_ipc_irq; + } +return 0 ; free_ipc_irq:@@ -744,6 +770,8 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)snd_hdac_ext_bus_device_remove (bus);#endif +hda_sdw_exit (sdev); +if (!IS_ERR_OR_NULL (hda->dmic_dev))platform_device_unregister (hda->dmic_dev);sound/soc/sof/intel/hda.h +0
-0
sound/soc/sof/intel/hda.h struct sof_intel_hda_dev { · line 403
Quoted 5 lines
sound/soc/sof/intel/hda.h +2
-0@@ -399,6 +399,11 @@ struct sof_intel_hda_dev {/* DMIC device */ struct platform_device *dmic_dev; + +#if IS_ENABLED (CONFIG_SOUNDWIRE_INTEL )
is this really required, context is a void pointer
Quoted 9 lines
sound/soc/sof/intel/hda.h +3
-0+/* sdw context */ +void *sdw; +#endif };static inline struct
hdac_bus*sof_to_bus(structsnd_sof_dev*s)Signature · 1 line
2.20.1
Signature · 1 line
~Vinod
Re: [alsa-devel] [RFC PATCH 3/5] ASoC: SOF: Intel: hda: add SoundWire IP support
Quoted 30 lines · Vinod Koul
Quoted 29 lines · Pierre-Louis Bossart
The Core0 needs to be powered before the SoundWire IP is initialized.
Call sdw_intel_init/exit and store the context. We only have one context, but depending on the hardware capabilities and BIOS settings may enable multiple SoundWire links.
Signed-off-by Pierre-Louis Bossart <[email protected]>--- sound/soc/sof/intel/hda.c | 40 +++++++++++++++++++++++++++++++++------ sound/soc/sof/intel/hda.h | 5 +++++ 2 files changed, 39 insertions(+), 6 deletions(-)sound/soc/sof/intel/hda.c +2
-0@@ -57,6 +57,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) {acpi_handle handle;struct sdw_intel_res res; +struct sof_intel_hda_dev *hdev; +void *sdw; handle =ACPI_HANDLE (sdev->dev);@@ -66,23 +68,32 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.irq = sdev->ipc_irq; res.parent = sdev->dev;
Quoted 8 lines
sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 71
Quoted 5 lines
sound/soc/sof/intel/hda.c +1
-4-hda_sdw_int_enable (sdev, true); - - sdev->sdw =sdw_intel_init (handle, &res); -if (!sdev->sdw) { + sdw =sdw_intel_init (handle, &res);should this be called for platforms without sdw, I was hoping that some checks would be performed.. For example how would skl deal with this?
Good point. For now we rely on CONFIG_SOUNDWIRE_INTEL to use a fallback, but if the kernel defines this config and we run on an older platform the only safety would be the hardware capabilities and BIOS dependencies, I need to test if it works. Thanks for the feedback.
Quoted 23 lines
Quoted 23 lines
sound/soc/sof/intel/hda.c +11
-0+if (!sdw) {dev_err (sdev->dev,"SDW Init failed\n" );return -EIO ; } +hda_sdw_int_enable (sdev, true); + +/* save context */ + hdev = sdev->pdata->hw_pdata; + hdev->sdw = sdw; +return 0 ; }static int hda_sdw_exit (struct snd_sof_dev *sdev) { +struct sof_intel_hda_dev *hdev; + + hdev = sdev->pdata->hw_pdata; +hda_sdw_int_enable (sdev, false);
Quoted 5 lines
sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 85
Quoted 2 lines
sound/soc/sof/intel/hda.c +0
-2-if (sdev->sdw) -sdw_intel_exit (sdev->sdw);this looks suspect, you are adding sdw calls here so how is this getting removed? Did I miss something...
That must be a squash/tick-tock error, we moved the 'sdw' field from the top-level 'sdev' structure to an intel-specific one. In the latest code I have a single patch to add the helper and all dependencies in one shot.
Quoted 61 lines
Quoted 43 lines
sound/soc/sof/intel/hda.c +20
-0+if (hdev->sdw) +sdw_intel_exit (hdev->sdw); + hdev->sdw =NULL ;return 0 ; }@@ -713,6 +724,21 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)/* set default mailbox offset for FW ready message */ sdev->dsp_box.offset =HDA_DSP_MBOX_UPLINK_OFFSET ; +/* need to power-up core before setting-up capabilities */ + ret =hda_dsp_core_power_up (sdev,HDA_DSP_CORE_MASK (0 )); +if (ret <0 ) { +dev_err (sdev->dev,"error: could not power-up DSP subsystem\n" ); + goto free_ipc_irq; + } + +/* initialize SoundWire capabilities */ + ret =hda_sdw_init (sdev); +if (ret <0 ) { +dev_err (sdev->dev,"error: SoundWire get caps error\n" ); +hda_dsp_core_power_down (sdev,HDA_DSP_CORE_MASK (0 )); + goto free_ipc_irq; + } +return 0 ; free_ipc_irq:@@ -744,6 +770,8 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)snd_hdac_ext_bus_device_remove (bus);#endif +hda_sdw_exit (sdev); +if (!IS_ERR_OR_NULL (hda->dmic_dev))platform_device_unregister (hda->dmic_dev);sound/soc/sof/intel/hda.h +0
-0sound/soc/sof/intel/hda.h struct sof_intel_hda_dev { · line 403
Quoted 5 lines
sound/soc/sof/intel/hda.h +2
-0@@ -399,6 +399,11 @@ struct sof_intel_hda_dev {/* DMIC device */ struct platform_device *dmic_dev; + +#if IS_ENABLED (CONFIG_SOUNDWIRE_INTEL )is this really required, context is a void pointer
Quoted 9 lines
sound/soc/sof/intel/hda.h +3
-0+/* sdw context */ +void *sdw; +#endif };static inline struct
hdac_bus*sof_to_bus(structsnd_sof_dev*s)Signature · 1 line
2.20.1
Re: [alsa-devel] [RFC PATCH 3/5] ASoC: SOF: Intel: hda: add SoundWire IP support
Quoted 37 lines · Pierre-Louis Bossart
Quoted 27 lines · Vinod Koul
Quoted 26 lines · Pierre-Louis Bossart
The Core0 needs to be powered before the SoundWire IP is initialized.
Call sdw_intel_init/exit and store the context. We only have one context, but depending on the hardware capabilities and BIOS settings may enable multiple SoundWire links.
Signed-off-by Pierre-Louis Bossart <[email protected]>--- sound/soc/sof/intel/hda.c | 40 +++++++++++++++++++++++++++++++++------ sound/soc/sof/intel/hda.h | 5 +++++ 2 files changed, 39 insertions(+), 6 deletions(-)sound/soc/sof/intel/hda.c +2
-0@@ -57,6 +57,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) {acpi_handle handle;struct sdw_intel_res res; +struct sof_intel_hda_dev *hdev; +void *sdw; handle =ACPI_HANDLE (sdev->dev);@@ -66,23 +68,32 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.irq = sdev->ipc_irq; res.parent = sdev->dev;Quoted 8 lines
sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 71
Quoted 5 lines
sound/soc/sof/intel/hda.c +1
-4-hda_sdw_int_enable (sdev, true); - - sdev->sdw =sdw_intel_init (handle, &res); -if (!sdev->sdw) { + sdw =sdw_intel_init (handle, &res);should this be called for platforms without sdw, I was hoping that some checks would be performed.. For example how would skl deal with this?
Quoted 4 lines
Good point. For now we rely on
CONFIG_SOUNDWIRE_INTELto use a fallback, but if the kernel defines this config and we run on an older platform the only safety would be the hardware capabilities and BIOS dependencies, I need to test if it works.
Yes I am not sure given the experience with BIOS relying on that is a great idea ! But if that works, that would be better.
Quoted 11 lines
Quoted 11 lines
sound/soc/sof/intel/hda.h struct sof_intel_hda_dev { · line 402
Quoted 9 lines
sound/soc/sof/intel/hda.h +2
-0@@ -399,6 +399,11 @@ struct sof_intel_hda_dev {/* DMIC device */ struct platform_device *dmic_dev; + +#if IS_ENABLED (CONFIG_SOUNDWIRE_INTEL )is this really required, context is a void pointer
??
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
sound/soc/sof/intel/hda.h +3
-0+/* sdw context */ +void *sdw; +#endif
Signature · 1 line
~Vinod
Re: [alsa-devel] [RFC PATCH 3/5] ASoC: SOF: Intel: hda: add SoundWire IP support
Quoted 38 lines · Vinod Koul
Quoted 37 lines · Pierre-Louis Bossart
Quoted 35 lines · Vinod Koul
Quoted 24 lines · Pierre-Louis Bossart
The Core0 needs to be powered before the SoundWire IP is initialized.
Call sdw_intel_init/exit and store the context. We only have one context, but depending on the hardware capabilities and BIOS settings may enable multiple SoundWire links.
Signed-off-by Pierre-Louis Bossart <[email protected]>--- sound/soc/sof/intel/hda.c | 40 +++++++++++++++++++++++++++++++++------ sound/soc/sof/intel/hda.h | 5 +++++ 2 files changed, 39 insertions(+), 6 deletions(-)sound/soc/sof/intel/hda.c +2
-0@@ -57,6 +57,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) {acpi_handle handle;struct sdw_intel_res res; +struct sof_intel_hda_dev *hdev; +void *sdw; handle =ACPI_HANDLE (sdev->dev);sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 70
Quoted 7 lines
sound/soc/sof/intel/hda.c +1
-4@@ -66,23 +68,32 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.irq = sdev->ipc_irq; res.parent = sdev->dev; -hda_sdw_int_enable (sdev, true); - - sdev->sdw =sdw_intel_init (handle, &res); -if (!sdev->sdw) { + sdw =sdw_intel_init (handle, &res);should this be called for platforms without sdw, I was hoping that some checks would be performed.. For example how would skl deal with this?
Quoted 7 lines
Quoted 4 lines
Good point. For now we rely on
CONFIG_SOUNDWIRE_INTELto use a fallback, but if the kernel defines this config and we run on an older platform the only safety would be the hardware capabilities and BIOS dependencies, I need to test if it works.Yes I am not sure given the experience with BIOS relying on that is a great idea ! But if that works, that would be better.
I don't think it's going to be that bad, first we need to find the ACPI description for the controller, then see which links are active, and even with all links disabled nothing bad will happen.
What I am more worried about are inconsistencies where e.g we have both I2C/I2S and SoundWire devices exposed at the same time. The BIOS deals with this with dynamic changes depending on user changes, and we are likely to see reports of problems due to BIOS configuration selection, not the BIOS itself.
RFC PATCH 4/5 ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
In reply to Pierre-Louis BossartThese callbacks are invoked when a matching hw_params/hw_free() DAI operation takes place, and will result in IPC operations with the SOF firmware.
--- sound/soc/sof/intel/hda.c | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+)
sound/soc/sof/intel/hda.c +66 -0
@@ -53,6 +53,70 @@ static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) 0); } +static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id) +{ +struct snd_sof_dev *sdev = arg; +struct snd_soc_dai *d = dai; +struct sof_ipc_dai_config config; +struct sof_ipc_reply reply; +int ret; +u32 size =sizeof (config); + +memset (&config,0 , size); + config.hdr.size = size; + config.hdr.cmd =SOF_IPC_GLB_DAI_MSG |SOF_IPC_DAI_CONFIG ; + config.type =SOF_DAI_INTEL_ALH ; + config.dai_index = (link_id <<8 ) | (d->id); + config.alh.stream_id = alh_stream_id; + +/* send message to DSP */ + ret =sof_ipc_tx_message (sdev->ipc, + config.hdr.cmd, &config, size, &reply, +sizeof (reply)); +if (ret <0 ) { +dev_err (sdev->dev, +"error: failed to set DAI hw_params for link %d dai->id %d ALH %d\n" , + link_id, d->id, alh_stream_id); + } + +return ret; +} + +static int sdw_free_stream (void *arg,void *s,void *dai,int link_id) +{ +struct snd_sof_dev *sdev = arg; +struct snd_soc_dai *d = dai; +struct sof_ipc_dai_config config; +struct sof_ipc_reply reply; +int ret; +u32 size =sizeof (config); + +memset (&config,0 , size); + config.hdr.size = size; + config.hdr.cmd =SOF_IPC_GLB_DAI_MSG |SOF_IPC_DAI_CONFIG ; + config.type =SOF_DAI_INTEL_ALH ; + config.dai_index = (link_id <<8 ) | d->id; + config.alh.stream_id =0xFFFF ;/* invalid value on purpose */ + +/* send message to DSP */ + ret =sof_ipc_tx_message (sdev->ipc, + config.hdr.cmd, &config, size, &reply, +sizeof (reply)); +if (ret <0 ) { +dev_err (sdev->dev, +"error: failed to free stream for link %d dai->id %d\n" , + link_id, d->id); + } + +return ret; +} + +static const struct sdw_intel_ops sdw_callback = { + .config_stream = sdw_config_stream, + .free_stream = sdw_free_stream, +}; +static int hda_sdw_init (struct snd_sof_dev *sdev) {acpi_handle handle;
@@ -67,6 +131,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.mmio_base = sdev->bar[HDA_DSP_BAR ]; res.irq = sdev->ipc_irq; res.parent = sdev->dev; + res.ops = &sdw_callback; + res.arg = sdev; sdw =sdw_intel_init (handle, &res);if (!sdw) {
Signature · 1 line
2.20.1
Re: [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
Hi Pierre,
A couple of comments below
Quoted 14 lines · Pierre-Louis Bossart
These callbacks are invoked when a matching hw_params/hw_free() DAI operation takes place, and will result in IPC operations with the SOF firmware.
Signed-off-by Pierre-Louis Bossart <[email protected]>--- sound/soc/sof/intel/hda.c | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+)sound/soc/sof/intel/hda.c +0
-0
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 57
Quoted 5 lines
sound/soc/sof/intel/hda.c +2
-0@@ -53,6 +53,70 @@ static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) 0); } +static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id)
I realise, that these function prototypes aren't being introduced by these patches, but just wondering whether such overly generic prototype is really a good idea here, whether some of those "void *" pointers could be given real types. The first one could be "struct device *" etc.
Quoted 4 lines
sound/soc/sof/intel/hda.c +4
-0+{ +struct snd_sof_dev *sdev = arg; +struct snd_soc_dai *d = dai; +struct sof_ipc_dai_config config;
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 71
Quoted 10 lines
sound/soc/sof/intel/hda.c +10
-0+struct sof_ipc_reply reply; +int ret; +u32 size =sizeof (config); + +memset (&config,0 , size); + config.hdr.size = size; + config.hdr.cmd =SOF_IPC_GLB_DAI_MSG |SOF_IPC_DAI_CONFIG ; + config.type =SOF_DAI_INTEL_ALH ; + config.dai_index = (link_id <<8 ) | (d->id); + config.alh.stream_id = alh_stream_id;
Entirely up to you, in such cases I usually do something like
+ struct sof_ipc_dai_config config = {
+ .type = SOF_DAI_INTEL_ALH,
+ .hre = {
+ .size = sizeof(config),
+ .cmd = SOF_IPC_GLB_DAI_MSG | SOF_IPC_DAI_CONFIG,
+ ...
which then also avoids a memset(). But that's mostly a matter of personal preference, since this is on stack, the compiler would probably internally anyway translate the above initialisation to a memset() with all the following assignments.
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 79
Quoted 8 lines
sound/soc/sof/intel/hda.c +8
-0+ +/* send message to DSP */ + ret =sof_ipc_tx_message (sdev->ipc, + config.hdr.cmd, &config, size, &reply, +sizeof (reply)); +if (ret <0 ) { + dev_err(sdev->dev, + "error: failed to set DAI hw_params for link %d dai->id %d ALH %d\n",
Are readers really expected to understand what "dai->id" means? Wouldn't "DAI ID" be friendlier, although I understand you - who might not know what "x->y" stands for?.. ;-)
Quoted 11 lines
sound/soc/sof/intel/hda.c +11
-0+ link_id, d->id, alh_stream_id); + } + +return ret; +} + +static int sdw_free_stream (void *arg,void *s,void *dai,int link_id) +{ +struct snd_sof_dev *sdev = arg; +struct snd_soc_dai *d = dai; +struct sof_ipc_dai_config config;
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 100
Quoted 10 lines
sound/soc/sof/intel/hda.c +10
-0+struct sof_ipc_reply reply; +int ret; +u32 size =sizeof (config); + +memset (&config,0 , size); + config.hdr.size = size; + config.hdr.cmd =SOF_IPC_GLB_DAI_MSG |SOF_IPC_DAI_CONFIG ; + config.type =SOF_DAI_INTEL_ALH ; + config.dai_index = (link_id <<8 ) | d->id; + config.alh.stream_id =0xFFFF ;/* invalid value on purpose */
ditto
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 109
Quoted 9 lines
sound/soc/sof/intel/hda.c +9
-0+ +/* send message to DSP */ + ret =sof_ipc_tx_message (sdev->ipc, + config.hdr.cmd, &config, size, &reply, +sizeof (reply)); +if (ret <0 ) { +dev_err (sdev->dev, +"error: failed to free stream for link %d dai->id %d\n" , + link_id, d->id);
ditto
Quoted 14 lines
sound/soc/sof/intel/hda.c +10
-0+ } + +return ret; +} + +static const struct sdw_intel_ops sdw_callback = { + .config_stream = sdw_config_stream, + .free_stream = sdw_free_stream, +}; +static int hda_sdw_init (struct snd_sof_dev *sdev) {acpi_handle handle;
sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 138
Quoted 8 lines
sound/soc/sof/intel/hda.c +2
-0@@ -67,6 +131,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.mmio_base = sdev->bar[HDA_DSP_BAR ]; res.irq = sdev->ipc_irq; res.parent = sdev->dev; + res.ops = &sdw_callback; + res.arg = sdev; sdw =sdw_intel_init (handle, &res);if (!sdw) {
Hm, looks like this function is using spaces for indentation... Let me check if this is coming from an earlier patch
Thanks
Guennadi
Quoted 3 lines
Signature · 1 line
2.20.1
Re: [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
On Thu, Aug 22, 2019 at 09:18:35AM +0200, Guennadi Liakhovetski wrote:
[snip]
Quoted 10 lines
Quoted 10 lines
static int
hda_sdw_init(struct snd_sof_dev *sdev){sound/soc/sof/intel/hda.c +2
-0acpi_handle handle;@@ -67,6 +131,8 @@ static int hda_sdw_init(struct snd_sof_dev *sdev) res.mmio_base = sdev->bar[HDA_DSP_BAR ]; res.irq = sdev->ipc_irq; res.parent = sdev->dev; + res.ops = &sdw_callback; + res.arg = sdev;
Quoted 5 lines
sound/soc/sof/intel/hda.c static int hda_sdw_init(struct snd_sof_dev *sdev) · line 138
Quoted 2 lines
sound/soc/sof/intel/hda.c +0
-0sdw =sdw_intel_init (handle, &res);if (!sdw) {Hm, looks like this function is using spaces for indentation... Let me check if this is coming from an earlier patch
Ouch, it's mutt or whatever editor it's using... Sorry for the noise.
Thanks
Guennadi
Re: [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
In reply to Guennadi LiakhovetskiThanks for the review Guennadi
Quoted 7 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 57
Quoted 2 lines
sound/soc/sof/intel/hda.c +2
-0+static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id)I realise, that these function prototypes aren't being introduced by these patches, but just wondering whether such overly generic prototype is really a good idea here, whether some of those "void *" pointers could be given real types. The first one could be "struct device *" etc.
In this case the 'arg' parameter is actually a private 'struct snd_sof_dev', as shown below [1]. We probably want to keep this relatively opaque, this is a context that doesn't need to be exposed to the SoundWire code.
The dai and params are indeed cases where we could use stronger types, they are snd_soc_dai and hw_params respectively. I don't recall why the existing code is this way, Vinod and Sanyog may have the history of this.
Quoted 4 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 60
Quoted 4 lines
sound/soc/sof/intel/hda.c +3
-0+{ +struct snd_sof_dev *sdev = arg; +struct snd_soc_dai *d = dai;
[1]
Quoted 21 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 71
Quoted 11 lines
sound/soc/sof/intel/hda.c +11
-0+struct sof_ipc_dai_config config; +struct sof_ipc_reply reply; +int ret; +u32 size =sizeof (config); + +memset (&config,0 , size); + config.hdr.size = size; + config.hdr.cmd =SOF_IPC_GLB_DAI_MSG |SOF_IPC_DAI_CONFIG ; + config.type =SOF_DAI_INTEL_ALH ; + config.dai_index = (link_id <<8 ) | (d->id); + config.alh.stream_id = alh_stream_id;Entirely up to you, in such cases I usually do something like
(quoted diff) +6
-0+ struct sof_ipc_dai_config config = { + .type = SOF_DAI_INTEL_ALH, + .hre = { + .size = sizeof(config), + .cmd = SOF_IPC_GLB_DAI_MSG | SOF_IPC_DAI_CONFIG, + ...
Quoted 4 lines
which then also avoids a
memset(). But that's mostly a matter of personal preference, since this is on stack, the compiler would probably internally anyway translate the above initialisation to amemset()with all the following assignments.
I have no preference, so in this case I will go with consistency with existing code, which uses the suggested style for all IPCs.
Quoted 13 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 79
Quoted 9 lines
sound/soc/sof/intel/hda.c +8
-0+ +/* send message to DSP */ + ret =sof_ipc_tx_message (sdev->ipc, + config.hdr.cmd, &config, size, &reply, +sizeof (reply)); +if (ret <0 ) { + dev_err(sdev->dev, + "error: failed to set DAI hw_params for link %d dai->id %d ALH %d\n",Are readers really expected to understand what "
dai->id" means? Wouldn't "DAI ID" be friendlier, although I understand you - who might not know what "x->y" stands for?.. ;-)
I was trying to avoid a confusion here, we have config->dai_index which are shared concepts between topology and firmware, and dai->id which is shared between topology and machine driver (which refers to the dai in the dai_link which has its own .id). In topology files we have the three indices and of course after a couple of weeks I can't recall which one maps to what. I am afraid DAI ID might be confused with dai_index. If there are suggestions on this I am all ears, all I care about is avoiding ambiguity and having to ask Ranjani what index this really is :-)
Re: [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
Quoted 10 lines · Pierre-Louis Bossart
Thanks for the review Guennadi
Quoted 7 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 57
Quoted 2 lines
sound/soc/sof/intel/hda.c +2
-0+static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id)I realise, that these function prototypes aren't being introduced by these patches, but just wondering whether such overly generic prototype is really a good idea here, whether some of those "void *" pointers could be given real types. The first one could be "struct device *" etc.
Quoted 3 lines
In this case the 'arg' parameter is actually a private 'struct
snd_sof_dev', as shown below [1]. We probably want to keep this relatively opaque, this is a context that doesn't need to be exposed to the SoundWire code.
Right, that's why I proposed struct device and not struct snd_sof_dev, to not make it SOF-specific, then sdev could be obtained from dev_get_drvdata(). But yes, that's unrelated to this series.
Thanks
Guennadi
Re: [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
In reply to Pierre-Louis BossartQuoted 10 lines · Pierre-Louis Bossart
Thanks for the review Guennadi
Quoted 7 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 57
Quoted 2 lines
sound/soc/sof/intel/hda.c +2
-0+static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id)I realise, that these function prototypes aren't being introduced by these patches, but just wondering whether such overly generic prototype is really a good idea here, whether some of those "void *" pointers could be given real types. The first one could be "struct device *" etc.
Quoted 3 lines
In this case the 'arg' parameter is actually a private 'struct
snd_sof_dev', as shown below [1]. We probably want to keep this relatively opaque, this is a context that doesn't need to be exposed to the SoundWire code.
This does look bit ugly.
Quoted 3 lines
The dai and params are indeed cases where we could use stronger types, they are
snd_soc_daiandhw_paramsrespectively. I don't recall why the existing code is this way, Vinod and Sanyog may have the history of this.
Yes we wanted to decouple the sdw and audio bits that is the reason why none of the audio types are used here, but I think it should be revisited and perhaps made as:
sdw_config_stream(struct device *sdw, struct sdw_callback_ctx *ctx)
where the callback context contains all the other args. That would make it look lot neater too and of course use real structs if possible
Signature · 1 line
~Vinod
Re: [alsa-devel] [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
Quoted 21 lines · Vinod Koul
Quoted 10 lines · Pierre-Louis Bossart
Thanks for the review Guennadi
Quoted 7 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 57
Quoted 2 lines
sound/soc/sof/intel/hda.c +2
-0+static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id)I realise, that these function prototypes aren't being introduced by these patches, but just wondering whether such overly generic prototype is really a good idea here, whether some of those "void *" pointers could be given real types. The first one could be "struct device *" etc.
Quoted 3 lines
In this case the 'arg' parameter is actually a private 'struct
snd_sof_dev', as shown below [1]. We probably want to keep this relatively opaque, this is a context that doesn't need to be exposed to the SoundWire code.This does look bit ugly.
Quoted 3 lines
The dai and params are indeed cases where we could use stronger types, they are
snd_soc_daiandhw_paramsrespectively. I don't recall why the existing code is this way, Vinod and Sanyog may have the history of this.
Quoted 8 lines
Yes we wanted to decouple the sdw and audio bits that is the reason why none of the audio types are used here, but I think it should be revisited and perhaps made as:
sdw_config_stream(struct device *sdw, struct sdw_callback_ctx *ctx)where the callback context contains all the other args. That would make it look lot neater too and of course use real structs if possible
the suggested sdw_callbback_ctx is really intel-specific at the moment, e.g. the notion of link_id and alh_stream_id are due to the hardware, it's not generic at all. And in the latest code we also pass the dai->id.
Re: [alsa-devel] [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
Quoted 26 lines · Pierre-Louis Bossart
Quoted 25 lines · Vinod Koul
Quoted 10 lines · Pierre-Louis Bossart
Thanks for the review Guennadi
Quoted 7 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 57
Quoted 2 lines
sound/soc/sof/intel/hda.c +2
-0+static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id)I realise, that these function prototypes aren't being introduced by these patches, but just wondering whether such overly generic prototype is really a good idea here, whether some of those "void *" pointers could be given real types. The first one could be "struct device *" etc.
Quoted 3 lines
In this case the 'arg' parameter is actually a private 'struct
snd_sof_dev', as shown below [1]. We probably want to keep this relatively opaque, this is a context that doesn't need to be exposed to the SoundWire code.This does look bit ugly.
Quoted 3 lines
The dai and params are indeed cases where we could use stronger types, they are
snd_soc_daiandhw_paramsrespectively. I don't recall why the existing code is this way, Vinod and Sanyog may have the history of this.Yes we wanted to decouple the sdw and audio bits that is the reason why none of the audio types are used here, but I think it should be revisited and perhaps made as:
Quoted 8 lines
Quoted 4 lines
sdw_config_stream(struct device *sdw, struct sdw_callback_ctx *ctx)where the callback context contains all the other args. That would make it look lot neater too and of course use real structs if possible
the suggested
sdw_callbback_ctxis really intel-specific at the moment, e.g. the notion oflink_idandalh_stream_idare due to the hardware, it's not generic at all. And in the latest code we also pass thedai->id.
s/sdw_callback_ctx/intel_sdw_callback_ctx
Yes this code is intel specific and this would be intel specific too
Signature · 1 line
~Vinod
Re: [alsa-devel] [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
Quoted 32 lines · Vinod Koul
Quoted 31 lines · Pierre-Louis Bossart
Quoted 29 lines · Vinod Koul
Quoted 10 lines · Pierre-Louis Bossart
Thanks for the review Guennadi
Quoted 7 lines
sound/soc/sof/intel/hda.c static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) · line 57
Quoted 2 lines
sound/soc/sof/intel/hda.c +2
-0+static int sdw_config_stream (void *arg,void *s,void *dai, +void *params,int link_id,int alh_stream_id)I realise, that these function prototypes aren't being introduced by these patches, but just wondering whether such overly generic prototype is really a good idea here, whether some of those "void *" pointers could be given real types. The first one could be "struct device *" etc.
Quoted 3 lines
In this case the 'arg' parameter is actually a private 'struct
snd_sof_dev', as shown below [1]. We probably want to keep this relatively opaque, this is a context that doesn't need to be exposed to the SoundWire code.This does look bit ugly.
Quoted 3 lines
The dai and params are indeed cases where we could use stronger types, they are
snd_soc_daiandhw_paramsrespectively. I don't recall why the existing code is this way, Vinod and Sanyog may have the history of this.Yes we wanted to decouple the sdw and audio bits that is the reason why none of the audio types are used here, but I think it should be revisited and perhaps made as:
sdw_config_stream(struct device *sdw, struct sdw_callback_ctx *ctx)where the callback context contains all the other args. That would make it look lot neater too and of course use real structs if possible
Quoted 7 lines
Quoted 3 lines
the suggested
sdw_callbback_ctxis really intel-specific at the moment, e.g. the notion oflink_idandalh_stream_idare due to the hardware, it's not generic at all. And in the latest code we also pass thedai->id.s/sdw_callback_ctx/intel_sdw_callback_ctx
Yes this code is intel specific and this would be intel specific too
ok, I'll fold all the fields in a structure then. That's a nice cleanup, thanks Guennadi and Vinod for the reviews.
RFC PATCH 5/5 ASoC: SOF: Intel: add support for SoundWire suspend/resume
In reply to Pierre-Louis BossartSomehow the core0 needs to be on to set-up the interrupts and power-up the SoundWire IP.
--- sound/soc/sof/intel/hda-dsp.c | 11 +++++++++++ sound/soc/sof/intel/hda.c | 2 +- sound/soc/sof/intel/hda.h | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-)
sound/soc/sof/intel/hda-dsp.c +11 -0
@@ -374,6 +374,17 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)hda_dsp_ctrl_ppcap_enable (sdev, true);hda_dsp_ctrl_ppcap_int_enable (sdev, true); +#if IS_ENABLED (CONFIG_SOUNDWIRE_INTEL ) +/* need to power-up core before setting-up capabilities */ + ret =hda_dsp_core_power_up (sdev,HDA_DSP_CORE_MASK (0 )); +if (ret <0 ) { +dev_err (sdev->dev,"error: could not power-up DSP subsystem\n" ); +return ret; + } + +hda_sdw_int_enable (sdev, true); +#endif +return 0 ; }
sound/soc/sof/intel/hda.c +1 -1
@@ -39,7 +39,7 @@#if IS_ENABLED (CONFIG_SOUNDWIRE_INTEL ) -static void hda_sdw_int_enable (struct snd_sof_dev *sdev,bool enable) +void hda_sdw_int_enable (struct snd_sof_dev *sdev,bool enable) {if (enable) snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR,
sound/soc/sof/intel/hda.h +5 -0
@@ -591,6 +591,11 @@ int hda_dsp_trace_init(struct snd_sof_dev *sdev, u32 *stream_tag);int hda_dsp_trace_release (struct snd_sof_dev *sdev);int hda_dsp_trace_trigger (struct snd_sof_dev *sdev,int cmd); +/* +* SoundWire support +*/ +void hda_sdw_int_enable (struct snd_sof_dev *sdev,bool enable); +/* common dai driver */ extern struct snd_soc_dai_driver skl_dai[];
Signature · 1 line
2.20.1
Hi Pierre,
In patch 4/5 I forgot to mention superfluous braces around dev_err() in sdw_config_stream() and sdw_free_stream(). Otherwise for the series:
Thanks
Guennadi
Quoted 37 lines · Pierre-Louis Bossart
This RFC is the companion of the other RFC 'soundwire: intel: simplify DAI/PDI handling'. Our purpose at this point is to gather feedback on the interfaces between the Intel SOF parts and the SoundWire code.
The suggested solution is a simple init/release inserted at probe/remove and resume/suspend, as well as two callbacks for the SOF driver to generate IPC configurations with the firmware. That level of separation completely hides the details of the SoundWire DAIs and will allow for 'transparent' multi-cpu DAI support, which will be handled in the machine driver and the soundwire DAIs.
This solution was tested on IceLake and CometLake, and captures the feedback from SOF contributors on an initial integration that was deemed too complicated (and rightly so).
Pierre-Louis Bossart (5):
ASoC: SOF: IPC: dai-intel: move ALH declarations in header file
ASoC: SOF: Intel: hda: add helper to initialize SoundWire IP
ASoC: SOF: Intel: hda: add SoundWire IP support
ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
ASoC: SOF: Intel: add support for SoundWire suspend/resumeinclude/sound/sof/dai-intel.h | 18 ++-- sound/soc/sof/intel/hda-dsp.c | 11 +++ sound/soc/sof/intel/hda.c | 157 ++++++++++++++++++++++++++++++++++ sound/soc/sof/intel/hda.h | 11 +++ 4 files changed, 188 insertions(+), 9 deletions(-)base-commit:
3b3aaa017e8072b1bfddda92be296b3463d870beSignature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 4 lines
In patch 4/5 I forgot to mention superfluous braces around
dev_err()insdw_config_stream()andsdw_free_stream(). Otherwise for the series:
Will fix, thanks for spotting this.
Quoted 1 line
Reviewed-by Guennadi Liakhovetski <[email protected]>
Thanks, I appreciate the overnight review!
Quoted 47 lines
Thanks
GuennadiQuoted 22 lines · Pierre-Louis Bossart
This RFC is the companion of the other RFC 'soundwire: intel: simplify DAI/PDI handling'. Our purpose at this point is to gather feedback on the interfaces between the Intel SOF parts and the SoundWire code.
The suggested solution is a simple init/release inserted at probe/remove and resume/suspend, as well as two callbacks for the SOF driver to generate IPC configurations with the firmware. That level of separation completely hides the details of the SoundWire DAIs and will allow for 'transparent' multi-cpu DAI support, which will be handled in the machine driver and the soundwire DAIs.
This solution was tested on IceLake and CometLake, and captures the feedback from SOF contributors on an initial integration that was deemed too complicated (and rightly so).
Pierre-Louis Bossart (5):
ASoC: SOF: IPC: dai-intel: move ALH declarations in header file
ASoC: SOF: Intel: hda: add helper to initialize SoundWire IP
ASoC: SOF: Intel: hda: add SoundWire IP support
ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
ASoC: SOF: Intel: add support for SoundWire suspend/resumeQuoted 15 lines
include/sound/sof/dai-intel.h | 18 ++-- sound/soc/sof/intel/hda-dsp.c | 11 +++ sound/soc/sof/intel/hda.c | 157 ++++++++++++++++++++++++++++++++++ sound/soc/sof/intel/hda.h | 11 +++ 4 files changed, 188 insertions(+), 9 deletions(-)base-commit:
3b3aaa017e8072b1bfddda92be296b3463d870beSignature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel