Commit Graph

260 Commits (70e522a02838e52ca007d3f183171fd9324eceb4)

Author SHA1 Message Date
Mauro Carvalho Chehab 6bda96447c [media] rc: rename the remaining things to rc_core
The Remote Controller subsystem is meant to be used not only by Infra Red
but also for similar types of Remote Controllers. The core is not specific
to Infra Red. As such, rename:
	- ir-core.h to rc-core.h
	- IR_CORE to RC_CORE
	- namespace inside rc-core.c/rc-core.h

To be consistent with the other changes.

No functional change on this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:50 -02:00
Jean Delvare 62c7cdd8a1 [media] TM6000: Drop unused macro
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Michel Ludwig <michel.ludwig@gmail.com>
Cc: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:45 -02:00
Jean Delvare 7bd444ede7 [media] TM6000: Clean-up i2c initialization
Usage of templates for large structures is a bad idea, as it wastes a
lot of space. Manually initializing the few fields we need is way more
efficient.

Also set the algorithm data const, use strlcpy instead of strcpy, fix
a small race (device data must always be set before registering said
device) and properly return error on adapter registration failure.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Michel Ludwig <michel.ludwig@gmail.com>
Cc: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:45 -02:00
Stefan Ringel c1937f8e34 [media] tm6000: add revision check
adding chip revision check

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:44 -02:00
David Härdeman d8b4b5822f [media] ir-core: make struct rc_dev the primary interface
This patch merges the ir_input_dev and ir_dev_props structs into a single
struct called rc_dev. The drivers and various functions in rc-core used
by the drivers are also changed to use rc_dev as the primary interface
when dealing with rc-core.

This means that the input_dev is abstracted away from the drivers which
is necessary if we ever want to support multiple input devs per rc device.

The new API is similar to what the input subsystem uses, i.e:
rc_device_alloc()
rc_device_free()
rc_device_register()
rc_device_unregister()

[mchehab@redhat.com: Fix compilation on mceusb and cx231xx, due to merge conflicts]
Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:37 -02:00
David Härdeman 62c6503125 [media] ir-core: remove remaining users of the ir-functions keyhandlers
This patch removes the remaining usages of the ir_input_nokey() and
ir_input_keydown() functions provided by drivers/media/IR/ir-functions.c
by using the corresponding functionality in ir-core instead.

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:35 -02:00
Laurent Pinchart 9a1f8b34aa [media] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions
The argument isn't used anymore by the functions, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-22 11:56:26 -02:00
Stefan Ringel 4f52610e29 [media] tm6000: bugfix set tv standards
bugfix set tv standards

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-09 15:03:20 -02:00
Jean Delvare cbf4bd380a i2c: Drop unused I2C_CLASS_TV flags
There are no users left for I2C_CLASS_TV_ANALOG and
I2C_CLASS_TV_DIGITAL, so we can get rid of them.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-31 21:06:59 +01:00
Linus Torvalds f063a0c0c9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 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)
2010-10-28 12:13:00 -07:00
Greg Kroah-Hartman e4c5bf8e3d Merge 'staging-next' to Linus's tree
This merges the staging-next tree to Linus's tree and resolves
some conflicts that were present due to changes in other trees that were
affected by files here.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-28 09:44:56 -07:00
Ruslan Pisarev 4363a0b834 [media] tm6000: fix a macro coding style issue
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>
2010-10-23 01:29:28 -02:00
Mauro Carvalho Chehab 638054ab02 tm6000: Remove some ugly debug code
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>
2010-10-23 01:26:29 -02:00
Laurent Pinchart 1532a07042 [media] v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev*
With the v4l2_i2c_new_subdev* functions now supporting loading modules
based on modaliases, replace the hardcoded module name passed to those
functions by NULL.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the drivers
modified here use.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-22 21:50:56 -02:00
Ruslan Pisarev 40004e24c4 [media] tm6000: fix macros and comments coding style issue in tm6000.h
This is a patch to the tm6000.h file that fixed up a macros and
comment error found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 14:02:44 -02:00
Ruslan Pisarev 51a5d39610 [media] Staging: tm6000: Delete braces from return in tm6000-cards.c
This is a patch to the tm6000-cards.c file that fixed up
a space error found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 14:01:55 -02:00
Ruslan Pisarev d0058645c6 [media] tm6000: fix comments coding style issue in group of files
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>
2010-10-21 14:01:22 -02:00
Ruslan Pisarev 60fbfdfd8c [media] Staging: tm6000: fix braces, tabs, comments and space coding style 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>
2010-10-21 13:59:23 -02:00
Ruslan Pisarev d7fe4a602d [media] tm6000: don't initialize static var on tm6000-i2c.c
This is a patch to the tm6000-i2c.c file that fixed "ERROR: do not
initialise statics to 0 or NULL" found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 13:55:07 -02:00
Mauro Carvalho Chehab 9efd85dfff [media] tm6000: fix resource locking
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 11:36:26 -02:00
Mauro Carvalho Chehab 4ae1839800 [media] tm6000: Use just one lock for devlist
This avoids a race condition

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 11:36:18 -02:00
Mauro Carvalho Chehab 06f08e3a4d [media] tm6000-alsa: fix some locking issues
Those locking issues affect tvtime, causing a kernel oops/panic, due to
a race condition.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 11:36:07 -02:00
Mauro Carvalho Chehab dc961136b9 [media] tm6000: don't use BKL at the driver
Instead, use core lock handling.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 11:35:25 -02:00
Mauro Carvalho Chehab c47d3e7f94 [media] Add a todo file for staging/tm6000
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 07:54:11 -02:00
Mauro Carvalho Chehab 589851d599 [media] V4L-DVB: tm6000: Move VBI init to a separate function
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>
2010-10-21 01:17:53 -02:00
Dmitry Belimov 421d1b7071 [media] tm6000: Improve audio standards handling and add SECAM-DK
Rework audio. Add SECAM-DK, move SECAM to SECAM-B | SECAM-G.

Add some new audio standards and tricks for future, see
tm6000_set_audio_std.

For SECAM-DK it works.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:17:52 -02:00
Mauro Carvalho Chehab 709944eae2 [media] tm6000: add audio standards table
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>
2010-10-21 01:17:51 -02:00
Mauro Carvalho Chehab 94d4350c54 [media] staging/tm6000: Fix a warning message
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>
2010-10-21 01:17:02 -02:00
Mauro Carvalho Chehab be737a8269 V4L/DVB: tm6000: Fix warnings due to a small array size
drivers/staging/tm6000/tm6000-stds.c:101: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:101: warning: (near initialization for ‘tv_stds[0].common’)
drivers/staging/tm6000/tm6000-stds.c:160: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:160: warning: (near initialization for ‘tv_stds[1].common’)
drivers/staging/tm6000/tm6000-stds.c:219: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:219: warning: (near initialization for ‘tv_stds[2].common’)
drivers/staging/tm6000/tm6000-stds.c:336: warning: excess elements in array initializer
drivers/staging/tm6000/tm6000-stds.c:336: warning: (near initialization for ‘tv_stds[4].common’)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:16:57 -02:00
Dmitri Belimov 73f4d265f6 V4L/DVB: tm6000+audio
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>
2010-10-21 01:06:20 -02:00
Hans Verkuil 08bff03ed6 V4L/DVB: videobuf: add ext_lock argument to the queue init functions
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>
2010-10-21 01:06:14 -02:00
Hans Verkuil 8dd4eddaf7 V4L/DVB: tm6000: removed unused i2c adapter ID
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:06:05 -02:00
Stefan Ringel 401ad27867 V4L/DVB: tm6000: bugfix param string
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21 01:04:49 -02:00
Tracey Dent ea195d1a7f Staging: tm6000: Makefile: replace the use of <module>-objs with <module>-y
Changed <module>-objs to <module>-y in Makefile.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:23:41 -07:00
Tracey Dent bee9f581f0 Staging: tm6000: Makefile: cleaned up Makefile cflag lines
Changed to use the proper ccflags-y option

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 11:56:39 -07:00
Stefan Ringel 1b376dac05 V4L/DVB: tm6000: bugfix data handling
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:22:02 -03:00
Randy Dunlap fb0c484f72 V4L/DVB: tm6000: depends on IR_CORE
tm6000 uses IR interfaces, so it should depend on IR_CORE.

ERROR: "get_rc_map" [drivers/staging/tm6000/tm6000.ko] undefined!
ERROR: "ir_input_unregister" [drivers/staging/tm6000/tm6000.ko] undefined!
ERROR: "__ir_input_register" [drivers/staging/tm6000/tm6000.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27 22:21:43 -03:00
Kulikov Vasiliy cd6541c03d staging: tm6000: fix memory leak
Original code doesn't call kfree(chip) on error.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 14:51:52 -07:00
Julia Lawall a3d7fc5ce9 staging: Drop unnecessary null test
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>
2010-08-31 11:13:15 -07:00
Mauro Carvalho Chehab 02c71055e5 V4L/DVB: tm6000-input: Make checkpatch.pl happy
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 15:29:35 -03:00
Stefan Ringel d064f96065 V4L/DVB: tm6000: add ir support
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 15:29:31 -03:00
Mauro Carvalho Chehab ccfb302882 V4L/DVB: tm6000: Partially revert some copybuf logic
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>
2010-08-02 14:06:02 -03:00
Mauro Carvalho Chehab 758bb0b3e7 V4L/DVB: tm6000: Be sure that the new buffer is empty
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:06:01 -03:00
Mauro Carvalho Chehab d0669c872f V4L/DVB: tm6000: Fix copybuf continue logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:06:00 -03:00
Mauro Carvalho Chehab 23ba94633d V4L/DVB: tm6000: audio packet has always 180 bytes
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:59 -03:00
Mauro Carvalho Chehab a59bff3714 V4L/DVB: tm6000: Improve set bitrate routines used by alsa
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:58 -03:00
Mauro Carvalho Chehab e8cbf0357e V4L/DVB: tm6000-alsa: Implement a routine to store data received from URB
Implements the fillbuf callback to store data received via URB
data transfers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:56 -03:00
Mauro Carvalho Chehab 3f23a81a10 V4L/DVB: tm6000-alsa: Fix several bugs at the driver initialization code
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>
2010-08-02 14:05:55 -03:00
Mauro Carvalho Chehab faa7c13481 V4L/DVB: tm6000: avoid unknown symbol tm6000_debug
Reported by Stefan Ringel.

Thanks-to: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:54 -03:00
Mauro Carvalho Chehab b17b86991a V4L/DVB: tm6000: Add a callback code for buffer fill
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>
2010-08-02 14:05:53 -03:00
Mauro Carvalho Chehab 39e1256bc4 V4L/DVB: tm6000: Use an enum for extension type
In order to better document and be sure that the values are used
at the proper places, convert extension type into an enum and
name it as "type", instead of "id".

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:52 -03:00
Mauro Carvalho Chehab 54b78608c6 V4L/DVB: tm6000-alsa: rework audio buffer allocation/deallocation
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:51 -03:00
Mauro Carvalho Chehab 0e57ff8d5c V4L/DVB: tm6000: Avoid OOPS when loading tm6000-alsa module
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:50 -03:00
Timofey Trofimov 52e0a72a0c V4L/DVB: Staging: tm6000: Fix coding style issues
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>
2010-08-02 14:05:44 -03:00
Stefan Ringel cee3926f5f V4L/DVB: tm6000: move dvb into a separate kern module
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>
2010-08-02 14:05:43 -03:00
Stefan Ringel d77057f250 V4L/DVB: tm6000: rewrite init and fini
rewrite tm6000_audio_init and tm6000_audio_fini

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:42 -03:00
Dmitri Belimov 53ff4c7900 V4L/DVB: tm6000: Fix Video decoder initialization
Fix video decoder overflow and avoid junk audio packets
when TV signal is lost.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02 14:05:41 -03:00
Stefan Ringel 83cb9a504c V4L/DVB: tm6000: rewrite copy_streams
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>
2010-08-02 14:05:40 -03:00
Tejun Heo 4ef09889d7 v4l-dvb: update gfp/slab.h includes
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>
2010-06-28 10:19:18 +10:00
Stefan Ringel 7e2d9820c3 V4L/DVB: tm6000: add DVB support for tuner xc5000
[mchehab@redhat.com: Fix compilation breakage due to duplicate cfg config delaration without {}]
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:07 -03:00
Stefan Ringel dcf5d3aa08 V4L/DVB: tm6000: set variable dev_mode in function tm6000_start_stream
set variable dev_mode in function tm6000_start_stream and check mode

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:06 -03:00
Stefan Ringel 71d67f739e V4L/DVB: tm6000: Properly select the tuners
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:05 -03:00
Stefan Ringel f36cc0342d V4L/DVB: tm6000: Add control to the power led
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>
2010-06-01 01:22:03 -03:00
Stefan Ringel 5a4b55e2c2 V4L/DVB: tm6000: bugfix stabilizing urb data
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:02 -03:00
Stefan Ringel 4b6ed9fd0b V4L/DVB: tm6000: bugfix video image
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>
2010-06-01 01:22:01 -03:00
Stefan Ringel 3569417e5a V4L/DVB: tm6000: add vbi message inside the type switch
add case line for vbi message

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:59 -03:00
Stefan Ringel 0f9bdbc2da V4L/DVB: tm6000: bugfix incorrect size
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:58 -03:00
Dmitri Belimov 2a15ac7ad6 V4L/DVB: tm6000, reset I2C bus function
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>
2010-06-01 01:21:57 -03:00
Stefan Ringel b9eb39d8f4 V4L/DVB: tm6000: Remove an extra ; symbol
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:55 -03:00
Stefan Ringel 0439db75c1 V4L/DVB: tm6000: add extension module support
add module init over tm6000 extension

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:54 -03:00
Mauro Carvalho Chehab e8d0416796 V4L/DVB (13554a): v4l: Use the video_drvdata function in drivers
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>
2010-05-19 12:59:18 -03:00
Stefan Ringel 3c7c5e9e89 V4L/DVB: tm6000: bugfix image position
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>
2010-05-19 12:59:17 -03:00
Stefan Ringel 9986da291b V4L/DVB: tm6000: README - add vbi
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:16 -03:00
Dmitri Belimov 1b0e48ad55 V4L/DVB: Rework for support xc5000
Set correct GPIO number for BEHOLD_WANDER/VOYAGER
Add xc5000 callback function
Small rework tm6000_cards_setup function
Small rework tm6000_config_tuner, build mode_mask by config information
Rework for support xc5000 silicon tuner
Add some information messages for more better understand an errors.

[mchehab@redhat.com: Fix CodingStyle and merge conflicts]
Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:41 -03:00
Mauro Carvalho Chehab 5a11b6fe5d Fix compilation breakage with tm6000
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>
2010-05-19 12:58:23 -03:00
Mauro Carvalho Chehab 6bc4631dbc V4L/DVB: tm6000: update the todo list
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:22 -03:00
Mauro Carvalho Chehab 4223871357 V4L/DVB: Fix color format with tm6010
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>
2010-05-19 12:58:22 -03:00
Roel Van Nyen 9d5164da8d V4L/DVB: tm6000: fix coding style issues of tm6000-cards.c
fix coding style issues

[mchehab@redhat.com: Fix conflicts with other patches]
Signed-off-by: Roel Van Nyen <roel.vannyen@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:21 -03:00
Stefan Ringel e18f58c626 V4L/DVB: tm6000: renaming firmware
renaming tm6000-xc3028.fw to xc3028-v24.fw

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:20 -03:00
Stefan Ringel 120756e10e V4L/DVB: tm6000: bugfix analog init for tm6010
- 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>
2010-05-19 12:58:20 -03:00
Mauro Carvalho Chehab 801dd3b32d V4L/DVB: tm6000: Don't copy outside the buffer
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>
2010-05-19 12:58:19 -03:00
Mauro Carvalho Chehab f4b727b3ae V4L/DVB: tm6000: Fix a panic if buffer become NULL
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>
2010-05-19 12:58:19 -03:00
Mauro Carvalho Chehab 6ae635c4f3 V4L/DVB: tm6000: Properly set alternate when preparing to stream
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>
2010-05-19 12:58:18 -03:00
Bee Hock Goh 1ebf2c7f78 V4L/DVB: tm6000: Add additional GPIO for UT821 during frmware loading
Signed-off-by: Bee Hock Goh <beehock@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:18 -03:00
Dmitri Belimov 20dead8da8 V4L/DVB: tm6000: fix i2c read
Set correct limit for I2C packet.
Use different method for the tm5600/tm6000 and tm6010 to read word.

[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:17 -03:00
Mauro Carvalho Chehab af9d9cfd54 V4L/DVB: tm6000: fix compilation due to the lack of a semicolon
Add a missing semicolon to fix this error:

In file included from drivers/staging/tm6000/tm6000-cards.c:32:
drivers/staging/tm6000/tm6000.h:123: error: two or more data types in
declaration specifiers

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:36 -03:00
Bee Hock Goh c16dd82b48 V4L/DVB: TM6000: Fix code which cause memory corruption
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>
2010-05-19 12:57:33 -03:00
Stefan Ringel 2f79088486 V4L/DVB: tm6000: request labeling board version check
request labeling board version check

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:32 -03:00
Stefan Ringel f1434f4e90 V4L/DVB: tm6000: tm6000_i2c_xfer: request labeling
labeling the request after tuner reading and writeing

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:31 -03:00
Stefan Ringel b57f432c28 V4L/DVB: tm6000: add gpios for tm6010 generic board
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:28 -03:00
Stefan Ringel 2edab1ee86 V4L/DVB: tm6000: add gpios to board struct
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:28 -03:00
Stefan Ringel 32a2232bfd V4L/DVB: tm6000: switch to gpio strcut
switch to a gpio structure

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:27 -03:00
Mauro Carvalho Chehab 2415a2c14e V4L/DVB: tm6000: replace occurences of req05 magic by a naming alias
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>
2010-05-18 00:47:12 -03:00
Mauro Carvalho Chehab d9a7240736 V4L/DVB: tm6000: add request to registers of the group 05
Yet another script magic. This time, the change were generated by this
script:

cat tm6000-regs.h |perl -ne 'if (m/^(\#define TM6010_REQ)(05)([^\s]+)(\s+)0x([A-F0-9].)/) { \
$name="$1$2$3"; $sp=$4; $req=$2; $val=$5; $val=~tr/A-F/a-f/; \
printf "$name%s0x%s, 0x%s\n", $sp, $req, $val; } else { print $_ }' \
>a; mv a tm6000-regs.h

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:11 -03:00
Mauro Carvalho Chehab f7d110c68c V4L/DVB: tm6000: Replace naming convention for registers of req 05 group
After looking at the "magic" registers, it is clear that usb registers
belong to request 5.

Replace them with this script:

cat /tmp/reg3 |perl -ne 'if (m/define (TM6000_U_)([^\s]+)\s+0x([A-F0-9].)/) { \
$name=$2; $val=$3; printf "s,$1$2,TM6010_REQ05_R%s_%s,g\n", $val, $name; }' >a;
sed -f a tm6000-regs.h >b; mv b tm6000-regs.h

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:10 -03:00
Mauro Carvalho Chehab 9afec493e2 V4L/DVB: tm6000: Replace all magic values by a register alias
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>
2010-05-18 00:47:09 -03:00
Mauro Carvalho Chehab 77012fb995 V4L/DVB: tm6000: Add request at Req07/Req08 register definitions
Use a pair Req/Reg for all registers at req07 and req08 groups. This
makes easier to replace them at the code with a script and helps to
avoid using the wrong req with some register.

This change were generated by this script:

if (m/^(\#define TM6010_REQ)([0-9].)([^\s]+)(\s+)0x([A-F0-9].)/) {
$name="$1$2$3"; $sp=$4; $req=$2; $val=$5; $val=~tr/A-F/a-f/; printf
"$name%s0x%s, 0x%s\n", $sp, $req, $val; } else { print $_ }

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:09 -03:00
Mauro Carvalho Chehab c4bccf5e78 V4L/DVB: tm6000: Replace all Req 8 group of regs with another naming convention
According with the original patch that added the register names, those
are related to tm6010, so name it properly as such. Also, clearly
indicates when a register belongs to Request 0x08 and add its register
value at the name. This makes easier to double check if the proper
register is used along the driver.

This patch were made with the help of this simple perl script, applied
over the definitions of the last register groups:

if (m/define (TM6000_)([^\s]+)\s+0x([A-F0-9].)/) { $name=$2;
$val=$3; printf "s,$1$2,TM6010_REQ08_R%s_%s,g\n", $val, $name; }

And were manually adjusted to fix a few minor issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:08 -03:00
Mauro Carvalho Chehab b8e286260e V4L/DVB: tm6000: Replace all Req 7 group of regs with another naming convention
According with the original patch that added the register names, those
are related to tm6010, so name it properly as such. Also, clearly
indicates when a register belongs to Request 0x07 and add its register
value at the name. This makes easier to double check if the proper
register is used along the driver.

This patch were made with the help of this simple perl script:

if (m/define (TM6000_)([^\s]+)\s+0x([A-F0-9].)/) { $name=$2; $val=$3;
printf "s,$1$2,TM6010_REQ07_R%s_%s,g\n", $val, $name; }

And were manually adjusted to fix a few minor issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:07 -03:00
Stefan Ringel 8b0d2a0527 V4L/DVB: tm6000: add new hybrid-stick
-add Hauppauge WinTV HVR 900H/WinTV USB2-Stick
	vid/pid
	0x2040/6601
	0x2040/6610
	0x2040/6611

-add Terratec Cinergy Hybrid-Stick
	vid/pid
	0x0ccd/0x00a5

-add Twinhan TU501(704D1)
	vid/pid
	0x13d3/0x3240
	0x13d3/0x3241
	0x13d3/0x3243
	0x13d3/0x3264

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:02 -03:00