Commit Graph

261743 Commits (035aa1475d6e4afdf97dccf6c6d6059063398b57)

Author SHA1 Message Date
Dan Carpenter e9013fb6eb [media] ddbridge: fix ddb_ioctl()
There were a several problems in this function:

1) Potential integer overflow in the comparison:
	if (fio.write_len + fio.read_len > 1028) {

2) If the user gave bogus values for write_len and read_len then
   returning -EINVAL is more appropriate than returning -ENOMEM.

3) wbuf was set to the address of an array and could never be NULL
   so I removed the pointless NULL check.

4) The call to vfree(wbuf) was improper.  That array is part of a
   larger struct and isn't allocated by itself.

5) flashio() can't actually fail, but we may as well add error
   handling in case this changes later.

6) In the default case where an ioctl is not implemented then
   returning -ENOTTY is more appropriate than returning -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:23:42 -03:00
Steve Kerrison 0db4bf42ba [media] CXD2820R: Replace i2c message translation with repeater gate control
This patch implements an i2c_gate_ctrl op for the cxd2820r. Thanks to Robert
Schlabbach for identifying the register address and field to set.

The old i2c intercept code that prefixed messages with a passthrough byte has
been removed and the PCTV nanoStick T2 290e entry in em28xx-dvb has been
updated appropriately.

Tested for DVB-T2 use; I would appreciate it if somebody with DVB-C capabilities
could test it as well - from inspection I cannot see any problems.

This is patch v2. It fixes some schoolboy style errors and removes superfluous
i2c entries in cxd2820r.h.

Signed-off-by: Steve Kerrison <steve@stevekerrison.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:13:41 -03:00
Andreas Oberritter 6fb2bdfa06 [media] DVB: Change API version in documentation: 3 -> 5.4
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:07:23 -03:00
Andreas Oberritter 7fc9da2a8f [media] DVB: improve documentation for satellite delivery systems
- Move voltage and tone to DVB-S.
- Add turbo code.
- In DVB-S2 and turbo code sections, refer to DVB-S, as both
  are extensions to DVB-S.
- Add modulation to DVB-S2.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:07:21 -03:00
Andreas Oberritter 8fc74fdb0f [media] DVB: gp8psk-fe: use SYS_TURBO
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:07:20 -03:00
Andreas Oberritter 14f55794b2 [media] DVB: dvb_frontend: Fix compatibility criteria for satellite receivers
identify a satellite receiver by its 'delivery_system' instead of
  'modulation', which may overlap between different delivery systems.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:07:18 -03:00
Andreas Oberritter 83dc314bea [media] DVB: Add SYS_TURBO for north american turbo code FEC
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 18:07:14 -03:00
Dan Carpenter 2f098cb1c8 [media] dib9000: return error code on failure
The ret = -EIO needs to be before the goto.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 13:08:20 -03:00
Dan Carpenter 0c61cc3ba4 [media] dib7000p: return error code on allocation failure
The goto needs to be moved after the assignment.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 13:03:52 -03:00
Mauro Carvalho Chehab 8513e14457 [media] dvb-core, tda18271c2dd: define get_if_frequency() callback
Tuners in general convert a high frequency carrier into an Intermediate
Frequency (IF).

Digital tuners like tda18271, xc3028, etc. generally allow changing the IF
frequency, although they generally have recommented settings for the IF.
Analog tuners, have a fixed IF frequency, that depends on the physical
characteristics of some analog components.

For digital tuners, it makes sense to have ways to configure IF,
via the tuner's configuration structure, like what's done inside the
tda18271-fe maps.

The demods need to know what IF is used by the tuner, as it will need
to convert internally from IF into baseband. Currently, the bridge driver
needs to fill a per-demod configuration struct for it, or pass it via
a dvb_attach parameter.

The tda18271 datasheet recommends to use different IF's for different
delivery system types and for different bandwidths.

The DRX-K demod also needs to know the IF frequency in order to work,
just like all other demods. However, as it accepts different delivery
systems (DVB-C and DVB-T), the IF may change if the standard and/or
bandwidth is changed.

So, the usual procedure of passing it via a config struct doesn't work.

One might try to code it as two separate IF frequencies, or even as a
table in function of the delivery system and the bandwidth, but this
will be messy.

So, it is better and simpler to just add a new callback for it and
require the tuners that can be used with MFE frontends like drx-k
to implement a new callback to return the used IF.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Antti Palosaari <crope@iki.fi>
2011-09-03 12:46:33 -03:00
Jarod Wilson f2d0c1c625 [media] em28xx: add em28xx_ prefix to functions
Makes it more straight-forward to follow stack traces if the functions
don't have generic names. Using this as a crutch while trying to better
understand the lockdep warnings I get when loading the em28xx driver.

CC: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 11:17:39 -03:00
Jarod Wilson 2f00e158b5 [media] redrat3: remove unused dev struct members
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 10:58:26 -03:00
Jonathan Corbet 297875b6a1 [media] videobuf2: Do not unconditionally map S/G buffers into kernel space
The one in-tree videobuf2-dma-sg driver (mmp-camera) has no need for a
kernel-space mapping of the buffers; one suspects that most other drivers
would not either.  The videobuf2-dma-sg module does the right thing if
buf->vaddr == NULL - it maps the buffer on demand if somebody needs it.  So
let's not map the buffer at allocation time; that will save a little CPU
time and a lot of address space in the vmalloc range.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 10:57:33 -03:00
Andreas Oberritter 77b1e2fbbd [media] DVB: dvb_frontend: update locking in dvb_frontend_{add, get_event}
- fepriv->parameters_out isn't protected by events->mtx, so
    move the call to fe->ops.get_frontend out of the locked area.
  - move the assignment of e->status into the locked area.

  - use direct assignment instead of memcpy.

  - use mutex_lock instead of mutex_lock_interruptible, because
    all code paths protected by this mutex won't block.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:49:07 -03:00
Andreas Oberritter 20640bea87 [media] DVB: dvb_frontend: clear stale events on FE_SET_FRONTEND
the first event after an attempt to tune.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:48:12 -03:00
Andreas Oberritter 5c9f480bdb [media] DVB: dvb_frontend: avoid possible race condition on first event
enqueued before the frontend thread wakes up.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:47:33 -03:00
Andreas Oberritter 56ce5ac41a [media] DVB: dvb_frontend: fix stale parameters on initial frontend event
Modify it to use the data given by the user.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:46:59 -03:00
Julia Lawall f00fd919ef [media] drivers/media/video/hexium_gemini.c: delete useless initialization
Delete nontrivial initialization that is immediately overwritten by the
result of an allocation function.

The semantic match that makes this change is as follows:

// <smpl>
@@
type T;
identifier i;
expression e;
@@

(
T i = \(0\|NULL\|ERR_PTR(...)\);
|
-T i = e;
+T i;
)
... when != i
i = \(kzalloc\|kcalloc\|kmalloc\)(...);

// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 08:43:14 -03:00
Mauro Carvalho Chehab f8dbab29f4 [media] tm6000: Don't try to use a non-existing interface
> [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>
2011-09-01 02:57:02 -03:00
Thierry Reding d657229ac4 [media] tm6000: Enable radio mode for Cinergy Hybrid XE
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 17:21:27 -03:00
Thierry Reding f009a946d7 [media] tm6000: Enable audio clock in radio mode
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 17:21:26 -03:00
Thierry Reding 8d90e1e382 [media] tm6000: Plug memory leak on PCM free
When releasing hardware resources, the DMA buffer allocated to the PCM
device needs to be freed to prevent a memory leak.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 17:21:25 -03:00
Thierry Reding aa4a583d35 [media] tm6000: Do not use video buffers in radio mode
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>
2011-08-31 17:21:24 -03:00
Thierry Reding dd0c8abf2a [media] tm6000: Execute lightweight reset on close
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>
2011-08-31 17:21:23 -03:00
Thierry Reding 88e834a841 [media] tm6000: Initialize isochronous transfers only once
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>
2011-08-31 17:21:08 -03:00
Thierry Reding 6f2e77bb95 [media] tm6000: Properly count device usage
When the USB device is disconnected, the device usage bit is not cleared
properly. This leads to errors when a device is unplugged and replugged
several times until all TM6000_MAXBOARDS bits are used and keeps the
driver from binding to the device.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 17:20:23 -03:00
Thierry Reding fc4eab2cba [media] tm6000: Add locking for USB transfers
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>
2011-08-31 17:17:18 -03:00
Thierry Reding c0fa65ff9e [media] tm6000: Rework standard register tables
This commit uses sentinel entries to terminate the TV standard register
tables instead of hard-coding their size, allowing further entries to be
added more easily. It is also more space-efficient if the tables have a
varying number of entries.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 17:17:17 -03:00
Thierry Reding 873545820a [media] tm6000: Disable video interface in radio mode
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>
2011-08-31 17:17:16 -03:00
Thierry Reding 4129e560fb [media] tm6000: Rename active interface register
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>
2011-08-31 17:17:14 -03:00
Thierry Reding 14f0915464 [media] tm6000: Flesh out the IRQ callback
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>
2011-08-31 17:17:13 -03:00
Thierry Reding 9dac920708 [media] tm6000: Implement I2C flush callback
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 17:17:06 -03:00
Thierry Reding 3fd02b4456 [media] tm6000: Use correct input in radio mode
In radio mode, the correct input is rinput. The pseudo index 5 is used
but cannot be used to index the vinput array because that only has 3
elements.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 17:16:53 -03:00
Thierry Reding 3d1a51db7e [media] tm6000: Miscellaneous cleanups
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>
2011-08-31 16:24:46 -03:00
Mauro Carvalho Chehab fd34cb08ba [media] tuner/xc2028: Fix frequency offset for radio mode
In radio mode, no frequency offset should be used.

Instead of taking Thierry's patch that creates a separate function
to calculate the digital offset, it seemed better to just keep
everything at the same place.

Reported-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 15:16:00 -03:00
Thierry Reding 4d37ece757 [media] tuner/xc2028: Add I2C flush callback
When loading the firmware, complete each chunk by sending an I2C flush
command to the frontend. Some devices like the tm6000 seem to require
this to properly flush the I2C buffers.

The current code in tm6000 executes the flush command once after each
I2C transfer, which slows down the firmware loading especially when
loading large BASE type images.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 15:03:22 -03:00
Sakari Ailus 69d232ae8e [media] omap3isp: ccdc: Use generic frame sync event instead of private HS_VS event
The ccdc block in the omap3isp produces events whenever it starts receiving
a new frame. A private HS_VS event was used for this previously. Now, the
generic V4L2_EVENT_FRAME_SYNC event is being used for the purpose.

This patch also provides the frame sequence number to user space.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-29 12:38:51 -03:00
Sakari Ailus eab00a0da2 [media] v4l: events: Define V4L2_EVENT_FRAME_SYNC
Define a frame sync event to tell user space when the reception of a frame
starts.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-29 12:37:15 -03:00
Jose Alberto Reguero c9f88aa976 [media] ttusb2: add support for the dvb-t part of CT-3650 v3
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:44:49 -03:00
istvan_v@mailbox.hu 84b271488d [media] cx88: notch filter control fixes
This patch reduces the number of available choices for the notch filter type control
so that the standard-specific filter types cannot be selected. It is now limited to
being either 0 (4xFsc, the default) or 1 (square pixel optimized).
The patch also removes the initialization of this control from cx88_reset(), since
that is already done by init_controls(), which is called by cx8800_initdev().

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:21:16 -03:00
Joe Perches 2b50763a0b [media] tda18212: Use standard logging, remove tda18212_priv.h
Use the more current logging styles with pr_fmt.
Remove now unnecessary private include.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:20:45 -03:00
Joe Perches be85fefecb [media] tda18271: Use printk extension %pV
Deduplicate printk formats to save ~20KB text.

$ size drivers/media/common/tuners/tda18271*o.*
   text	   data	    bss	    dec	    hex	filename
  10747	     56	   1920	  12723	   31b3	drivers/media/common/tuners/tda18271-common.o.new
  18889	     56	   3112	  22057	   5629	drivers/media/common/tuners/tda18271-common.o.old
  20561	    204	   4264	  25029	   61c5	drivers/media/common/tuners/tda18271-fe.o.new
  31093	    204	   6000	  37297	   91b1	drivers/media/common/tuners/tda18271-fe.o.old
   3681	   6760	    440	  10881	   2a81	drivers/media/common/tuners/tda18271-maps.o.new
   5631	   6760	    680	  13071	   330f	drivers/media/common/tuners/tda18271-maps.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:19:43 -03:00
Antti Palosaari f68baeff45 [media] af9015: use logic or instead of sum numbers
Style issue.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:43 -03:00
Antti Palosaari 4c0cfa24f7 [media] af9015: map remote for Leadtek WinFast DTV2000DS
Thanks to Thomas Gutzler for reporting this.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Thomas Gutzler <thomas.gutzler@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:32 -03:00
Antti Palosaari e36454376a [media] em28xx: use MFE lock for PCTV nanoStick T2 290e
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:22 -03:00
Julia Lawall eb28dc39d3 [media] drivers/media/dvb/dvb-usb/usb-urb.c: adjust array index
Convert array index from the loop bound to the loop index.

A simplified version of the semantic patch that fixes this problem is as

// <smpl>
@@
expression e1,e2,ar;
@@

for(e1 = 0; e1 < e2; e1++) { <...
  ar[
- e2
+ e1
  ]
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:15 -03:00
Julian Scheel 93165b7774 [media] Add support for new revision of KNC 1 DVB-C cards. Using tda10024 instead of tda10023, which is compatible to tda10023 driver
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:41:46 -03:00
Benjamin Larsson 3188d5485e [media] get_dvb_firmware: Firmware extraction for IT9135 based devices
Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:37:56 -03:00
Malcolm Priestley f6d8735493 [media] it913x: Driver for Kworld UB499-2T (id 1b80:e409) v1.05
Driver for Kworld UB499-2T (id 1b80:e409)

The device driver has been named it913x, so that support for other family members
can be added later.

TODOs
Firmware support for other it913x devices.
Remote control support, there are two known types.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
[mchehab@redhat.com: Fix a merge conflict]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:35:21 -03:00
Malcolm Priestley 52cb3e2757 [media] it9137: Fimrware retrival information for Kworld UB499-2T T09 (id 1b80:e409)
Firmware information for Kworld UB499-2T T09 based on IT913x series. This device
uses file dvb-usb-it9137-01.fw.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:30:43 -03:00