[oe-commits] Roger Monk : dsplink: Added class device create support to dsplink to allow udev to create the device node .

GIT User account git at amethyst.openembedded.net
Sat Feb 21 10:15:48 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: def6b6c43d06c72846ace18f619dc3c625bb813c
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=def6b6c43d06c72846ace18f619dc3c625bb813c

Author: Roger Monk <r-monk at ti.com>
Date:   Sat Feb 21 00:20:37 2009 +0000

dsplink: Added class device create support to dsplink to allow udev to create the device node.
* Removed awk/manual devnode creation/deletion from load/unload scripts.
* Bump PR

Signed-off-by: Koen Kooi <koen at openembedded.org>

---

 .../dsplink-add-class-device-create-support.patch  |   55 ++++++++++++++++++++
 .../files/loadmodules-ti-codec-engine-apps.sh      |    4 +-
 packages/dsplink/files/loadmodules-ti-dmai-apps.sh |    4 +-
 .../dsplink/files/loadmodules-ti-dsplink-apps.sh   |    4 +-
 .../files/unloadmodules-ti-codec-engine-apps.sh    |    2 +-
 .../dsplink/files/unloadmodules-ti-dmai-apps.sh    |    2 +-
 .../dsplink/files/unloadmodules-ti-dsplink-apps.sh |    2 +-
 packages/dsplink/ti-codec-engine_2.21.bb           |    3 +-
 8 files changed, 66 insertions(+), 10 deletions(-)

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
index 0000000..b43c348
--- /dev/null
+++ b/packages/dsplink/files/dsplink-add-class-device-create-support.patch
@@ -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
+ 
+ /*  ----------------------------------- OS Specific Headers         */
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/device.h>
++#endif
+ #include <linux/autoconf.h>
+ #include <linux/spinlock.h>
+ #include <linux/module.h>
+@@ -190,6 +194,16 @@
+  */
+ STATIC Int32 major = 230 ;
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++/** ----------------------------------------------------------------------------
++ *  @name   dsplink_class
++ *
++ *  @desc   class struct for device create.
++ *  ----------------------------------------------------------------------------
++ */
++STATIC struct class *dsplink_class;
++#endif
++
+ /** ----------------------------------------------------------------------------
+  *  @name   DRV_IsInitialized
+  *
+@@ -673,6 +687,11 @@
+         }
+ #endif /* if defined (CHNL_COMPONENT) */
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++        dsplink_class = class_create(THIS_MODULE, "dsplink");
++        device_create(dsplink_class, NULL, MKDEV(major, 0), NULL, "dsplink");
++#endif
++
+         if (DSP_SUCCEEDED (status)) {
+             DRV_IsInitialized = TRUE ;
+         }
+@@ -717,6 +736,11 @@
+     }
+ #endif /* if defined (CHNL_COMPONENT) */
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++    device_destroy(dsplink_class, MKDEV(major, 0));
++    class_destroy(dsplink_class);
++#endif
++
+     unregister_chrdev (major, "dsplink") ;
+ 
+     DRV_IsInitialized = FALSE ;
diff --git a/packages/dsplink/files/loadmodules-ti-codec-engine-apps.sh b/packages/dsplink/files/loadmodules-ti-codec-engine-apps.sh
index 743a07e..9f9233d 100755
--- a/packages/dsplink/files/loadmodules-ti-codec-engine-apps.sh
+++ b/packages/dsplink/files/loadmodules-ti-codec-engine-apps.sh
@@ -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
 #
diff --git a/packages/dsplink/files/loadmodules-ti-dmai-apps.sh b/packages/dsplink/files/loadmodules-ti-dmai-apps.sh
index af4cef9..7120b74 100755
--- a/packages/dsplink/files/loadmodules-ti-dmai-apps.sh
+++ b/packages/dsplink/files/loadmodules-ti-dmai-apps.sh
@@ -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
 #
diff --git a/packages/dsplink/files/loadmodules-ti-dsplink-apps.sh b/packages/dsplink/files/loadmodules-ti-dsplink-apps.sh
index c93b637..9cfb19d 100755
--- a/packages/dsplink/files/loadmodules-ti-dsplink-apps.sh
+++ b/packages/dsplink/files/loadmodules-ti-dsplink-apps.sh
@@ -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
diff --git a/packages/dsplink/files/unloadmodules-ti-codec-engine-apps.sh b/packages/dsplink/files/unloadmodules-ti-codec-engine-apps.sh
index 17436a5..f990d99 100755
--- a/packages/dsplink/files/unloadmodules-ti-codec-engine-apps.sh
+++ b/packages/dsplink/files/unloadmodules-ti-codec-engine-apps.sh
@@ -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
diff --git a/packages/dsplink/files/unloadmodules-ti-dmai-apps.sh b/packages/dsplink/files/unloadmodules-ti-dmai-apps.sh
index 2465c43..793d727 100755
--- a/packages/dsplink/files/unloadmodules-ti-dmai-apps.sh
+++ b/packages/dsplink/files/unloadmodules-ti-dmai-apps.sh
@@ -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
diff --git a/packages/dsplink/files/unloadmodules-ti-dsplink-apps.sh b/packages/dsplink/files/unloadmodules-ti-dsplink-apps.sh
index 8694114..48fa84b 100755
--- a/packages/dsplink/files/unloadmodules-ti-dsplink-apps.sh
+++ b/packages/dsplink/files/unloadmodules-ti-dsplink-apps.sh
@@ -2,4 +2,4 @@
 
 # remove DSP/BIOS Link driver
 rmmod dsplinkk
-rm -f /dev/dsplink
+#rm -f /dev/dsplink
diff --git a/packages/dsplink/ti-codec-engine_2.21.bb b/packages/dsplink/ti-codec-engine_2.21.bb
index c2055c1..607cbd0 100644
--- a/packages/dsplink/ti-codec-engine_2.21.bb
+++ b/packages/dsplink/ti-codec-engine_2.21.bb
@@ -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 \





More information about the Openembedded-commits mailing list