summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/zr364xx.c
AgeCommit message (Collapse)Author
2009-08-11zr364: wrong indexesAntoine Jacquet
From: Roel Kluin <roel.kluin@gmail.com> The order of indexes is reversed Priority: high Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2009-07-22zr364xx: error message when buffer is too small and code cleanupAntoine Jacquet
From: Lamarque Vieira Souza <lamarque@gmail.com> . added code to print an error message when buffer is too small to hold frame data, that is better than just a hard crash. Tested using MAX_FRAME_SIZE = 50000, lots of error messages appeared in /var/log/messages but no crash. . removed line "f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;" in zr364xx_vidioc_try_fmt_vid_cap, it should not be there. . changes to improve performance (or at least not hurt it): removed some unneeded debug messages; added macro FULL_DEBUG to enable debug messages in performance critical places, this macro is disabled by default; removed "if (frm->lpvbits == NULL)..." in zr364xx_read_video_callback because after analisying the source code I concluded it will always results to false, so it is not needed. . some small code reorganization. Signed-off-by: Lamarque V. Souza <lamarque@gmail.com> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2009-07-20Implement changing resolution on the fly for zr364xx driverAntoine Jacquet
From: Lamarque Vieira Souza <lamarque@gmail.com> This patch implements changing resolution in zr364xx_vidioc_s_fmt_vid_cap for zr364xx driver. This version is synced with v4l-dvb as of 20/Jul/2009. Tested with Creative PC-CAM 880. OBS: I had to increase MAX_FRAME_SIZE to prevent a hard crash in my notebook (caps lock blinking) when testing with mplayer, which automatically sets resolution to the maximum (640x480). Maybe we should add code to auto-detect frame size to prevent this kind of crash in the future. Signed-off-by: Lamarque V. Souza <lamarque@gmail.com> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2009-07-21zr364xx: Need to include linux/version.hMauro Carvalho Chehab
drivers/media/video/zr364xx.c: In function ‘zr364xx_vidioc_querycap’: drivers/media/video/zr364xx.c:736: error: implicit declaration of function ‘KERNEL_VERSION’ kernel-sync: Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-15zr364xx: implement V4L2_CAP_STREAMINGAntoine Jacquet
From: Lamarque Vieira Souza <lamarque@gmail.com> This patch implements V4L2_CAP_STREAMING for the zr364xx driver, by converting the driver to use videobuf. This version is synced with v4l-dvb as of 15/Jul/2009. Tested with Creative PC-CAM 880. It basically: . implements V4L2_CAP_STREAMING using videobuf; . re-implements V4L2_CAP_READWRITE using videobuf; . copies cam->udev->product to the card field of the v4l2_capability struct. That gives more information to the users about the webcam; . moves the brightness setting code from before requesting a frame (in read_frame) to the vidioc_s_ctrl ioctl. This way the brightness code is executed only when the application requests a change in brightness and not before every frame read; . comments part of zr364xx_vidioc_try_fmt_vid_cap that says that Skype + libv4l do not work. This patch fixes zr364xx for applications such as mplayer, Kopete+libv4l and Skype+libv4l can make use of the webcam that comes with zr364xx chip. Signed-off-by: Lamarque V. Souza <lamarque@gmail.com> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2009-06-06zr364xx.c: vfree does its own NULL checkMauro Carvalho Chehab
From: Figo.zhang <figo1802@gmail.com> vfree() does it's own NULL checking, no need for explicit check before calling it. Signed-off-by: Figo.zhang <figo1802@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-02V4L/DVB: zr364xx: remove unused #include <version.h>Mauro Carvalho Chehab
From: Huang Weiyi <weiyi.huang@gmail.com> Remove unused #include <version.h> in drivers/media/video/zr364xx.c. Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-28zr364xx: Remove code for things already done by video_ioctl2Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on VIDEO_CAPTURE buffers. Thus, there is no need to check or set the buffer's 'type' field since it must already be set to VIDEO_CAPTURE. Checking the buffer type can be removed from zr364xx_vidioc_(s|g|try|enum)_fmt_vid_cap(). The v4l2 core code in v4l2_ioctl will zero out the structure the driver is supposed to fill in for read-only ioctls. For read/write ioctls, all the fields which aren't supplied from userspace will be zeroed out. Zeroing code can be removed from zr364xx_vidioc_querycap(), zr364xx_vidioc_enum_input(), zr364xx_vidioc_enum_fmt_vid_cap(), and zr364xx_vidioc_g_fmt_vid_cap(). Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> CC: Antoine Jacquet <royale@zerezo.com>
2009-01-18zr364xx: add support for Aiptek DV T300Antoine Jacquet
From: Antoine Jacquet <royale@zerezo.com> Priority: normal Tested-by: Hámorszky Balázs <balihb@freepop.hu> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2009-01-01Use usb_set_intfdataMauro Carvalho Chehab
From: Julia Lawall <julia@diku.dk> This code had calls to both usb_set_intfdata and dev_set_drvdata, doing the same thing. The semantic patch that lead to finding this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @header@ @@ @same depends on header@ position p; @@ usb_set_intfdata@p(...) { ... } @depends on header@ position _p!=same.p; identifier _f; struct usb_interface *intf; expression data; @@ _f@_p(...) { <+... - dev_set_drvdata(&intf->dev, data); + usb_set_intfdata(intf, data); ...+> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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-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-10-10USB: remove info() macro from usb media driversMauro Carvalho Chehab
From: Greg Kroah-Hartman <gregkh@suse.de> USB should not be having it's own printk macros, so remove info() and use the system-wide standard of dev_info() wherever possible. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> CC: Douglas Landgraf <dougsland@gmail.com> CC: Mike Isely <isely@pobox.com> CC: Thierry Merle <thierry.merle@free.fr> CC: Antoine Jacquet <royale@zerezo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-08-18zr364xx: handle video exclusive open internalyAntoine Jacquet
From: Antoine Jacquet <royale@zerezo.com> Count the users and do not use video_exclusive_open() anymore. Priority: normal Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2008-08-18zr364xx: remove BKLAntoine Jacquet
From: Antoine Jacquet <royale@zerezo.com> Remove the Big Kernel Lock from zr364xx driver after pushdown. Now using an internal locking mecanism on open(). Priority: normal Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2008-07-30v4l: move BKL down to the driver level.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
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-21videodev: move all ioctl callbacks to a new v4l2_ioctl_ops structHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it. This ensures a clean separation between the const ops struct and the non-const video_device struct. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-20videodev: move some functions from v4l2-dev.h to v4l2-common.h or v4l2-ioctl.hHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The functions in a header should not belong to another module. The prio functions belong to v4l2-common.c, so move them to v4l2-common.h. The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header and move those functions to it. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.16Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 4 removes the compatibility support for kernels < 2.6.16. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-05-28videodev: renamed the vidioc_*_fmt_* callbacksHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The naming for the callbacks that handle the VIDIOC_ENUM_FMT and VIDIOC_S/G/TRY_FMT ioctls was very confusing. Renamed it to match the v4l2_buf_type name. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-04-15Sync some small differences from kernel treeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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>
2008-01-25zr364xx: add support for Creative DiVi CAM 516Antoine Jacquet
From: Antoine Jacquet <royale@zerezo.com> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2008-01-25zr364xx: add support for Pentax Optio 50Antoine Jacquet
From: Antoine Jacquet <royale@zerezo.com> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2007-10-29zr364: make file_operations constDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> zr364: make file_operations const Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2007-06-25zr364xx: add support for Trust Powerc@m 970ZAntoine Jacquet
From: Antoine Jacquet <royale@zerezo.com> Add Trust Powerc@m 970Z (0x06d6:0x003b) to the list of supported devices. Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2007-05-20zr364xx: fix return valuesroyale@royale
From: Akinobu Mita <akinobu.mita@gmail.com> This patch fixes several return value related problems in zr364xx. - return -ENOMEM instead of -ENODEV on out of memory - zr364xx checks video_register_device() error only when its return value is -1. But video_register_device() doesn't always return -1 on error. - If usb_register() returns error, module_init() wrongly returns 1: retval = usb_register(&zr364xx_driver) < 0; ... return retval; And it allows the module to be loaded. Because sys_init_module() doesn't see positive return value as error. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2007-03-07zr364xx: Use kernel's byte-swapping functionTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Some code to swap bytes wasn't using the swab16() function that the kernel provides for this. Make use of it, which results in more efficient code. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Antoine Jacquet <royale@zerezo.com>
2007-03-05Fix compilation issue with zr364xx when V4L1 is disabledAntoine Jacquet
From: Antoine Jacquet <royale@zerezo.com> Add a missing header to fix compilation issue in the zr364xx driver when CONFIG_VIDEO_V4L1 and CONFIG_VIDEO_V4L1_COMPAT are not set. Signed-off-by: Antoine Jacquet <royale@zerezo.com>
2007-02-27Update zr364xx V4L2 driverMauro Carvalho Chehab
From: Antoine Jacquet <royale@zerezo.com> I did some change on the zr364xx driver following your comments: * I replaced hardcoded values for initialization methods, unfortunately I don't have nicer names to give for now. * I removed the DBG() on all ioctl2 functions and used the .debug var instead. * Following a comment on linux-usb-devel I misunderstood, I added an endianness test which was an error, so I removed it (the order of the bytes in the JPEG header should not depend on endianness). Signed-off-by: Antoine Jacquet <royale@zerezo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.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-19zr364xx: Automatic whitespace cleanupTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> File wasn't passed through whitespace script when it was checked in. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-18USB: add zr364xx V4L2 driverMauro Carvalho Chehab
From: Antoine Jacquet <royale@zerezo.com> This patch adds a V4L2 driver giving support for USB webcams based on the zr364xx chipsets. Signed-off-by: Antoine Jacquet <royale@zerezo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>