random kernel version compatibility hacks
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 25 Mar 2012 00:38:05 +0000 (02:38 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 25 Mar 2012 00:43:47 +0000 (02:43 +0200)
Kbuild
services4/3rdparty/bufferclass_ti/bc_cat.c
services4/3rdparty/dc_omap3430_linux/Kbuild
services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.c
services4/3rdparty/dc_omap3430_linux/omaplfb_linux.c
services4/srvkm/env/linux/osfunc.c
services4/system/omap3430/sysutils_linux.c

diff --git a/Kbuild b/Kbuild
index 3ca2fc8..81043c1 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -61,4 +61,7 @@ obj-y := services4/3rdparty/dc_omap3430_linux/
 endif
 obj-y += services4/3rdparty/bufferclass_ti/
 
+ifeq ($(VERSION), 3)
+export EXTRA_CFLAGS += -DAUTOCONF_INCLUDED
+endif
 
index 0b9f6e0..879e78f 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/fs.h>
+#include <linux/version.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <img_defs.h>
@@ -492,7 +493,7 @@ static int __init bc_cat_init(void)
 #ifdef PLAT_TI8168  
    width_align = 8;
 #else
-   width_align = cpu_is_omap3530() && omap_rev_lt_3_0() ? 32 : 8;   
+   width_align = cpu_is_omap3530() && ( omap_rev() < OMAP3430_REV_ES3_0 ) ? 32 : 8;   
 #endif    
     major = register_chrdev(0, DEVNAME, &bc_cat_fops);
 
index eca3626..fb3602f 100755 (executable)
@@ -12,5 +12,9 @@ EXTRA_CFLAGS =        -DLINUX \
                -I$(PVR_BUILD_DIR)/services4/system/include \
                $(SYS_CFLAGS.1) \
 
+ifeq ($(VERSION), 3)
+export EXTRA_CFLAGS += -DAUTOCONF_INCLUDED
+endif
+
 obj-m := omaplfb.o
 omaplfb-y := omaplfb_displayclass.o omaplfb_linux.o
index 349beb5..0e6802d 100644 (file)
 #include "kerneldisplay.h"
 #include "omaplfb.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+#define acquire_console_sem console_lock
+#define release_console_sem console_unlock
+#endif
 static void *gpvAnchor;
 
 static int fb_idx = 0;
index 91254af..61a3686 100644 (file)
@@ -56,7 +56,9 @@ extern int omap_dispc_request_irq(unsigned long, void (*)(void *), void *);
 extern void omap_dispc_free_irq(unsigned long, void (*)(void *), void *);
 extern void omap_dispc_set_plane_base(int plane, IMG_UINT32 phys_addr);
 #else
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32))
+#if   (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#include <video/omapdss.h>
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32))
 #include <plat/display.h>
 #else
 #include <mach/display.h>
index 17e5d97..b96a6b7 100644 (file)
@@ -1516,7 +1516,8 @@ typedef struct TIMER_CALLBACK_DATA_TAG
 
 static TIMER_CALLBACK_DATA sTimers[OS_MAX_TIMERS];
 
-static spinlock_t sTimerStructLock = SPIN_LOCK_UNLOCKED;
+//static spinlock_t sTimerStructLock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sTimerStructLock);
 
 static IMG_VOID OSTimerCallbackWrapper(IMG_UINT32 ui32Data)
 {
index 05f8f79..b758ce1 100644 (file)
@@ -33,7 +33,8 @@
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
 #include <linux/semaphore.h>
-#include <plat/resource.h>
+#include <linux/smp.h>
+#include <asm-generic/resource.h>
 #include <plat/omap-pm.h>
 #else