ASoC: Intel: ssp-common: relocate source file
authorBrent Lu <brent.lu@intel.com>
Wed, 27 Mar 2024 16:23:51 +0000 (11:23 -0500)
committerMark Brown <broonie@kernel.org>
Thu, 28 Mar 2024 13:58:10 +0000 (13:58 +0000)
Moving ssp-common source and header files from sound/soc/intel/boards
directory to sound/soc/intel/common directory and rename the source
file. Keep file content unchanged for tracking purpose.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240327162408.63953-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/Makefile
sound/soc/intel/boards/sof_board_helpers.h
sound/soc/intel/boards/sof_cirrus_common.h
sound/soc/intel/boards/sof_maxim_common.h
sound/soc/intel/boards/sof_nuvoton_common.h
sound/soc/intel/boards/sof_realtek_common.h
sound/soc/intel/boards/sof_ssp_common.c [deleted file]
sound/soc/intel/boards/sof_ssp_common.h [deleted file]
sound/soc/intel/common/Makefile
sound/soc/intel/common/soc-acpi-intel-ssp-common.c [new file with mode: 0644]
sound/soc/intel/common/sof_ssp_common.h [new file with mode: 0644]

index 8f711be46c43ef023cdfd3cd0f3edf562cf2fabc..a93b658ed67285ce3798a6c14c46175942c209ab 100644 (file)
@@ -101,8 +101,5 @@ obj-$(CONFIG_SND_SOC_INTEL_SOF_CIRRUS_COMMON) += snd-soc-intel-sof-cirrus-common
 snd-soc-intel-sof-nuvoton-common-objs += sof_nuvoton_common.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_NUVOTON_COMMON) += snd-soc-intel-sof-nuvoton-common.o
 
-snd-soc-intel-sof-ssp-common-objs += sof_ssp_common.o
-obj-$(CONFIG_SND_SOC_INTEL_SOF_SSP_COMMON) += snd-soc-intel-sof-ssp-common.o
-
 snd-soc-intel-sof-board-helpers-objs += sof_board_helpers.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_BOARD_HELPERS) += snd-soc-intel-sof-board-helpers.o
index b6a83ca14fa82aeaf9a02ef16c03c5e35048c415..bd5c48cd0649ba60778d1a332a8f329358789c7a 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <sound/soc.h>
 #include "sof_hdmi_common.h"
-#include "sof_ssp_common.h"
+#include "../common/sof_ssp_common.h"
 
 /*
  * Common board quirks: from bit 8 to 31, LSB 8 bits reserved for machine
index d4ecf8d023d190382dc3a5e0b91e2b22374cfdd1..445621466f05c86fae73a09886017101efafda73 100644 (file)
@@ -9,7 +9,7 @@
 #define __SOF_CIRRUS_COMMON_H
 
 #include <sound/soc.h>
-#include "sof_ssp_common.h"
+#include "../common/sof_ssp_common.h"
 
 /*
  * Cirrus Logic CS35L41/CS35L53
index fe0212fbad8eabaca1ee402f73844ef43f390d2e..63054bcd287bd4288110acb2a2a86ac5235b50f8 100644 (file)
@@ -11,7 +11,7 @@
 #define __SOF_MAXIM_COMMON_H
 
 #include <sound/soc.h>
-#include "sof_ssp_common.h"
+#include "../common/sof_ssp_common.h"
 
 /*
  * Maxim MAX98373
index 53a84f9a67c0ebae882d0a758562f6fc17adfd26..af2e58b1d393b9fb7aec2c752d957bbed4b2a59b 100644 (file)
@@ -9,7 +9,7 @@
 #define __SOF_NUVOTON_COMMON_H
 
 #include <sound/soc.h>
-#include "sof_ssp_common.h"
+#include "../common/sof_ssp_common.h"
 
 /*
  * Nuvoton NAU8318
index e3fa2924c1c1b84951392e275a4766492fbd1d03..99b23d96521a2bfeda12e73817ec8b9837aea32d 100644 (file)
@@ -11,7 +11,7 @@
 #define __SOF_REALTEK_COMMON_H
 
 #include <sound/soc.h>
-#include "sof_ssp_common.h"
+#include "../common/sof_ssp_common.h"
 
 /*
  * Realtek ALC1011
diff --git a/sound/soc/intel/boards/sof_ssp_common.c b/sound/soc/intel/boards/sof_ssp_common.c
deleted file mode 100644 (file)
index 9607279..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-//
-// Copyright(c) 2023 Intel Corporation. All rights reserved.
-
-#include <linux/device.h>
-#include <sound/soc-acpi.h>
-#include "sof_ssp_common.h"
-
-/*
- * Codec probe function
- */
-#define CODEC_MAP_ENTRY(n, h, t)       \
-       {                               \
-               .name = n,              \
-               .acpi_hid = h,          \
-               .codec_type = t,        \
-       }
-
-struct codec_map {
-       const char *name;
-       const char *acpi_hid;
-       enum sof_ssp_codec codec_type;
-};
-
-static const struct codec_map codecs[] = {
-       /* Cirrus Logic */
-       CODEC_MAP_ENTRY("CS42L42", CS42L42_ACPI_HID, CODEC_CS42L42),
-
-       /* Dialog */
-       CODEC_MAP_ENTRY("DA7219", DA7219_ACPI_HID, CODEC_DA7219),
-
-       /* Everest */
-       CODEC_MAP_ENTRY("ES8316", ES8316_ACPI_HID, CODEC_ES8316),
-       CODEC_MAP_ENTRY("ES8326", ES8326_ACPI_HID, CODEC_ES8326),
-       CODEC_MAP_ENTRY("ES8336", ES8336_ACPI_HID, CODEC_ES8336),
-
-       /* Nuvoton */
-       CODEC_MAP_ENTRY("NAU8825", NAU8825_ACPI_HID, CODEC_NAU8825),
-
-       /* Realtek */
-       CODEC_MAP_ENTRY("RT5650", RT5650_ACPI_HID, CODEC_RT5650),
-       CODEC_MAP_ENTRY("RT5682", RT5682_ACPI_HID, CODEC_RT5682),
-       CODEC_MAP_ENTRY("RT5682S", RT5682S_ACPI_HID, CODEC_RT5682S),
-};
-
-static const struct codec_map amps[] = {
-       /* Cirrus Logic */
-       CODEC_MAP_ENTRY("CS35L41", CS35L41_ACPI_HID, CODEC_CS35L41),
-
-       /* Maxim */
-       CODEC_MAP_ENTRY("MAX98357A", MAX_98357A_ACPI_HID, CODEC_MAX98357A),
-       CODEC_MAP_ENTRY("MAX98360A", MAX_98360A_ACPI_HID, CODEC_MAX98360A),
-       CODEC_MAP_ENTRY("MAX98373", MAX_98373_ACPI_HID, CODEC_MAX98373),
-       CODEC_MAP_ENTRY("MAX98390", MAX_98390_ACPI_HID, CODEC_MAX98390),
-
-       /* Nuvoton */
-       CODEC_MAP_ENTRY("NAU8318", NAU8318_ACPI_HID, CODEC_NAU8318),
-
-       /* Realtek */
-       CODEC_MAP_ENTRY("RT1011", RT1011_ACPI_HID, CODEC_RT1011),
-       CODEC_MAP_ENTRY("RT1015", RT1015_ACPI_HID, CODEC_RT1015),
-       CODEC_MAP_ENTRY("RT1015P", RT1015P_ACPI_HID, CODEC_RT1015P),
-       CODEC_MAP_ENTRY("RT1019P", RT1019P_ACPI_HID, CODEC_RT1019P),
-       CODEC_MAP_ENTRY("RT1308", RT1308_ACPI_HID, CODEC_RT1308),
-};
-
-enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(codecs); i++) {
-               if (!acpi_dev_present(codecs[i].acpi_hid, NULL, -1))
-                       continue;
-
-               dev_dbg(dev, "codec %s found\n", codecs[i].name);
-               return codecs[i].codec_type;
-       }
-
-       return CODEC_NONE;
-}
-EXPORT_SYMBOL_NS(sof_ssp_detect_codec_type, SND_SOC_INTEL_SOF_SSP_COMMON);
-
-enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(amps); i++) {
-               if (!acpi_dev_present(amps[i].acpi_hid, NULL, -1))
-                       continue;
-
-               dev_dbg(dev, "amp %s found\n", amps[i].name);
-               return amps[i].codec_type;
-       }
-
-       return CODEC_NONE;
-}
-EXPORT_SYMBOL_NS(sof_ssp_detect_amp_type, SND_SOC_INTEL_SOF_SSP_COMMON);
-
-const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(codecs); i++) {
-               if (codecs[i].codec_type != codec_type)
-                       continue;
-
-               return codecs[i].name;
-       }
-       for (i = 0; i < ARRAY_SIZE(amps); i++) {
-               if (amps[i].codec_type != codec_type)
-                       continue;
-
-               return amps[i].name;
-       }
-
-       return NULL;
-}
-EXPORT_SYMBOL_NS(sof_ssp_get_codec_name, SND_SOC_INTEL_SOF_SSP_COMMON);
-
-MODULE_DESCRIPTION("ASoC Intel SOF Common Machine Driver Helpers");
-MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/intel/boards/sof_ssp_common.h b/sound/soc/intel/boards/sof_ssp_common.h
deleted file mode 100644 (file)
index ff84154..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright(c) 2023 Intel Corporation.
- */
-
-#ifndef __SOF_SSP_COMMON_H
-#define __SOF_SSP_COMMON_H
-
-/* Cirrus Logic */
-#define CS35L41_ACPI_HID       "CSC3541"
-#define CS42L42_ACPI_HID       "10134242"
-
-/* Dialog */
-#define DA7219_ACPI_HID                "DLGS7219"
-
-/* Everest */
-#define ES8316_ACPI_HID                "ESSX8316"
-#define ES8326_ACPI_HID                "ESSX8326"
-#define ES8336_ACPI_HID                "ESSX8336"
-
-#define MAX_98357A_ACPI_HID    "MX98357A"
-#define MAX_98360A_ACPI_HID    "MX98360A"
-#define MAX_98373_ACPI_HID     "MX98373"
-#define MAX_98390_ACPI_HID     "MX98390"
-
-/* Nuvoton */
-#define NAU8318_ACPI_HID       "NVTN2012"
-#define NAU8825_ACPI_HID       "10508825"
-
-/* Realtek */
-#define RT1011_ACPI_HID                "10EC1011"
-#define RT1015_ACPI_HID                "10EC1015"
-#define RT1015P_ACPI_HID       "RTL1015"
-#define RT1019P_ACPI_HID       "RTL1019"
-#define RT1308_ACPI_HID                "10EC1308"
-#define RT5650_ACPI_HID                "10EC5650"
-#define RT5682_ACPI_HID                "10EC5682"
-#define RT5682S_ACPI_HID       "RTL5682"
-
-enum sof_ssp_codec {
-       CODEC_NONE,
-
-       /* headphone codec */
-       CODEC_CS42L42,
-       CODEC_DA7219,
-       CODEC_ES8316,
-       CODEC_ES8326,
-       CODEC_ES8336,
-       CODEC_NAU8825,
-       CODEC_RT5650,
-       CODEC_RT5682,
-       CODEC_RT5682S,
-
-       /* speaker amplifier */
-       CODEC_CS35L41,
-       CODEC_MAX98357A,
-       CODEC_MAX98360A,
-       CODEC_MAX98373,
-       CODEC_MAX98390,
-       CODEC_NAU8318,
-       CODEC_RT1011,
-       CODEC_RT1015,
-       CODEC_RT1015P,
-       CODEC_RT1019P,
-       CODEC_RT1308,
-};
-
-enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev);
-enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev);
-
-const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type);
-
-#endif /* __SOF_SSP_COMMON_H */
index f7370e5b4e9e418d4e2bd4aa9c9e374414e4e05d..15c8a64368c57c912a9ca42bb735db166371bfbe 100644 (file)
@@ -17,3 +17,6 @@ snd-soc-acpi-intel-match-objs := soc-acpi-intel-byt-match.o soc-acpi-intel-cht-m
 
 obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o
 obj-$(CONFIG_SND_SOC_ACPI_INTEL_MATCH) += snd-soc-acpi-intel-match.o
+
+snd-soc-intel-sof-ssp-common-objs += soc-acpi-intel-ssp-common.o
+obj-$(CONFIG_SND_SOC_INTEL_SOF_SSP_COMMON) += snd-soc-intel-sof-ssp-common.o
diff --git a/sound/soc/intel/common/soc-acpi-intel-ssp-common.c b/sound/soc/intel/common/soc-acpi-intel-ssp-common.c
new file mode 100644 (file)
index 0000000..9607279
--- /dev/null
@@ -0,0 +1,122 @@
+// SPDX-License-Identifier: GPL-2.0-only
+//
+// Copyright(c) 2023 Intel Corporation. All rights reserved.
+
+#include <linux/device.h>
+#include <sound/soc-acpi.h>
+#include "sof_ssp_common.h"
+
+/*
+ * Codec probe function
+ */
+#define CODEC_MAP_ENTRY(n, h, t)       \
+       {                               \
+               .name = n,              \
+               .acpi_hid = h,          \
+               .codec_type = t,        \
+       }
+
+struct codec_map {
+       const char *name;
+       const char *acpi_hid;
+       enum sof_ssp_codec codec_type;
+};
+
+static const struct codec_map codecs[] = {
+       /* Cirrus Logic */
+       CODEC_MAP_ENTRY("CS42L42", CS42L42_ACPI_HID, CODEC_CS42L42),
+
+       /* Dialog */
+       CODEC_MAP_ENTRY("DA7219", DA7219_ACPI_HID, CODEC_DA7219),
+
+       /* Everest */
+       CODEC_MAP_ENTRY("ES8316", ES8316_ACPI_HID, CODEC_ES8316),
+       CODEC_MAP_ENTRY("ES8326", ES8326_ACPI_HID, CODEC_ES8326),
+       CODEC_MAP_ENTRY("ES8336", ES8336_ACPI_HID, CODEC_ES8336),
+
+       /* Nuvoton */
+       CODEC_MAP_ENTRY("NAU8825", NAU8825_ACPI_HID, CODEC_NAU8825),
+
+       /* Realtek */
+       CODEC_MAP_ENTRY("RT5650", RT5650_ACPI_HID, CODEC_RT5650),
+       CODEC_MAP_ENTRY("RT5682", RT5682_ACPI_HID, CODEC_RT5682),
+       CODEC_MAP_ENTRY("RT5682S", RT5682S_ACPI_HID, CODEC_RT5682S),
+};
+
+static const struct codec_map amps[] = {
+       /* Cirrus Logic */
+       CODEC_MAP_ENTRY("CS35L41", CS35L41_ACPI_HID, CODEC_CS35L41),
+
+       /* Maxim */
+       CODEC_MAP_ENTRY("MAX98357A", MAX_98357A_ACPI_HID, CODEC_MAX98357A),
+       CODEC_MAP_ENTRY("MAX98360A", MAX_98360A_ACPI_HID, CODEC_MAX98360A),
+       CODEC_MAP_ENTRY("MAX98373", MAX_98373_ACPI_HID, CODEC_MAX98373),
+       CODEC_MAP_ENTRY("MAX98390", MAX_98390_ACPI_HID, CODEC_MAX98390),
+
+       /* Nuvoton */
+       CODEC_MAP_ENTRY("NAU8318", NAU8318_ACPI_HID, CODEC_NAU8318),
+
+       /* Realtek */
+       CODEC_MAP_ENTRY("RT1011", RT1011_ACPI_HID, CODEC_RT1011),
+       CODEC_MAP_ENTRY("RT1015", RT1015_ACPI_HID, CODEC_RT1015),
+       CODEC_MAP_ENTRY("RT1015P", RT1015P_ACPI_HID, CODEC_RT1015P),
+       CODEC_MAP_ENTRY("RT1019P", RT1019P_ACPI_HID, CODEC_RT1019P),
+       CODEC_MAP_ENTRY("RT1308", RT1308_ACPI_HID, CODEC_RT1308),
+};
+
+enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(codecs); i++) {
+               if (!acpi_dev_present(codecs[i].acpi_hid, NULL, -1))
+                       continue;
+
+               dev_dbg(dev, "codec %s found\n", codecs[i].name);
+               return codecs[i].codec_type;
+       }
+
+       return CODEC_NONE;
+}
+EXPORT_SYMBOL_NS(sof_ssp_detect_codec_type, SND_SOC_INTEL_SOF_SSP_COMMON);
+
+enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(amps); i++) {
+               if (!acpi_dev_present(amps[i].acpi_hid, NULL, -1))
+                       continue;
+
+               dev_dbg(dev, "amp %s found\n", amps[i].name);
+               return amps[i].codec_type;
+       }
+
+       return CODEC_NONE;
+}
+EXPORT_SYMBOL_NS(sof_ssp_detect_amp_type, SND_SOC_INTEL_SOF_SSP_COMMON);
+
+const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(codecs); i++) {
+               if (codecs[i].codec_type != codec_type)
+                       continue;
+
+               return codecs[i].name;
+       }
+       for (i = 0; i < ARRAY_SIZE(amps); i++) {
+               if (amps[i].codec_type != codec_type)
+                       continue;
+
+               return amps[i].name;
+       }
+
+       return NULL;
+}
+EXPORT_SYMBOL_NS(sof_ssp_get_codec_name, SND_SOC_INTEL_SOF_SSP_COMMON);
+
+MODULE_DESCRIPTION("ASoC Intel SOF Common Machine Driver Helpers");
+MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/intel/common/sof_ssp_common.h b/sound/soc/intel/common/sof_ssp_common.h
new file mode 100644 (file)
index 0000000..ff84154
--- /dev/null
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright(c) 2023 Intel Corporation.
+ */
+
+#ifndef __SOF_SSP_COMMON_H
+#define __SOF_SSP_COMMON_H
+
+/* Cirrus Logic */
+#define CS35L41_ACPI_HID       "CSC3541"
+#define CS42L42_ACPI_HID       "10134242"
+
+/* Dialog */
+#define DA7219_ACPI_HID                "DLGS7219"
+
+/* Everest */
+#define ES8316_ACPI_HID                "ESSX8316"
+#define ES8326_ACPI_HID                "ESSX8326"
+#define ES8336_ACPI_HID                "ESSX8336"
+
+#define MAX_98357A_ACPI_HID    "MX98357A"
+#define MAX_98360A_ACPI_HID    "MX98360A"
+#define MAX_98373_ACPI_HID     "MX98373"
+#define MAX_98390_ACPI_HID     "MX98390"
+
+/* Nuvoton */
+#define NAU8318_ACPI_HID       "NVTN2012"
+#define NAU8825_ACPI_HID       "10508825"
+
+/* Realtek */
+#define RT1011_ACPI_HID                "10EC1011"
+#define RT1015_ACPI_HID                "10EC1015"
+#define RT1015P_ACPI_HID       "RTL1015"
+#define RT1019P_ACPI_HID       "RTL1019"
+#define RT1308_ACPI_HID                "10EC1308"
+#define RT5650_ACPI_HID                "10EC5650"
+#define RT5682_ACPI_HID                "10EC5682"
+#define RT5682S_ACPI_HID       "RTL5682"
+
+enum sof_ssp_codec {
+       CODEC_NONE,
+
+       /* headphone codec */
+       CODEC_CS42L42,
+       CODEC_DA7219,
+       CODEC_ES8316,
+       CODEC_ES8326,
+       CODEC_ES8336,
+       CODEC_NAU8825,
+       CODEC_RT5650,
+       CODEC_RT5682,
+       CODEC_RT5682S,
+
+       /* speaker amplifier */
+       CODEC_CS35L41,
+       CODEC_MAX98357A,
+       CODEC_MAX98360A,
+       CODEC_MAX98373,
+       CODEC_MAX98390,
+       CODEC_NAU8318,
+       CODEC_RT1011,
+       CODEC_RT1015,
+       CODEC_RT1015P,
+       CODEC_RT1019P,
+       CODEC_RT1308,
+};
+
+enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev);
+enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev);
+
+const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type);
+
+#endif /* __SOF_SSP_COMMON_H */