summaryrefslogtreecommitdiff
path: root/v4l/compat.h
AgeCommit message (Collapse)Author
2007-11-01v4l/compat.h: add KERN_CONT for pre-2.6.24 kernelsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-11-02Add compatibility code for BIT_MASK and BIT_WORDMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-02Backport some changesets touching S/G codeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Backport kernel changesets: 45711f1af6eff1a6d010703b4862e0d2b9afd056 117636092a87a28a013a4acb5de5492645ed620f 642f149031d70415d9318b919d50b71e4724adbd Also, added newer entreis at compat.h, to avoid needing to add checks for linux versions inside the source codes. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-02Backport commit ba25f9dcc4ea6e30839fcab5a5516f2176d5bfedMauro Carvalho Chehab
kern-sync: Author: Pavel Emelyanov <xemul@openvz.org> Date: Thu Oct 18 23:40:40 2007 -0700 Use helpers to obtain task pid in printks The task_struct->pid member is going to be deprecated, so start using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in the kernel. The first thing to start with is the pid, printed to dmesg - in this case we may safely use task_pid_nr(). Besides, printks produce more (much more) than a half of all the explicit pid usage. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-18Fix compilation for distro kernels with newer -ALSA treesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-16Backport kernel commit 918f3a0e8cf67b5db966516f255eaf24d814fac0Clemens Ladisch
kernel-sync: ALSA HG commit 5279 Date: Mon, 13 Aug 2007 15:40:54 +0000 (+0200) [ALSA] pcm: add snd_pcm_rate_to_rate_bit() helper Add a snd_pcm_rate_to_rate_bit() function to factor out common code used by several drivers. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-15compat: fix syntax mistake in compat.hTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> A previous patch forgot the "define" in #define and so won't even compile when the code was triggered (kernel < 2.6.13). Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-10-08V4L: convert struct class_device to struct deviceMauro Carvalho Chehab
From: Kay Sievers <kay.sievers@vrfy.org> The currently used "struct class_device" will be removed from the kernel. Here is a patch that converts all users in drivers/media/video/ to struct device. Reviewed-by: Thierry Merle <thierry.merle@free.fr> Reviewed-by: Mike Isely <isely@pobox.com> Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
2007-09-03Remove some compat code from pwc-if, moving to compat.hMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-21Cleanup: remove linux/moduleparam.h from drivers/media filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This patch removes all occurences of moduleparm.h from drivers/media files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-17compat: Fix device_create compat codeTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The current compat code for device_create/destroy doesn't work properly for kernels 2.6.14 or below, and 2.6.18 to 2.6.23. For kernels 2.6.14 and below, the device_create/destroy compat code wasn't enabled. Those kernels need it too. For kernels 2.6.18 to 2.6.23, compat code _was_ getting including, which caused errors since 2.6.18 and above already have device_create and device_destroy. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-16compat: ALSA compat codeTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Removed some ALSA compat code from bt87x and put it into compat.h, then use this code in cx88-alsa and saa7134-alsa to avoid lots and lots of #ifs. All the kernel version checks in cx88-alsa and saa7134 were off by one too, which is now fixed. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-17Make dvbdev compatible again with older kernel versionsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> class_device_create/class_device_destroy are being replaced by device_create/device_destroy. This patch make it backward compatible. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-20compat: set_freezable() version check off by 1Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The function wasn't added until after 2.6.22. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-07-20compat: keep printing pci revision on older kernelsTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> In 2.6.23, there is a new struct pci_dev->revision field to get the pci revision. A couple drivers now use this to print the revision and on old kernels don't print it anymore. This patch adds a simple function to get the revision to compat.h to make it easy for the backward compay code to keep printing the revision like is used too. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-07-19Fix compatibility with kernels older than 2.6.22Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Thanks to Michael Krufky for pointing this issue. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-06-23compat: Add compat.h code for pci_match_device()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The first argument changed in 2.6.13, but it can be make backward compatible with a macro. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-05-13backport commit cbefb762b67fa6d3eb2a48ae3380358a940e8c9dMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Backport the original patch from Mattia Dongili <malattia@linux.it> meye: make meye use sony-laptop instead of sonypi Change sonypi_camera_command() calls to sony_pic_camera_command() and use the renamed macros. Also, added compat stuff to allow compiling meye driver for kernels < 2.6.22 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-27compat: fix test for true already being definedTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The #ifndef true test didn't work, as true is an enum, not a macro. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-25budget-ci: Fixed compilation error for kernel < 2.6.19Oliver Endriss
From: Oliver Endriss <o.endriss@gmx.de> Fix compilation error introduced by changeset 6d08d71cbcfb. Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
2007-02-19compat: Add compat code for vm_insert_page()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add an inline versin of vm_insert_page() that uses remap_pfn_range() to compat.h. Remove compat code from em28xx-video.c, sn9c102_core.c, and usbvision-video.c since compat.h is now doing the same thing. USB_ZC0301, USB_ET61X251, and USB_ZR364XX will now compile under 2.6.12. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-19compat: Fix compat stuff for usbvision and zr364xxTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> compat.h was missing from usbvideo-i2c.c and zr364xx.c zr364xx.c needed the struct semaphore -> struct mutex compat check. Added an old i2c id to compat.h. These could be added to the Hg copy of linux/i2c-id.h instead? There's just this one so far. zr364xx needs 2.6.15 because of vm_insert_page(), so add to versions.txt Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-19compat: Add -include linux/version.h to cflagsTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add -include linux/version.h to the cflags. Now code can have backward compatibility test without including compat.h first. Linux headers included from compat.h are removed, so that code will get the same headers when compiling in v4l-dvb as it does in the kernel. Many drivers have compat.h moved to the end of their include list, as this lets compat.h do things it can't do at the beginning. Such as test of something is defined to include compat code, or to put a wrapper around a function without changing the function's name. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-19compat: Add code to compat.h for try_to_sleep()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Compat.h used to have an argument, now it doesn't. There was also some code: if (current->flags & PF_FREEZE) { refrigerator(PF_FREEZE); } which is the same as try_to_freeze(), and so can be replaced by it. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-01-30include config-compat.h with gcc -include commandTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The kernel's config settings from autoconf.h are overridden by the file config-compat.h, which is included from compat.h. Code compiled before compat.h is included will see the kernel's settings, while code compiled after will see v4l-dvb's version of the settings. This has caused hard to track down bugs on more than one occasion. Always including compat.h first will not work, as some of the compatibility code requires that certain kernel headers be included first in order to work correctly. This patch makes config-compat.h be included second (after the kernel's autoconf.h) for every file by using a gcc "-include" command line option, the same way the kernel autoconf.h file is included. This should eliminate the problem of config-compat.h not being included in the right spot. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-01-30compat: Handle input_register_device() change and some othersTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> input_register_device() was changed to return an error code instead of being void in 2.6.15. Handle it with a macro wrapper in config.h. For this to work, linux/input.h must be included before config.h. This required some trivial header re-ordering in budget-ci.c and ttusb_dec.c. In kernel 2.6.15-rc1 a helper function called setup_timer() was added to linux/timer.h. Add to compat.h, but require that linux/timer.h be included first to give the definition of struct timer_list. A new 4GB DMA zone, __GFP_DMA32, was added in 2.6.15-rc2. Alias it to __GFP_DMA on older kernels. Handle another 2.6.15 "input_dev->dev to input_dev->cdev.dev" change for some recently added code in cinergyT2.c. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-01-09Fix compilation on some webcamsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> The recent updates on some webcams replaced vmalloc_32 by vmallo_32_user. However, it seems that this doesn't exist before kernel 2.6.19 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-11-19compat: Use kernel version to control PCIAGP_FAIL compat codeTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> PCIAGP_FAIL is a new pci quirk added in 2.6.19. The code in compat.h was checking if PCIAGP_FAIL was already defined to determine whether or not to include the backward compatibility code. This didn't work in a number of cases when compat.h was included before linux/pci.h, as PCIAGP_FAIL would get defined by compat.h and then re-defined by linux/pci.h. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-10-04Add compat for true/falseMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> true/false were incorporated at a common code on pre-kernel 2.6.19. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-09-14Currently, PCIAGP_FAIL only exists on 2.6.18-rc6-mm1Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-08-27Add compat code for usb_to_input_id() which appeared in 2.6.13Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Put static inline usb_to_input_id() inside compat.h for pre 2.6.13. This needs linux/usb.h to be included first! Drivers that need linux/usb_input.h compatibility must include linux/usb.h before they include compat.h. There is just no way around it. linux/usb.h cannot be unconditionally included in compat.h because that will break other, non-usb, drivers. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-07-25bttv: clean up some pre-2.6.0 class device compat stuffTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add bit of compat code for class_device_create_file() to compat.h for pre-2.6.0 kernels. This allows an #ifdef to be removed from bttv-driver.c, and helps other code which never had one. Changed the code to turn on for pre-2.6.0, rather than pre-2.5.0, as the class device stuff was added in 2.5.69. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-07-19[PATCH] irq-flags: media: Use the new IRQF_ constantsMauro Carvalho Chehab
From: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-15Add compat.h code for schedule_timeout_interruptible()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add a static inline version of schedule_timeout_interruptible(), it's only two lines, to compat.h. This will make bt866 and ks0127 compile with pre 2.6.14 kernels. Remove #if/#else code from msp3400, saa7134-tvaudio, and vivi that used to handle this. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-07-15Whitespace cleanupTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> From the whitespace script Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-05-29compat: handle input key definitions added in 2.6.14Michael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-05-07fix ability to pass compile-time build options when building from the hg repoMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> When building in-kernel, compile-time build options are passed into the compiler using '#include <linux/config.h>' . This file #include's <linux/autoconf.h> , which is created on the fly by the kbuild system. However, this does not work correctly when building from the mercurial repository, since the kernel is built indepentently of v4l/.myconfig This creates a "config-compat.h", which will be #include'd by compat.h and will emulate <linux/config.h> for the local build. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-04-25remove forced dvb frontend module dependencies left around from old build methodMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-02-06implemented compat.h for mutex_trylock()Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Fixed also a small mistake at including mutex.h kernel-sync Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-15V4L/DVB (3354e): bttv semaphore to mutex conversionMauro Carvalho Chehab
From: Ingo Molnar <mingo@elte.hu> Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. build-tested. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync
2005-12-11Makes v4l compile under 2.4 kernelsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@brturbo.com.br> kernel-sync - Makes V4L compile with kernel 2.4 - em28xx doesn't compile with 2.4 kernels. Additional work is necessary to make it compile. Thanks-to: Stefan Leichter <Stefan.Leichter@camLine.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-12-10make tree to compile against kernel 2.5.31Mauro Carvalho Chehab
kernel-sync Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-12-08Revert my changes from this morning. I was wrong :-(Michael Krufky
- Revert my changes from this morning. I was wrong :-( Thanks to Laurent Pinchart <laurent.pinchart@skynet.be> for pointing out my error. Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-08fix compat.h inputdev changesMichael Krufky
Removed linux version check, #include <linux/input.h> ...Should now work for everybody. Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-08Restore 2.6.15 check in compat.h for inputdev changesMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-08fixed backwards compatability for non-vanilla 2.6.14 kernels.Michael Krufky
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-12-04Backport of Dmitry Torokhov's input layer changes at mainline kernelRicardo Cerqueira
From: Ricardo Cerqueira <v4l@cerqueira.org> kernel-sync Ported changes by Dmitry Torokhov <dtor_core@ameritech.net> and added backwards compatibility checks for kernels < 2.6.15 Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
2005-11-23remove repeated codeMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-11-232.6.12 backwards compatability for dvbdev.c in dvb+v4l merged-trees.Michael Krufky
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-11-23add dvb-core to v4l/dvb merged-trees build environmentMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@m1k.net>