History log of /linux-master/drivers/media/pci/cx23885/cx23885.h
Revision Date Author Comments
# 74637731 01-Sep-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: cx23885-alsa: number of pages should be unsigned long

As reported by smatch:

drivers/media//pci/cx23885/cx23885-alsa.c:83 cx23885_alsa_dma_init() warn: should 'nr_pages << 12' be a 64 bit type?

the number of patches should be unsigned long.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# dc4cac67 16-Nov-2019 Forest Crossman <cyrozap@gmail.com>

media: cx23885: Add support for AVerMedia CE310B

The AVerMedia CE310B is a simple composite + S-Video + stereo audio
capture card, and uses only the CX23888 to perform all of these
functions.

I've tested both video inputs and the audio interface and confirmed that
they're all working. However, there are some issues:

* Sometimes when I switch inputs the video signal turns black and can't
be recovered until the system is rebooted. I haven't been able to
determine the cause of this behavior, nor have I found a solution to
fix it or any workarounds other than rebooting.
* The card sometimes seems to have trouble syncing to the video signal,
and some of the VBI data appears as noise at the top of the frame, but
I assume that to be a result of my very noisy RF environment and the
card's unshielded input traces rather than a configuration issue.

Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 2169e6da 11-Jun-2019 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: media/pci: don't set description for ENUM_FMT

The V4L2 core sets the description for the driver in order to ensure
consistent naming.

So drop the strscpy of the description in drivers. Also remove any
description strings in driver-internal structures since those are
no longer needed.

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


# c942fddf 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 3 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

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 [author] [kishon] [vijay] [abraham]
[i] [kishon]@[ti] [com] 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

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 [author] [graeme] [gregory]
[gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
[kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
[hk] [hemahk]@[ti] [com] 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

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

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

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


# 16790554 18-Feb-2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: pci: fix several typos

Use codespell to fix lots of typos over frontends.

Manually verified to avoid false-positives.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 4bd46aa0 18-Dec-2018 Brad Love <brad@nextdimension.cc>

media: cx23885: only reset DMA on problematic CPUs

It is reported that commit 95f408bbc4e4 ("media: cx23885: Ryzen DMA
related RiSC engine stall fixes") caused regresssions with other CPUs.

Ensure that the quirk will be applied only for the CPUs that
are known to cause problems.

A module option is added for explicit control of the behaviour.

Fixes: 95f408bbc4e4 ("media: cx23885: Ryzen DMA related RiSC engine stall fixes")

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


# c00ba2c1 05-Jan-2018 Brad Love <brad@nextdimension.cc>

media: cx23885: Add support for new Hauppauge QuadHD (885)

Add new QuadHD digital only PCIe boards to driver list.
Differentiate them from 888 digital/analog QuadHD models.

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


# 16fad674 05-Jan-2018 Brad Love <brad@nextdimension.cc>

media: cx23885: Add support for Hauppauge PCIe Starburst2

Add new PCIe DVB-S/S2.
A single port Hauppauge HVR-5525

cx23885 + a8293 + m88rs6000t

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


# 94f11518 05-Jan-2018 Brad Love <brad@nextdimension.cc>

media: cx23885: Add support for Hauppauge PCIe HVR1265 K4

Add new PCIe board to driver list and board register/configure functions

cx23885 + lgdt3306a + si2157 digital/analog

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


# 6e6a8b5a 04-Jan-2018 Mauro Carvalho Chehab <mchehab@kernel.org>

media: replace all <spaces><tab> occurrences

There are a lot of places where sequences of space/tabs are
found. Get rid of all spaces before tabs.

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


# 0e2d9a9d 27-Sep-2017 Bhumika Goyal <bhumirks@gmail.com>

media: cx23885/saa7134: make vb2_ops const

Make vb2_ops const as they are only stored in the const field of a
vb2_queue structure. Make the declarations const too.

Done using Coccinelle.

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


# e39682b5 13-Nov-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx23885: convert it to use pr_foo() macros

Instead of calling printk() directly, use pr_foo()
macros, as suggested at the Kernel's coding style.

Please notice that a conversion to dev_foo() is not trivial,
as several parts on this driver uses pr_cont().

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


# e837d85c 22-Sep-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx23885: Fix some smatch warnings

Make sure that it won't go past the config buffers

drivers/media/pci/cx23885/cx23885-dvb.c:1733 dvb_register() warn: buffer overflow 'netup_xc5000_config' 2 <= s32max
drivers/media/pci/cx23885/cx23885-dvb.c:1745 dvb_register() warn: buffer overflow 'netup_stv0367_config' 2 <= s32max
drivers/media/pci/cx23885/cx23885-dvb.c:1752 dvb_register() warn: buffer overflow 'netup_xc5000_config' 2 <= s32max

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


# dd9ad4fb 09-Aug-2016 Stephen Backway <stev391@gmail.com>

[media] cx23885: Add support for Hauppauge WinTV quadHD ATSC version

Add support for the Hauppauge WinTV quadHD ATSC version.
IR support has not been provided, all 4 tuners, demodulators etc are working.
Further documentation can be found on Linux TV wiki.

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


# 10a5210e 02-Jul-2016 Stephen Backway <stev391@gmail.com>

[media] cx23885: Add support for Hauppauge WinTV quadHD DVB version

Add support fo the Hauppauge WinTV quadHD DVB version.
IR support has not been provided, all 4 tuners, demodulators etc are working.
Further documentation can be found on Linux TV wiki.

Signed-off-by: Stephen Backway <stev391@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 2bc46b3a 14-Feb-2016 Hans Verkuil <hans.verkuil@cisco.com>

[media] media/pci: convert drivers to use the new vb2_queue dev field

Stop using alloc_ctx and just fill in the device pointer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6c43a217 30-Nov-2015 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: add support for ViewCast 260e and 460e

Add support for these two new cards.

Based upon Devin's initial patch made for an older kernel which I
cleaned up and rebased. Thanks to Kernel Labs for that work.

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


# e80bf856 30-Nov-2015 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: fix format/crop handling

While testing the cx23885 driver with various TV standards I found
a number of bugs:

1) norm_maxw() returned 768 instead of 720 for PAL formats. This should
always be 720, so drop this inline function and just always use 720.
2) cropcap() was missing, so the pixelaspect was never known and qv4l2 would
scale the image incorrectly. Add cropcap support.
3) cx23885_set_tvnorm() should just return 0 if the same standard was
set again. If another standard is set, then reset the width/height and
call set_fmt for the subdevs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
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>


# 2d700715 22-Sep-2015 Junghak Sung <jh1009.sung@samsung.com>

[media] media: videobuf2: Restructure vb2_buffer

Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer.

Add new member variables - bytesused, length, offset, userptr, fd,
data_offset - to struct vb2_plane in order to cover all information
of v4l2_plane.
struct vb2_plane {
<snip>
unsigned int bytesused;
unsigned int length;
union {
unsigned int offset;
unsigned long userptr;
int fd;
} m;
unsigned int data_offset;
}

Replace v4l2_buf with new member variables - index, type, memory - which
are common fields for buffer management.
struct vb2_buffer {
<snip>
unsigned int index;
unsigned int type;
unsigned int memory;
unsigned int num_planes;
struct vb2_plane planes[VIDEO_MAX_PLANES];
<snip>
};

v4l2 specific fields - flags, field, timestamp, timecode,
sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c
struct vb2_v4l2_buffer {
struct vb2_buffer vb2_buf;

__u32 flags;
__u32 field;
struct timeval timestamp;
struct v4l2_timecode timecode;
__u32 sequence;
};

Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 0df289a2 07-Jun-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] dvb: Get rid of typedev usage for enums

The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.

So, let's do it.

This patch was generated by this shell script:

for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done

While here, make CodingStyle fixes on the affected lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*


# bf5e3ef0 16-Apr-2015 Antti Palosaari <crope@iki.fi>

[media] cx23885: add support for DVB I2C SEC client

Add support for I2C SEC (satellite equipment controller) client.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 721f3223 22-Dec-2014 Matthias Schwarzott <zzam@gentoo.org>

[media] cx23885: Split Hauppauge WinTV Starburst from HVR4400 card entry

Unconditionally attaching Si2161/Si2165 demod driver
breaks Hauppauge WinTV Starburst.
So create own card entry for this.

Add card name comments to the subsystem ids.

This fixes a regression introduced in 3.17 by
36efec48e2e6016e05364906720a0ec350a5d768 ([media] cx23885: Add si2165 support for HVR-5500)

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: stable@vger.kernel.org # for 3.17 and upper
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 1fc77d01 11-Dec-2014 Antti Palosaari <crope@iki.fi>

[media] cx23885: Hauppauge WinTV-HVR5525

Add board profile for Hauppauge WinTV-HVR5525.

Device is build upon following main components:
Conexant CX23888
Montage M88RS6000
Allegro A8293
Silicon Labs Si2168-B40
Silicon Labs Si2157-A30

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 0c3a14c1 18-Nov-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] vb2-dma-sg: add allocation context to dma-sg

Require that dma-sg also uses an allocation context. This is in preparation
for adding prepare/finish memops to sync the memory between DMA and CPU.

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


# c02ef64a 11-Nov-2014 Nibble Max <nibble.max@gmail.com>

[media] cx23885: add DVBSky T982(Dual DVB-T2/T/C) support

DVBSky T982 DVB-T2/T/C dual PCIe card:
1>dvb frontend: SI2158A20(tuner),SI2168A30(demod)
2>PCIe bridge: CX23885(port b: parallel mode, port c: serial mode)
3>rc: cx23885 integrated.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# c29d6a83 05-Nov-2014 nibble.max <nibble.max@gmail.com>

[media] cx23885: add DVBSky S952 support

DVBSky S952 dvb-s/s2 dual PCIe card:
1>dvb frontend: M88TS2022(tuner),M88DS3103(demod)
2>PCIe bridge: CX23885(port b: parallel mode, port c: serial mode)
3>rc: cx23885 integrated.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# cba5480c 05-Nov-2014 nibble.max <nibble.max@gmail.com>

[media] cx23885: add DVBSky S950 support

DVBSky S950 dvb-s/s2 PCIe card:
1>dvb frontend: M88TS2022(tuner),M88DS3103(demod)
2>PCIe bridge: cx23885
3>rc: cx23885 integrated.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 61b103e8 30-Oct-2014 Olli Salonen <olli.salonen@iki.fi>

[media] cx23885: add support for TechnoTrend CT2-4500 CI

TechnoTrend CT2-4500 CI is a PCIe device with DVB-T2/C tuner. It is
similar to DVBSky T980C, just with different PCI ID and remote controller.

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


# 0e6c7b01 23-Oct-2014 nibble.max <nibble.max@gmail.com>

[media] cx23885: add DVBSky S950C dvb-s/s2 ci PCIe card support(no RC)

DVBSky s950ci dvb-s/s2 ci PCIe card:
1>dvb frontend: M88TS2022(tuner),M88DS3103(demod)
2>ci controller: CIMAX SP2 or its clone.
3>PCIe bridge: CX23885

The patchs are based on the following patchs.
Olli Salonen submit:
https://patchwork.linuxtv.org/patch/26180/
https://patchwork.linuxtv.org/patch/26183/
https://patchwork.linuxtv.org/patch/26324/
Nibble Max submit:
https://patchwork.linuxtv.org/patch/26207/

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# e450de45 29-Sep-2014 Olli Salonen <olli.salonen@iki.fi>

[media] cx23885: add I2C client for CI into state and handle unregistering

If the CI chip has an I2C driver, we need to store I2C client into state.

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


# 82c10276 29-Sep-2014 Olli Salonen <olli.salonen@iki.fi>

[media] cx23855: add support for DVBSky T980C (no CI support)

This patch adds basic support for DVBSky T980C card. CI interface is not supported.

DVBSky T980C is a PCIe card with the following components:
- CX23885 PCIe bridge
- Si2168-A20 demodulator
- Si2158-A20 tuner
- CIMaX SP2 CI chip

The demodulator and tuner need firmware. They're the same as used with TT CT2-4650 CI:
https://www.mail-archive.com/linux-media@vger.kernel.org/msg78033.html

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


# 29442266 11-Aug-2014 Olli Salonen <olli.salonen@iki.fi>

[media] cx23855: add support for DVBSky T9580 DVB-C/T2/S2 tuner

DVBSky T9580 is a dual tuner card with one DVB-T2/C tuner and one DVB-S2 tuner. It contains the following components:

- PCIe bridge: Conexant CX23885
- Demod for terrestrial/cable: Silicon Labs Si2168-A30
- Tuner for terrestrial/cable: Silicon Labs Si2158-A20
- Demod for sat: Montage DS3103
- Tuner for sat: Montage TS2022

This patch depends on Max Nibble's patch for m88ds3103 (see patchwork 25312: https://patchwork.linuxtv.org/patch/25312/ ).

3 firmwares are needed:
- Si2168-A30 demod and Si2158-A20 tuner: same as TechnoTrend CT2-4400, https://www.mail-archive.com/linux-media@vger.kernel.org/msg76944.html
- Montage DS3103 demod: same as PCTV 461e, Antti has it on his LinuxTV project page: http://palosaari.fi/linux/v4l-dvb/firmware/M88DS3103/

IR receiver is not supported.

Values in cx23885_gpio_setup, cx23885_card_setup and dvbsky_t9580_set_voltage as well as the EEPROM read function are taken from the manufacturer provided semi-open source driver. The drivers in question are Linux GPL'd media tree drivers for cx23885 modified by Max Nibble (nibble.max@gmail.com) with proprietary tuner/demod drivers. Max is aware of this patch and has approved my use of the values in this patch.

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


# 5cd3b6b4 11-Aug-2014 Olli Salonen <olli.salonen@iki.fi>

[media] cx23855: add frontend set voltage function into state

Setting the LNB voltage requires setting some GPIOs on the cx23885 with some boards before calling the actual set_voltage function in the demod driver. Add a function pointer into state for that case.

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


# b0b12e63 11-Aug-2014 Olli Salonen <olli.salonen@iki.fi>

[media] cx23885: add i2c client handling into dvb_unregister and state

Prepare cx23885 driver for handling I2C client that is needed for certain demodulators and tuners (for example Si2168 and Si2157). I2C client for tuner and demod stored in state and unregistering of the I2C devices added into dvb_unregister.

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


# 1c5eaa23 20-Sep-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: fix size helper functions

The norm_swidth function was unused and is dropped. It's not clear
what the purpose of that function was.

The norm_maxh function was changed so it tests for 60 Hz standards
rather than for 50 Hz standards. The is the preferred order.

The norm_maxw function was poorly written and used: it gives the maximum
allowed line width for the given standard. For 60 Hz that's 720, but
for 50 Hz that's 768 which allows for 768x576 which gives you square
pixels. For 60 Hz formats it is 640x480 that gives square pixels, so
there is no need to go beyond 720.

The initial width was set using norm_maxh(), which was wrong. Just set
to 720, that's what you normally use. Since the initial standard was
NTSC anyway the initial width was always 720 anyway.

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


# 4d63a25c 10-Aug-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: remove btcx-risc dependency

It's just as easy to do it in the driver. This dependency only uses a
fraction of the btcx-risc module and doing it directly in the driver
adds only a few lines. The btcx-risc module is really meant for the
bttv driver, not for other drivers.

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


# 453afdd9 14-Aug-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: convert to vb2

As usual, this patch is very large due to the fact that half a vb2 conversion
isn't possible. And since this affects 417, alsa, core, dvb, vbi and video the
changes are all over.

What made this more difficult was the peculiar way the risc program was setup.
The driver allowed for running out of buffers in which case the DMA would stop
and restart when the next buffer was queued. There was also a complicated
timeout system for when buffers weren't filled. This was replaced by a much
simpler scheme where there is always one buffer around and the DMA will just
cycle that buffer until a new buffer is queued. In that case the previous
buffer will be chained to the new buffer. An interrupt is generated at the
start of the new buffer telling the driver that the previous buffer can be
passed on to userspace.

Much simpler and more robust. The old code seems to be copied from the
cx88 driver. But it didn't fit the vb2 ops very well and replacing it with
the new scheme made the code easier to understand. Not to mention that this
patch removes 600 lines of code.

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


# 03105397 09-Aug-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: remove FSF address as per checkpatch

These addresses are usually out-of-date and the top-level license will
always have the right address. So drop it from these sources.

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


# 568f44a1 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: use video_drvdata to get cx23885_dev pointer

Use video_drvdata(file) instead of fh->dev to get the cx23885_dev
pointer. This prepares for the vb2 conversion where fh->dev (renamed
to fh->q_dev in this patch) will be removed completely.

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


# 9529a4b0 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: drop videobuf abuse in cx23885-alsa

The alsa driver uses videobuf low-level functions that are not
available in vb2, so replace them by driver-specific functions.

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


# 91d2d674 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: fmt, width and height are global, not per-fh

Move these fields from cx23885_fh to cx23885_dev.

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


# e749c6e6 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: drop unused clip fields from struct cx23885_fh

There is no overlay support, so drop these unused fields.

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


# 1f159c77 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: drop type field from struct cx23885_fh

This information is available elsewhere as well.

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


# 86961933 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: drop radio-related dead code

Currently no radio device nodes are ever created, so remove the dead radio
code.

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


# 5150392c 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: convert 417 to the control framework

Convert the -417 source to the control framework as well.

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


# da59a4de 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: convert to the control framework

This is part 1, converting the uncompressed video/vbi nodes to use
the control framework.

The next patch converts the compressed video node as well.

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


# 86dd9831 23-Apr-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: support v4l2_fh and g/s_priority

Add support for struct v4l2_fh and priority handling.

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


# 46b21bba 12-Jun-2014 James Harper <james.harper@ejbdigital.com.au>

[media] Add support for DViCO FusionHDTV DVB-T Dual Express2

DViCO FusionHDTV DVB-T Dual Express2 is cx23885 + dib7070

[m.chehab@samsung.com: fix conflicts and make checkpatch happy]

Signed-off-by: James Harper <james.harper@ejbdigital.com.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# cce11b09 27-Jun-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] cx23885: add support for Hauppauge ImpactVCB-e

Add support for Hauppauge model 71100: WinTV-ImpactVCB-e
(PCIe, Retail, half height)

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


# 642ca1a0 13-Sep-2013 Anca Emanuel <anca.emanuel@gmail.com>

[media] cx23885: Add Leadtek Winfast PxPVR2200

Tested:
Composite: http://imgur.com/Rb1TCF3
TV: http://imgur.com/KNrfsmv
Firmware used: xc3028-v27.fw

Not tested: audio, component, s-video, mpeg2 encoder, FM radio.

For audio, it uses an CD style cable to connect to the analog "CD_IN" on the motherboard.

I didn't found how to unmute it (alsamixer do not show an CD or AUX channel).

Signed-off-by: Anca Emanuel <anca.emanuel@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# e6001482 01-Oct-2013 Luis Alves <ljalvs@gmail.com>

[media] cx23885: add support for cx24117 with tbs6980 or tbs6981

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 15472faf 09-Aug-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] cx23885-dvb: use a better approach to hook set_frontend

When the frontend drivers got converted to DVBv5 API, the original
hook that tracked when a frontend is set got removed, being replaced
by an approach that would use the gate control. That doesn't work
fine with some boards. Also, the code were called more times than
desired.
Replace it by a logic that will hook the dvb set_frontend ops,
with works with both DVBv3 and DVBv5 calls.
Tested on a Mygica X8502 OEM board.

Tested-by: Alfredo Delaiti <alfredodelaiti@netscape.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# b530a447 19-Mar-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] v4l2: add const to argument of write-only s_frequency ioctl

This ioctl is defined as IOW, so pass the argument as const.

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


# e8d42373 08-Dec-2012 Oleh Kravchenko <oleg@kaa.org.ua>

[media] Added support for AVerTV Hybrid Express Slim HC81R

This patch provide only analog support.
The device is based on AF9013 demodulator, XC3028 tuner
and CX23885 chipset; subsystem id: 1461:d939

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


# 7c62f5a1 15-Dec-2012 Michael Krufky <mkrufky@linuxtv.org>

[media] cx23885: add basic DVB-S2 support for Hauppauge HVR-4400

Add basic DVB-S2 support for the Hauppauge HVR-4400 PCIe board.
Thanks to Antti Palosaari and Devin Heitmueller for their
suggestions and testing.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# f667190b 12-Sep-2012 Mariusz Bia?o?czyk <manio@skyboo.net>

[media] Add support for Prof Revolution DVB-S2 8000 PCI-E card

The device is based on STV0903 demodulator, STB6100 tuner
and CX23885 chipset; subsystem id: 8000:3034
This is a modified version of the official Prof Tuners Group patch:
http://www.proftuners.com/sites/default/files/prof8000_0.patch

[mchehab@redhat.com: trivial merge conflict fixup]
Signed-off-by: Mariusz Bialonczyk <manio@skyboo.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


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

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

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

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