summaryrefslogtreecommitdiffstats
path: root/drivers/staging/tm6000/tm6000-core.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] move tm6000 to drivers/media/videoMauro Carvalho Chehab2011-09-231-965/+0
| | | | | | The serious bugs got fixed already. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Fix some CodingStyle issuesMauro Carvalho Chehab2011-09-231-10/+10
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Add fast USB access quirkThierry Reding2011-09-211-1/+2
| | | | | | | | | Some devices support fast access to registers using the USB interface while others require a certain delay after each operation. This commit adds a quirk that can be enabled by devices that don't need the delay. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Don't try to use a non-existing interfaceMauro Carvalho Chehab2011-09-011-0/+6
| | | | | | | | | | | | | | | > [34883.426065] tm6000 #0: registered device video0 > [34883.430591] Trident TVMaster TM5600/TM6000/TM6010 USB2 board (Load status: 0) > [34883.437763] usbcore: registered new interface driver tm6000 > [34884.608372] BUG: unable to handle kernel NULL pointer dereference at 00000002 > [34884.615514] IP: [<f8c4ceea>] tm6000_reset+0xd7/0x11c [tm6000] The dev->int_in USB interfaces is used by some devices for the Remote Controller. Not all devices seem to define this interface, so, tm6000_reset should not try to set the interface to it on such devices. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Execute lightweight reset on closeThierry Reding2011-08-311-0/+43
| | | | | | | | | | | 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: Add locking for USB transfersThierry Reding2011-08-311-1/+3
| | | | | | | | | This commit introduces the usb_lock mutex to ensure that a USB request always gets the proper response. While this is currently not really necessary it will become important as there are more users. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Disable video interface in radio modeThierry Reding2011-08-311-1/+6
| | | | | | | | | Video data is useless in radio mode, so the corresponding interface can be safely disabled. This should reduce the amount of isochronous traffic noticeably. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Rename active interface registerThierry Reding2011-08-311-6/+6
| | | | | | | | The register ACTIVE_VIDEO_IF register should be named ACTIVE_IF since it controls more than just the video interface. 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-9/+8
| | | | | | | | 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>
* [media] tm6000: remove unused exportsStefan Ringel2011-05-201-3/+0
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: remove input selectStefan Ringel2011-05-201-8/+0
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: move from tm6000_set_reg to tm6000_set_reg_maskStefan Ringel2011-05-201-16/+10
| | | | | | | move from tm6000_set_reg to tm6000_set_reg_mask 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-10/+2
| | | | | | | change input control Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: change to virtual inputsStefan Ringel2011-05-201-27/+33
| | | | | | | change to virtual inputs Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: add radio support to the driverDmitri Belimov2011-03-211-36/+224
| | | | | | | | | | | | | | | | | | | | | | 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: relabeling any registersStefan Ringel2011-03-211-25/+39
| | | | | | | relabeling any registers Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tm6000: Fix mutex unbalanceDmitri Belimov2010-12-291-1/+1
| | | | | | | | | | | Hi Fix never unlocked mutex. No more crash after removing USB stick. 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 revision checkStefan Ringel2010-12-291-7/+20
| | | | | | | adding chip revision check Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6Linus Torvalds2010-10-281-4/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (841 commits) Staging: brcm80211: fix usage of roundup in structures Staging: bcm: fix up network device reference counting Staging: keucr: fix up US_ macro change staging: brcm80211: brcmfmac: Removed codeversion from firmware filenames. staging: brcm80211: Remove unnecessary header files. staging: brcm80211: Remove unnecessary includes from bcmutils.c staging: brcm80211: Removed unnecessary pktsetprio() function. Staging: brcm80211: remove typedefs.h Staging: brcm80211: remove uintptr typedef usage Staging: hv: remove struct vmbus_channel_interface Staging: hv: remove Open from struct vmbus_channel_interface Staging: hv: storvsc: call vmbus_open directly Staging: hv: netvsc: call vmbus_open directly Staging: hv: channel: export vmbus_open to modules Staging: hv: remove Close from struct vmbus_channel_interface Staging: hv: netvsc: call vmbus_close directly Staging: hv: storvsc: call vmbus_close directly Staging: hv: channel: export vmbus_close to modules Staging: hv: remove SendPacket from struct vmbus_channel_interface Staging: hv: storvsc: call vmbus_sendpacket directly ... Fix up conflicts in drivers/staging/cx25821/cx25821-audio-upstream.c drivers/staging/cx25821/cx25821-audio.h due to warring whitespace cleanups (neither of which were all that great)
| * staging: Drop unnecessary null testJulia Lawall2010-08-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ iterator I; expression x; statement S; @@ I(x,...) { <... - if (x != NULL || ...) S ...> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | [media] tm6000: fix a macro coding style issueRuslan Pisarev2010-10-231-1/+1
| | | | | | | | | | | | | | | | | | This is a patch to the tm6000-core.c file that fixed up a macros error and error initialise statics to 0 found by the checkpatch.pl tools. [mchehab@redhat.com: removed a merge conflict and add spaces between binary operator] Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | tm6000: Remove some ugly debug codeMauro Carvalho Chehab2010-10-231-10/+2
| | | | | | | | | | | | | | | | Those time debugs were here just while developing the driver. They are not really needed, as kernel may be configured to print jiffies with printk's. Also, it breaks, if more than one device is connected. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | [media] tm6000: fix comments coding style issue in group of filesRuslan Pisarev2010-10-211-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a patch to the tm6000-cards.c tm6000-core.c tm6000-dvb.c tm6000-i2c.c tm6000-input.c tm6000-regs.h tm6000-stds.c tm6000-usb-isoc.h tm6000.h files that fixed up a comments warnings found by the checkpatch.pl tools. Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | [media] tm6000: Use just one lock for devlistMauro Carvalho Chehab2010-10-211-9/+4
| | | | | | | | | | | | This avoids a race condition Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | [media] tm6000: don't use BKL at the driverMauro Carvalho Chehab2010-10-211-2/+0
| | | | | | | | | | | | 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-19/+30
| | | | | | | | | | | | | | | | 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-39/+5
| | | | | | | | | | | | | | 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>
* | [media] staging/tm6000: Fix a warning messageMauro Carvalho Chehab2010-10-211-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I added a code to the driver to force it to produce a warning. This were intended to remind me about a very bad hack. I never found a way to workaround. So, instead of those warnings: drivers/staging/tm6000/tm6000-core.c: In function ‘tm6000_init_analog_mode’: drivers/staging/tm6000/tm6000-core.c:328: warning: ISO C90 forbids mixed declarations and code Let's document the issue and hope if someone with the support of the vendor might fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | V4L/DVB: tm6000+audioDmitri Belimov2010-10-211-1/+0
|/ | | | | | | | | | | | | | | 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: tm6000: Improve set bitrate routines used by alsaMauro Carvalho Chehab2010-08-021-1/+10
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000-alsa: Fix several bugs at the driver initialization codeMauro Carvalho Chehab2010-08-021-3/+3
| | | | | | | | There are several missing things at the driver, preventing, for example, the code to start/stop DMA to actually work. Fix them before implementing a routine to store data at the audio buffers. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Add a callback code for buffer fillMauro Carvalho Chehab2010-08-021-0/+17
| | | | | | | 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: Staging: tm6000: Fix coding style issuesTimofey Trofimov2010-08-021-78/+71
| | | | | | | | | | Fixed coding style issues founded by checkpatch.pl in files: tm6000-alsa.c,tm6000-cards, tm6000-core.c, tm6000-dvb.c, tm6000-i2c.c, tm6000-stds.c, tm6000-usb-isoc.h, tm6000.h [mchehab@redhat.com: Fix some compilation breakages] Signed-off-by: Timofey Trofimov <tumoxep@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: move dvb into a separate kern moduleStefan Ringel2010-08-021-0/+1
| | | | | | | | | move dvb into a separate kern module [mchehab@redhat.com: Fix several compilation breakages] Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* v4l-dvb: update gfp/slab.h includesTejun Heo2010-06-281-0/+1
| | | | | | | | | | Implicit slab.h inclusion via percpu.h is about to go away. Make sure gfp.h or slab.h is included as necessary. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
* V4L/DVB: tm6000: Add control to the power ledStefan Ringel2010-06-011-0/+13
| | | | | | | Turn power led off, if device is disconnected Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000, reset I2C bus functionDmitri Belimov2010-06-011-0/+16
| | | | | | | Add new function for reset I2C bus. Rework some code for use this function. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: add extension module supportStefan Ringel2010-06-011-0/+92
| | | | | | | add module init over tm6000 extension Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: Fix color format with tm6010Mauro Carvalho Chehab2010-05-191-2/+5
| | | | | | | | | | | | | | | | 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: bugfix analog init for tm6010Stefan Ringel2010-05-191-3/+94
| | | | | | | | | - change values in function tm6000_set_fourcc_format - disable digital source - add vbi and audio init Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: request labeling board version checkStefan Ringel2010-05-191-2/+16
| | | | | | | request labeling board version check Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: replace occurences of req05 magic by a naming aliasMauro Carvalho Chehab2010-05-181-2/+2
| | | | | | | | | | | | Yet another naming replace magic thanks to perl scripts. This time, it is done with: 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_USBREG, 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: Replace all magic values by a register aliasMauro Carvalho Chehab2010-05-181-179/+179
| | | | | | | | | | | | | | 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-1/+1
| | | | | | | 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: tm6000: add additional init register for tm6010Stefan Ringel2010-05-181-0/+7
| | | | | Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: fix build errorsRandy Dunlap2010-05-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) tm6000 uses usb_*() interfaces, so it should depend on USB. drivers/built-in.o: In function `tm6000_usb_disconnect': tm6000-cards.c:(.text+0x4abb44): undefined reference to `usb_put_dev' drivers/built-in.o: In function `tm6000_usb_probe': tm6000-cards.c:(.text+0x4ac923): undefined reference to `usb_get_dev' tm6000-cards.c:(.text+0x4ac93c): undefined reference to `usb_set_interface' drivers/built-in.o: In function `tm6000_read_write_usb': (.text+0x4ad274): undefined reference to `usb_control_msg' drivers/built-in.o: In function `tm6000_uninit_isoc': tm6000-video.c:(.text+0x4b00d5): undefined reference to `usb_kill_urb' tm6000-video.c:(.text+0x4b00e4): undefined reference to `usb_unlink_urb' tm6000-video.c:(.text+0x4b013c): undefined reference to `usb_buffer_free' tm6000-video.c:(.text+0x4b014b): undefined reference to `usb_free_urb' drivers/built-in.o: In function `tm6000_prepare_isoc': tm6000-video.c:(.text+0x4b0773): undefined reference to `usb_alloc_urb' tm6000-video.c:(.text+0x4b0835): undefined reference to `usb_buffer_alloc' drivers/built-in.o: In function `tm6000_irq_callback': tm6000-video.c:(.text+0x4b1ad3): undefined reference to `usb_submit_urb' drivers/built-in.o: In function `tm6000_module_init': tm6000-cards.c:(.init.text+0x24499): undefined reference to `usb_register_driver' drivers/built-in.o: In function `tm6000_module_exit': tm6000-cards.c:(.exit.text+0x5cb0): undefined reference to `usb_deregister' (2) tm6000-alsa uses interfaces from tm6000-core, so when they are both built as modules, the core interfaces need to be exported. ERROR: "tm6000_set_reg" [drivers/staging/tm6000/tm6000-alsa.ko] undefined! ERROR: "tm6000_get_reg" [drivers/staging/tm6000/tm6000-alsa.ko] undefined! Cc: linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>, linux-media@vger.kernel.org Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: move board-specific init to tm6000-cardsMauro Carvalho Chehab2010-05-181-47/+2
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: Allow tm6000 driver compilationMauro Carvalho Chehab2010-05-181-1/+0
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: tm6000: add digital init for tm6010Stefan Ringel2010-05-181-26/+46
| | | | | | | | The init sequence requires extra initialization for tm6010 in digital mode. Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (12852): tm6000: Fix compilation against 2.6.31Mauro Carvalho Chehab2010-05-181-1/+1
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
OpenPOWER on IntegriCloud