* [alsa-devel] [PATCH -next] ASoC: rt5677: Fix build error without CONFIG_SPI
@ 2019-11-27 8:21 YueHaibing
2019-11-27 18:59 ` Curtis Malainey
2019-11-28 13:18 ` [alsa-devel] Applied "ASoC: rt5677: Fix build error without CONFIG_SPI" to the asoc tree Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2019-11-27 8:21 UTC (permalink / raw)
To: bardliao, oder_chiou, lgirdwood, broonie, perex, tiwai, benzh,
cujomalainey
Cc: alsa-devel, YueHaibing, linux-kernel
If CONFIG_SPI is n, SND_SOC_RT5677_SPI also is n, building fails:
sound/soc/codecs/rt5677.o: In function `rt5677_irq':
rt5677.c:(.text+0x2dbf): undefined reference to `rt5677_spi_hotword_detected'
sound/soc/codecs/rt5677.o: In function `rt5677_dsp_work':
rt5677.c:(.text+0x3709): undefined reference to `rt5677_spi_write'
This adds stub helpers to fix this.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 461c623270e4 ("ASoC: rt5677: Load firmware via SPI using delayed work")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
sound/soc/codecs/rt5677-spi.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/codecs/rt5677-spi.h b/sound/soc/codecs/rt5677-spi.h
index 3af36ec..088b779 100644
--- a/sound/soc/codecs/rt5677-spi.h
+++ b/sound/soc/codecs/rt5677-spi.h
@@ -9,9 +9,25 @@
#ifndef __RT5677_SPI_H__
#define __RT5677_SPI_H__
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
int rt5677_spi_read(u32 addr, void *rxbuf, size_t len);
int rt5677_spi_write(u32 addr, const void *txbuf, size_t len);
int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw);
void rt5677_spi_hotword_detected(void);
+#else
+static inline int rt5677_spi_read(u32 addr, void *rxbuf, size_t len)
+{
+ return -EINVAL;
+}
+static inline int rt5677_spi_write(u32 addr, const void *txbuf, size_t len)
+{
+ return -EINVAL;
+}
+static inline int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw)
+{
+ return -EINVAL;
+}
+static inline void rt5677_spi_hotword_detected(void){}
+#endif
#endif /* __RT5677_SPI_H__ */
--
2.7.4
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [alsa-devel] [PATCH -next] ASoC: rt5677: Fix build error without CONFIG_SPI
2019-11-27 8:21 [alsa-devel] [PATCH -next] ASoC: rt5677: Fix build error without CONFIG_SPI YueHaibing
@ 2019-11-27 18:59 ` Curtis Malainey
2019-11-28 13:18 ` [alsa-devel] Applied "ASoC: rt5677: Fix build error without CONFIG_SPI" to the asoc tree Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Curtis Malainey @ 2019-11-27 18:59 UTC (permalink / raw)
To: YueHaibing
Cc: Oder Chiou, ALSA development, Linux Kernel Mailing List,
Takashi Iwai, Liam Girdwood, Ben Zhang, Mark Brown, Bard Liao,
Curtis Malainey
On Wed, Nov 27, 2019 at 12:22 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> If CONFIG_SPI is n, SND_SOC_RT5677_SPI also is n, building fails:
>
> sound/soc/codecs/rt5677.o: In function `rt5677_irq':
> rt5677.c:(.text+0x2dbf): undefined reference to `rt5677_spi_hotword_detected'
> sound/soc/codecs/rt5677.o: In function `rt5677_dsp_work':
> rt5677.c:(.text+0x3709): undefined reference to `rt5677_spi_write'
>
> This adds stub helpers to fix this.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 461c623270e4 ("ASoC: rt5677: Load firmware via SPI using delayed work")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Curtis Malainey <cujomalainey@chromium.org>
> ---
> sound/soc/codecs/rt5677-spi.h | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [alsa-devel] Applied "ASoC: rt5677: Fix build error without CONFIG_SPI" to the asoc tree
2019-11-27 8:21 [alsa-devel] [PATCH -next] ASoC: rt5677: Fix build error without CONFIG_SPI YueHaibing
2019-11-27 18:59 ` Curtis Malainey
@ 2019-11-28 13:18 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-11-28 13:18 UTC (permalink / raw)
To: YueHaibing
Cc: oder_chiou, alsa-devel, benzh, tiwai, lgirdwood, linux-kernel,
Hulk Robot, Mark Brown, bardliao, cujomalainey
The patch
ASoC: rt5677: Fix build error without CONFIG_SPI
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
From fb3194413d1ef79732931a40f54da21a16505a76 Mon Sep 17 00:00:00 2001
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 27 Nov 2019 16:21:45 +0800
Subject: [PATCH] ASoC: rt5677: Fix build error without CONFIG_SPI
If CONFIG_SPI is n, SND_SOC_RT5677_SPI also is n, building fails:
sound/soc/codecs/rt5677.o: In function `rt5677_irq':
rt5677.c:(.text+0x2dbf): undefined reference to `rt5677_spi_hotword_detected'
sound/soc/codecs/rt5677.o: In function `rt5677_dsp_work':
rt5677.c:(.text+0x3709): undefined reference to `rt5677_spi_write'
This adds stub helpers to fix this.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 461c623270e4 ("ASoC: rt5677: Load firmware via SPI using delayed work")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191127082145.6100-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/rt5677-spi.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/codecs/rt5677-spi.h b/sound/soc/codecs/rt5677-spi.h
index 3af36ec928e9..088b77931727 100644
--- a/sound/soc/codecs/rt5677-spi.h
+++ b/sound/soc/codecs/rt5677-spi.h
@@ -9,9 +9,25 @@
#ifndef __RT5677_SPI_H__
#define __RT5677_SPI_H__
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
int rt5677_spi_read(u32 addr, void *rxbuf, size_t len);
int rt5677_spi_write(u32 addr, const void *txbuf, size_t len);
int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw);
void rt5677_spi_hotword_detected(void);
+#else
+static inline int rt5677_spi_read(u32 addr, void *rxbuf, size_t len)
+{
+ return -EINVAL;
+}
+static inline int rt5677_spi_write(u32 addr, const void *txbuf, size_t len)
+{
+ return -EINVAL;
+}
+static inline int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw)
+{
+ return -EINVAL;
+}
+static inline void rt5677_spi_hotword_detected(void){}
+#endif
#endif /* __RT5677_SPI_H__ */
--
2.20.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-28 13:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 8:21 [alsa-devel] [PATCH -next] ASoC: rt5677: Fix build error without CONFIG_SPI YueHaibing
2019-11-27 18:59 ` Curtis Malainey
2019-11-28 13:18 ` [alsa-devel] Applied "ASoC: rt5677: Fix build error without CONFIG_SPI" to the asoc tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).