summaryrefslogtreecommitdiffstats
path: root/drivers/staging/tm6000/tm6000-video.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] move tm6000 to drivers/media/videoMauro Carvalho Chehab2011-09-231-1813/+0
| | | | | | The serious bugs got fixed already. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Do not use video buffers in radio modeThierry Reding2011-08-311-8/+10
| | | | | | | | If the radio device is opened there is no need to initialize the video buffer queue because it is not used. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Execute lightweight reset on closeThierry Reding2011-08-311-0/+7
| | | | | | | | | | | When the last user closes the device, perform a lightweight reset of the device to bring it into a well-known state. Note that this is not always enough with the TM6010, which sometimes needs a hard reset to get into a working state again. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Initialize isochronous transfers only onceThierry Reding2011-08-311-6/+2
| | | | | | | | | This fixes a memory leak where isochronous buffers would be set up for each video buffer, while it is sufficient to set them up only once per device. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Flesh out the IRQ callbackThierry Reding2011-08-311-1/+13
| | | | | | | | This brings the IRQ callback implementation more in line with how other drivers do it. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Miscellaneous cleanupsThierry Reding2011-08-311-44/+31
| | | | | | | | This commit fixes a number of coding style issues as well as some issues reported by checkpatch and sparse. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Staging: tm6000: remove unneeded check in get_next_buf()Dan Carpenter2011-07-081-3/+0
| | | | | | | | | | | | We dereference "buf" on the line before so if it were NULL here we would have OOPsed earlier. Also list_entry() never returns NULL. And finally, we handled the situation where the list is empty earlier in the function. So this test isn't needed and I've removed it. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Remove unneeded version.h includes (and add where needed) for drivers/tm6000/Jesper Juhl2011-07-051-1/+0
| | | | | | | | | | It was pointed out by 'make versioncheck' that linux/version.h was not always being included where needed and sometimes included needlessly in drivers/staging/tm6000/. This patch fixes up the includes. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: tm6000: cleaned up code in tm6000-video.c according to coding styleCurtis McEnroe2011-06-281-19/+20
| | | | | | | | Fixed all errors reported by the checker in tm6000-video.c mostly relating to whitespace. Signed-off-by: Curtis McEnroe <programble@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [media] tm6000: fix uninitialized field, change prink to dprintkStefan Ringel2011-05-211-1/+4
| | | | | | | fix uninitialized field, change prink to dprintk Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: add pts loggingStefan Ringel2011-05-201-1/+5
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: change from ioctl to unlocked_ioctlStefan Ringel2011-05-201-4/+4
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: all audio packets must swabStefan Ringel2011-05-201-8/+5
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: change input controlStefan Ringel2011-05-201-6/+3
| | | | | | | change input control Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: vitual input enumsStefan Ringel2011-05-201-43/+57
| | | | | | | vitual input enums Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: add tm6010 audio mode setupStefan Ringel2011-05-201-12/+23
| | | | | | | add tm6010 audio mode setup Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: add radio capabilitiesStefan Ringel2011-05-201-16/+18
| | | | | | | add radio capabilities Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: fix vbuf may be used uninitializedJarod Wilson2011-05-201-2/+2
| | | | | | | | | | | | | | | In commit 8aff8ba95155df, most of the manipulations to vbuf inside copy_streams were gated on if !dev->radio, but one place that touches vbuf lays outside those gates -- a memcpy of vbuf isn't NULL. If we initialize vbuf to NULL, that memcpy will never happen in the case where we do have dev->radio, and otherwise, in the !dev->radio case, the code behaves exactly like it did prior to 8aff8ba95155df. While we're at it, also fix an incorrectly indented closing brace for one of the sections touching vbuf that is conditional on !dev->radio. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* [media] tm6000: fix s-video inputDmitri Belimov2011-03-221-4/+13
| | | | | | | | | | | | | | | | | | | | | Add compatibility for composite and s-video inputs. Some TV cards hasn't it. Fix S-Video input, the s-video cable has only video signals no audio. Call the function of audio configure kill chroma in signal. only b/w video. Known bugs: - after s-video the audio for radio didn't work, TV crashed hardly - after composite TV crashed hardly too. P.S. After this patch I'll want to rework the procedure of configure video. Now it has a lot of junk and dubles. With my best regards, Dmitry. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: add radio support to the driverDmitri Belimov2011-03-211-39/+288
| | | | | | | | | | | | | | | | | | | | | | Changes: Add function tm6000_set_reg_mask for change some bits in regs. Very usefull, simplify some code with this function. Add control mute Add control volume Add control audio input MUX Add support radio Radio works well. TV works too Known bugs: The programm gnomeradio can't set freq for radio, it use old v4l API. Audio over USB works via arecord. The programm mplayer can set freq but no any audio mplayer -v -rawaudio rate=48000 radio://105.2/capture driver=v4l2:alsa:adevice=hw.1,0:amode=1:audiorate=48000:forceaudio:immediatemode=0 When start watch TV very shortly after radio the kernel crashed hardly. Didn't stop all USB URBs, need some time for stop. [mchehab@redhat.com: fix merge conflicts] Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: rework init codeDmitri Belimov2011-01-191-10/+36
| | | | | | | | Rework device init part. Move common code part to a function. Usefull for register multiple devices like video, radio, vbi etc. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: rework and fix IRDmitri Belimov2010-12-291-0/+5
| | | | | | | | | | | | | | | | Hi This patch didn't kill Stefan's remotes and just for upload my good part of code. 1. Add some code for show IR activity 2. Add filter for IR remotes 3. Split remotes to different types. 4. Fix stop interrupt pipe when isoc pipe started. When we decide general way of IR I'll add support our remotes. For our customers I'll made custom temporary patch without this part. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] V4L: remove V4L1 compatibility modeHans Verkuil2010-12-291-12/+0
| | | | | Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: bugfix set tv standardsStefan Ringel2010-11-091-0/+1
| | | | | | | bugfix set tv standards Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] Staging: tm6000: fix braces, tabs, comments and space coding style ↵Ruslan Pisarev2010-10-211-172/+173
| | | | | | | | | | | issue in tm6000-video.c This is a patch to the tm6000-video.c file that fixed up a braces, tabs, comments and space Errors and Warnings found by the checkpatch.pl tools. [mchehab@redhat.com: some changes didn't apply as it were based to an older version, so used patch -f to apply only the changes that are OK] Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: fix resource lockingMauro Carvalho Chehab2010-10-211-14/+42
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: don't use BKL at the driverMauro Carvalho Chehab2010-10-211-14/+7
| | | | | | Instead, use core lock handling. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] V4L-DVB: tm6000: Move VBI init to a separate functionMauro Carvalho Chehab2010-10-211-9/+7
| | | | | | | | While here, documment that VBI may need changes, based on video STD, and do some cleanup at device init, to be sure that VBI init will happen all the times, and to remove a duplicated video standard call. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: add audio standards tableMauro Carvalho Chehab2010-10-211-5/+7
| | | | | | | The better is to remove the audio init from tm6000-core and add a separate per-standard set of tables. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000+audioDmitri Belimov2010-10-211-0/+8
| | | | | | | | | | | | | | | I rework my last patch for audio and now audio works well. This patch can be submited to GIT tree Quality of audio now is good for SECAM-DK. For other standard I set some value from datasheet need some tests. 1. Fix pcm buffer overflow 2. Rework pcm buffer fill method 3. Swap bytes in audio stream 4. Change some registers value for TM6010 5. Change pcm buffer size Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: videobuf: add ext_lock argument to the queue init functionsHans Verkuil2010-10-211-1/+1
| | | | | | | | | Add an ext_lock argument to the videobuf init functions. This allows drivers to pass the vdev->lock pointer (or any other externally held lock) to videobuf. For now all drivers just pass NULL. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Partially revert some copybuf logicMauro Carvalho Chehab2010-08-021-2/+2
| | | | | | | | | | | Partially revert changeset 0208bef609242a2d50b95edc713a41566cae500b: As pointed by Stefan Ringel <stefan.ringel@arcor.de>, many packets become damaged by this change. That means that the "size" field of Video/VBI is not presenting 180 bytes, as it should be expected. Thanks-to: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Be sure that the new buffer is emptyMauro Carvalho Chehab2010-08-021-2/+1
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Fix copybuf continue logicMauro Carvalho Chehab2010-08-021-3/+3
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: audio packet has always 180 bytesMauro Carvalho Chehab2010-08-021-1/+4
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: avoid unknown symbol tm6000_debugMauro Carvalho Chehab2010-08-021-0/+1
| | | | | | | Reported by Stefan Ringel. Thanks-to: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Add a callback code for buffer fillMauro Carvalho Chehab2010-08-021-1/+1
| | | | | | | Implements a callback to be used by tm6000-alsa, in order to allow filling audio data packets. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: rewrite copy_streamsStefan Ringel2010-08-021-210/+118
| | | | | | | | Merge function copy streams() and copy_packets() into a new function copy_streams(), fixing the bugs. Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* 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>