ramips: add alsa support
add the SDK alsa driver. this has only been tested on mt7628/88 and wm8960. mt7620 is only compile tested. Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 47205
This commit is contained in:
		@@ -105,6 +105,39 @@
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							i2c@900 {
 | 
				
			||||||
 | 
								compatible = "mediatek,mt7628-i2c";
 | 
				
			||||||
 | 
								reg = <0x900 0x100>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								resets = <&rstctrl 16>;
 | 
				
			||||||
 | 
								reset-names = "i2c";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								#address-cells = <1>;
 | 
				
			||||||
 | 
								#size-cells = <0>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								status = "disabled";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								pinctrl-names = "default";
 | 
				
			||||||
 | 
								pinctrl-0 = <&i2c_pins>;
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							i2s@a00 {
 | 
				
			||||||
 | 
								compatible = "ralink,mt7620a-i2s";
 | 
				
			||||||
 | 
								reg = <0xa00 0x100>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								resets = <&rstctrl 17>;
 | 
				
			||||||
 | 
								reset-names = "i2s";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								interrupt-parent = <&intc>;
 | 
				
			||||||
 | 
								interrupts = <10>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								dmas = <&gdma 2>,
 | 
				
			||||||
 | 
									<&gdma 3>;
 | 
				
			||||||
 | 
								dma-names = "tx", "rx";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								status = "disabled";
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spi@b00 {
 | 
							spi@b00 {
 | 
				
			||||||
			compatible = "ralink,mt7621-spi";
 | 
								compatible = "ralink,mt7621-spi";
 | 
				
			||||||
			reg = <0xb00 0x100>;
 | 
								reg = <0xb00 0x100>;
 | 
				
			||||||
@@ -178,6 +211,49 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			status = "disabled";
 | 
								status = "disabled";
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							pwm@5000 {
 | 
				
			||||||
 | 
								compatible = "mediatek,mt7628-pwm";
 | 
				
			||||||
 | 
								reg = <0x5000 0x1000>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								resets = <&rstctrl 31>;
 | 
				
			||||||
 | 
								reset-names = "pwm";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								pinctrl-names = "default";
 | 
				
			||||||
 | 
								pinctrl-0 = <&pwm0_pins>, <&pwm1_pins>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								status = "disabled";
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							pcm@2000 {
 | 
				
			||||||
 | 
								compatible = "ralink,mt7620a-pcm";
 | 
				
			||||||
 | 
								reg = <0x2000 0x800>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								resets = <&rstctrl 11>;
 | 
				
			||||||
 | 
								reset-names = "pcm";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								interrupt-parent = <&intc>;
 | 
				
			||||||
 | 
								interrupts = <4>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								status = "disabled";
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							gdma: gdma@2800 {
 | 
				
			||||||
 | 
								compatible = "ralink,mt7620a-gdma", "ralink,rt2880-gdma";
 | 
				
			||||||
 | 
								reg = <0x2800 0x800>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								resets = <&rstctrl 14>;
 | 
				
			||||||
 | 
								reset-names = "dma";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								interrupt-parent = <&intc>;
 | 
				
			||||||
 | 
								interrupts = <7>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								#dma-cells = <1>;
 | 
				
			||||||
 | 
								#dma-channels = <16>;
 | 
				
			||||||
 | 
								#dma-requests = <16>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								status = "disabled";
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pinctrl {
 | 
						pinctrl {
 | 
				
			||||||
@@ -195,6 +271,20 @@
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							spi_cs1_pins: spi_cs1 {
 | 
				
			||||||
 | 
								spi_cs1 {
 | 
				
			||||||
 | 
									ralink,group = "spi cs1";
 | 
				
			||||||
 | 
									ralink,function = "spi cs1";
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							i2c_pins: i2c {
 | 
				
			||||||
 | 
								i2c {
 | 
				
			||||||
 | 
									ralink,group = "i2c";
 | 
				
			||||||
 | 
									ralink,function = "i2c";
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		uart0_pins: uartlite {
 | 
							uart0_pins: uartlite {
 | 
				
			||||||
			uartlite {
 | 
								uartlite {
 | 
				
			||||||
				ralink,group = "uart0";
 | 
									ralink,group = "uart0";
 | 
				
			||||||
@@ -222,6 +312,27 @@
 | 
				
			|||||||
				ralink,function = "sdxc";
 | 
									ralink,function = "sdxc";
 | 
				
			||||||
			};
 | 
								};
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							pwm0_pins: pwm0 {
 | 
				
			||||||
 | 
								pwm0 {
 | 
				
			||||||
 | 
									ralink,group = "pwm0";
 | 
				
			||||||
 | 
									ralink,function = "pwm0";
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							pwm1_pins: pwm1 {
 | 
				
			||||||
 | 
								pwm1 {
 | 
				
			||||||
 | 
									ralink,group = "pwm1";
 | 
				
			||||||
 | 
									ralink,function = "pwm1";
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							pcm_i2s_pins: i2s {
 | 
				
			||||||
 | 
								i2s {
 | 
				
			||||||
 | 
									ralink,group = "i2s";
 | 
				
			||||||
 | 
									ralink,function = "pcm";
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rstctrl: rstctrl {
 | 
						rstctrl: rstctrl {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,7 +56,7 @@ $(eval $(call KernelPackage,i2c-mt7621))
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
define KernelPackage/sound-mt7620
 | 
					define KernelPackage/sound-mt7620
 | 
				
			||||||
  TITLE:=MT7620 PCM/I2S Alsa Driver
 | 
					  TITLE:=MT7620 PCM/I2S Alsa Driver
 | 
				
			||||||
  DEPENDS:=@TARGET_ramips_mt7620 +kmod-sound-soc-core +kmod-regmap
 | 
					  DEPENDS:=@TARGET_ramips_mt7620 +kmod-sound-soc-core +kmod-regmap @BROKEN
 | 
				
			||||||
  KCONFIG:= \
 | 
					  KCONFIG:= \
 | 
				
			||||||
	CONFIG_SND_MT7620_SOC_I2S \
 | 
						CONFIG_SND_MT7620_SOC_I2S \
 | 
				
			||||||
	CONFIG_SND_MT7620_SOC_WM8960
 | 
						CONFIG_SND_MT7620_SOC_WM8960
 | 
				
			||||||
@@ -73,3 +73,30 @@ define KernelPackage/sound-mt7620/description
 | 
				
			|||||||
endef
 | 
					endef
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(eval $(call KernelPackage,sound-mt7620))
 | 
					$(eval $(call KernelPackage,sound-mt7620))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					define KernelPackage/sound-mtk
 | 
				
			||||||
 | 
					  TITLE:=Mediatek I2S Alsa Driver
 | 
				
			||||||
 | 
					  DEPENDS:= +kmod-sound-soc-core +kmod-regmap +kmod-i2c-ralink @(TARGET_ramips_mt7628||TARGET_ramips_mt7688||TARGET_ramips_mt7620)
 | 
				
			||||||
 | 
					  KCONFIG:= \
 | 
				
			||||||
 | 
						CONFIG_SND_MT76XX_SOC \
 | 
				
			||||||
 | 
						CONFIG_SND_MT76XX_I2S \
 | 
				
			||||||
 | 
						CONFIG_SND_MT76XX_PCM \
 | 
				
			||||||
 | 
						CONFIG_SND_SOC_WM8960
 | 
				
			||||||
 | 
					  FILES:= \
 | 
				
			||||||
 | 
						$(LINUX_DIR)/sound/soc/mtk/ralink_gdma.ko \
 | 
				
			||||||
 | 
						$(LINUX_DIR)/sound/soc/mtk/snd-soc-mt76xx-i2s-ctl.ko \
 | 
				
			||||||
 | 
						$(LINUX_DIR)/sound/soc/mtk/snd-soc-mt76xx-i2s.ko \
 | 
				
			||||||
 | 
						$(LINUX_DIR)/sound/soc/mtk/snd-soc-mt76xx-pcm.ko \
 | 
				
			||||||
 | 
						$(LINUX_DIR)/sound/soc/mtk/snd-soc-mt76xx-machine.ko \
 | 
				
			||||||
 | 
						$(LINUX_DIR)/sound/soc/mtk/i2c_wm8960.ko \
 | 
				
			||||||
 | 
						$(LINUX_DIR)/sound/soc/codecs/snd-soc-wm8960.ko
 | 
				
			||||||
 | 
					  AUTOLOAD:=$(call AutoLoad,90,ralink_gdma snd-soc-wm8960 i2c_wm8960 snd-soc-mt76xx-i2s-ctl snd-soc-mt76xx-i2s snd-soc-mt76xx-pcm snd-soc-mt76xx-machine)
 | 
				
			||||||
 | 
					  $(call AddDepends/sound)
 | 
				
			||||||
 | 
					endef
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					define KernelPackage/sound-mtk/description
 | 
				
			||||||
 | 
					 Alsa modules for ralink i2s controller.
 | 
				
			||||||
 | 
					endef
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$(eval $(call KernelPackage,sound-mtk))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -166,6 +166,8 @@ CONFIG_SOC_MT7620=y
 | 
				
			|||||||
# CONFIG_SOC_RT288X is not set
 | 
					# CONFIG_SOC_RT288X is not set
 | 
				
			||||||
# CONFIG_SOC_RT305X is not set
 | 
					# CONFIG_SOC_RT305X is not set
 | 
				
			||||||
# CONFIG_SOC_RT3883 is not set
 | 
					# CONFIG_SOC_RT3883 is not set
 | 
				
			||||||
 | 
					CONFIG_SND_MT76XX_SOC_MT7620=y
 | 
				
			||||||
 | 
					# CONFIG_SND_MT76XX_SOC_MT7628 is not set
 | 
				
			||||||
CONFIG_SPI=y
 | 
					CONFIG_SPI=y
 | 
				
			||||||
CONFIG_SPI_MASTER=y
 | 
					CONFIG_SPI_MASTER=y
 | 
				
			||||||
# CONFIG_SPI_MT7621 is not set
 | 
					# CONFIG_SPI_MT7621 is not set
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -164,6 +164,8 @@ CONFIG_SOC_MT7620=y
 | 
				
			|||||||
# CONFIG_SOC_RT288X is not set
 | 
					# CONFIG_SOC_RT288X is not set
 | 
				
			||||||
# CONFIG_SOC_RT305X is not set
 | 
					# CONFIG_SOC_RT305X is not set
 | 
				
			||||||
# CONFIG_SOC_RT3883 is not set
 | 
					# CONFIG_SOC_RT3883 is not set
 | 
				
			||||||
 | 
					# CONFIG_SND_MT76XX_SOC_MT7620 is not set
 | 
				
			||||||
 | 
					CONFIG_SND_MT76XX_SOC_MT7628=y
 | 
				
			||||||
CONFIG_SPI=y
 | 
					CONFIG_SPI=y
 | 
				
			||||||
CONFIG_SPI_MASTER=y
 | 
					CONFIG_SPI_MASTER=y
 | 
				
			||||||
CONFIG_SPI_MT7621=y
 | 
					CONFIG_SPI_MT7621=y
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8411
									
								
								target/linux/ramips/patches-3.18/0303-alsa.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8411
									
								
								target/linux/ramips/patches-3.18/0303-alsa.patch
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user