[media] em28xx-dvb: fix PCTV 461e tuner I2C binding

Add missing m88ts2022 module reference counts as removing that module
is not allowed when it is used by em28xx-dvb module. That same module
was not unregistered correctly, fix it too.

Error cases validated by returning errors from m88ds3103, m88ts2022
and a8293 probe().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] rtl28xxu: add ID [0ccd:00b4] TerraTec NOXON DAB Stick (rev 3)

I've got the following DAB USB stick that also works fine with the
DVB_USB_RTL28XXU driver after I added its USB ID:
	Bus 001 Device 009: ID 0ccd:00b4 TerraTec Electronic GmbH

[crope@iki.fi: apply patch partly manually]
Signed-off-by: Till Dörges <till@doerges.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] tda10071: remove a duplicative test

"ret" is an error code here, we already tested that.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] tda10071: do not check tuner PLL lock on read_status()

Tuner PLL lock flag was mapped to FE_HAS_SIGNAL, which is wrong. PLL
lock has nothing to do with received signal. In real life that flag
is always set.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] tda10071: coding style issues

Fix some coding style issues, mostly reported by checkpatch.pl.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] af9035: Move it913x single devices to af9035

The generic v1 and v2 devices have been all tested.

IDs tested
USB_PID_ITETECH_IT9135 v1 & v2
USB_PID_ITETECH_IT9135_9005 v1
USB_PID_ITETECH_IT9135_9006 v2

Current Issues
There is no signal  on
USB_PID_ITETECH_IT9135 v2

No SNR reported all devices.

All single devices tune and scan fine.

All remotes tested okay.

Dual device failed to register second adapter
USB_PID_KWORLD_UB499_2T_T09
It is not clear what the problem is at the moment.

So only single IDs are transferred in this patch.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] af9035: add default 0x9135 slave I2C address

On some devices the vendor has not set EEPROM_2ND_DEMOD_ADDR.

Checks tmp is not zero after call to get EEPROM_2ND_DEMOD_ADDR and sets the
default slave address of 0x3a on 0x9135 devices.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] af9035: Add remaining it913x dual ids to af9035

As follow on to patch
af9035: Move it913x single devices to af9035
and patch 1.

SNR is reported as db/10 values.

All dual ids are added to af9035 and it913x driver disabled.

it913x/it913x-fe removal patches to follow.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] af9035: use default i2c slave address for af9035 too

Some device vendors has forgotten set correct slave demod I2C address
to eeprom. Use default I2C address when eeprom has no address at all.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] it913x: dead code Remove driver

Following moving ids to af9035.

This driver is no longer in use.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] it913x-fe: Dead code remove driver

This driver has been replaced by af9033 and tuner_it913x

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] MAINTAINERS: Remove it913x* maintainers entries

This driver was removed, and supported devices got moved to
anoher driver.

So, cleanup MAINTAINERS as well.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] get_dvb_firmware: it913x: Remove it9137 firmware files

Remove it9137 firmware files it9137.txt and it9137 get_dvb_firmware.

dvb-usb-it9137-01.fw firmware is no longer in use.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] radio-usb-si4713: make array of structs const

The start_seq[] should be const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] v4l2-subdev: Allow 32-bit compat ioctls

Add support for 32-bit ioctls with v4l-subdev device nodes.

Rather than keep adding new ioctls to the list in v4l2-compat-ioctl32.c, just check
if the ioctl is a non-private V4L2 ioctl and if so, call the conversion code.

We keep forgetting to add new ioctls, so this is a more robust solution.

In addition extend the subdev API with support for a compat32 function to
convert custom v4l-subdev ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] vivi: fix sequence counting

The sequence counting was not reset to 0 between each streaming run,
and it was increased only every other frame. This is incorrect behavior:
the confusion is with FIELD_ALTERNATE systems where each field is transmitted
separately and only when both fields have been received is the frame
sequence number increased.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] vivi: drop unused field

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] vivi: queue_setup improvements

Drop the vid_limit module option: there is really no need to limit this.
No other driver does that. If you try to allocate more buffers then vb2
will automatically reduce the number of buffers anyway.

Also add sanity checks if the size in the fmt argument is going to be
used and drop the code that checks against *nbuffers == 0: this can
never happen (the vb2 framework ensures that) and the code was wrong
anyway since *nbuffers should have been set to the minimum number of
required buffers which is 1 for this driver.

Since vivi is often used as a template driver it is good to have this
driver be as compliant as possible. This broken code was for example
copied to the s2255 driver (which is being fixed as well).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
saa716x: Initial commit based on http://powarman.dyndns.org/hgwebdir.cgi/v4l-dvb-saa716x/
saa716x: Fix to build FF cards in newer kernels