Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (80 sloc) 2.16 KB
--- a/target/linux/ramips/modules.mk
+++ b/target/linux/ramips/modules.mk
@@ -121,13 +121,15 @@ define KernelPackage/sound-mt7620
CONFIG_SND_RALINK_SOC_I2S \
CONFIG_SND_SIMPLE_CARD \
CONFIG_SND_SIMPLE_CARD_UTILS \
- CONFIG_SND_SOC_WM8960
+ CONFIG_SND_SOC_WM8960 \
+ CONFIG_SND_SOC_MAX98357A
FILES:= \
$(LINUX_DIR)/sound/soc/ralink/snd-soc-ralink-i2s.ko \
$(LINUX_DIR)/sound/soc/generic/snd-soc-simple-card.ko \
$(LINUX_DIR)/sound/soc/generic/snd-soc-simple-card-utils.ko \
- $(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8960.ko
- AUTOLOAD:=$(call AutoLoad,90,snd-soc-wm8960 snd-soc-ralink-i2s snd-soc-simple-card)
+ $(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8960.ko \
+ $(LINUX_DIR)/sound/soc/codecs/snd-soc-max98357a.ko
+ AUTOLOAD:=$(call AutoLoad,90,snd-soc-wm8960 snd-soc-max98357a snd-soc-ralink-i2s snd-soc-simple-card)
$(call AddDepends/sound)
endef
--- a/target/linux/ramips/dts/OMEGA2.dtsi
+++ b/target/linux/ramips/dts/OMEGA2.dtsi
@@ -30,6 +30,31 @@
linux,code = <KEY_RESTART>;
};
};
+
+ sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "Audio-I2S";
+ simple-audio-card,format = "i2s";
+ simple-audio-card,bitclock-master = <&cpu_dai_master>;
+ simple-audio-card,frame-master = <&cpu_dai_master>;
+ simple-audio-card,widgets =
+ "Speaker", "External Speaker";
+
+ cpu_dai_master: simple-audio-card,cpu {
+ sound-dai = <&i2s>;
+ };
+
+ dailink0_master: simple-audio-card,codec {
+ sound-dai = <&codec>;
+ };
+ };
+
+ codec: max98357a {
+ #sound-dai-cells = <0>;
+ compatible = "maxim,max98357a";
+ sdmode-gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
+ };
+
};
&pinctrl {
@@ -51,7 +76,7 @@
i2s {
ralink,group = "i2s";
- ralink,function = "gpio";
+ ralink,function = "i2s";
};
spis {
@@ -170,6 +195,7 @@
};
&i2s {
+ #sound-dai-cells = <0>;
status = "okay";
};
--- /dev/null
+++ b/target/linux/ramips/patches-4.14/0722-asoc-enable-max98357a-kconfig.patch
@@ -0,0 +1,11 @@
+--- a/sound/soc/codecs/Kconfig
++++ b/sound/soc/codecs/Kconfig
+@@ -601,7 +601,7 @@
+ tristate
+
+ config SND_SOC_MAX98357A
+- tristate
++ tristate "Maxim MAX98357A CODEC"
+
+ config SND_SOC_MAX98371
+ tristate
You can’t perform that action at this time.