dsplink: Added class device create support to dsplink to allow udev to create the...
authorRoger Monk <r-monk@ti.com>
Sat, 21 Feb 2009 00:20:37 +0000 (00:20 +0000)
committerKoen Kooi <koen@openembedded.org>
Sat, 21 Feb 2009 10:11:03 +0000 (11:11 +0100)
* Removed awk/manual devnode creation/deletion from load/unload scripts.
* Bump PR

Signed-off-by: Koen Kooi <koen@openembedded.org>
packages/dsplink/files/dsplink-add-class-device-create-support.patch [new file with mode: 0644]
packages/dsplink/files/loadmodules-ti-codec-engine-apps.sh
packages/dsplink/files/loadmodules-ti-dmai-apps.sh
packages/dsplink/files/loadmodules-ti-dsplink-apps.sh
packages/dsplink/files/unloadmodules-ti-codec-engine-apps.sh
packages/dsplink/files/unloadmodules-ti-dmai-apps.sh
packages/dsplink/files/unloadmodules-ti-dsplink-apps.sh
packages/dsplink/ti-codec-engine_2.21.bb

diff --git a/packages/dsplink/files/dsplink-add-class-device-create-support.patch b/packages/dsplink/files/dsplink-add-class-device-create-support.patch
new file mode 100644 (file)
index 0000000..b43c348
--- /dev/null
@@ -0,0 +1,55 @@
+diff -uNr codec_engine_2_21/cetools/packages/dsplink/gpp/src/pmgr/Linux/2.6.18/drv_pmgr.c codec_engine_2_21_fix/cetools/packages/dsplink/gpp/src/pmgr/Linux/2.6.18/drv_pmgr.c 
+--- codec_engine_2_21/cetools/packages/dsplink/gpp/src/pmgr/Linux/2.6.18/drv_pmgr.c    2008-10-24 20:58:01.000000000 +0100
++++ codec_engine_2_21_fix/cetools/packages/dsplink/gpp/src/pmgr/Linux/2.6.18/drv_pmgr.c        2009-02-20 23:46:42.000000000 +0000
+@@ -37,6 +37,10 @@
+ #endif\r
\r
+ /*  ----------------------------------- OS Specific Headers         */\r
++#include <linux/version.h>\r
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)\r
++#include <linux/device.h>\r
++#endif\r
+ #include <linux/autoconf.h>\r
+ #include <linux/spinlock.h>\r
+ #include <linux/module.h>\r
+@@ -190,6 +194,16 @@
+  */\r
+ STATIC Int32 major = 230 ;\r
\r
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)\r
++/** ----------------------------------------------------------------------------\r
++ *  @name   dsplink_class\r
++ *\r
++ *  @desc   class struct for device create.\r
++ *  ----------------------------------------------------------------------------\r
++ */\r
++STATIC struct class *dsplink_class;\r
++#endif\r
++\r
+ /** ----------------------------------------------------------------------------\r
+  *  @name   DRV_IsInitialized\r
+  *\r
+@@ -673,6 +687,11 @@
+         }\r
+ #endif /* if defined (CHNL_COMPONENT) */\r
\r
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)\r
++        dsplink_class = class_create(THIS_MODULE, "dsplink");\r
++        device_create(dsplink_class, NULL, MKDEV(major, 0), NULL, "dsplink");\r
++#endif\r
++\r
+         if (DSP_SUCCEEDED (status)) {\r
+             DRV_IsInitialized = TRUE ;\r
+         }\r
+@@ -717,6 +736,11 @@
+     }\r
+ #endif /* if defined (CHNL_COMPONENT) */\r
\r
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)\r
++    device_destroy(dsplink_class, MKDEV(major, 0));\r
++    class_destroy(dsplink_class);\r
++#endif\r
++\r
+     unregister_chrdev (major, "dsplink") ;\r
\r
+     DRV_IsInitialized = FALSE ;\r
index 743a07e..9f9233d 100755 (executable)
@@ -29,8 +29,8 @@ modprobe cmemk phys_start=0x85000000 phys_end=0x86000000 pools=20x4096,8x131072,
 modprobe dsplinkk
 
 # make /dev/dsplink
-rm -f /dev/dsplink
-mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
+#rm -f /dev/dsplink
+#mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
 
 # insert Local Power Manager driver
 #
index af4cef9..7120b74 100755 (executable)
@@ -29,8 +29,8 @@ modprobe cmemk phys_start=0x85800000 phys_end=0x86800000 pools=20x4096,8x131072,
 modprobe dsplinkk
 
 # make /dev/dsplink
-rm -f /dev/dsplink
-mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
+#rm -f /dev/dsplink
+#mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
 
 # insert Local Power Manager driver
 #
index c93b637..9cfb19d 100755 (executable)
@@ -21,5 +21,5 @@ awk '/MemTotal:/ {
 modprobe dsplinkk
 
 # make /dev/dsplink
-rm -f /dev/dsplink
-mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
+#rm -f /dev/dsplink
+#mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0
index 17436a5..f990d99 100755 (executable)
@@ -5,7 +5,7 @@ rmmod lpm_omap3530
 
 # remove DSP/BIOS Link driver
 rmmod dsplinkk
-rm -f /dev/dsplink
+#rm -f /dev/dsplink
 
 # remove cmem module
 rmmod cmemk
index 2465c43..793d727 100755 (executable)
@@ -5,7 +5,7 @@ rmmod lpm_omap3530
 
 # remove DSP/BIOS Link driver
 rmmod dsplinkk
-rm -f /dev/dsplink
+#rm -f /dev/dsplink
 
 # remove cmem module
 rmmod cmemk
index 8694114..48fa84b 100755 (executable)
@@ -2,4 +2,4 @@
 
 # remove DSP/BIOS Link driver
 rmmod dsplinkk
-rm -f /dev/dsplink
+#rm -f /dev/dsplink
index c2055c1..607cbd0 100644 (file)
@@ -8,7 +8,7 @@ RDEPENDS = "update-modules"
 inherit module
 
 # tconf from xdctools dislikes '.' in pwd :/
-PR = "r15"
+PR = "r16"
 PV = "221"
 
 # Get CE tarball from TI website, place in sources and calculate
@@ -19,6 +19,7 @@ SRC_URI = "http://install.tarball.in.source.dir/codec_engine_2_21.tar.gz \
            file://cmem-class-device-27-and-sched-include-fix.patch;patch=1 \
            file://sdma-class-device-and-includes-fix.patch;patch=1 \
            file://dsplink-semaphore-27.patch;patch=1 \
+           file://dsplink-add-class-device-create-support.patch;patch=1 \
            file://lpm-device-create-and-semaphore-include-fix.patch;patch=1 \
            file://lpm-make-symbol-warnings-fix.patch;patch=1 \
            file://Makefile-dsplink-gpp \