summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/w9968cf.c
AgeCommit message (Collapse)Author
2009-08-10v4l: simplify v4l2_i2c_new_subdev and friendsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Rewrite v4l2_i2c_new_subdev as a simplified version of v4l2_i2c_new_subdev_cfg and remove v4l2_i2c_new_probed_subdev and v4l2_i2c_new_probed_subdev_addr. This simplifies this API substantially. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-06-19Stop defining I2C adapter IDs nobody usesMauro Carvalho Chehab
From: Jean Delvare <khali@linux-fr.org> There is no point in defining I2C adapter IDs when no code is using them. As this field might go away in the future, stop using it when we don't need to. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-05-30w8968cf: Use v4l bounding/alignment functionTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The v4l function has a better algorithm for aligning image size. The existing code was casting pointers to u32 and to unsigned int into pointers to u16. This could mess up if someone passed in an image size greater than 65,535 and on big-endian platforms it won't work at all. The existing bounding code would shrink an image if it was too big, but returned ERANGE if it was too small. The code will not shrink or expand as necessary. Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2009-04-05merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvbMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-01w9968cf: use usb_interface.dev for v4l2_device_registerJanne Grunau
From: Janne Grunau <j@jannau.net> Priority: normal Signed-off-by: Janne Grunau <j@jannau.net>
2009-04-01v4l2-common: add explicit v4l2_device pointer as first arg to ↵Hans Verkuil
new_(probed)_subdev From: Hans Verkuil <hverkuil@xs4all.nl> The functions v4l2_i2c_new_subdev and v4l2_i2c_new_probed_subdev relied on i2c_get_adapdata to return the v4l2_device. However, this is not always possible on embedded platforms. So modify the API to pass the v4l2_device pointer explicitly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-30v4l2: use old-style i2c API for kernels < 2.6.26 instead of < 2.6.22Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Originally the intention was to switch to the new style i2c API starting with the introduction of the API in 2.6.22. However, the i2c_new_probed_device() function has a lethal bug that wasn't fixed until 2.6.25. Or more accurately, it was only fixed in the stable series of 2.6.25 and 2.6.26. Given the fact that the new i2c API also changed starting with 2.6.26 (the addition of i2c_device_id), it is easiest to switch APIs starting with 2.6.26. This patch updates all the legacy code accordingly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-14v4l2: call v4l2_device_disconnect in USB drivers.Mauro Carvalho Chehab
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-10avoid loading the entire videodev.h header for drivers that are already V4L2 ↵Mauro Carvalho Chehab
only From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-08w9968cf/ovcamchip: convert to v4l2_subdev.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-08w9968cf: add v4l2_device.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-07backport commit b305271861219f0ce162eb565f0f28f4c781299dMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Author: Jean Delvare <khali@linux-fr.org> i2c: Drop I2C_CLASS_CAM_DIGITAL There are a number of drivers which set their i2c bus class to I2C_CLASS_CAM_DIGITAL, however no chip driver actually checks for this flag, so we might as well drop it now. kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30v4l2-ioctl: change to long return type to match unlocked_ioctl.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Since internal to v4l2 the ioctl prototype is the same regardless of it being called through .ioctl or .unlocked_ioctl, we need to convert it all to the long return type of unlocked_ioctl. Thanks to Jean-Francois Moine for posting an initial patch for this and thus bringing it to our attention. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> CC: Jean-Francois Moine <moinejf@free.fr>
2008-12-30v4l2: introduce v4l2_file_operations.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Introduce a struct v4l2_file_operations for v4l2 drivers. Remove the unnecessary inode argument. Move compat32 handling (and llseek) into the v4l2-dev core: this is now handled in the v4l2 core and no longer in the drivers themselves. Note that this changeset reverts an earlier patch that changed the return type of__video_ioctl2 from int to long. This change will be reinstated later in a much improved version. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-11-25fix boards for kernels with algo_controlMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> changeset 4ecae6da8244 removed algo_control from i2c drivers. However, on older kernels, a dummy function to implement algo_control is required, otherwise, an OOPS is generated. This patch adds a backport for all i2c drivers that defines an i2c_algorithm, except for cafe_ccic, since OLPC hardware only works for kernels newer than 2.6.19. Some of the backported drivers would need also extra changes to work with older kernels, as specified on v4l/versions.txt. Yet, I decided to add the backport for those drivers also, since the lack of algo_control doesn't generate any compilation error, but it is enough to break the driver. So, better to all for all boards than to allow compiling a kernel backported that just generates OOPS. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21backport commit a65e5d782f9db2a61a914dc01a329e0c2dcf92a1Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Author: Johannes Berg <johannes@sipsolutions.net> remove CONFIG_KMOD from drivers Straight forward conversions to CONFIG_MODULE; many drivers include <linux/kmod.h> conditionally and then don't have any other conditional code so remove it from those. kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-19v4l: use video_device.num instead of minor in video%dHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now independent of the minor number. So instead of using the minor field of the video_device struct one has to use the num field: this always contains the kernel number of the device node. I forgot about this when I did the v4l2 core change, so this patch converts all drivers that use it in one go. Luckily the change is trivial. Priority: high Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> CC: michael@mihu.de CC: mchehab@infradead.org CC: corbet@lwn.net CC: luca.risolia@studio.unibo.it CC: isely@pobox.com CC: pe1rxq@amsat.org CC: royale@zerezo.com CC: mkrufky@linuxtv.org CC: stoth@linuxtv.org
2008-09-04w9968cf: Fix order of usb_alloc_urb validationMauro Carvalho Chehab
From: Douglas Schilling Landgraf <dougsland@linuxtv.org> Fixed order of usb_alloc_urb pointer validation. Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> CC: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-07-26v4l2-dev: remove unused type and type2 field from video_deviceHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The type and type2 fields were unused and so could be removed. Instead add a vfl_type field that contains the type of the video device. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-21Remove obsolete owner field from video_device struct.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> According to an old comment this should have been removed in 2.6.15. Better late than never... Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-20Fix x86_64 compilation and move some macros to v4l2-ioctl.hMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20videodev: rename 'dev' to 'parent'Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The field 'dev' is not the video device, but the parent of the video device. Rename accordingly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-03-23[PATCH] add macro validation for v4l_compat_ioctl32.Douglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> Added macro CONFIG_COMPAT for v4l_compat_ioctl32. Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2008-01-27[PATCH] static memoryDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> - Static memory is always initialized with 0. - Replaced in some cases C99 comments for /* */ Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2007-10-17backport changeset 3be27d37c257fa5f99363f9c8e06e405cbad712eMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Original description: i2c: Remove NOP i2c_algorithm.algo_control() methods This removes NOP implementations of i2c_algorithm.algo_control. With this change, there are no implementations of this hook in the kernel.org tree ... that hook seems about ripe to remove. kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-15v4l core: remove the unused .hardware V4L1 fieldMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> struct video_device used to define a .hardware field. While initialized on severl drivers, this field is never used inside V4L. However, drivers using it need to include the old V4L1 header. This seems to cause compilation troubles with some random configs. Better just to remove it from all drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 V4L: w9968cf, remove bad usage of ERESTARTSYSMauro Carvalho Chehab
From: Jiri Slaby <jirislaby@gmail.com> w9968cf, remove bad usage of ERESTARTSYS down_read_trylock can't be interrupted and so ERESTARTSYS would reach userspace, which is not permitted. Change it to EAGAIN Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Acked-by: Luca Risolia <luca.risolia@studio.unibo.it> 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-02-21backport changeset 12a917f69d1468c91d646dbad8408dd0d39d6207Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Backport changeset from Jean Delvare <khali@linux-fr.org> that declare i2c_adapter parent devices. kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21Backport: make file_operations constMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Backport a kernel patch by Arjan van de Ven <arjan@linux.intel.com> that made all file_operations instances const. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-11Fix namespace conflict between w9968cf.c on MIPSMauro Carvalho Chehab
From: Ralf Baechle <ralf@linux-mips.org> Both use __SC. Since __* is sort of private namespace I've choosen to fix this in the driver. For consistency I decieded to also change __UNSC to UNSC. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-10-21IRQ: Maintain regs pointer globally rather than passing to IRQ handlersMauro Carvalho Chehab
Kernel-sync: This patch is required to allow compilation of the tree with kernel 2.6.19. This is the original description of the original patch, signed by David Howells <dhowells@redhat.com>: Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-10-04USB: Dealias -110 code (more complete)Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Apply the relevant parts of a patch from Pete Zaitcev <zaitcev@redhat.com> kernel-sync: Original description: The purpose of this patch is to split off the case when a device does not reply on the lower level (which is reported by HC hardware), and a case when the device accepted the request, but does not reply at upper level. This redefinition allows to diagnose issues easier, without asking the user if the -110 happened "immediately". The usbmon splits such cases already thanks to its timestamp, but it's not always available. I adjusted all drivers which I found affected (by searching for "urb"). Out of tree drivers may suffer a little bit, but I do not expect much breakage. At worst they may print a few messages. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-04-07Added almost all other V4L missing drivers to the treeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Now, drivers/media tree is complete. Only missing zoran36120 since this won't work and it is a good candidate to be removed from kernel soon. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>