History log of /linux-master/drivers/media/usb/cx231xx/cx231xx-cards.c
Revision Date Author Comments
# 7c617138 05-Sep-2019 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: cx231xx: convert to the vb2 framework

This patch converts the cx231xx driver to the vb2 framework.
Since you can't do a partial conversion this is a big-bang patch,
i.e. large and hard to review. I never found a way around this.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Co-developed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 6b338c72 14-Aug-2019 Geert Uytterhoeven <geert+renesas@glider.be>

media: Fix various misspellings of disconnected

Fix typos.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 575f6031 05-Jun-2019 Brad Love <brad@nextdimension.cc>

media: cx231xx-cards: Add Hauppauge 955Q variant

cx231xx/lgdt3306a/si2157/cx25840

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 74ba9207 20-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
675 mass ave cambridge ma 02139 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 441 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 830a57f4 03-May-2018 Brad Love <brad@nextdimension.cc>

media: cx231xx: Fix several incorrect demod addresses

Now the board values match the hard coded
constants used in the dvb initialization.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 29e61d6e 26-Mar-2018 Kai-Heng Feng <kai.heng.feng@canonical.com>

media: cx231xx: Add support for AverMedia DVD EZMaker 7

User reports AverMedia DVD EZMaker 7 can be driven by VIDEO_GRABBER.
Add the device to the id_table to make it work.

BugLink: https://bugs.launchpad.net/bugs/1620762

Cc: stable@vger.kernel.org
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# a2c52cd7 06-Mar-2018 Brad Love <brad@nextdimension.cc>

media: cx231xx: Add second i2c demod to Hauppauge 975

Hauppauge HVR-975 is a hybrid, dual frontend, single tuner USB device.
It contains lgdt3306a and si2168 frontends and one si2157 tuner. The
lgdt3306a frontend is currently enabled. This creates the second
demodulator and attaches it to the tuner.

Enables lgdt3306a|si2168 + si2157

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 9aa4d4ea 22-Feb-2018 Markus Elfring <elfring@users.sourceforge.net>

media: usb: don't initialize vars if not needed

Some local variables will be set to an appropriate value before usage.
Thus omit explicit initialisations at the beginning of these functions.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 19fbf1ba 09-Jan-2018 Brad Love <brad@nextdimension.cc>

media: cx231xx: Add support for Hauppauge HVR-975

Hauppauge HVR-975 is hybrid NTSC/PAL, QAM/ATSC, and DVB-C/T/T2 usb device.

Only ATSC/QAM front end is initially active. Second frontend support is
work in progress.

CX23102 + LG3306A/Si2168(WiP) + Si2157

Changes since v1:
- removed double semicolon

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# c5bef50e 09-Jan-2018 Brad Love <brad@nextdimension.cc>

media: cx231xx: Add support for Hauppauge HVR-935C

HVR-935C is hybrid PAL, DVB-C/T/T2 usb device.

CX23102 + Si2168 + Si2157

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# fada1935 28-Dec-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: move dvb kAPI headers to include/media

Except for DVB, all media kAPI headers are at include/media.

Move the headers to it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# fdda0109 18-Nov-2017 Romain Reignier <r.reignier@robopec.com>

media: cx231xx: Add support for The Imaging Source DFG/USB2pro

Note that the inputs for the Composite and S-Video are inverted in
regard to most of the other boards using a cx231xx chip.

Signed-off-by: Romain Reignier <r.reignier@robopec.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>


# 1bfbb885 28-Oct-2017 Oleh Kravchenko <oleg@kaa.org.ua>

media: cx231xx: Fix NTSC/PAL on Astrometa T2hybrid

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 9d377dae 28-Oct-2017 Oleh Kravchenko <oleg@kaa.org.ua>

media: cx231xx: Fix NTSC/PAL on Evromedia USB Full Hybrid Full HD

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 47f42f3e 28-Oct-2017 Oleh Kravchenko <oleg@kaa.org.ua>

media: rc: mceusb: add support for 1b80:d3b2

Evromedia USB Full Hybrid Full HD (1b80:d3b2) has IR on Interface 0.
Remote controller supplied with this tuner fully compatible
with RC_MAP_MSI_DIGIVOX_III.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6c3b047f 21-Sep-2017 Johan Hovold <johan@kernel.org>

[media] cx231xx-cards: fix NULL-deref on missing association descriptor

Make sure to check that we actually have an Interface Association
Descriptor before dereferencing it during probe to avoid dereferencing a
NULL-pointer.

Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver")

Cc: stable <stable@vger.kernel.org> # 2.6.30
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 0f42b331 21-Apr-2017 Oleh Kravchenko <oleg@kaa.org.ua>

[media] cx231xx: Initial support Astrometa T2hybrid

This patch provide only digital support;
The device is based on 24C02N EEPROM, Panasonic MN88473 demodulator,
Rafael Micro R828D tuner and CX23102-11Z chipset;
USB id: 15f4:0135.

Status:
- DVB-T/T2 works fine;
- Composite works fine;
- Analog not implemented.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 0cd273bb 13-Mar-2017 Johan Hovold <johan@kernel.org>

[media] cx231xx-cards: fix NULL-deref at probe

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer or accessing memory beyond the endpoint array should a
malicious device lack the expected endpoints.

Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver")

Cc: stable <stable@vger.kernel.org> # 2.6.30
Cc: Sri Deevi <Srinivasa.Deevi@conexant.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 446aba66 03-Mar-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] tveeprom: get rid of unused arg on tveeprom_hauppauge_analog()

tveeprom_hauppauge_analog() used to need the I2C adapter in
order to print debug messages. As it now uses pr_foo() facilities
since commit 6037b3ca28f4 ("[media] tveeprom: print log messages
using pr_foo()"), the first argument of the function is not
needed anymore.

So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# a096fd64 29-Jan-2017 Oleh Kravchenko <oleg@kaa.org.ua>

[media] cx231xx: Initial support Evromedia USB Full Hybrid Full HD

This patch provide only digital support.
The device is based on Si2168 30-demodulator,
Si2158-20 tuner and CX23102-11Z chipset;
USB id: 1b80:d3b2.

Status:
- DVB-T2 works fine;
- Composite and SVideo works fine;
- Analog not implemented.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 3c59bb47 05-Sep-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx-cards: unregister IR earlier

Without this patch, a bug is issued when the module is removed:

[ 1417.425863] cx231xx 1-3.1.4:1.1: Cx231xx dvb Extension removed
[ 1417.571923] BUG: unable to handle kernel paging request at ffffffffc081a024
[ 1417.571962] IP: [<ffffffff813da854>] string+0x24/0x80
[ 1417.571987] PGD 1c09067 PUD 1c0b067 PMD 88e653067 PTE 0
[ 1417.572013] Oops: 0000 [#1] SMP
[ 1417.572026] Modules linked in: mb86a20s dvb_core cx231xx_alsa ir_kbd_i2c(-) tda18271 tea5767 tuner cx25840 cx231xx i2c_mux videobuf_vmalloc tveeprom cx2341x videobuf_core rc_core v4l2_common videodev media bnep usblp fuse xt_CHECKSUM iptable_mangle tun ebtable_filter ebtables ip6table_filter ip6_tables xt_physdev br_netfilter bridge nf_log_ipv4 nf_log_common xt_LOG xt_conntrack ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack cpufreq_stats vfat fat snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel snd_hda_intel snd_hda_codec kvm snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm irqbypass crct10dif_pclmul iTCO_wdt crc32_pclmul nfsd hci_uart iTCO_vendor_support
[ 1417.572317] snd_timer ghash_clmulni_intel btbcm intel_cstate btqca snd intel_uncore btintel intel_rapl_perf mei_me bluetooth mei shpchp soundcore pcspkr i2c_i801 auth_rpcgss wmi acpi_als kfifo_buf nfs_acl industrialio rfkill lockd pinctrl_sunrisepoint pinctrl_intel tpm_tis tpm intel_lpss_acpi intel_lpss acpi_pad grace sunrpc binfmt_misc hid_logitech_hidpp hid_logitech_dj 8021q garp stp llc mrp i915 i2c_algo_bit drm_kms_helper drm e1000e sdhci_pci sdhci mmc_core crc32c_intel ptp pps_core video i2c_hid fjes analog gameport joydev [last unloaded: rc_pixelview_002t]
[ 1417.572487] CPU: 4 PID: 24493 Comm: rmmod Tainted: G W 4.7.0+ #2
[ 1417.572504] Hardware name: /NUC6i7KYB, BIOS KYSKLi70.86A.0041.2016.0817.1130 08/17/2016
[ 1417.572526] task: ffff880894b81e80 ti: ffff880896bdc000 task.ti: ffff880896bdc000
[ 1417.572544] RIP: 0010:[<ffffffff813da854>] [<ffffffff813da854>] string+0x24/0x80
[ 1417.572564] RSP: 0018:ffff880896bdfbe8 EFLAGS: 00010286
[ 1417.572577] RAX: ffffffffc081a025 RBX: ffff8808935aa15c RCX: ffff0a00ffffff04
[ 1417.572594] RDX: ffffffffc081a024 RSI: ffffffffffffffff RDI: ffff8808935aa15c
[ 1417.572610] RBP: ffff880896bdfbe8 R08: fffffffffffffffe R09: ffff8808935aa91c
[ 1417.572628] R10: ffffffffc07b85d6 R11: 0000000000000000 R12: ffff8808935aa91c
[ 1417.572644] R13: 00000000000007c5 R14: ffffffffc07b85dd R15: ffffffffc07b85dd
[ 1417.572662] FS: 00007f5a5392d700(0000) GS:ffff8808bed00000(0000) knlGS:0000000000000000
[ 1417.572681] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1417.572705] CR2: ffffffffc081a024 CR3: 0000000897188000 CR4: 00000000003406e0
[ 1417.572735] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1417.572761] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 1417.572778] Stack:
[ 1417.572785] ffff880896bdfc48 ffffffff813dcf77 0000000000000005 ffff8808935aa157
[ 1417.572806] ffff880896bdfc58 ffff0a00ffffff04 000000009d27375e ffff8808935aa000
[ 1417.572829] 0000000000000800 ffff880896182800 0000000000000000 ffff88089e898ae0
[ 1417.572850] Call Trace:
[ 1417.572860] [<ffffffff813dcf77>] vsnprintf+0x2d7/0x500
[ 1417.572873] [<ffffffff813d3e12>] add_uevent_var+0x82/0x120
[ 1417.572890] [<ffffffffc07b534d>] rc_dev_uevent+0x2d/0x60 [rc_core]
[ 1417.572907] [<ffffffff81515969>] dev_uevent+0xd9/0x2d0
[ 1417.572921] [<ffffffff813d4309>] kobject_uevent_env+0x2d9/0x4f0
[ 1417.572938] [<ffffffff813d452b>] kobject_uevent+0xb/0x10
[ 1417.572954] [<ffffffff81513a3f>] device_del+0x18f/0x260
[ 1417.572974] [<ffffffff813d2db7>] ? kobject_put+0x27/0x50
[ 1417.572998] [<ffffffffc07b5e25>] rc_unregister_device+0x75/0xb0 [rc_core]
[ 1417.573028] [<ffffffffc07e6023>] ir_remove+0x23/0x30 [ir_kbd_i2c]
[ 1417.573055] [<ffffffff8162bf88>] i2c_device_remove+0x58/0xb0
[ 1417.573078] [<ffffffff81518191>] __device_release_driver+0xa1/0x160
[ 1417.573102] [<ffffffff81518de6>] driver_detach+0xa6/0xb0
[ 1417.573122] [<ffffffff81517b25>] bus_remove_driver+0x55/0xd0
[ 1417.573146] [<ffffffff815195bc>] driver_unregister+0x2c/0x50
[ 1417.573168] [<ffffffff8162cf62>] i2c_del_driver+0x22/0x50
[ 1417.573194] [<ffffffffc07e6ba4>] ir_kbd_driver_exit+0x10/0x46c [ir_kbd_i2c]
[ 1417.573227] [<ffffffff81126348>] SyS_delete_module+0x1b8/0x220
[ 1417.573254] [<ffffffff817debf2>] entry_SYSCALL_64_fastpath+0x1a/0xa4
[ 1417.573279] Code: eb e9 76 ff ff ff 90 55 49 89 f1 48 89 ce 48 c1 fe 30 48 81 fa ff 0f 00 00 48 89 e5 4c 8d 46 ff 76 40 48 85 f6 74 4e 48 8d 42 01 <0f> b6 12 84 d2 74 43 49 01 c0 31 f6 eb 0c 48 83 c0 01 0f b6 50
[ 1417.573437] RIP [<ffffffff813da854>] string+0x24/0x80
[ 1417.573455] RSP <ffff880896bdfbe8>
[ 1417.573465] CR2: ffffffffc081a024
[ 1417.580053] ---[ end trace 4ca9e2eced326a62 ]---

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 24b923f0 04-Sep-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: fix GPIOs for Pixelview SBTVD hybrid

This device uses GPIOs: 28 to switch between analog and
digital modes: on digital mode, it should be set to 1.

The code that sets it on analog mode is OK, but it misses
the logic that sets it on digital mode.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6cf5dad1 21-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] media_device: move allocation out of media_device_*_init

Right now, media_device_pci_init and media_device_usb_init does
media_device allocation internaly. That preents its usage when
the media_device struct is embedded on some other structure.

Move memory allocation outside it, to make it more generic.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 41b44e35 22-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] media-device: move PCI/USB helper functions from v4l2-mc

Those ancillary functions could be called even when compiled
without V4L2 support, as warned by ktest build robot:

All errors (new ones prefixed by >>):

>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined!

Also, there's nothing there that are specific to V4L2. So, move
those ancillary functions to MC core.

No functional changes. Just function rename.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 6168309a 11-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: create connectors at the media graph

We need to add connectors to the cx231xx graph.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 08f49200 11-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: use v4l2 core function to create the MC graph

Instead of having its own routine, use the one defined at the
core, as it is generic enough to handle the cx231xx usecases.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 67873d4e 11-Feb-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] use v4l2_mc_usb_media_device_init() on most USB devices

Except for the usbuvc driver (with has an embedded media_device
struct on it), the other drivers have a pointer to media_device.

On those drivers, replace their own implementation for the core
one. That warrants that those subdev drivers will fill the
media_device info the same way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 163c9bca 27-Jan-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] tuner.h: rename TUNER_PAD_IF_OUTPUT to TUNER_PAD_OUTPUT

The output of a tuner is not only IF frequencies. They may also
output audio on some of its pins, and may even be a zero-IF tuner,
with outputs a baseband. So, rename the PAD name to make it
clearer and add a proper documentation about that at tuner.h.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 9f806795 28-Dec-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] usb: check media device errors

There are now two new warnings:

drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 'dvb_usbv2_media_device_register':
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:433:2: warning: ignoring return value of '__media_device_register', declared with attribute warn_unused_result [-Wunused-result]
media_device_register(adap->dvb_adap.mdev);
^
drivers/media/usb/dvb-usb/dvb-usb-dvb.c: In function 'dvb_usb_media_device_register':
drivers/media/usb/dvb-usb/dvb-usb-dvb.c:128:2: warning: ignoring return value of '__media_device_register', declared with attribute warn_unused_result [-Wunused-result]
media_device_register(adap->dvb_adap.mdev);
^

Those are because the drivers are not properly checking if the
media device init and register were succeeded.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 9832e155 11-Dec-2015 Javier Martinez Canillas <javier@osg.samsung.com>

[media] media-device: split media initialization and registration

The media device node is registered and so made visible to user-space
before entities are registered and links created which means that the
media graph obtained by user-space could be only partially enumerated
if that happens too early before all the graph has been created.

To avoid this race condition, split the media init and registration
in separate functions and only register the media device node when
all the pending subdevices have been registered, either explicitly
by the driver or asynchronously using v4l2_async_register_subdev().

The media_device_register() had a check for drivers not filling dev
and model fields but all drivers in mainline set them and not doing
it will be a driver bug so change the function return to void and
add a BUG_ON() for dev being NULL instead.

Also, add a media_device_cleanup() function that will destroy the
graph_mutex that is initialized in media_device_init().

[mchehab@osg.samsung.com: Fix compilation if !CONFIG_MEDIA_CONTROLLER
and remove two warnings added by this changeset]
Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 4ca72efa 10-Dec-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] uapi/media.h: Rename entities types to functions

Rename the userspace types from MEDIA_ENT_T_ to MEDIA_ENT_F_
and add the backward compatibility bits.

The changes at the .c files was generated by the following
coccinelle script:

@@
@@
-MEDIA_ENT_T_UNKNOWN
+MEDIA_ENT_F_UNKNOWN
@@
@@
-MEDIA_ENT_T_DVB_BASE
+MEDIA_ENT_F_DVB_BASE
@@
@@
-MEDIA_ENT_T_V4L2_BASE
+MEDIA_ENT_F_V4L2_BASE
@@
@@
-MEDIA_ENT_T_V4L2_SUBDEV_BASE
+MEDIA_ENT_F_V4L2_SUBDEV_BASE
@@
@@
-MEDIA_ENT_T_CONNECTOR_BASE
+MEDIA_ENT_F_CONNECTOR_BASE
@@
@@
-MEDIA_ENT_T_V4L2_VIDEO
+MEDIA_ENT_F_IO_V4L
@@
@@
-MEDIA_ENT_T_V4L2_VBI
+MEDIA_ENT_F_IO_VBI
@@
@@
-MEDIA_ENT_T_V4L2_SWRADIO
+MEDIA_ENT_F_IO_SWRADIO
@@
@@
-MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN
+MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
@@
@@
-MEDIA_ENT_T_CONN_RF
+MEDIA_ENT_F_CONN_RF
@@
@@
-MEDIA_ENT_T_CONN_SVIDEO
+MEDIA_ENT_F_CONN_SVIDEO
@@
@@
-MEDIA_ENT_T_CONN_COMPOSITE
+MEDIA_ENT_F_CONN_COMPOSITE
@@
@@
-MEDIA_ENT_T_CONN_TEST
+MEDIA_ENT_F_CONN_TEST
@@
@@
-MEDIA_ENT_T_V4L2_SUBDEV_SENSOR
+MEDIA_ENT_F_CAM_SENSOR
@@
@@
-MEDIA_ENT_T_V4L2_SUBDEV_FLASH
+MEDIA_ENT_F_FLASH
@@
@@
-MEDIA_ENT_T_V4L2_SUBDEV_LENS
+MEDIA_ENT_F_LENS
@@
@@
-MEDIA_ENT_T_V4L2_SUBDEV_DECODER
+MEDIA_ENT_F_ATV_DECODER
@@
@@
-MEDIA_ENT_T_V4L2_SUBDEV_TUNER
+MEDIA_ENT_F_TUNER
@@
@@
-MEDIA_ENT_T_DVB_DEMOD
+MEDIA_ENT_F_DTV_DEMOD
@@
@@
-MEDIA_ENT_T_DVB_DEMUX
+MEDIA_ENT_F_TS_DEMUX
@@
@@
-MEDIA_ENT_T_DVB_TSOUT
+MEDIA_ENT_F_IO_DTV
@@
@@
-MEDIA_ENT_T_DVB_CA
+MEDIA_ENT_F_DTV_CA
@@
@@
-MEDIA_ENT_T_DVB_NET_DECAP
+MEDIA_ENT_F_DTV_NET_DECAP

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 0e576b76 06-Sep-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] media-entity.h: rename entity.type to entity.function

Entities should have one or more functions. Calling it as a
type proofed to not be correct, as an entity could eventually
have more than one type.

So, rename the field as function.

Please notice that this patch doesn't extend support for
multiple function entities. Such change will happen when
we have real case drivers using it.

No functional changes.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# ab232e46 04-Sep-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: enforce check for graph creation

If the graph creation fails, don't register the device.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 188d2d55 31-Aug-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] tuner-core: add an input pad

Tuners actually have at least one connector on its input.

Add a PAD to connect it.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 8df00a15 07-Aug-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] media: rename the function that create pad links

With the new API, a link can be either between two PADs or between an interface
and an entity. So, we need to use a better name for the function that create
links between two pads.

So, rename the such function to media_create_pad_link().

No functional changes.

This patch was created via this shell script:
for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a && mv a $i; done

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 599bedb7 13-Nov-2015 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx_dvb: use demod_i2c for demod attach

Tested:
* CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx
* CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx

Not Tested:
* CX231XX_BOARD_HAUPPAUGE_EXETER
* CX231XX_BOARD_HAUPPAUGE_955Q

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# d647f0b7 13-Nov-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] include/media: move driver interface headers to a separate dir

Let's not mix headers used by the core with those headers that
are needed by some driver-specific interface header.

The headers used on drivers were manually moved using:
mkdir include/media/drv-intf/
git mv include/media/cx2341x.h include/media/cx25840.h \
include/media/exynos-fimc.h include/media/msp3400.h \
include/media/s3c_camif.h include/media/saa7146.h \
include/media/saa7146_vv.h include/media/sh_mobile_ceu.h \
include/media/sh_mobile_csi2.h include/media/sh_vou.h \
include/media/si476x.h include/media/soc_mediabus.h \
include/media/tea575x.h include/media/drv-intf/

And the references for those headers were corrected using:

MAIN_DIR="media/"
PREV_DIR="media/"
DIRS="drv-intf/"

echo "Checking affected files" >&2
for i in $DIRS; do
for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
n=`basename $j`
git grep -l $n
done
done|sort|uniq >files && (
echo "Handling files..." >&2;
echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
(
cd include/$MAIN_DIR;
for j in $DIRS; do
for i in $(ls $j); do
echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\";
done;
done;
echo "cat > a && mv a \$i; done";
);
echo "Handling documentation..." >&2;
echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
(
cd include/$MAIN_DIR;
for j in $DIRS; do
for i in $(ls $j); do
echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
done;
done;
echo "cat > a && mv a \$i; done"
);
) >script && . ./script

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>


# eee1d06d 20-May-2015 Tommi Rantala <tt.rantala@gmail.com>

[media] cx231xx: Add support for Terratec Grabby

Add support for the Terratec Grabby with USB ID 0ccd:00a6.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 7f3c2e1d 06-Jun-2015 Hans Verkuil <hverkuil@xs4all.nl>

[media] cx231xx: fix compiler warning

Fix this compiler warning by allocating a structure to read the eeprom instead
of doing it on the stack and worse: the eeprom array is static, so that can
cause problems if there are multiple cx231xx instances.

cx231xx-cards.c: In function 'cx231xx_card_setup':
cx231xx-cards.c:1110:1: warning: the frame size of 2064 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^

I did consider removing the code altogether since the result is actually
not used at the moment, but I decided against it since it is used in other
drivers and someone might want to start using it in this driver as well. And
then it is useful that the code is already there.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 60acf187 09-Mar-2015 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx231xx: embed video_device

Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 809abdbf 27-Feb-2015 Olli Salonen <olli.salonen@iki.fi>

[media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tuner

Hauppauge HVR-955Q is a ATSC/QAM USB tuner with LGDT3306A demodulator and SiLabs Si2157-A30 tuner.

Only digital TV has been tested (both ATSC and QAM256).

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 63ba8c75 17-Feb-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: fix compilation if the media controller is not defined

drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_probe’:
drivers/media/usb/cx231xx/cx231xx-cards.c:1589:15: error: ‘struct v4l2_device’ has no member named ‘mdev’
dev->v4l2_dev.mdev = dev->media_dev;
^
drivers/media/usb/cx231xx/cx231xx-cards.c:1589:26: error: ‘struct cx231xx’ has no member named ‘media_dev’
dev->v4l2_dev.mdev = dev->media_dev;
^
scripts/Makefile.build:257: recipe for target 'drivers/media/usb/cx231xx/cx231xx-cards.o' failed

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# d35a9855 03-Jan-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: create media links for analog mode

Now that we have entities and pads, let's create media links
between them, for analog setup.

We may not have all the links for digital yet, as the dvb extention
may not be loaded yet.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 1d058bdc 01-Jan-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: add media controller support

Let's add media controller support for this driver and register it
for both V4L and DVB.

The media controller on this driver is not mandatory, as it can fully
work without it. So, if the media controller register fails, just print
an error message, but proceed with device registering.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# b5603a94 02-Feb-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: don't use dev it not allocated

changeset 5eeb3014827f added a fixup at the error check
code. However, it introduced a new error:

drivers/media/usb/cx231xx/cx231xx-cards.c:1586 cx231xx_usb_probe() error: we previously assumed 'dev' could be null (see line 1430)

This happens when dev = kmalloc() fails. So, instead of relying
on it to succeed, just change the parameter of clear_bit() from
'dev->devno' to 'nr'.

Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 5eeb3014 16-Jan-2015 Alexey Khoroshilov <khoroshilov@ispras.ru>

[media] cx231xx: fix usbdev leak on failure paths in cx231xx_usb_probe()

Commit b7085c086475 ("cx231xx: convert from pr_foo to dev_foo")
moves usb_get_dev(interface_to_usbdev(interface)) to the beginning
of cx231xx_usb_probe() to use udev->dev in dev_err(),
but it does not make sure usbdev is put on all failure paths.

Later dev_err(udev->dev) was replaced by dev_err(d).
So the patch moves usb_get_dev() below (before the first use)
and fixes another failure path.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 336fea92 03-Nov-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: Improve the log message

Unfortunately, on devices that have multiple interfaces, udev->dev
points to the parent device (usb) instead of the cx231xx specific one.

Due to that the logs don't look too nice, as they'll print messages
as if they were produced by USB core:
usb-1-2: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces

Instead of using the name of the parent device, let's use the name
of the first cx231xx interface for all cx231xx sub-modules.

With this path, the logs will be nicer:

cx231xx 1-2:1.1: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 3b795d01 02-Nov-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: use dev_foo instead of printk

There are several places at cx231xx that uses printk without
any special reason. Change all of them to use dev_foo().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# b7085c08 02-Nov-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: convert from pr_foo to dev_foo

Replace all pr_foo occurrences by dev_foo, as this is
the recommended way for drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# ed0e3729 01-Nov-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: Cleanup printk at the driver

There are lots of debug printks printed with pr_info. Also, the
printk's data are not too coherent:

- there are duplicated driver name at the print format;
- function name format string differs from function to function;
- long strings broken into multiple lines;
- some printks just produce ugly reports, being almost useless
as-is.

Do a cleanup on that.

Still, there are much to be done in order to do a better printk
job on this driver, but, at least it will now be a way less
verbose, if debug printks are disabled, and some logs might
actually be useful.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 589dadf2 01-Nov-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: get rid of driver-defined printk macros

It currently does just like what pr_foo() macros do. So,
replace them.

A deeper cleanup is needed, as there are lots of debug macros
printed with pr_info.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 660acd54 01-Oct-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: drop unconditional port3 switching

All switching should be done by i2c mux adapters.
Drop explicit dont_use_port_3 flag.
Drop info message about switch.

Only the removed code in start_streaming is questionable:
It did switch the port_3 flag without accessing i2c in between.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# b9ce9dfd 01-Oct-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: change usage of I2C_1 to the real i2c port

change almost all instances of I2C_1 to I2C_1_MUX_3

Only these cases are changed to I2C_1_MUX_1:
* All that have dont_use_port_3 set.
* CX231XX_BOARD_HAUPPAUGE_EXETER, old code did explicitly not switch to port3.
* eeprom access for 930C

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# c3c3f1ae 01-Oct-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: add wrapper to get the i2c_adapter pointer

This is a preparation for mapping I2C_1_MUX_1 and I2C_1_MUX_3 later to the seperate
muxed i2c adapters.

Map mux adapters to I2C_1 for now.

Add local variables for i2c_adapters in dvb_init to get line lengths
shorter.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# d032ca12 01-Oct-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: Use symbolic constants for i2c ports instead of numbers

Replace numbers by the constants of same value and same meaning.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 9c672890 01-Oct-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: use own i2c_client for eeprom access

This is a preparation for deleting the otherwise useless i2c_clients
that are allocated for all the i2c master adapters.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 8618ac4d 31-Aug-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: Add support for Hauppauge WinTV-HVR-901H (1114xx)

Add support for:
[2040:b139] Hauppauge WinTV HVR-901H (1114xx)

According to the inf file, the hardware is similar to [2040:b131] Hauppauge WinTV 930C-HD (model 1114xx)
The only difference is the demod Si2161 instead of Si2165 (but both are
supported by the si2165 driver).

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 57cbf3ef 31-Aug-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: Add support for Hauppauge WinTV-HVR-900H (111xxx)

Add support for:
[2040:b138] Hauppauge WinTV HVR-900H (111xxx)

The hardware is similar to [2040:b130] Hauppauge WinTV 930C-HD (model 1113xx)
The only difference is the demod Si2161 instead of Si2165 (but both are
supported by the si2165 driver).

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 1f97947c 27-Jul-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: handle errors at read_eeprom()

Fix the following warnings:
drivers/media/usb/cx231xx/cx231xx-cards.c: In function 'read_eeprom':
drivers/media/usb/cx231xx/cx231xx-cards.c:979:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 140a7987 22-Jul-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: Add support for PCTV QuatroStick 522e

Add support for:
[2013:025e] PCTV QuatroStick 522e

The hardware is identical to Hauppauge WinTV 930C-HD (model 1114xx)

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# a141a887 22-Jul-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: Add support for PCTV QuatroStick 521e

Add support for:
[2013:0259] PCTV QuatroStick 521e

The hardware is identical to Hauppauge WinTV 930C-HD (model 1113xx)

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 9e49f7c3 22-Jul-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: Add digital support for HVR930C-HD model 1114xx

Add support for:
[2040:b131] Hauppauge WinTV 930C-HD (model 1114xx)

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Tested-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# dd2e7dd2 22-Jul-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx231xx: Add digital support for HVR 930c-HD model 1113xx

Add support for:
[2040:b130] Hauppauge WinTV 930C-HD (model 1113xx)

After loading the driver the first open to dvb device node fails.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 52841e5e 27-Jul-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: return an error if it can't read PCB config

Instead of using some random value, return an error if the
PCB config is not available or doesn't match a know profile

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 4d2a7d35 27-Jul-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: move analog init code to a separate function

That makes easier to understand the code. It would also help
to add support for having boards with just digital support
on some latter patch, as allowed by some PCB configs.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 184a8278 27-Jul-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: use devm_ functions to allocate memory

The initialization is already too complex. Use devm_ functions
to make the code simpler and easier to modify.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# dcb78ac7 27-Jul-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: Don't let an interface number to go past the array

On some newer boards, like HVR-930C HD, the information at
the PCB tables are sometimes higher than the ones actually
available on the device. That causes the probing code to
go past the interfaces array.

Add checks to the interface number before going past the
array.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 139d2882 27-Jul-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: Fix the max number of interfaces

The max number of interfaces was read from the wrong descriptor.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# dad4c418 04-Jan-2014 Links (Markus) <help.markus+git@gmail.com>

[media] cx231xx: add support for a CX23103 Video Grabber USB

Add a new USB ID to the driver.

Signed-off-by: Links (Markus) <help.markus+git@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 7e4b9187 01-Nov-2013 Dan Carpenter <dan.carpenter@oracle.com>

[media] cx231xx: use after free on error path in probe

We dereference "dev" after it has already been freed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 256d013a 07-Oct-2013 Alexey Khoroshilov <khoroshilov@ispras.ru>

[media] cx231xx: fix double free and leaks on failure path in cx231xx_usb_probe()

There are numerous issues in error handling code of cx231xx initialization.
Double free (when cx231xx_init_dev() calls kfree(dev) via cx231xx_release_resources()
and then cx231xx_usb_probe() does the same) and memory leaks
(e.g. usb_get_dev() before (ifnum != 1) check in cx231xx_usb_probe())
are just a few of them.
The patch fixes the issues in cx231xx_usb_probe() and cx231xx_init_dev()
by moving usb_get_dev(interface_to_usbdev(interface)) below in code and
implementing proper error handling.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 8b1255a2 16-Aug-2013 Johannes Erdfelt <johannes@erdfelt.com>

[media] cx231xx: Add support for KWorld UB445-U

The KWorld UB445-U is similar to the UB430-AF but with a Samsung S5H1411
frontend. Luckily all of the hardware is already well supported, just the
device and USB ids need to be added to get it to work.

Signed-off-by: Johannes Erdfelt <johannes@erdfelt.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 08fe9f7d 29-May-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx231xx: remove g_chip_ident

Remove g_chip_ident and replace it with g_chip_info.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 3ead1ba31 01-Mar-2013 Matt Gomboc <gomboc0@gmail.com>

[media] cx231xx : Add support for OTG102 aka EZGrabber2

Thanks for the response, I have done as you suggested.
Below is an updated patch for the OTG102 device against http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/cx231xx, kernel version 3.8.
With further testing it appears the extra clauses in cx231xx-cards.c were not necessary (in static in cx231xx_init_dev and static int cx231xx_usb_probe), so those have been also been removed.

Signed-off-by: Matt Gomboc <gomboc0@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 69a11a32 07-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx231xx: fix big-endian problems

Tested on my big-endian ppc-based test machine.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# fff9e818 07-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx231xx: don't use port 3 on the Conexant video grabber

It's not working reliably if port 3 is enabled.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# b31077a8 07-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx231xx: disable 417 support from the Conexant video grabber

The 417 support doesn't work. Until someone can dig into this driver to
figure out why it isn't working the 417 support is disabled.
Sometimes you can actually stream a bit, but very soon the whole machine
crashes, so something is seriously wrong.
For the record, this was not introduced by my recent changes to this driver,
it was broken before that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# d2370f8e 17-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx231xx: convert to the control framework

This is needed to resolve the v4l2-compliance complaints about the control
ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 3724dde9 23-Oct-2012 Ezequiel Garcia <elezegarcia@gmail.com>

[media] cx231xx: Replace memcpy with struct assignment

This kind of memcpy() is error-prone. Its replacement with a struct
assignment is prefered because it's type-safe and much easier to read.
Found by coccinelle. Hand patched and reviewed.
Tested by compilation only.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier struct_name;
struct struct_name to;
struct struct_name from;
expression E;
@@
-memcpy(&(to), &(from), E);
+to = from;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 68c97bf3 28-Nov-2012 Alf Høgemark <alf@i100.no>

[media] cx231xx : Add support for Elgato Video Capture V2

This patch adds support for the Elgato Video Capture, version 2, device.
The device is added based on the code for CX231XX_BOARD_HAUPPAUGE_USBLIVE2,
it is simply a copy of the code for that board, with the proper USB device
info for the Elgato Video Capture V2 device.

Signed-off-by: Alf Høgemark <alf@i100.no>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# d4c06133 27-Oct-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx231xx: get rid of warning: no previous prototype

drivers/media/usb/cx231xx/cx231xx-avcore.c:1071:5: warning: no previous prototype for 'stopAudioFirmware' [-Wmissing-prototypes]
drivers/media/usb/cx231xx/cx231xx-avcore.c:1076:5: warning: no previous prototype for 'restartAudioFirmware' [-Wmissing-prototypes]
drivers/media/usb/cx231xx/cx231xx-cards.c:689:6: warning: no previous prototype for 'cx231xx_reset_out' [-Wmissing-prototypes]
drivers/media/usb/cx231xx/cx231xx-cards.c:697:6: warning: no previous prototype for 'cx231xx_enable_OSC' [-Wmissing-prototypes]
drivers/media/usb/cx231xx/cx231xx-cards.c:701:6: warning: no previous prototype for 'cx231xx_sleep_s5h1432' [-Wmissing-prototypes]
drivers/media/usb/cx231xx/cx231xx-i2c.c:75:5: warning: no previous prototype for 'cx231xx_i2c_send_bytes' [-Wmissing-prototypes]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 0c0d06ca 13-Aug-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] rename most media/video usb drivers to media/usb

Rename all USB drivers with their own directory under
drivers/media/video into drivers/media/usb and update the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>