[alsa-devel] [PATCH 21/35] ASoC: Intel: Expose ACPI loading members

Cezary Rojewski cezary.rojewski at intel.com
Thu Aug 22 21:04:11 CEST 2019


No framework should know upfront about specifics of its inheriting
members. sst-acpi contains Baytrail and Haswell specific data. In order
to prevent circular dependency, it's compiled into separate module.

Let's do it right and obey inheritance rule. As a first step, elevate
sst-acpi members so they could be shared by Haswell and
Baytrail-specific handlers - this is to prevent code duplication.

Signed-off-by: Cezary Rojewski <cezary.rojewski at intel.com>
---
 sound/soc/intel/common/sst-acpi.c | 23 ++++-------------------
 sound/soc/intel/common/sst-dsp.h  | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c
index 0e8e0a7a11df..42f9b02f2ea3 100644
--- a/sound/soc/intel/common/sst-acpi.c
+++ b/sound/soc/intel/common/sst-acpi.c
@@ -19,23 +19,6 @@
 #define SST_WPT_DSP_DMA_ADDR_OFFSET	0x0FE000
 #define SST_LPT_DSP_DMA_SIZE		(1024 - 1)
 
-/* Descriptor for setting up SST platform data */
-struct sst_acpi_desc {
-	const char *drv_name;
-	struct snd_soc_acpi_mach *machines;
-	/* Platform resource indexes. Must set to -1 if not used */
-	int resindex_lpe_base;
-	int resindex_pcicfg_base;
-	int resindex_fw_base;
-	int irqindex_host_ipc;
-	int resindex_dma_base;
-	/* Unique number identifying the SST core on platform */
-	int sst_id;
-	/* DMA only valid when resindex_dma_base != -1*/
-	int dma_engine;
-	int dma_size;
-};
-
 struct sst_acpi_priv {
 	struct platform_device *pdev_mach;
 	struct platform_device *pdev_pcm;
@@ -71,7 +54,7 @@ static void sst_acpi_fw_cb(const struct firmware *fw, void *context)
 	return;
 }
 
-static int sst_acpi_probe(struct platform_device *pdev)
+int sst_acpi_probe(struct platform_device *pdev)
 {
 	const struct acpi_device_id *id;
 	struct device *dev = &pdev->dev;
@@ -157,8 +140,9 @@ static int sst_acpi_probe(struct platform_device *pdev)
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(sst_acpi_probe);
 
-static int sst_acpi_remove(struct platform_device *pdev)
+int sst_acpi_remove(struct platform_device *pdev)
 {
 	struct sst_acpi_priv *sst_acpi = platform_get_drvdata(pdev);
 	struct sst_pdata *sst_pdata = &sst_acpi->sst_pdata;
@@ -170,6 +154,7 @@ static int sst_acpi_remove(struct platform_device *pdev)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(sst_acpi_remove);
 
 static struct sst_acpi_desc sst_acpi_haswell_desc = {
 	.drv_name = "haswell-pcm-audio",
diff --git a/sound/soc/intel/common/sst-dsp.h b/sound/soc/intel/common/sst-dsp.h
index 63c29bb45cf1..a2ac7998fbdb 100644
--- a/sound/soc/intel/common/sst-dsp.h
+++ b/sound/soc/intel/common/sst-dsp.h
@@ -166,6 +166,27 @@
 #define SST_PMCS_PS_MASK	0x3
 
 struct sst_dsp;
+struct platform_device;
+
+/* Descriptor for setting up SST platform data */
+struct sst_acpi_desc {
+	const char *drv_name;
+	struct snd_soc_acpi_mach *machines;
+	/* Platform resource indexes. Must set to -1 if not used */
+	int resindex_lpe_base;
+	int resindex_pcicfg_base;
+	int resindex_fw_base;
+	int irqindex_host_ipc;
+	int resindex_dma_base;
+	/* Unique number identifying the SST core on platform */
+	int sst_id;
+	/* DMA only valid when resindex_dma_base != -1*/
+	int dma_engine;
+	int dma_size;
+};
+
+int sst_acpi_probe(struct platform_device *pdev);
+int sst_acpi_remove(struct platform_device *pdev);
 
 /*
  * SST Platform Data.
-- 
2.17.1



More information about the Alsa-devel mailing list