summaryrefslogtreecommitdiff
path: root/drivers/media/usb/hdpvr
AgeCommit message (Collapse)Author
2013-10-15[media] hdpvr: fix sparse warningsHans Verkuil
drivers/media/usb/hdpvr/hdpvr-core.c:110:54: warning: incorrect type in argument 1 (different base types) drivers/media/usb/hdpvr/hdpvr-core.c:112:39: warning: invalid assignment: += drivers/media/usb/hdpvr/hdpvr-core.c:304:26: warning: Using plain integer as NULL pointer Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-09-03[media] hdpvr: fix iteration over uninitialized lists in hdpvr_probe()Alexey Khoroshilov
free_buff_list and rec_buff_list are initialized in the middle of hdpvr_probe(), but if something bad happens before that, error handling code calls hdpvr_delete(), which contains iteration over the lists (via hdpvr_free_buffers()). The patch moves the lists initialization to the beginning and by the way fixes goto label in error handling of registering videodev. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Cc: stable@vger.kernel.org
2013-08-24[media] v4l2-dv-timings: rename v4l_match_dv_timings to v4l2_match_dv_timingsHans Verkuil
It's the only function in v4l2-dv-timings.c with the v4l prefix instead of v4l2. Make it consistent with the other functions. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] v4l2: use new V4L2_DV_BT_BLANKING/FRAME definesHans Verkuil
Use the new defines to calculate the full blanking and frame sizes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-08-18[media] v4l2: move dv-timings related code to v4l2-dv-timings.cHans Verkuil
v4l2-common.c contained a bunch of dv-timings related functions. Move that to the new v4l2-dv-timings.c which is a more appropriate place for them. There aren't many drivers that do HDTV, so it is a good idea to separate common code related to that into a module of its own. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-13[media] hdpvr: improve error handlingHans Verkuil
get_video_info() should never return EFAULT, instead it should return the low-level usb_control_msg() error. Add a valid field to the hdpvr_video_info struct so the driver can easily check if a valid format was detected. Whenever get_video_info is called and it returns an error (e.g. usb_control_msg failed), then return that error to userspace as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-13[media] hdpvr: code cleanupHans Verkuil
Remove an unnecessary 'else' and invert a condition which makes the code more readable. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-13[media] hdpvr: fix querystd 'unknown format' returnHans Verkuil
If no format has been detected, then querystd should return V4L2_STD_UNKNOWN, not V4L2_STD_ALL. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-27[media] hdpvr: Removed unnecessary use of kzalloc() in get_video_info()Leonid Kegulskiy
[mchehab@redhat.com: CodingStyle fixes] Signed-off-by: Leonid Kegulskiy <leo@lumanate.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-27[media] media: fix hdpvr kconfig/build errorsRandy Dunlap
Fix hdpvr build errors when CONFIG_I2C=m and VIDEO_V4L2=m and VIDEO_HDPVR=y. drivers/built-in.o: In function `hdpvr_disconnect': hdpvr-core.c:(.text+0xef542): undefined reference to `v4l2_device_disconnect' hdpvr-core.c:(.text+0xef57e): undefined reference to `i2c_del_adapter' hdpvr-core.c:(.text+0xef58a): undefined reference to `video_unregister_device' drivers/built-in.o: In function `hdpvr_delete': (.text+0xef5b9): undefined reference to `video_device_release' drivers/built-in.o: In function `hdpvr_probe': hdpvr-core.c:(.text+0xef63a): undefined reference to `v4l2_device_register' hdpvr-core.c:(.text+0xefd97): undefined reference to `i2c_del_adapter' drivers/built-in.o: In function `hdpvr_s_ctrl': hdpvr-video.c:(.text+0xf03c0): undefined reference to `v4l2_ctrl_activate' drivers/built-in.o: In function `hdpvr_device_release': hdpvr-video.c:(.text+0xf0470): undefined reference to `v4l2_device_unregister' hdpvr-video.c:(.text+0xf0479): undefined reference to `v4l2_ctrl_handler_free' hdpvr-video.c:(.text+0xf048f): undefined reference to `i2c_del_adapter' drivers/built-in.o: In function `hdpvr_open': hdpvr-video.c:(.text+0xf0570): undefined reference to `video_devdata' hdpvr-video.c:(.text+0xf057b): undefined reference to `v4l2_fh_init' hdpvr-video.c:(.text+0xf0583): undefined reference to `v4l2_fh_add' drivers/built-in.o: In function `video_drvdata': hdpvr-video.c:(.text+0xf08a0): undefined reference to `video_devdata' drivers/built-in.o: In function `vidioc_s_dv_timings': hdpvr-video.c:(.text+0xf0d34): undefined reference to `v4l_match_dv_timings' drivers/built-in.o: In function `hdpvr_poll': hdpvr-video.c:(.text+0xf1455): undefined reference to `v4l2_ctrl_poll' drivers/built-in.o: In function `hdpvr_release': hdpvr-video.c:(.text+0xf18f6): undefined reference to `v4l2_fh_release' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1be3): undefined reference to `v4l2_ctrl_handler_init_class' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1c19): undefined reference to `v4l2_ctrl_new_std' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1c42): undefined reference to `v4l2_ctrl_new_std' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1c6b): undefined reference to `v4l2_ctrl_new_std' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1cac): undefined reference to `v4l2_ctrl_new_std' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1cd5): undefined reference to `v4l2_ctrl_new_std' drivers/built-in.o:(.text+0xf1cfe): more undefined references to `v4l2_ctrl_new_std' follow drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1d75): undefined reference to `v4l2_ctrl_new_std_menu' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1d9e): undefined reference to `v4l2_ctrl_new_std_menu' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1dc3): undefined reference to `v4l2_ctrl_new_std_menu' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1de5): undefined reference to `v4l2_ctrl_new_std_menu' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1e18): undefined reference to `v4l2_ctrl_new_std' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1e4b): undefined reference to `v4l2_ctrl_new_std' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1e90): undefined reference to `v4l2_ctrl_cluster' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1e98): undefined reference to `v4l2_ctrl_handler_setup' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1ec1): undefined reference to `video_device_alloc' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1f85): undefined reference to `__video_register_device' drivers/built-in.o: In function `hdpvr_register_videodev': (.text+0xf1fac): undefined reference to `v4l2_ctrl_handler_free' drivers/built-in.o: In function `hdpvr_register_ir_tx_i2c': (.text+0xf238f): undefined reference to `i2c_new_device' drivers/built-in.o: In function `hdpvr_register_ir_rx_i2c': (.text+0xf2434): undefined reference to `i2c_new_device' drivers/built-in.o: In function `hdpvr_register_i2c_adapter': (.text+0xf2514): undefined reference to `i2c_add_adapter' drivers/built-in.o:(.rodata+0x1b368): undefined reference to `video_ioctl2' drivers/built-in.o:(.rodata+0x1b690): undefined reference to `v4l2_ctrl_log_status' drivers/built-in.o:(.rodata+0x1b6f8): undefined reference to `v4l2_ctrl_subscribe_event' drivers/built-in.o:(.rodata+0x1b700): undefined reference to `v4l2_event_unsubscribe' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21[media] hdpvr: Added some error handling in hdpvr_start_streaming()Leonid Kegulskiy
Signed-off-by: Leonid Kegulskiy <leo@lumanate.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21[media] hdpvr: Removed unnecessary get_video_info() call from ↵Leonid Kegulskiy
hdpvr_device_init() Signed-off-by: Leonid Kegulskiy <leo@lumanate.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: allow g/s/enum/querystd when in legacy modeHans Verkuil
Both MythTV and gstreamer expect that they can set/get/query/enumerate the standards, even if the input is the component input for which standards really do not apply. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: add dv_timings supportHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: add g/querystd, remove deprecated current_normHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: recognize firmware version 0x1eHans Verkuil
This is the latest firmware version and - it seems - the most reliable. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: register the video node at the end of probeHans Verkuil
Video nodes can be used at once after registration, so make sure the full initialization is done before registering them. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: small fixesHans Verkuil
- return EBUSY instead of EAGAIN. - add missing break. - remove unnecessary buf type check (done by the core). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: support device_caps in querycapHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: add prio and control event supportHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: remove hdpvr_fh and just use v4l2_fhHans Verkuil
This prepares the driver for priority and control event handling. This patch also checks for correct streaming ownership and it makes a small improvement to the encoder_cmd ioctls: always zero 'flags' and drop the memset of 'raw' as that is already done by the v4l2 core. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] hdpvr: convert to the control frameworkHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2: pass std by value to the write-only s_std ioctlHans Verkuil
This ioctl is defined as IOW, so pass the argument by value instead of by reference. I could have chosen to add const instead, but this is 1) easier to handle in drivers and 2) consistent with the s_std subdev operation. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23[media] hdpvr-video: Use the proper check for I2C supportMauro Carvalho Chehab
As reported by Geert Uytterhoeven <geert@linux-m68k.org>: drivers/media/usb/hdpvr/hdpvr-video.c: warning: "CONFIG_I2C_MODULE" is not defined [-Wundef] Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Thanks-to: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18[media] hdpvr: Fix memory leakSyam Sidhardhan
This patch fixes the print_buf leaking. Signed-off-by: Syam Sidhardhan <s.syam@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06[media] [V2,23/24] usb/hdpvr/hdpvr-i2c.c: use IS_ENABLED() macroPeter Senna Tschudin
replace: #if defined(CONFIG_I2C) || \ defined(CONFIG_I2C_MODULE) with: #if IS_ENABLED(CONFIG_I2C) This change was made for: CONFIG_I2C Reported-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06[media] [V2,22/24] usb/hdpvr/hdpvr-core.c: use IS_ENABLED() macroPeter Senna Tschudin
replace: #if defined(CONFIG_I2C) || \ defined(CONFIG_I2C_MODULE) with: #if IS_ENABLED(CONFIG_I2C) This change was made for: CONFIG_I2C Reported-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-12-27[media] hdpvr: Replace memcpy with struct assignmentEzequiel Garcia
This kind of memcpy() is error-prone. Its replacement with a struct assignment is prefered because it's type-safe and much easier to read. Found by coccinelle. Hand patched and reviewed. Tested by compilation only. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier struct_name; struct struct_name to; struct struct_name from; expression E; @@ -memcpy(&(to), &(from), E); +to = from; // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-11-22[media] drivers/media/usb/hdpvr/hdpvr-core.c: fix error return codePeter Senna Tschudin
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-27[media] rc-core: add separate defines for protocol bitmaps and numbersDavid Härdeman
The RC_TYPE_* defines are currently used both where a single protocol is expected and where a bitmap of protocols is expected. Functions like rc_keydown() and functions which add/remove entries to the keytable want a single protocol. Future userspace APIs would also benefit from numeric protocols (rather than bitmap ones). Keytables are smaller if they can use a small(ish) integer rather than a bitmap. Other functions or struct members (e.g. allowed_protos, enabled_protocols, etc) accept multiple protocols and need a bitmap. Using different types reduces the risk of programmer error. Using a protocol enum whereever possible also makes for a more future-proof user-space API as we don't need to worry about a sufficient number of bits being available (e.g. in structs used for ioctl() calls). The use of both a number and a corresponding bit is dalso one in e.g. the input subsystem as well (see all the references to set/clear bit when changing keytables for example). This patch separate the different usages in preparation for upcoming patches. Where a single protocol is expected, enum rc_type is used; where one or more protocol(s) are expected, something like u64 is used. The patch has been rewritten so that the format of the sysfs "protocols" file is no longer altered (at the loss of some detail). The file itself should probably be deprecated in the future though. Signed-off-by: David Härdeman <david@hardeman.nu> Cc: Andy Walls <awalls@md.metrocast.net> Cc: Maxim Levitsky <maximlevitsky@gmail.com> Cc: Antti Palosaari <crope@iki.fi> Cc: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] v4l2: make vidioc_s_audio constHans Verkuil
Write-only ioctls should have a const argument in the ioctl op. Do this conversion for vidioc_s_audio. Adding const for write-only ioctls was decided during the 2012 Media Workshop. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15[media] move i2c files into drivers/media/i2cMauro Carvalho Chehab
Move ancillary I2C drivers into drivers/media/i2c, in order to better organize them. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15[media] rename most media/video usb drivers to media/usbMauro Carvalho Chehab
Rename all USB drivers with their own directory under drivers/media/video into drivers/media/usb and update the building system. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>