[media] Export I2C module alias information in missing drivers
The I2C core always reports the MODALIAS uevent as "i2c:<client name"
regardless if the driver was matched using the I2C id_table or the
of_match_table. So the driver needs to export the I2C table and this
be built into the module or udev won't have the necessary information
to auto load the correct module when the device is added.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Peter Griffin [Thu, 30 Jul 2015 17:09:00 +0000 (14:09 -0300)]
[media] c8sectpfe: Add Kconfig and Makefile for the driver
This patch adds the Kconfig and Makefile for the c8sectpfe driver
so it will be built. It also selects additional demodulator and tuners
which are required by the supported NIM cards.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Peter Griffin [Thu, 30 Jul 2015 17:08:59 +0000 (14:08 -0300)]
[media] c8sectpfe: Add c8sectpfe debugfs support
Some basic debugfs support to dump the IP registers. Further
statistics could easily be added in the future for example for
each enabled tsin channel we could expose number of corrupt packets
received etc.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Peter Griffin [Thu, 30 Jul 2015 17:08:58 +0000 (14:08 -0300)]
[media] c8sectpfe: Add support for various ST NIM cards
This patch adds support for the following 2 NIM cards: -
1) B2100A (2x stv0367 demods & 2x NXP tda18212 tuners)
2) STV0903-6110NIM (stv0903 demod + 6110 tuner, lnb24)
A NIM card is a cold plugable expansion card which usually
features a demodulator / tuner combination.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Peter Griffin [Thu, 30 Jul 2015 17:08:57 +0000 (14:08 -0300)]
[media] c8sectpfe: Add LDVB helper functions
These functions are used by the core code for creating the LDVB
devices and adapter.
Addtionally some older SoC's (and potentially newer ones) have different
frontend HW which would allow those devices to be easily supported
in the future by keeping the code specific to the IP separate from the
more generic code.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Peter Griffin [Thu, 30 Jul 2015 17:08:56 +0000 (14:08 -0300)]
[media] c8sectpfe: STiH407/10 Linux DVB demux support
This patch adds support for the c8sectpfe input HW found on
STiH407/410 SoC's.
It currently supports the TS input block, memdma engine
and hw PID filtering blocks of the C8SECTPFE subsystem.
The driver creates one LinuxDVB adapter, and a
demux/dvr/frontend set of devices for each tsin channel
which is specificed in the DT. It has been tested with
multiple tsin channels tuned, locked, and grabbing TS
simultaneously.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Joe Perches [Thu, 30 Jul 2015 17:08:53 +0000 (14:08 -0300)]
[media] dvb-pll: Convert struct dvb_pll_desc uses to const
Convert the struct dvb_pll_desc uses to const and
change the "entries" fixed array size from 12 to []
It saves a couple KB overall and remove ~5KB of data.
$ size drivers/media/dvb-frontends/dvb-pll.o*
text data bss dec hex filename
8520 1552 2120 12192 2fa0 drivers/media/dvb-frontends/dvb-pll.o.new
5624 6363 2120 14107 371b drivers/media/dvb-frontends/dvb-pll.o.old
[PG] Patch taken from https://lkml.org/lkml/2015/6/24/721 with
commit message updated.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Reviewed-by: Michael Ira Krufky <m.krufky@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Peter Griffin [Thu, 30 Jul 2015 17:08:52 +0000 (14:08 -0300)]
[media] stv0367: Add support for 16Mhz reference clock
The B2100A dvb NIM card from ST has 2x stv0367 demodulators
and 2x TDA18212 silicon tuners, with a 16Mhz crystal. To
get this working properly with the upstream driver we need
to add support for the 16Mhz reference clock.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Peter Griffin [Thu, 30 Jul 2015 17:08:51 +0000 (14:08 -0300)]
[media] stv0367: Refine i2c error trace to include i2c address
When using stv0367 demodulator with STi STB platforms,
we can have easily have four or more stv0367 demods running
in the system at one time.
As typically the b2120 reference design ships with a b2004a daughter
board, which can accept two dvb NIM cards, and each b2100A NIM
has 2x stv0367 demods and 2x NXPs tuner on it.
In such circumstances it is useful to print the i2c address
on error messages to know which one is failing due to I2C issues.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
The Linux stack is short; we need to be able to count the number
of bytes used at stack on each function. So, we don't like to
use variable-length arrays, as complained by smatch:
drivers/media/dvb-frontends/horus3a.c:57:19: warning: Variable length array is used.
The max usecase of the driver seems to be 10 bytes + 1 for the
register.
So, let's be safe and allocate 11 bytes for the write buffer.
This should be enough to cover all cases. If not, let's print
an error message.
The Linux stack is short; we need to be able to count the number
of bytes used at stack on each function. So, we don't like to
use variable-length arrays, as complained by smatch:
drivers/media/dvb-frontends/horus3a.c:57:19: warning: Variable length array is used.
The max usecase of the driver seems to be 5 bytes + 1 for the
register.
So, let's be safe and allocate 6 bytes for the write buffer.
This should be enough to cover all cases. If not, let's print
an error message.
[media] cxd2841er: don't use variable length arrays
The Linux stack is short; we need to be able to count the number
of bytes used at stack on each function. So, we don't like to
use variable-length arrays, as complained by smatch:
drivers/media/dvb-frontends/cxd2841er.c:205:19: warning: Variable length array is used.
The max usecase of the driver seems to be 15 bytes + 1 for the
register.
So, let's be safe and allocate 17 bytes for the write buffer.
This should be enough to cover all cases. If not, let's print
an error message.
Add NetUP Dual Universal CI PCIe board driver.
The board has
- two CI slots
- two I2C adapters
- SPI master bus for accessing flash memory containing
FPGA firmware
[media] cxd2841er: declare static functions as such
drivers/media/dvb-frontends/cxd2841er.c:992:5: warning: no previous prototype for 'cxd2841er_get_carrier_offset_t2' [-Wmissing-prototypes]
int cxd2841er_get_carrier_offset_t2(
^
drivers/media/dvb-frontends/cxd2841er.c:1032:5: warning: no previous prototype for 'cxd2841er_get_carrier_offset_c' [-Wmissing-prototypes]
int cxd2841er_get_carrier_offset_c(
^
drivers/media/dvb-frontends/cxd2841er.c:1360:5: warning: no previous prototype for 'cxd2841er_read_snr_t2' [-Wmissing-prototypes]
int cxd2841er_read_snr_t2(struct cxd2841er_priv *priv, u32 *snr)
^
Add DVB SEC frontend driver for STM LNBH25PQR chip.
[mchehab@osg.samsung.com: fix merge conflict:
fe_sec_voltage_t should not be used in kernelspace anymore.
instead, it should use enum fe_sec_voltage] Signed-off-by: Kozlov Sergey <serjk@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Christian Löpke [Sat, 18 Jul 2015 07:15:01 +0000 (04:15 -0300)]
[media] Technisat SkyStar USB HD,(DVB-S/S2) too much URBs for arm devices
Using 8 URBs results in a consecutive buffer allocation of too much
memory for some arm devices.
As we use isochronuous transfers the number of URBs can be reduced
without risking data-loss.
Signed-off-by: Christian Loepke <loepke@edfritsch.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
David Härdeman [Wed, 22 Jul 2015 20:55:24 +0000 (17:55 -0300)]
[media] rc-core: improve the lirc protocol reporting
Commit 275ddb40bcf686d210d86c6718e42425a6a0bc76 removed the lirc
"protocol" but kept backwards compatibility by always listing
the protocol as present and enabled. This patch further improves
the logic by only listing the protocol if the lirc module is loaded
(or if lirc is builtin).
Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Vaishali Thakkar [Fri, 26 Jun 2015 04:34:37 +0000 (01:34 -0300)]
[media] pctv452e: Replace memset with eth_zero_addr
Use eth_zero_addr to assign the zero address to the given address
array instead of memset when second argument is address of zero.
Note that the 6 in the third argument of memset appears to represent
an ethernet address size (ETH_ALEN).
The Coccinelle semantic patch that makes this change is as follows:
[media] tuners: Make all TV tuners visible if COMPILE_TEST=y
Make the TV tuners menu visible when compile-testing, to allow
selecting additional drivers on top of the drivers that are already
automatically selected if MEDIA_SUBDRV_AUTOSELECT is enabled.
Without this, many drivers stay disabled during e.g. allmodconfig.
Vaishali Thakkar [Fri, 26 Jun 2015 04:47:49 +0000 (01:47 -0300)]
[media] ttpci: Replace memset with eth_zero_addr
Use eth_zero_addr to assign the zero address to the given address
array instead of memset when second argument is address of zero.
Note that the 6 in the third argument of memset appears to represent
an ethernet address size (ETH_ALEN).
The Coccinelle semantic patch that makes this change is as follows:
[media] i2c: Make all i2c devices visible if COMPILE_TEST=y
Make the i2c devices menu visible when compile-testing, to allow
selecting additional drivers on top of the drivers that are already
automatically selected if MEDIA_SUBDRV_AUTOSELECT is enabled.
Without this, many drivers stay disabled during e.g. allmodconfig.
[media] dvb-frontends: Make all DVB Frontends visible if COMPILE_TEST=y
Make the DVB Frontends menu visible when compile-testing, to allow
selecting additional drivers on top of the drivers that are already
automatically selected if MEDIA_SUBDRV_AUTOSELECT is enabled.
Without this, many drivers stay disabled during e.g. allmodconfig.
[media] x86/mm/pat, drivers/media/ivtv: move pat warn and replace WARN() with pr_warn()
On built-in kernels this warning will always splat as this is part
of the module init. Fix that by shifting the PAT requirement check
out under the code that does the "quasi-probe" for the device. This
device driver relies on an existing driver to find its own devices,
it looks for that device driver and its own found devices, then
uses driver_for_each_device() to try to see if it can probe each of
those devices as a frambuffer device with ivtvfb_init_card(). We
tuck the PAT requiremenet check then on the ivtvfb_init_card()
call making the check at least require an ivtv device present
before complaining.
Reported-by: Fengguang Wu <fengguang.wu@intel.com> [0-day test robot] Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antonio Borneo [Tue, 23 Jun 2015 14:53:19 +0000 (11:53 -0300)]
[media] s5c73m3: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus
field of an spi_driver to spi_bus_type. These days this is done in
spi_register_driver(), so we can drop the manual assignment.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Krzysztof Hałasa [Fri, 19 Jun 2015 10:20:40 +0000 (07:20 -0300)]
[media] pci/Kconfig: don't use MEDIA_ANALOG_TV_SUPPORT for grabber cards
I noticed certain cards are currently under MEDIA_ANALOG_TV_SUPPORT
but it seems they are frame grabbers (with CVBS, Svideo etc. inputs)
rather than TV receivers (with analog TV tuners).
MEDIA_CAMERA_SUPPORT maybe isn't the best name (only "meye" driver seems
to drive a real camera in a laptop) but it at least doesn't select the
TUNERs.
Perhaps the following patch would make sense.
Signed-off-by: Krzysztof Ha?asa <khalasa@piap.pl> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/mt9v032.c: In function ‘mt9v032_probe’:
CC [M] drivers/media/i2c/s5k4ecgx.o
drivers/media/i2c/mt9v032.c:996:20: warning: ‘pdata’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (pdata && pdata->link_freqs) {
^
It can indeed be uninitialized in one corner case. Initialize to NULL.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Philipp Zabel [Thu, 6 Aug 2015 12:38:02 +0000 (09:38 -0300)]
[media] v4l2: move tracepoint generation into separate file
To compile videobuf2-core as a module, the vb2_* tracepoints must be
exported from the videodev module. Instead of exporting vb2 tracepoint
symbols from v4l2-ioctl.c, move the tracepoint generation into a separate
file. This patch fixes the following build error in the modpost stage,
introduced by 2091f5181c66 ("[media] videobuf2: add trace events"):
Prashant Laddha [Mon, 3 Aug 2015 08:36:43 +0000 (05:36 -0300)]
[media] vivid: support cvt, gtf timings for video out
The generation of cvt, gtf timings is already supported by v4l2-ctl.
This patch adds support for setting cvt,gtf timings for video out.
While enabling cvt,gtf in vivid capture, the vivid video out was
missed out. Adding it now.
William Towle [Thu, 23 Jul 2015 12:21:34 +0000 (09:21 -0300)]
[media] media: adv7604: reduce support to first (digital) input
Using adv7611_read_cable_det() for ADV7612 means that full
support for '.max_port = ADV7604_PAD_HDMI_PORT_B,' isn't available
due to the need for multiple port reads to determine cable detection,
and an agreed mechanism for communicating the separate statuses.
This patch replaces adv7611_read_cable_det() with a functionally
identical copy, commented appropriately.
Earlier submissions [leading to commit 8331d30b] also set .cp_csc,
which is used in a cp_read() call within adv76xx_log_status().
Signed-off-by: William Towle <william.towle@codethink.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
William Towle [Thu, 23 Jul 2015 12:21:33 +0000 (09:21 -0300)]
[media] media: adv7604: fix probe of ADV7611/7612
Prior to commit f862f57d ("[media] media: i2c: ADV7604: Migrate to
regmap"), the local variable 'val' contained the combined register
reads used in the chipset version ID test. Restore this expectation
so that the comparison works as it used to.
Signed-off-by: William Towle <william.towle@codethink.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 15 Jun 2015 11:33:38 +0000 (08:33 -0300)]
[media] soc_camera: compliance fixes
- REQBUFS(0) will stop streaming, free buffers and release the file ownership.
- Return ENOTTY for create_bufs for a vb1 driver
- Return EBUSY if there is a different streaming owner and set the new owner on
success.
Hans Verkuil [Mon, 15 Jun 2015 11:33:37 +0000 (08:33 -0300)]
[media] soc_camera: fix expbuf support
- For vb1 drivers just return -ENOTTY.
- For vb2 drivers allow vb2_expbuf without there being a stream owner:
the vb2_expbuf function will return the correct error message in that case.
Hans Verkuil [Mon, 15 Jun 2015 11:33:32 +0000 (08:33 -0300)]
[media] ak881x: simplify standard checks
Simplify confusing conditions. This also swaps the checks for NTSC and PAL:
to be consistent with other drivers check for NTSC first. So if the user
sets both NTSC and PAL bits, then NTSC wins.
Antti Palosaari [Tue, 21 Apr 2015 14:16:44 +0000 (11:16 -0300)]
[media] tda10071: do not get_frontend() when not ready
This is a bit hack, but returning error when driver is not tuned yet
causes DVBv5 zap stop polling DVBv5 statistics. Thus return 0 even
callback is called during invalid device state.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Tue, 21 Apr 2015 12:58:15 +0000 (09:58 -0300)]
[media] tda10071: protect firmware command exec with mutex
There should be clearly some lock in order to make sure firmware
command in execution is not disturbed by another command. It has
worked as callbacks are serialized somehow pretty well and command
execution happens usually without any delays.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
On power-on LNB power supply voltage is disabled, due to that no
need to disable it during probe. Tone is supply is hard-coded as
external tone coming from the demodulator. Program both voltage
and tone on set_voltage(). Use register cache to prevent unneeded
programming.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 20 Jul 2015 13:18:22 +0000 (10:18 -0300)]
[media] bt819/saa7110/vpx3220: remove legacy control ops
The zoran driver has now been converted to the control framework
which means that these three subdevice drivers no longer need to
support the legacy core control ops since the last bridge driver
that needed that has now been converted.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 20 Jul 2015 13:09:32 +0000 (10:09 -0300)]
[media] fsl-viu: small fixes
- Fix an off-by-one index check in vidioc_enum_fmt()
- Fill in the pix.sizeimage field in vidioc_try_fmt_cap()
- Fix an off-by-one index check in vidioc_s_input()
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 20 Jul 2015 13:09:28 +0000 (10:09 -0300)]
[media] fsl-viu: convert to the control framework
Interestingly enough, the existing control handling code basically did
nothing. At least the new code will inherit the controls from the
saa7115 driver.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 20 Jul 2015 12:59:38 +0000 (09:59 -0300)]
[media] usbvision: move init code to probe()
These things are only initialized if you start streaming video, but
they are also used in the disconnect function. So just init them
always during probe time.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 20 Jul 2015 12:59:33 +0000 (09:59 -0300)]
[media] usbvision: frequency fixes
- setup initial radio and tv frequencies.
- set/get the correct frequency (radio vs tv).
- disable tuner/freq ioctls if there is no tuner.
- fix some tuner index checks.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 20 Jul 2015 12:59:28 +0000 (09:59 -0300)]
[media] usbvision: remove power_on_at_open and timed power off
This causes lots of problems and is *very* slow as well.
One of the main problems is that this prohibits the use of the control
framework since subdevs will be unloaded on power off which is not allowed
as long as they are used by a usb device.
Apparently the reason for doing this is to turn off a noisy tuner. My hardware
has no problem with that, and I wonder whether the hardware with that noisy
tuner wasn't just functioning improperly as I have never heard of noisy tuners.
Contact me if you have one of those devices and I can take a look whether the
tuner can't be powered off if necessary by letting the tuner subdevice go
into standby mode. Unloading the tuner module is just evil and is not the
right approach.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Here's the driver for the Renesas R-Car JPEG processing unit.
The driver is implemented within the V4L2 framework as a memory-to-memory
device. It presents two video nodes to userspace, one for the encoding part,
and one for the decoding part.
It was found that the only working mode for encoding is no markers output, so we
generate markers with software. In the current version of driver we also use
software JPEG header parsing because with hardware parsing performance is lower
than desired.
>From a userspace point of view the process is typical (S_FMT, REQBUF,
optionally QUERYBUF, QBUF, STREAMON, DQBUF) for both the source and destination
queues. STREAMON can return -EINVAL in case of mismatch of output and capture
queues format. Also during decoding driver can return buffers if queued
buffer with JPEG image contains image with inappropriate subsampling (e.g.
4:2:0 in JPEG and 4:2:2 in capture). If JPEG image and queue format dimensions
differ driver will return buffer on QBUF with VB2_BUF_STATE_ERROR flag.
During encoding the available formats are: V4L2_PIX_FMT_NV12M,
V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16, V4L2_PIX_FMT_NV16M for source and
V4L2_PIX_FMT_JPEG for destination.
During decoding the available formats are: V4L2_PIX_FMT_JPEG for source and
V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_NV16M, V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16
for destination.
Performance of current version:
1280x800 NV12 image encoding/decoding
decoding ~122 FPS
encoding ~191 FPS
This indicates that device_caps are missing but doesn't give
much of a clue which driver is actually at fault. Improve
the warning output by showing the capabilities and the
responsible driver.
Signed-off-by: Laura Abbott <labbott@fedoraproject.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>