Skip to contentSkip to conversation

ASoC: rt286: Add RL6347A class device shared support for RT286

PATCH Applied Oder Chiou 2 participants 2 messages Jun 12, 2015

Subsystems (3)
lore
Share & tools
lore

Oder Chiou

author maintainer
#0 lore raw

PATCH 1/1 ASoC: rt286: Add RL6347A class device shared support for RT286

The patch separates the IO function from the rt286. It is prepared to share for new chips that support the same IO function.

---
 sound/soc/codecs/Kconfig   |   5 ++
 sound/soc/codecs/Makefile  |   2 +
 sound/soc/codecs/rl6347a.c | 128 +++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/rl6347a.h |  32 ++++++++++++
 sound/soc/codecs/rt286.c   |  97 +++-------------------------------
 5 files changed, 173 insertions(+), 91 deletions(-)
 create mode 100644 sound/soc/codecs/rl6347a.c
 create mode 100644 sound/soc/codecs/rl6347a.h
sound/soc/codecs/Kconfig +5 -0
index 9b36011..efaafce 100644
@@ -509,6 +509,11 @@ config SND_SOC_RL6231
 	default m if SND_SOC_RT5670=m
 	default m if SND_SOC_RT5677=m
 
+config SND_SOC_RL6347A
+	tristate
+	default y if SND_SOC_RT286=y
+	default m if SND_SOC_RT286=m
+
 config SND_SOC_RT286
 	tristate
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 3dcf5ac..cf160d9 100644
@@ -77,6 +77,7 @@ snd-soc-pcm512x-objs := pcm512x.o
 snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o
 snd-soc-pcm512x-spi-objs := pcm512x-spi.o
 snd-soc-rl6231-objs := rl6231.o
+snd-soc-rl6347a-objs := rl6347a.o
 snd-soc-rt286-objs := rt286.o
 snd-soc-rt5631-objs := rt5631.o
 snd-soc-rt5640-objs := rt5640.o
@@ -263,6 +264,7 @@ obj-$(CONFIG_SND_SOC_PCM512x)	+= snd-soc-pcm512x.o
 obj-$(CONFIG_SND_SOC_PCM512x_I2C)	+= snd-soc-pcm512x-i2c.o
 obj-$(CONFIG_SND_SOC_PCM512x_SPI)	+= snd-soc-pcm512x-spi.o
 obj-$(CONFIG_SND_SOC_RL6231)	+= snd-soc-rl6231.o
+obj-$(CONFIG_SND_SOC_RL6347A)	+= snd-soc-rl6347a.o
 obj-$(CONFIG_SND_SOC_RT286)	+= snd-soc-rt286.o
 obj-$(CONFIG_SND_SOC_RT5631)	+= snd-soc-rt5631.o
 obj-$(CONFIG_SND_SOC_RT5640)	+= snd-soc-rt5640.o
sound/soc/codecs/rl6347a.c new file +128 -0

128 lines not on this page · raw message

sound/soc/codecs/rl6347a.h new file +32 -0
new file mode 100644
index 0000000..1cb56e5
@@ -0,0 +1,32 @@
+/*
+ * rl6347a.h - RL6347A class device shared support
+ *
+ * Copyright 2015 Realtek Semiconductor Corp.
+ *
+ * Author: Oder Chiou <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __RL6347A_H__
+#define __RL6347A_H__
+
+#define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D)
+
+#define RL6347A_VENDOR_REGISTERS	0x20
+
+#define RL6347A_COEF_INDEX\
+	VERB_CMD(AC_VERB_SET_COEF_INDEX, RL6347A_VENDOR_REGISTERS, 0)
+#define RL6347A_PROC_COEF\
+	VERB_CMD(AC_VERB_SET_PROC_COEF, RL6347A_VENDOR_REGISTERS, 0)
+
+struct rl6347a_priv {
+	struct reg_default *index_cache;
+	int index_cache_size;
+};
+
+int rl6347a_hw_write(void *context, unsigned int reg, unsigned int value);
+int rl6347a_hw_read(void *context, unsigned int reg, unsigned int *value);
+
+#endif /* __RL6347A_H__ */
sound/soc/codecs/rt286.c +6 -91

133 lines not on this page · raw message

Signature · 1 line
1.8.1.1.439.g50a6b54
maintainer Applied
#1 lore raw
Quoted 2 lines · Oder Chiou

The patch separates the IO function from the rt286. It is prepared to share for new chips that support the same IO function.

Applied, thanks.