Skip to contentSkip to conversation

ASoC: rt5682: Add the soundwire support

PATCH In review Oder Chiou 2 participants 2 messages Feb 5, 2020 – Feb 11, 2020

Subsystems (3)
lore
Share & tools
lore

Oder Chiou

author maintainer
#0 lore raw

PATCH 2/2 ASoC: rt5682: Add the soundwire support

This patch adds the soundwire support for ALC5682.

---
 sound/soc/codecs/Kconfig      |   7 +
 sound/soc/codecs/Makefile     |   2 +
 sound/soc/codecs/rt5682-sdw.c | 333 ++++++++++++++++++++++
 sound/soc/codecs/rt5682-sdw.h |  20 ++
 sound/soc/codecs/rt5682.c     | 517 ++++++++++++++++++++++++++++++++--
 sound/soc/codecs/rt5682.h     |  46 ++-
 6 files changed, 890 insertions(+), 35 deletions(-)
 create mode 100644 sound/soc/codecs/rt5682-sdw.c
 create mode 100644 sound/soc/codecs/rt5682-sdw.h
sound/soc/codecs/Kconfig +7 -0
index c9eb683bd1b0..666a3722c90c 100644
@@ -168,6 +168,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_RT5670 if I2C
 	select SND_SOC_RT5677 if I2C && SPI_MASTER
 	select SND_SOC_RT5682 if I2C
+	select SND_SOC_RT5682_SDW if SOUNDWIRE
 	select SND_SOC_RT700_SDW if SOUNDWIRE
 	select SND_SOC_RT711_SDW if SOUNDWIRE
 	select SND_SOC_RT715_SDW if SOUNDWIRE
@@ -1087,6 +1088,12 @@ config SND_SOC_RT5677_SPI
 config SND_SOC_RT5682
 	tristate
 
+config SND_SOC_RT5682_SDW
+	tristate "Realtek RT5682 Codec - SDW"
+	depends on SOUNDWIRE
+	select SND_SOC_RT5682
+	select REGMAP_SOUNDWIRE
+
 config SND_SOC_RT700
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index ba1b4b3fa2da..c0561f584f5b 100644
@@ -177,6 +177,7 @@ snd-soc-rt5670-objs := rt5670.o
 snd-soc-rt5677-objs := rt5677.o
 snd-soc-rt5677-spi-objs := rt5677-spi.o
 snd-soc-rt5682-objs := rt5682.o
+snd-soc-rt5682-sdw-objs := rt5682-sdw.o
 snd-soc-rt700-objs := rt700.o rt700-sdw.o
 snd-soc-rt711-objs := rt711.o rt711-sdw.o
 snd-soc-rt715-objs := rt715.o rt715-sdw.o
@@ -476,6 +477,7 @@ obj-$(CONFIG_SND_SOC_RT5670)	+= snd-soc-rt5670.o
 obj-$(CONFIG_SND_SOC_RT5677)	+= snd-soc-rt5677.o
 obj-$(CONFIG_SND_SOC_RT5677_SPI)	+= snd-soc-rt5677-spi.o
 obj-$(CONFIG_SND_SOC_RT5682)	+= snd-soc-rt5682.o
+obj-$(CONFIG_SND_SOC_RT5682_SDW)	+= snd-soc-rt5682-sdw.o
 obj-$(CONFIG_SND_SOC_RT700)     += snd-soc-rt700.o
 obj-$(CONFIG_SND_SOC_RT711)     += snd-soc-rt711.o
 obj-$(CONFIG_SND_SOC_RT715)     += snd-soc-rt715.o
sound/soc/codecs/rt5682-sdw.c new file +333 -0

333 lines not on this page · raw message

sound/soc/codecs/rt5682-sdw.h new file +20 -0
new file mode 100644
index 000000000000..76e6f607066e
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ *
+ * rt5682-sdw.h  --  RT5682 SDW ALSA SoC audio driver
+ *
+ * Copyright 2019 Realtek Semiconductor Corp.
+ * Author: Oder Chiou <[email protected]>
+ */
+
+#ifndef __RT5682_SDW_H__
+#define __RT5682_SDW_H__
+
+#define RT5682_SDW_ADDR_L			0x3000
+#define RT5682_SDW_ADDR_H			0x3001
+#define RT5682_SDW_DATA_L			0x3004
+#define RT5682_SDW_DATA_H			0x3005
+#define RT5682_SDW_CMD				0x3008
+
+#define RT5682_PROBE_TIMEOUT			2000
+
+#endif /* __RT5682_SDW_H__ */
sound/soc/codecs/rt5682.c +486 -31

625 lines not on this page · raw message

sound/soc/codecs/rt5682.h +42 -4

80 lines not on this page · raw message

Signature · 1 line
2.24.1

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel