[PATCH v4 16/22] [media] em28xx: use a better value for I2C timeouts

2014-01-04 Thread Mauro Carvalho Chehab
In the lack of a better spec, let's assume the timeout values compatible with SMBus spec: http://smbus.org/specs/smbus110.pdf at chapter 8 - Electrical Characteristics of SMBus devices Ok, SMBus is a subset of I2C, and not all devices will be following it, but the timeout value before

[PATCH v4 11/22] [media] em28xx: check if a device has audio earlier

2014-01-04 Thread Mauro Carvalho Chehab
Better to split chipset detection from the audio setup. So, move the detection code to em28xx_init_dev(). Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-cards.c | 11 +++ drivers/media/usb/em28xx/em28xx-core.c | 12 +--- 2 files

[PATCH v4 03/22] [media] em28xx: move analog-specific init to em28xx-video

2014-01-04 Thread Mauro Carvalho Chehab
There are several init code inside em28xx-cards that are actually part of analog initialization. Move the code to em28x-video, in order to remove part of the mess. In thesis, no functional changes so far. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com ---

[PATCH v4 01/22] [media] em28xx: move some video-specific functions to em28xx-video

2014-01-04 Thread Mauro Carvalho Chehab
Now that we want to split the video handling to a separate module, move all video-specific functions to em28xx-video. No functional changes. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-cards.c | 107 -

[PATCH v4 05/22] [media] em28xx: initialize analog I2C devices at the right place

2014-01-04 Thread Mauro Carvalho Chehab
In order to initialize the analog tuner, v4l2 should be registere first, or otherwise we get an oops: [ 51.783537] BUG: unable to handle kernel NULL pointer dereference at) [ 51.784479] IP: [81319fbb] __list_add+0x1b/0xc0 [ 51.784479] PGD 0 [ 51.784479] Oops: [#1] SMP

[PATCH v4 12/22] [media] em28xx: properly implement AC97 wait code

2014-01-04 Thread Mauro Carvalho Chehab
Instead of assuming that msleep() is precise, use a jiffies based code to wait for AC97 to be available. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-core.c | 7 +-- drivers/media/usb/em28xx/em28xx.h | 5 - 2 files changed, 9

[PATCH v4 07/22] [media] em28xx: improve extension information messages

2014-01-04 Thread Mauro Carvalho Chehab
Add a message with consistent prints before and after each extension initialization, and provide a better text for module load. While here, add a missing sanity check for extension finish code at em28xx-v4l extension. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com ---

[PATCH v4 13/22] [media] em28xx: initialize audio latter

2014-01-04 Thread Mauro Carvalho Chehab
Better to first write the GPIOs of the input mux, before initializing the audio. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-video.c | 40 - 1 file changed, 20 insertions(+), 20 deletions(-) diff --git

[PATCH v4 17/22] [media] em28xx-i2c: Fix error code for I2C error transfers

2014-01-04 Thread Mauro Carvalho Chehab
The proper error code for I2C errors are EREMOTEIO. The em28xx driver is using EIO instead. Replace all occurrences of EIO at em28xx-i2c, in order to fix it. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-i2c.c | 20 ++-- 1 file

[PATCH v4 18/22] [media] em28xx: don't return -ENODEV for I2C xfer errors

2014-01-04 Thread Mauro Carvalho Chehab
-ENODEV reports a permanent condition where a device is not found, and used only during device probing or device removal, as stated at the V4L2 spec: http://linuxtv.org/downloads/v4l-dvb-apis/gen_errors.html Except during device detection, this is not the case of I2C transfer timeout

[PATCH v4 21/22] [media] em28xx-audio: allocate URBs at device driver init

2014-01-04 Thread Mauro Carvalho Chehab
From: Mauro Carvalho Chehab mche...@redhat.com Instead of allocating/deallocating URBs and transfer buffers every time stream is started/stopped, just do it once. That reduces the memory allocation pressure and makes the code that start/stop streaming a way simpler. Signed-off-by: Mauro

[PATCH v4 20/22] [media] em28xx: use usb_alloc_coherent() for audio

2014-01-04 Thread Mauro Carvalho Chehab
Instead of allocating transfer buffers with kmalloc() use usb_alloc_coherent(). That makes it work also with arm CPUs. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-audio.c | 31 --- 1 file changed, 20 insertions(+), 11

[PATCH v4 15/22] [media] em28xx: Fix em28xx deplock

2014-01-04 Thread Mauro Carvalho Chehab
When em28xx extensions are loaded/removed, there are two locks: a single static em28xx_devlist_mutex that registers each extension and the struct em28xx dev-lock. When extensions are registered, em28xx_devlist_mutex is taken first, and then dev-lock. Be sure that, when extensions are being

[PATCH v4 22/22] [media] em28xx: retry read operation if it fails

2014-01-04 Thread Mauro Carvalho Chehab
I2C read operations can also take some time to happen. Try again, if it fails with return code different than 0x10 until timeout. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-i2c.c | 62 +++ 1 file changed, 34

[PATCH v4 02/22] [media] em28xx: some cosmetic changes

2014-01-04 Thread Mauro Carvalho Chehab
In order to make easier for the next patches, do some cosmetic changes. No functional changes. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-cards.c | 2 +- drivers/media/usb/em28xx/em28xx-video.c | 2 -- drivers/media/usb/em28xx/em28xx.h

[PATCH v4 04/22] [media] em28xx: make em28xx-video to be a separate module

2014-01-04 Thread Mauro Carvalho Chehab
Now that all analog-specific code are at em28xx-video, convert it into an em28xx extension and load it as a separate module. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/Kconfig | 6 ++- drivers/media/usb/em28xx/Makefile| 5 ++-

[PATCH v4 08/22] [media] em28xx: convert i2c wait completion logic to use jiffies

2014-01-04 Thread Mauro Carvalho Chehab
The I2C wait completion/timeout logic currently assumes that msleep(5) will wait exaclty 5 ms. This is not true at all, as it depends on CONFIG_HZ. Convert it to use jiffies, in order to not wait for more time than needed. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com ---

[PATCH v4 00/22] em28xx: split analog part into a separate module

2014-01-04 Thread Mauro Carvalho Chehab
This patch series split em28xx into a separate V4L2 driver, allowing the new dvb-only chips to be supported without requiring V4L2. While testing the original patchset, I noticed several issues with HVR-950. The remaining patches on this series fix most of those issues. There's one remaining

[PATCH v4 09/22] [media] tvp5150: make read operations atomic

2014-01-04 Thread Mauro Carvalho Chehab
Instead of using two I2C operations between write and read, use just one i2c_transfer. That allows I2C mutexes to not let any other I2C transfer between the two. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/i2c/tvp5150.c | 26 +++--- 1 file

[PATCH v4 10/22] [media] tuner-xc2028: remove unused code

2014-01-04 Thread Mauro Carvalho Chehab
This macro is not used. remove it. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/tuners/tuner-xc2028.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index

[PATCH v4 06/22] [media] em28xx: add warn messages for timeout

2014-01-04 Thread Mauro Carvalho Chehab
changeset 45f04e82d035 added a logic to check if em28xx got a timeout on an I2C transfer. That patch started to produce a series of errors that is present with HVR-950, like: [ 4032.218656] xc2028 19-0061: Error on line 1299: -19 However, as there are several places where -ENODEV is produced,

Re: [PATCH v3 00/24] em28xx: split analog part into a separate module

2014-01-04 Thread Mauro Carvalho Chehab
Em Fri, 03 Jan 2014 21:29:20 +0100 Frank Schäfer fschaefer@googlemail.com escreveu: Am 28.12.2013 13:15, schrieb Mauro Carvalho Chehab: This patch series split em28xx into a separate V4L2 driver, allowing the new dvb-only chips to be supported without requiring V4L2. While testing

[PATCH 01/11] libdvbv5: fix dvb_parse_descriptors and make dvb_desc_init private

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/descriptors.h |2 -- lib/libdvbv5/descriptors.c | 44 ++-- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/lib/include/libdvbv5/descriptors.h

[PATCH 05/11] libdvbv5: fix PMT parser

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/pmt.h |6 +- lib/libdvbv5/descriptors/pmt.c | 22 +++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/include/libdvbv5/pmt.h b/lib/include/libdvbv5/pmt.h index

[PATCH 03/11] libdvbv5: add parser for CAT

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/cat.h | 51 +++ lib/libdvbv5/Makefile.am |2 ++ lib/libdvbv5/descriptors.c |2 ++ lib/libdvbv5/descriptors/cat.c | 66 4 files

[PATCH 02/11] libdvbv5: add attribute packed to structs and unions

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/atsc_header.h|2 +- lib/include/libdvbv5/desc_atsc_service_location.h |4 ++-- lib/include/libdvbv5/desc_cable_delivery.h|8 lib/include/libdvbv5/desc_event_extended.h|4

[PATCH 07/11] libdvbv5: use DVB_DESC_HEADER macro in all descriptors

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/desc_atsc_service_location.h |7 ++- lib/include/libdvbv5/desc_ca.h|7 ++- lib/include/libdvbv5/desc_ca_identifier.h |7 ++- lib/include/libdvbv5/desc_cable_delivery.h|

[PATCH 04/11] libdvbv5: add parser for ca and ca_identifier descriptors

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/desc_ca.h| 63 lib/include/libdvbv5/desc_ca_identifier.h | 55 + lib/libdvbv5/Makefile.am | 10 ++-- lib/libdvbv5/descriptors.c

[PATCH 06/11] libdvbv5: cleanup printing tables and descriptors

2014-01-04 Thread André Roth
- log hex values where appropriate - cleanup indents Signed-off-by: André Roth neol...@gmail.com --- lib/libdvbv5/descriptors.c|4 ++-- lib/libdvbv5/descriptors/cat.c|2 +- lib/libdvbv5/descriptors/desc_atsc_service_location.c |1 -

[PATCH 11/11] libdvbv5: remove unneeded includes

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/libdvbv5/descriptors/desc_atsc_service_location.c |1 - lib/libdvbv5/descriptors/desc_ca.c|1 - lib/libdvbv5/descriptors/desc_ca_identifier.c |1 - lib/libdvbv5/descriptors/desc_cable_delivery.c|

[PATCH 08/11] libdvbv5: make dvb_desc_default_init and dvb_desc_default_print private

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/descriptors.h | 16 lib/libdvbv5/descriptors.c |4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/include/libdvbv5/descriptors.h b/lib/include/libdvbv5/descriptors.h

[PATCH 10/11] libdvbv5: descriptor parser return int

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/desc_atsc_service_location.h |2 +- lib/include/libdvbv5/desc_ca.h|2 +- lib/include/libdvbv5/desc_ca_identifier.h |2 +- lib/include/libdvbv5/desc_cable_delivery.h

[PATCH 09/11] libdvbv5: use TABLE_INIT macro

2014-01-04 Thread André Roth
Signed-off-by: André Roth neol...@gmail.com --- lib/include/libdvbv5/descriptors.h |2 +- lib/libdvbv5/descriptors.c | 24 +--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/include/libdvbv5/descriptors.h

[PATCH v4 19/22] [media] em28xx: cleanup I2C debug messages

2014-01-04 Thread Mauro Carvalho Chehab
The I2C output messages is too polluted. Clean it a little bit, by: - use the proper core support for memory dumps; - hide most stuff under the i2c_debug umbrella; - add the missing KERN_CONT where needed; - use 2 levels or verbosity. Only the second one

[PATCH v4 RFC 1/2] [media] em28xx: retry I2C write ops if failed by timeout

2014-01-04 Thread Mauro Carvalho Chehab
At least on HVR-950, sometimes an I2C operation fails. This seems to be more frequent when the device is connected into an USB 3.0 port. Instead of report an error, try to repeat it, for up to 20 ms. That makes the code more reliable. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com

[PATCH v4 RFC 2/2] [media] em28xx: USB: adjust for changed 3.8 USB API

2014-01-04 Thread Mauro Carvalho Chehab
The recent changes in the USB API (implement new semantics for URB_ISO_ASAP) made the former meaning of the URB_ISO_ASAP flag the default, and changed this flag to mean that URBs can be delayed. This is not the behaviour wanted by any of the audio drivers because it leads to discontinuous playback

[PATCH v4 14/22] [media] em28xx: unify module version

2014-01-04 Thread Mauro Carvalho Chehab
Use the same module version on all em28xx sub-modules, and use the same naming convention to describe the driver. Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com --- drivers/media/usb/em28xx/em28xx-audio.c | 3 ++- drivers/media/usb/em28xx/em28xx-core.c | 2 --

Re: [PATCH v4 RFC 1/2] [media] em28xx: retry I2C write ops if failed by timeout

2014-01-04 Thread Markus Rechberger
Did you trace the i2c messages on the bus? This seems like papering the actual bug. USB 3.0 is a disaster with Linux, maybe your hardware or your controller driver is not okay? There are other bugreports out there which are USB 3.0 related, some of our customers reported that since 3.6.0 is okay

[PATCH] support for CX23103 Video Grabber USB

2014-01-04 Thread Links (Markus)
From: Links (Markus) help.markus+...@gmail.com modified: drivers/media/usb/cx231xx/cx231xx-cards.c Signed-off-by: Links (Markus) help.markus+...@gmail.com --- drivers/media/usb/cx231xx/cx231xx-cards.c |2 ++ 1 file changed, 2 insertions(+) diff --git

cron job: media_tree daily build: ERRORS

2014-01-04 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Sun Jan 5 04:00:27 CET 2014 git branch: test git hash: f7d40eea8e3e531f1517ab7eded552e8837ef5da gcc

Regression on nxt2004

2014-01-04 Thread Mark Goldberg
Firmware loading fails intermittently on nxt2004 with the fedora 3.12.5-302.fc20.x86_64 kernel. It appears that this is due to [PATCH 3.11 178/272] [media] dvb-frontends: Don't use dynamic static allocation. If I revert the patch for nxt200x.c it works correctly. See