From e281de7e89d92742c1aa3844a560f6e74ea83c78 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 10 Sep 2005 13:14:00 +0000 Subject: usb audio from dave, thx git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1882 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/Config.in | 5 ++++ target/linux/control/kmod-usb-audio.control | 6 +++++ target/linux/linux-2.4/Makefile | 4 +++ target/linux/linux-2.4/config/brcm | 29 ++++++++++++++++++++-- .../linux-2.4/patches/generic/222-sound.patch | 27 ++++++++++++++++++++ 5 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 target/linux/control/kmod-usb-audio.control create mode 100644 target/linux/linux-2.4/patches/generic/222-sound.patch diff --git a/target/linux/Config.in b/target/linux/Config.in index 3f1ad23309..22b2f8dbd1 100644 --- a/target/linux/Config.in +++ b/target/linux/Config.in @@ -227,6 +227,11 @@ config BR2_PACKAGE_KMOD_USB_PRINTER default m depends BR2_PACKAGE_KMOD_USB_CONTROLLER +config BR2_PACKAGE_KMOD_USB_AUDIO + tristate "Support for USB soundcards" + default m + depends BR2_PACKAGE_KMOD_USB_CONTROLLER + config BR2_PACKAGE_KMOD_USB_ACM tristate "Support for USB modems/isdn controllers" default m diff --git a/target/linux/control/kmod-usb-audio.control b/target/linux/control/kmod-usb-audio.control new file mode 100644 index 0000000000..31f35728f3 --- /dev/null +++ b/target/linux/control/kmod-usb-audio.control @@ -0,0 +1,6 @@ +Package: kmod-usb-audio +Priority: optional +Section: sys +Maintainer: David Collett +Source: buildroot internal +Description: Kernel Support for USB Soundcards diff --git a/target/linux/linux-2.4/Makefile b/target/linux/linux-2.4/Makefile index 35349d2635..ca00a327fb 100644 --- a/target/linux/linux-2.4/Makefile +++ b/target/linux/linux-2.4/Makefile @@ -135,6 +135,10 @@ $(eval $(call KMOD_template,USB_STORAGE,usb-storage,\ $(eval $(call KMOD_template,USB_PRINTER,usb-printer,\ $(MODULES_DIR)/kernel/drivers/usb/printer.o \ ,CONFIG_USB_PRINTER,kmod-usb-core,60,printer)) +$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\ + $(MODULES_DIR)/kernel/drivers/sound/soundcore.o \ + $(MODULES_DIR)/kernel/drivers/usb/audio.o \ +,CONFIG_USB_AUDIO,kmod-usb-core,60,soundcore audio)) $(eval $(call KMOD_template,IDE,ide,\ $(MODULES_DIR)/kernel/drivers/ide/*.o \ $(MODULES_DIR)/kernel/drivers/ide/*/*.o \ diff --git a/target/linux/linux-2.4/config/brcm b/target/linux/linux-2.4/config/brcm index 19ea26e92d..871cbdc6a2 100644 --- a/target/linux/linux-2.4/config/brcm +++ b/target/linux/linux-2.4/config/brcm @@ -1164,7 +1164,32 @@ CONFIG_VIDEO_PROC_FS=y # # Sound # -# CONFIG_SOUND is not set +CONFIG_SOUND=m +# CONFIG_SOUND_ALI5455 is not set +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_MIDI_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_FORTE is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_SONICVIBES is not set +# CONFIG_SOUND_TRIDENT is not set +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_VIA82CXXX is not set +# CONFIG_MIDI_VIA82CXXX is not set +# CONFIG_SOUND_OSS is not set +# CONFIG_SOUND_TVMIXER is not set +# CONFIG_SOUND_AD1980 is not set +# CONFIG_SOUND_WM97XX is not set # # USB support @@ -1189,7 +1214,7 @@ CONFIG_USB_OHCI=m # # USB Device Class drivers # -# CONFIG_USB_AUDIO is not set +CONFIG_USB_AUDIO=m # CONFIG_USB_EMI26 is not set # diff --git a/target/linux/linux-2.4/patches/generic/222-sound.patch b/target/linux/linux-2.4/patches/generic/222-sound.patch new file mode 100644 index 0000000000..351e8c2072 --- /dev/null +++ b/target/linux/linux-2.4/patches/generic/222-sound.patch @@ -0,0 +1,27 @@ +diff -rNu linux-2.4.30/drivers/sound/sound_core.c linux-2.4.30.new/drivers/sound/sound_core.c +--- linux-2.4.30/drivers/sound/sound_core.c 2001-10-01 05:26:08.000000000 +1000 ++++ linux-2.4.30.new/drivers/sound/sound_core.c 2005-08-27 22:52:55.061719968 +1000 +@@ -174,9 +174,9 @@ + } + + if (r == low) +- sprintf (name_buf, "%s", name); ++ snprintf (name_buf, sizeof(name_buf), "%s", name); + else +- sprintf (name_buf, "%s%d", name, (r - low) / SOUND_STEP); ++ snprintf (name_buf, sizeof(name_buf), "%s%d", name, (r - low) / SOUND_STEP); + s->de = devfs_register (devfs_handle, name_buf, + DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor, + S_IFCHR | mode, fops, NULL); +@@ -507,9 +507,9 @@ + * ALSA toplevel modules for soundcards, thus we need + * load them at first. [Jaroslav Kysela ] + */ +- sprintf(mod, "sound-slot-%i", unit>>4); ++ snprintf(mod, sizeof(mod), "sound-slot-%i", unit>>4); + request_module(mod); +- sprintf(mod, "sound-service-%i-%i", unit>>4, chain); ++ snprintf(mod, sizeof(mod), "sound-service-%i-%i", unit>>4, chain); + request_module(mod); + spin_lock(&sound_loader_lock); + s = __look_for_unit(chain, unit); -- cgit v1.2.3