From d52f93fe01b0af75969c732e27679ebfca38b3f4 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 17 Dec 2018 18:56:14 -0600 Subject: [PATCH 1/3] ASoC: soc-acpi: add static inline fallbacks when CONFIG_ACPI=n Fix compilation issues reported by 0day-Kbuild with sparc64 w/ SOF. Signed-off-by: Pierre-Louis Bossart --- include/sound/soc-acpi.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index 266e64e3c24c4f..6cbbeed9cdd0c8 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -22,20 +22,37 @@ struct snd_soc_acpi_package_context { #define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1) #if IS_ENABLED(CONFIG_ACPI) +/* acpi match */ +struct snd_soc_acpi_mach * +snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines); + bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], struct snd_soc_acpi_package_context *ctx); + +/* check all codecs */ +struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg); + #else +/* acpi match */ +static inline struct snd_soc_acpi_mach * +snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines) +{ + return NULL; +} + static inline bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], struct snd_soc_acpi_package_context *ctx) { return false; } -#endif -/* acpi match */ -struct snd_soc_acpi_mach * -snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines); +/* check all codecs */ +static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) +{ + return NULL; +} +#endif /** * snd_soc_acpi_mach_params: interface for machine driver configuration @@ -105,7 +122,4 @@ struct snd_soc_acpi_codecs { u8 codecs[SND_SOC_ACPI_MAX_CODECS][ACPI_ID_LEN]; }; -/* check all codecs */ -struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg); - #endif From b341d8d499b5f076fd52cefceff93f715ed5c09b Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 17 Dec 2018 18:12:59 -0600 Subject: [PATCH 2/3] ASoC: SOF: cleanup Kconfig further Simplify selection of SND_SOC_SOF. It used to be selected following the module dependencies but since the module/buit-in selection is only done at the top-level it can be selected from the top-level. Also add dependency on SOC_SOC_ACPI This fixes compilation issues with sparc64 allyesconfig reported by 0day/kbuild Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/Kconfig | 8 ++++++-- sound/soc/sof/intel/Kconfig | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index e4ed5582217357..627b3c2c5edabe 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -11,6 +11,7 @@ if SND_SOC_SOF_TOPLEVEL config SND_SOC_SOF_PCI tristate "SOF PCI enumeration support" depends on PCI + select SND_SOC_SOF select SND_SOC_SOF_OPTIONS select SND_SOC_SOF_INTEL_PCI if SND_SOC_SOF_INTEL_TOPLEVEL help @@ -22,6 +23,7 @@ config SND_SOC_SOF_PCI config SND_SOC_SOF_ACPI tristate "SOF ACPI enumeration support" depends on ACPI || COMPILE_TEST + select SND_SOC_SOF select SND_SOC_SOF_OPTIONS select SND_SOC_SOF_INTEL_ACPI if SND_SOC_SOF_INTEL_TOPLEVEL select IOSF_MBI if X86 @@ -35,6 +37,7 @@ config SND_SOC_SOF_SPI tristate "SOF SPI support" select SPI select SPI_MASTER + select SND_SOC_SOF select SND_SOC_SOF_OPTIONS select SND_SOC_SOF_SPIDSP help @@ -135,8 +138,9 @@ config SND_SOC_SOF help This option is not user-selectable but automagically handled by 'select' statements at a higher level - Due to module dependencies this option needs to be selected - at the lowest level for each platform + The selection is made at the top level and does not exactly follow + module dependencies but since the module or built-in type is decided + at the top level it doesn't matter. source "sound/soc/sof/intel/Kconfig" source "sound/soc/sof/xtensa/Kconfig" diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index cf751377e4e76c..46edc9dc3cc365 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -33,8 +33,8 @@ config SND_SOC_SOF_INTEL_COMMON tristate select SND_SOC_ACPI_INTEL_MATCH select SND_SOC_SOF_XTENSA - select SND_SOC_SOF select SND_SOC_INTEL_MACH + select SND_SOC_ACPI if ACPI help This option is not user-selectable but automagically handled by 'select' statements at a higher level From 2019fcccd2d046ae7ae5ad43840759b87632c2bd Mon Sep 17 00:00:00 2001 From: Libin Yang Date: Mon, 17 Dec 2018 20:07:17 +0800 Subject: [PATCH 3/3] ASoC: SOF: use const for snd_sof_dsp_ops f91b468d751 ('ASoC: SOF: make ops constant') missed a couple of places when const can be used. Fix. Signed-off-by: Libin Yang Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/hw-spi.c | 2 +- sound/soc/sof/hw-spi.h | 2 +- sound/soc/sof/virtio-fe.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/hw-spi.c b/sound/soc/sof/hw-spi.c index 2d5f34e66f7487..a9a53c957163c0 100644 --- a/sound/soc/sof/hw-spi.c +++ b/sound/soc/sof/hw-spi.c @@ -275,7 +275,7 @@ static int spi_cmd_done(struct snd_sof_dev *sof_dev __maybe_unused, int dir __ma } /* SPI SOF ops */ -struct snd_sof_dsp_ops snd_sof_spi_ops = { +const struct snd_sof_dsp_ops snd_sof_spi_ops = { /* device init */ .probe = spi_sof_probe, .remove = spi_sof_remove, diff --git a/sound/soc/sof/hw-spi.h b/sound/soc/sof/hw-spi.h index 1929856eabec90..69ba896a1076fd 100644 --- a/sound/soc/sof/hw-spi.h +++ b/sound/soc/sof/hw-spi.h @@ -1,6 +1,6 @@ #ifndef HW_SPI_H #define HW_SPI_H -extern struct snd_sof_dsp_ops snd_sof_spi_ops; +extern const struct snd_sof_dsp_ops snd_sof_spi_ops; #endif diff --git a/sound/soc/sof/virtio-fe.c b/sound/soc/sof/virtio-fe.c index 6e9de114c2384c..3af6f37bd897ae 100644 --- a/sound/soc/sof/virtio-fe.c +++ b/sound/soc/sof/virtio-fe.c @@ -100,7 +100,7 @@ static int virtio_fe_remove(struct snd_sof_dev *sdev) } /* baytrail ops */ -struct snd_sof_dsp_ops snd_sof_virtio_fe_ops = { +const struct snd_sof_dsp_ops snd_sof_virtio_fe_ops = { /* device init */ .probe = virtio_fe_probe, .remove = virtio_fe_remove,