summaryrefslogtreecommitdiff
path: root/packages/dsplink/files
diff options
context:
space:
mode:
Diffstat (limited to 'packages/dsplink/files')
-rw-r--r--packages/dsplink/files/built-with-angstrom.patch48
-rw-r--r--packages/dsplink/files/cmem-class-device-27-and-sched-include-fix.patch23
-rw-r--r--packages/dsplink/files/do-not-panic-on-mixer-failure.patch31
-rw-r--r--packages/dsplink/files/dsplink-semaphore-27.patch36
-rw-r--r--packages/dsplink/files/lpm-device-create-and-semaphore-include-fix.patch121
-rw-r--r--packages/dsplink/files/support-32bit-align.patch17
-rw-r--r--packages/dsplink/files/update-cpu-name.patch16
-rw-r--r--packages/dsplink/files/update-fb-display.patch77
-rw-r--r--packages/dsplink/files/update-v4l2-display.patch127
9 files changed, 496 insertions, 0 deletions
diff --git a/packages/dsplink/files/built-with-angstrom.patch b/packages/dsplink/files/built-with-angstrom.patch
new file mode 100644
index 0000000000..fc49789718
--- /dev/null
+++ b/packages/dsplink/files/built-with-angstrom.patch
@@ -0,0 +1,48 @@
+Index: dmai_1_20_00_06/packages/config.bld
+===================================================================
+--- dmai_1_20_00_06.orig/packages/config.bld 2009-02-11 19:38:51.000000000 -0600
++++ dmai_1_20_00_06/packages/config.bld 2009-02-11 19:39:23.000000000 -0600
+@@ -42,7 +42,7 @@
+
+ /* location of the Codec Sourcery Arm9 tools */
+ var GCArmv5T = xdc.useModule('gnu.targets.arm.GCArmv5T');
+-GCArmv5T.LONGNAME = 'bin/arm-none-linux-gnueabi-gcc';
++GCArmv5T.LONGNAME = 'bin/arm-angstrom-linux-gnueabi-gcc';
+ GCArmv5T.platform = "ti.platforms.evm3530";
+ GCArmv5T.rootDir = java.lang.System.getenv("CSTOOL_DIR");
+
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/Makefile
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/Makefile 2009-02-11 19:39:57.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/Makefile 2009-02-11 19:58:05.000000000 -0600
+@@ -33,7 +33,7 @@
+ DMAI_INSTALL_DIR = ../../../..
+ TARGET = dmai
+
+-include $(DMAI_INSTALL_DIR)/Rules.make
++#include $(DMAI_INSTALL_DIR)/Rules.make
+
+ # Should the full command be echoed to the console during build?
+ VERBOSE=false
+@@ -64,7 +64,7 @@
+ MVL_CPP_FLAGS = $(GNU_CPP_FLAGS) -Dxdc_target_name__=MVArm9
+ CS_CPP_FLAGS = $(GNU_CPP_FLAGS) -Dxdc_target_name__=codesourcery/GCArmv5T
+
+-GNU_C_FLAGS = $(C_FLAGS) -Wall -Werror
++GNU_C_FLAGS = $(C_FLAGS) -Wall
+ C64P_C_FLAGS = $(C_FLAGS)
+
+ GNU_AR_FLAGS = $(AR_FLAGS)
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/apps/Makefile.app
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/apps/Makefile.app 2009-02-11 19:58:44.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/apps/Makefile.app 2009-02-11 19:59:01.000000000 -0600
+@@ -34,7 +34,7 @@
+ ifndef DMAI_INSTALL_DIR
+ DMAI_INSTALL_DIR = ../../../../../..
+ endif
+-include $(DMAI_INSTALL_DIR)/Rules.make
++#include $(DMAI_INSTALL_DIR)/Rules.make
+
+ # Should the full command be echoed to the console during build?
+ VERBOSE=false
diff --git a/packages/dsplink/files/cmem-class-device-27-and-sched-include-fix.patch b/packages/dsplink/files/cmem-class-device-27-and-sched-include-fix.patch
new file mode 100644
index 0000000000..8eb3210bb1
--- /dev/null
+++ b/packages/dsplink/files/cmem-class-device-27-and-sched-include-fix.patch
@@ -0,0 +1,23 @@
+diff -uNr codec_engine_2_21/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c codec_engine_2_21_fix/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
+--- codec_engine_2_21/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c 2009-02-12 22:02:15.000000000 +0000
++++ codec_engine_2_21_fix/cetools/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c 2009-02-12 22:08:49.000000000 +0000
+@@ -29,6 +29,7 @@
+ #include <linux/mm.h>
+ #include <linux/seq_file.h>
+ #include <linux/vmalloc.h>
++#include <linux/sched.h>
+ #include <asm/cacheflush.h>
+ #include <asm/uaccess.h>
+ #include <asm/pgtable.h>
+@@ -1710,7 +1711,11 @@
+ #ifdef USE_CLASS_DEVICE
+ class_device_create(cmem_class, NULL, MKDEV(cmem_major, 0), NULL, "cmem");
+ #else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ device_create(cmem_class, NULL, MKDEV(cmem_major, 0), NULL, "cmem");
++#else
+ device_create(cmem_class, NULL, MKDEV(cmem_major, 0), "cmem");
++#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ #endif // USE_CLASS_DEVICE
+ #endif // USE_CLASS_SIMPLE
+ #endif // USE_UDEV
diff --git a/packages/dsplink/files/do-not-panic-on-mixer-failure.patch b/packages/dsplink/files/do-not-panic-on-mixer-failure.patch
new file mode 100644
index 0000000000..20e1aece72
--- /dev/null
+++ b/packages/dsplink/files/do-not-panic-on-mixer-failure.patch
@@ -0,0 +1,31 @@
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Sound_alsa.c
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/linux/Sound_alsa.c 2009-02-11 19:19:23.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Sound_alsa.c 2009-02-11 19:19:25.000000000 -0600
+@@ -139,7 +139,7 @@
+
+ snd_mixer_selem_id_free (sid);
+ snd_mixer_close (rcMixer);
+-
++
+ return Dmai_EOK;
+ }
+
+@@ -431,14 +431,13 @@
+ Sound_alsa_delete(hSound);
+ return NULL;
+ }
+-
++
+ if (setMixerVolume (attrs) <0) {
+- Sound_alsa_delete (hSound);
+- return NULL;
++ Dmai_dbg2("Failed to set the mixer volume on %s (%s)\n",
++ AUDIO_DEVICE, snd_strerror(status));
+ }
+ }
+
+-
+ return hSound;
+ }
+
diff --git a/packages/dsplink/files/dsplink-semaphore-27.patch b/packages/dsplink/files/dsplink-semaphore-27.patch
new file mode 100644
index 0000000000..b2f71169fd
--- /dev/null
+++ b/packages/dsplink/files/dsplink-semaphore-27.patch
@@ -0,0 +1,36 @@
+diff -uNr codec_engine_2_21/cetools/packages/dsplink/gpp/src/osal/Linux/2.6.18/sync.c codec_engine_2_21_fix/cetools/packages/dsplink/gpp/src/osal/Linux/2.6.18/sync.c
+--- codec_engine_2_21/cetools/packages/dsplink/gpp/src/osal/Linux/2.6.18/sync.c 2008-12-19 16:27:19.000000000 +0530
++++ codec_engine_2_21_mod/cetools/packages/dsplink/gpp/src/osal/Linux/2.6.18/sync.c 2009-02-12 10:08:48.000000000 +0530
+@@ -30,9 +30,14 @@
+
+
+ /* ----------------------------------- OS Specific Headers */
++#include <linux/version.h>
+ #include <linux/autoconf.h>
+ #include <linux/spinlock.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+ #include <asm/semaphore.h>
++#else
++#include <linux/semaphore.h>
++#endif
+ #include <linux/timer.h>
+ #include <linux/sched.h>
+ #include <linux/delay.h>
+diff -uNr codec_engine_2_21/cetools/packages/dsplink/gpp/src/osal/Linux/user.c codec_engine_2_21_fix/cetools/packages/dsplink_mod/gpp/src/osal/Linux/user.c
+--- codec_engine_2_21/cetools/packages/dsplink/gpp/src/osal/Linux/user.c 2008-12-19 16:27:19.000000000 +0530
++++ codec_engine_2_21_fix/cetools/packages/dsplink_mod/gpp/src/osal/Linux/user.c 2009-02-12 10:08:05.000000000 +0530
+@@ -30,9 +30,14 @@
+
+
+ /* ----------------------------------- OS Specific Headers */
++#include <linux/version.h>
+ #include <linux/autoconf.h>
+ #include <linux/spinlock.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+ #include <asm/semaphore.h>
++#else
++#include <linux/semaphore.h>
++#endif
+ #include <linux/timer.h>
+ #include <linux/sched.h>
+ #include <linux/delay.h>
diff --git a/packages/dsplink/files/lpm-device-create-and-semaphore-include-fix.patch b/packages/dsplink/files/lpm-device-create-and-semaphore-include-fix.patch
new file mode 100644
index 0000000000..a3bc2b14a6
--- /dev/null
+++ b/packages/dsplink/files/lpm-device-create-and-semaphore-include-fix.patch
@@ -0,0 +1,121 @@
+diff -uNr codec_engine_2_21/cetools/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
+--- codec_engine_2_21/cetools/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c 2008-11-05 00:18:39.000000000 +0000
++++ codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c 2009-02-13 00:16:50.000000000 +0000
+@@ -225,6 +225,9 @@
+ .os_wait = lpm_os_wait,
+ .os_trace = lpm_os_trace,
+ };
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ char lpm_tempDeviceCreateName[50];
++#endif
+
+ TRACE(KERN_ALERT "lpm.ko: + lpm_init\n");
+
+@@ -286,9 +289,16 @@
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ NULL, "lpm%d", lpm->inst[i].minor);
+ #else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ sprintf(lpm_tempDeviceCreateName, "lpm%d", lpm->inst[i].minor);
++ device_create(lpm->lpm_class, NULL,
++ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
++ NULL, lpm_tempDeviceCreateName);
++#else
+ device_create(lpm->lpm_class, NULL,
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ "lpm%d", lpm->inst[i].minor);
++#endif /* LINUX_VERSION */
+ #endif
+ }
+
+diff -uNr codec_engine_2_21/cetools/packages/ti/bios/power/modules/omap2530/lpm/lpm_driver.c codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/omap2530/lpm/lpm_driver.c
+--- codec_engine_2_21/cetools/packages/ti/bios/power/modules/omap2530/lpm/lpm_driver.c 2008-11-05 00:18:39.000000000 +0000
++++ codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/omap2530/lpm/lpm_driver.c 2009-02-13 00:16:50.000000000 +0000
+@@ -225,6 +225,9 @@
+ .os_wait = lpm_os_wait,
+ .os_trace = lpm_os_trace,
+ };
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ char lpm_tempDeviceCreateName[50];
++#endif
+
+ TRACE(KERN_ALERT "lpm.ko: + lpm_init\n");
+
+@@ -286,9 +289,16 @@
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ NULL, "lpm%d", lpm->inst[i].minor);
+ #else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ sprintf(lpm_tempDeviceCreateName, "lpm%d", lpm->inst[i].minor);
++ device_create(lpm->lpm_class, NULL,
++ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
++ NULL, lpm_tempDeviceCreateName);
++#else
+ device_create(lpm->lpm_class, NULL,
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ "lpm%d", lpm->inst[i].minor);
++#endif /* LINUX_VERSION */
+ #endif
+ }
+
+diff -uNr codec_engine_2_21/cetools/packages/ti/bios/power/modules/dm357/lpm/lpm_driver.c codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/dm357/lpm/lpm_driver.c
+--- codec_engine_2_21/cetools/packages/ti/bios/power/modules/dm357/lpm/lpm_driver.c 2008-11-05 00:18:39.000000000 +0000
++++ codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/dm357/lpm/lpm_driver.c 2009-02-13 00:16:50.000000000 +0000
+@@ -225,6 +225,9 @@
+ .os_wait = lpm_os_wait,
+ .os_trace = lpm_os_trace,
+ };
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ char lpm_tempDeviceCreateName[50];
++#endif
+
+ TRACE(KERN_ALERT "lpm.ko: + lpm_init\n");
+
+@@ -286,9 +289,16 @@
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ NULL, "lpm%d", lpm->inst[i].minor);
+ #else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ sprintf(lpm_tempDeviceCreateName, "lpm%d", lpm->inst[i].minor);
++ device_create(lpm->lpm_class, NULL,
++ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
++ NULL, lpm_tempDeviceCreateName);
++#else
+ device_create(lpm->lpm_class, NULL,
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ "lpm%d", lpm->inst[i].minor);
++#endif /* LINUX_VERSION */
+ #endif
+ }
+
+diff -uNr codec_engine_2_21/cetools/packages/ti/bios/power/modules/dm6446/lpm/lpm_driver.c codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/dm6446/lpm/lpm_driver.c
+--- codec_engine_2_21/cetools/packages/ti/bios/power/modules/dm6446/lpm/lpm_driver.c 2008-11-05 00:18:39.000000000 +0000
++++ codec_engine_2_21_fix/cetools/packages/ti/bios/power/modules/dm6446/lpm/lpm_driver.c 2009-02-13 00:16:50.000000000 +0000
+@@ -225,6 +225,9 @@
+ .os_wait = lpm_os_wait,
+ .os_trace = lpm_os_trace,
+ };
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ char lpm_tempDeviceCreateName[50];
++#endif
+
+ TRACE(KERN_ALERT "lpm.ko: + lpm_init\n");
+
+@@ -286,9 +289,16 @@
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ NULL, "lpm%d", lpm->inst[i].minor);
+ #else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ sprintf(lpm_tempDeviceCreateName, "lpm%d", lpm->inst[i].minor);
++ device_create(lpm->lpm_class, NULL,
++ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
++ NULL, lpm_tempDeviceCreateName);
++#else
+ device_create(lpm->lpm_class, NULL,
+ MKDEV(lpm->inst[i].major, lpm->inst[i].minor),
+ "lpm%d", lpm->inst[i].minor);
++#endif /* LINUX_VERSION */
+ #endif
+ }
+
+
diff --git a/packages/dsplink/files/support-32bit-align.patch b/packages/dsplink/files/support-32bit-align.patch
new file mode 100644
index 0000000000..0ee817d9d9
--- /dev/null
+++ b/packages/dsplink/files/support-32bit-align.patch
@@ -0,0 +1,17 @@
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/linux/omap3530/Resize.c
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/linux/omap3530/Resize.c 2009-02-11 19:20:45.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/linux/omap3530/Resize.c 2009-02-11 19:21:09.000000000 -0600
+@@ -557,9 +557,9 @@
+ srcOffset = srcDim.y * srcDim.lineLength + srcDim.x * 2;
+ dstOffset = dstDim.y * dstDim.lineLength + dstDim.x * 2;
+
+- /* Input and output buffers must be 4096 bytes aligned */
+- assert(((Buffer_getPhysicalPtr(hDstBuf) + srcOffset) & 0xFFF) == 0);
+- assert(((Buffer_getPhysicalPtr(hSrcBuf) + dstOffset) & 0xFFF) == 0);
++ /* Pointers must be a multiple of 32 bytes */
++ assert((Buffer_getPhysicalPtr(hDstBuf) & 0x1F) == 0);
++ assert((Buffer_getPhysicalPtr(hSrcBuf) & 0x1F) == 0);
+
+ /* Queue the resizer buffers */
+ for (i=0; i < 2; i++) {
diff --git a/packages/dsplink/files/update-cpu-name.patch b/packages/dsplink/files/update-cpu-name.patch
new file mode 100644
index 0000000000..f9905f59bf
--- /dev/null
+++ b/packages/dsplink/files/update-cpu-name.patch
@@ -0,0 +1,16 @@
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Cpu.c
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/linux/Cpu.c 2009-02-11 18:08:50.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Cpu.c 2009-02-11 18:11:41.000000000 -0600
+@@ -103,7 +103,10 @@
+ else if (strcmp(valBuf, "DM357 EVM") == 0) {
+ *device = Cpu_Device_DM6446;
+ }
+- else if (strcmp(valBuf, "OMAP3EVM Board") == 0) {
++ else if ((strcmp(valBuf, "OMAP3EVM Board") == 0)
++ (strcmp(valBuf, "OMAP3 EVM") == 0)
++ (strcmp(valBuf, "OMAP3 Beagle Board") == 0)
++ ){
+ *device = Cpu_Device_OMAP3530;
+ }
+ else {
diff --git a/packages/dsplink/files/update-fb-display.patch b/packages/dsplink/files/update-fb-display.patch
new file mode 100644
index 0000000000..91c1dd15aa
--- /dev/null
+++ b/packages/dsplink/files/update-fb-display.patch
@@ -0,0 +1,77 @@
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Display_fbdev.c
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/linux/Display_fbdev.c 2009-02-11 19:59:57.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Display_fbdev.c 2009-02-11 20:02:46.000000000 -0600
+@@ -41,10 +41,7 @@
+ #include <sys/ioctl.h>
+ #include <linux/fb.h>
+
+-#ifdef Dmai_Device_omap3530
+-/* OMAP specific kernel headers */
+-#include <video/omapfbdev.h>
+-#else
++#ifndef Dmai_Device_omap3530
+ /* Davinci specific kernel headers */
+ #include <video/davincifb_ioctl.h>
+ #endif
+@@ -184,11 +181,13 @@
+ }
+ #endif
+
++#if 0
+ /* Set up the sysfs variables before opening the display device */
+ if (_Display_sysfsSetup(attrs, channel) < 0) {
+ cleanup(hDisplay);
+ return NULL;
+ }
++#endif
+
+ /* Open video display device */
+ hDisplay->fd = open(attrs->displayDevice, O_RDWR);
+@@ -423,6 +422,7 @@
+ ******************************************************************************/
+ Int Display_fbdev_get(Display_Handle hDisplay, Buffer_Handle *hBufPtr)
+ {
++#if defined (FBIO_WAITFORVSYNC)
+ BufTab_Handle hBufTab = hDisplay->hBufTab;
+ int dummy;
+
+@@ -436,7 +436,8 @@
+ }
+
+ *hBufPtr = BufTab_getBuf(hBufTab, hDisplay->workingIdx);
+-
++
++#endif
+ return Dmai_EOK;
+ }
+
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Display.c
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/linux/Display.c 2009-02-11 20:00:10.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Display.c 2009-02-11 20:02:07.000000000 -0600
+@@ -80,18 +80,18 @@
+
+ const Display_Attrs Display_Attrs_O3530_VID_DEFAULT = {
+ 3,
+- Display_Std_V4L2,
+- VideoStd_VGA,
+- Display_Output_LCD,
+- "/dev/video1",
++ Display_Std_FBDEV,
++ VideoStd_D1_NTSC,
++ Display_Output_DVI,
++ "/dev/fb2",
+ 0
+ };
+
+ const Display_Attrs Display_Attrs_O3530_OSD_DEFAULT = {
+ 1,
+ Display_Std_FBDEV,
+- VideoStd_VGA,
+- Display_Output_LCD,
++ VideoStd_D1_NTSC,
++ Display_Output_DVI,
+ "/dev/fb0",
+ 0
+ };
diff --git a/packages/dsplink/files/update-v4l2-display.patch b/packages/dsplink/files/update-v4l2-display.patch
new file mode 100644
index 0000000000..8bb77d8473
--- /dev/null
+++ b/packages/dsplink/files/update-v4l2-display.patch
@@ -0,0 +1,127 @@
+Index: dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Display_v4l2.c
+===================================================================
+--- dmai_1_20_00_06.orig/packages/ti/sdo/dmai/linux/Display_v4l2.c 2009-02-11 19:22:51.000000000 -0600
++++ dmai_1_20_00_06/packages/ti/sdo/dmai/linux/Display_v4l2.c 2009-02-11 19:27:02.000000000 -0600
+@@ -120,7 +120,9 @@
+ struct v4l2_format fmt;
+ enum v4l2_buf_type type;
+ Display_Handle hDisplay;
+- Int channel;
++#if defined(Dmai_Device_omap3530) && defined(V4L2_CID_ROTATION)
++ struct v4l2_control control;
++#endif
+
+ assert(attrs);
+
+@@ -134,44 +136,6 @@
+
+ hDisplay->userAlloc = TRUE;
+
+-#ifdef Dmai_Device_omap3530
+- /* channel = 0 - digital video path
+- * channel = 1 - analog video path
+- */
+- switch (attrs->videoOutput) {
+- case Display_Output_SVIDEO:
+- case Display_Output_COMPOSITE:
+- channel = 1;
+- break;
+- case Display_Output_DVI:
+- case Display_Output_LCD:
+- case Display_Output_SYSTEM:
+- channel = 0;
+- break;
+- default:
+- /* do nothing */
+- break;
+- }
+-#else
+- if (strcmp(attrs->displayDevice, "/dev/video2") == 0) {
+- channel = 0;
+- }
+- else if (strcmp(attrs->displayDevice, "/dev/video3") == 0) {
+- channel = 1;
+- }
+- else {
+- Dmai_err1("%s not a display device\n", attrs->displayDevice);
+- cleanup(hDisplay);
+- return NULL;
+- }
+-#endif
+-
+- /* Set up the sysfs variables before opening the display device */
+- if (_Display_sysfsSetup(attrs, channel) < 0) {
+- cleanup(hDisplay);
+- return NULL;
+- }
+-
+ /* Open video capture device */
+ hDisplay->fd = open(attrs->displayDevice, O_RDWR, 0);
+
+@@ -182,9 +146,8 @@
+ return NULL;
+ }
+
+-#ifdef Dmai_Device_omap3530
+-#define VIDIOC_S_OMAP2_ROTATION _IOW ('V', 3, int)
+-
++
++#if defined(Dmai_Device_omap3530) && defined(V4L2_CID_ROTATION)
+ if (attrs->rotation != 0 && attrs->rotation != 90 &&
+ attrs->rotation != 180 && attrs->rotation != 270) {
+
+@@ -193,49 +156,16 @@
+ return NULL;
+ }
+
+- if (ioctl(hDisplay->fd, VIDIOC_S_OMAP2_ROTATION, &attrs->rotation) < 0) {
+- Dmai_err2("Failed VIDIOC_S_OMAP2_ROTATION on %s (%s)\n",
++ control.id = V4L2_CID_ROTATION;
++ control.value = attrs->rotation;
++
++ if (ioctl(hDisplay->fd, VIDIOC_S_CTRL, &control) < 0) {
++ Dmai_err2("Failed VIDIOC_S_CTRL on %s (%s)\n",
+ attrs->displayDevice, strerror(errno));
+ cleanup(hDisplay);
+ return NULL;
+ }
+
+- switch (attrs->videoStd) {
+- case VideoStd_D1_NTSC:
+- fmt.fmt.pix.width = VideoStd_D1_WIDTH;
+- fmt.fmt.pix.height = VideoStd_D1_NTSC_HEIGHT;
+- break;
+- case VideoStd_D1_PAL:
+- fmt.fmt.pix.width = VideoStd_D1_WIDTH;
+- fmt.fmt.pix.height = VideoStd_D1_PAL_HEIGHT;
+- break;
+- case VideoStd_VGA:
+- fmt.fmt.pix.width = VideoStd_VGA_WIDTH;
+- fmt.fmt.pix.height = VideoStd_VGA_HEIGHT;
+- break;
+- case VideoStd_480P:
+- fmt.fmt.pix.width = VideoStd_480P_WIDTH;
+- fmt.fmt.pix.height = VideoStd_480P_HEIGHT;
+- break;
+- case VideoStd_720P_60:
+- fmt.fmt.pix.width = VideoStd_480P_WIDTH;
+- fmt.fmt.pix.height = VideoStd_480P_HEIGHT;
+- break;
+- default:
+- Dmai_err1("Unknown video standard %d\n", attrs->videoStd);
+- cleanup(hDisplay);
+- return NULL;
+- }
+-
+- fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY;
+- fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+-
+- if (ioctl(hDisplay->fd, VIDIOC_S_FMT, &fmt) == -1) {
+- Dmai_err2("Failed VIDIOC_S_FMT on %s (%s)\n", attrs->displayDevice,
+- strerror(errno));
+- cleanup(hDisplay);
+- return NULL;
+- }
+ #endif /* Dmai_Device_omap3530 */
+
+ /* Determine the video image dimensions */