ASoC: rt5575: Add the codec driver for the ALC5575
Subsystems (3)
Oder Chiou
maintainerPATCH 4/4 ASoC: rt5575: Add the codec driver for the ALC5575
The ALC5575 integrates an audio DSP that typically loads its firmware from an external flash via its own SPI host interface. In certain hardware configurations, the firmware can alternatively be loaded through the SPI client interface. The driver provides basic mute and volume control functions. When the SPI client interface is enabled, firmware loading is handled by the SPI driver.
Signed-off-by Oder Chiou <[email protected]>
--- sound/soc/codecs/Kconfig | 10 + sound/soc/codecs/Makefile | 3 + sound/soc/codecs/rt5575-spi.c | 118 ++++++++++++ sound/soc/codecs/rt5575-spi.h | 27 +++ sound/soc/codecs/rt5575.c | 352 ++++++++++++++++++++++++++++++++++ sound/soc/codecs/rt5575.h | 58 ++++++ 6 files changed, 568 insertions(+) create mode 100644 sound/soc/codecs/rt5575-spi.c create mode 100644 sound/soc/codecs/rt5575-spi.h create mode 100644 sound/soc/codecs/rt5575.c create mode 100644 sound/soc/codecs/rt5575.h
sound/soc/codecs/Kconfig +10 -0
@@ -212,6 +212,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_RT1305 imply SND_SOC_RT1308 imply SND_SOC_RT5514 + imply SND_SOC_RT5575 imply SND_SOC_RT5616 imply SND_SOC_RT5631 imply SND_SOC_RT5640
@@ -1783,6 +1784,15 @@ config SND_SOC_RT5514_SPI_BUILTIN bool # force RT5514_SPI to be built-in to avoid link errors default SND_SOC_RT5514=y && SND_SOC_RT5514_SPI=m +config SND_SOC_RT5575 + tristate "Realtek ALC5575 Codec - I2C" + depends on I2C + +config SND_SOC_RT5575_SPI + tristate "Realtek ALC5575 Codec - SPI" + depends on SPI_MASTER && I2C + depends on SND_SOC_RT5575 + config SND_SOC_RT5616 tristate "Realtek RT5616 CODEC" depends on I2C
sound/soc/codecs/Makefile +3 -0
@@ -253,6 +253,8 @@ snd-soc-rt286-y := rt286.o snd-soc-rt298-y := rt298.o snd-soc-rt5514-y := rt5514.o snd-soc-rt5514-spi-y := rt5514-spi.o +snd-soc-rt5575-y := rt5575.o +snd-soc-rt5575-$(CONFIG_SND_SOC_RT5575_SPI) += rt5575-spi.o snd-soc-rt5616-y := rt5616.o snd-soc-rt5631-y := rt5631.o snd-soc-rt5640-y := rt5640.o
@@ -686,6 +688,7 @@ obj-$(CONFIG_SND_SOC_RT298) += snd-soc-rt298.o obj-$(CONFIG_SND_SOC_RT5514) += snd-soc-rt5514.o obj-$(CONFIG_SND_SOC_RT5514_SPI) += snd-soc-rt5514-spi.o obj-$(CONFIG_SND_SOC_RT5514_SPI_BUILTIN) += snd-soc-rt5514-spi.o +obj-$(CONFIG_SND_SOC_RT5575) += snd-soc-rt5575.o obj-$(CONFIG_SND_SOC_RT5616) += snd-soc-rt5616.o obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o
sound/soc/codecs/rt5575-spi.c new file +118 -0
118 lines not on this page · raw message
sound/soc/codecs/rt5575-spi.h new file +27 -0
@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* rt5575-spi.h -- ALC5575 SPI driver +* +* Copyright(c) 2025 Realtek Semiconductor Corp. +* +*/ + +#ifndef __RT5575_SPI_H__ +#define __RT5575_SPI_H__ + +#if IS_ENABLED (CONFIG_SND_SOC_RT5575_SPI ) +struct spi_device *rt5575_spi_get_device (struct device *dev); +int rt5575_spi_fw_load (struct spi_device *spi); +#else +static inline struct spi_device *rt5575_spi_get_device (struct device *dev) +{ +return NULL ; +} + +static inline int rt5575_spi_fw_load (struct spi_device *spi) +{ +return -EINVAL ; +} +#endif + +#endif /* __RT5575_SPI_H__ */
sound/soc/codecs/rt5575.c new file +352 -0
352 lines not on this page · raw message
sound/soc/codecs/rt5575.h new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
2.52.0