summaryrefslogtreecommitdiffstats
path: root/drivers/staging/tm6000/tm6000-video.c
Commit message (Collapse)AuthorAgeFilesLines
* V4L/DVB: tm6000: bugfix stabilizing urb dataStefan Ringel2010-06-011-2/+2
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: bugfix video imageStefan Ringel2010-06-011-43/+45
| | | | | | | | bugfix: Avoid loosing frames, causing image delays on some of the image lines. [mchehab@redhat.com: Fix compilation breakage by merging with the patch fix] Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: add vbi message inside the type switchStefan Ringel2010-06-011-2/+4
| | | | | | | add case line for vbi message Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: bugfix incorrect sizeStefan Ringel2010-06-011-1/+5
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (13554a): v4l: Use the video_drvdata function in driversMauro Carvalho Chehab2010-05-191-26/+2
| | | | | | | | | | | | | | | Fix all device drivers to use the video_drvdata function instead of maintaining a local list of minor to private data mappings. Call video_set_drvdata to register the driver private pointer when not already done. Where applicable, the local list of mappings is completely removed when it becomes unused. [mchehab.redhat.com: patch broke into two. This one changes just tm6000] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: bugfix image positionStefan Ringel2010-05-191-2/+2
| | | | | | | bugfix incorrect image and line position in videobuffer Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Fix compilation breakage with tm6000Mauro Carvalho Chehab2010-05-191-2/+2
| | | | | | | | | | | | | | | | | | | Randy Dunlap <randy.dunlap@oracle.com> reported a breakage while compiling drivers/staging/tm6000, due to this change: commit 1c1b78bee1a94f98deeb9c24b21c4812e191646c Author: Greg Kroah-Hartman <gregkh@suse.de> Date: Thu Apr 29 15:46:07 2010 -0700 USB: remove unused usb_buffer_alloc and usb_buffer_free macros Now that all callers are converted over, remove the compatibility functions and all is good. As the function got renamed, the rename should also be applied at tm6000. Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: Fix color format with tm6010Mauro Carvalho Chehab2010-05-191-2/+2
| | | | | | | | | | | | | | | | The values for the fourcc format were correct, but applied to the wrong register. With this change, video is now barely working again with tm6000. While here, let's remove, for now, the memset. This way, people can have some image when testing this device. Yet to be fixed: parts of the image frame are missed. As we don't clean the buffers anymore, this is "recovered" by repeating the values from a previous frame. The quality is bad, since the image pixels will contain data from some previous frames, generating weird delay artifacts. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Don't copy outside the bufferMauro Carvalho Chehab2010-05-191-5/+5
| | | | | | | | | | | | | | | | | | | | | tm6000 tm6000_irq_callback :urb resubmit failed (error=-1) BUG: unable to handle kernel paging request at 000000000100f700 IP: [<ffffffffa007ee79>] tm6000_irq_callback+0x51e/0xac7 [tm6000] (gdb) list * tm6000_irq_callback+0x51e 0x2e79 is in tm6000_irq_callback (drivers/staging/tm6000/tm6000-video.c:363). 358 dev->isoc_ctl.tmp_buf_len--; 359 } 360 if (dev->isoc_ctl.tmp_buf_len) { 361 memcpy (&header,p, 362 dev->isoc_ctl.tmp_buf_l$ 363 memcpy (((u8 *)header)+ 364 dev->isoc_ctl.tmp_buf, 365 ptr, 366 4-dev->isoc_ctl.tmp_buf$ 367 ptr+=4-dev->isoc_ctl.tmp_buf_le$ Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Fix a panic if buffer become NULLMauro Carvalho Chehab2010-05-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing a video standard takes a long time to happen on tm6000, since it needs to load another firmware, and the i2c implementation on this device is really slow. When the driver tries to change the video standard, a kernel panic is produced: BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 IP: [<ffffffffa0c7b48a>] tm6000_irq_callback+0x57f/0xac2 [tm6000] ... Kernel panic - not syncing: Fatal exception in interrupt By inspecting it with gdb: (gdb) list *tm6000_irq_callback+0x57f 0x348a is in tm6000_irq_callback (drivers/staging/tm6000/tm6000-video.c:202). 197 /* FIXME: move to tm6000-isoc */ 198 static int last_line = -2, start_line = -2, last_field = -2; 199 200 /* FIXME: this is the hardcoded window size 201 */ 202 unsigned int linewidth = (*buf)->vb.width << 1; 203 204 if (!dev->isoc_ctl.cmd) { 205 c = (header >> 24) & 0xff; 206 Clearly, it was the trial to access *buf, at line 202 that caused the Panic. As ioctl is serialized, While S_STD is handled,QBUF/DQBUF won't be called. So, the driver will run out of the buffers, and *buf will become NULL. As, on tm6000, the same URB can contain more than one video buffer, it is likely to hit a condition where no new buffer is available whily copying the streams. The fix is to leave the URB copy loop, if there's no more buffers are available. The same bug could also be produced by an application that is not fast enough to request new video buffers. The same bug were reported by Bee Hock Goh <beehock@gmail.com>. Thanks-to: Bee Hock Goh <beehock@gmail.com> for reporting the bug Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Properly set alternate when preparing to streamMauro Carvalho Chehab2010-05-191-8/+13
| | | | | | | | | | Although the code is getting the better alternates, it is not really using it. Get the interface/alternate numbers and use it where needed. This patch implements also one small fix at the last_line set, as proposed by Bee Hock Goh <behock@gmail.com>. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: TM6000: Fix code which cause memory corruptionBee Hock Goh2010-05-191-1/+1
| | | | | | | | | | The driver was doing malloc when buf is null causing memory corruption. The analog part is still pretty much broken but at least fixing this will stop it from crashing the machine when streamon. Signed-off-by: Bee Hock Goh <beehock@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Replace all magic values by a register aliasMauro Carvalho Chehab2010-05-181-8/+8
| | | | | | | | | | | | | | Instead of using magic pairs of req/reg, replace them by the defined values. This patch were generated by the following script: cat tm6000-regs.h |perl -ne 'if (m/(TM6010_REQ[^\s]+)\s+0x([a-f0-9]+)\, 0x([a-f0-9]+)/) { $name="$1"; $req=$2; $val=$3; printf "s/REQ_${req}_SET_GET_AVREG[_BIT]*, 0x[0]*$3,/$1,/\n" }' >a; for i in tm*.c; do sed -f a $i >b && mv b $i; done Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: fix some info messagesDmitri Belimov2010-05-181-3/+3
| | | | | | | Fix some messages for add information about TM6010 Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: drivers/staging/tm6000/tm6000-video.c: correct NULL testJulia Lawall2010-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test the just-allocated value for NULL rather than some other value. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,y; statement S; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ( if ((x) == NULL) S | if ( - y + x == NULL) S ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (13556a): v4l: Remove unneeded video_device::minor assignmentsLaurent Pinchart2010-05-181-1/+0
| | | | | | | | | | | | | Now that the video_device registration is tested using video_is_registered(), drivers don't need to initialize the video_device::minor field to -1 anymore. Remove those unneeded assignments. [mchehab.redhat.com: apply just the tm6000 changes on a separate patch] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (13555a): v4l: Use video_device_node_name() instead of the minor numberMauro Carvalho Chehab2010-05-181-10/+12
| | | | | | | | | | | | Instead of using the minor number in kernel log messages, use the device node name as returned by the video_device_node_name() function. This makes debug, informational and error messages easier to understand for end users. [mchehab.redhat.com: apply just the tm6000 changes on a separate patch] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12853): tm6000: Fix almost all warnings at the driverMauro Carvalho Chehab2010-05-181-7/+6
| | | | | | | | | | Onr warning is left, since it is there for a purpose: tm6000-core.c:218: warning: ISO C90 forbids mixed declarations and code It indicates a place where a temporary hack were added. Tests are needed to be sure that we can remove it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12852): tm6000: Fix compilation against 2.6.31Mauro Carvalho Chehab2010-05-181-3/+4
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12845): tm6000: more buffer handling fixesMauro Carvalho Chehab2010-05-181-15/+34
| | | | | | Before this patch, we were writing outside vmalloced buffer Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12844): tm6000: avoid writing on a floating pointerMauro Carvalho Chehab2010-05-181-0/+1
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12842): tm6000: avoid kernel panic while retrieving the filling bufferMauro Carvalho Chehab2010-05-181-25/+42
| | | | | | | Instead of storing next buf on a temp var, saved over URB processing, restore it using get_next_buf. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12841): tm6000: Fix compilation with newer v4l2-dev APIMauro Carvalho Chehab2010-05-181-34/+38
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12836): tm6000: revert to an old way to copy videoMauro Carvalho Chehab2010-05-181-196/+191
| | | | | | The new way is causing machine hangups. This one works. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12835): tm6000: Cleanups to work like em28xx-videoMauro Carvalho Chehab2010-05-181-165/+16
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12829): tm6000: several changes on usb preparation trying to avoid ↵Mauro Carvalho Chehab2010-05-181-47/+49
| | | | | | -EPROTO errors Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12828): tm6000: fixes several CodingStyle and do some cleanupsMauro Carvalho Chehab2010-05-181-167/+146
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12827): tm6000: fix image hangsMauro Carvalho Chehab2010-05-181-48/+26
| | | | | | | A previous committed patch hanged image output. This patch corrects this issue. It also warrants that buffer is updated for each frame0+frame1 frame set. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12823): tm6000: Uses another method for handling incomplete packetsMauro Carvalho Chehab2010-05-181-127/+122
| | | | | | | This requires a little more memory, and some memcpy to work, but the logic is simpler than the previous method. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12815): tm6000: follow videobuf API changesMauro Carvalho Chehab2010-05-181-15/+15
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12805): tm6000: Fix a memory leak at tm6000-videoMauro Carvalho Chehab2010-05-181-0/+1
| | | | | | | | | | if a transfer buffer allocation fails, the last allocated urb is leaked (it hasn't been stored in dev->urb[] yet so tm6000_uninit_isoc misses it). The patch also includes a small typo fix. Thanks to Florin Malita <fmalita@gmail.com> for pointing this. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12803): tm6000: make tm6000_devused staticMauro Carvalho Chehab2010-05-181-2/+0
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12800): tm6000: fix tm6000 analog video buffer handlingMauro Carvalho Chehab2010-05-181-58/+140
| | | | | | | | | | | | | | Previously, there were no sync between video buffer filling and received URBs. So, the presented image were a mix of frame and frame-1. Now, a filled buffer should contain only data for that frame. allocates a maximum of 64 KB per each URB area. This fixed two bugs: - Sometimes, there were no available continuos block of about 1 MB; - Image weren't not properly updated, since parts of the URBs aren't updated. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12799): tm6000: avoid troubles if a header is broken on separate URBsMauro Carvalho Chehab2010-05-181-13/+43
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12798): tm6000: Split header processing from header findMauro Carvalho Chehab2010-05-181-76/+87
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12797): tm6000: Allow selecting audio bitrateMauro Carvalho Chehab2010-05-181-10/+27
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12795): tm6000: Fix buffering sizeMauro Carvalho Chehab2010-05-181-0/+4
| | | | | | At the first time an application were called, resolutions were wrong. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12794): tm6000: handle also PAL/SECAM resolutionsMauro Carvalho Chehab2010-05-181-22/+9
| | | | | | Fix the resolutions for 625 line video standards (european PAL/SECAM) Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12791): tm6000: fix poll() methodMauro Carvalho Chehab2010-05-181-3/+2
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12790): tm6000: check for errors on usb->statusMauro Carvalho Chehab2010-05-181-34/+51
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12784): tm6000: Some cleanups at the driverMauro Carvalho Chehab2010-05-181-2/+0
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12782): tm6000: Correct some device capabilitiesMichel Ludwig2010-05-181-1/+14
| | | | | | | | Add tuner reset GPIO and demodulator address fields to the tm6000_core struct. Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12776): tm6000: decrement users countMauro Carvalho Chehab2010-05-181-2/+6
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12775): tm6000: fix usb_submit_urb to be called inside interrupt ↵Michel Ludwig2010-05-181-1/+1
| | | | | | | context Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12774): tm6000: fix module load/unloadMichel Ludwig2010-05-181-9/+22
| | | | | Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12773): tm6000: fix module unregisterMichel Ludwig2010-05-181-1/+1
| | | | | Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12772): tm6000: fix module load/unloadMichel Ludwig2010-05-181-6/+5
| | | | | Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12770): Add tm6000 driver to staging treeMauro Carvalho Chehab2010-05-181-0/+1559
Adds a driver for Trident TV Master tm5600/tm6000 chips. Those USB devices are usually found with a Xceive xc2028/xc3028 tuner, although the firmware seems to be modified to work with those chips on some older devices. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
OpenPOWER on IntegriCloud