Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH 1/1] media: pci: meye: set error code on failures
From: Pan Bian @ 2016-12-04  5:40 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: linux-kernel, Pan Bian

From: Pan Bian <bianpan2016@163.com>

The value of return variable ret is 0 on some error paths, for example,
when pci_resource_start() returns a NULL pointer. 0 means no error in
this context, which is contrary to the fact. This patch fixes the bug.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189011

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/media/pci/meye/meye.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index ba887e8..115e141 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1669,6 +1669,7 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 		goto outenabledev;
 	}
 
+	ret = -EIO;
 	mchip_adr = pci_resource_start(meye.mchip_dev,0);
 	if (!mchip_adr) {
 		v4l2_err(v4l2_dev, "meye: mchip has no device base address\n");
-- 
1.9.1



^ permalink raw reply related

* cron job: media_tree daily build: ERRORS
From: Hans Verkuil @ 2016-12-04  5:10 UTC (permalink / raw)
  To: linux-media

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 Dec  4 05:00:16 CET 2016
media-tree git hash:	365fe4e0ce218dc5ad10df17b150a366b6015499
media_build git hash:	1606032398b1d79149c1507be2029e1a00d8dff0
v4l-utils git hash:	063d1f5d5e60783002d781e8a23911acbda65e99
gcc version:		i686-linux-gcc (GCC) 6.2.0
sparse version:		v0.5.0-3553-g78b2ea6
smatch version:		v0.5.0-3553-g78b2ea6
host hardware:		x86_64
host os:		4.8.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: OK
linux-git-arm-pxa: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: WARNINGS
linux-3.11.1-i686: OK
linux-3.12.67-i686: OK
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: WARNINGS
linux-3.16.7-i686: WARNINGS
linux-3.17.8-i686: WARNINGS
linux-3.18.7-i686: WARNINGS
linux-3.19-i686: WARNINGS
linux-4.0.9-i686: WARNINGS
linux-4.1.33-i686: WARNINGS
linux-4.2.8-i686: WARNINGS
linux-4.3.6-i686: WARNINGS
linux-4.4.22-i686: WARNINGS
linux-4.5.7-i686: WARNINGS
linux-4.6.7-i686: WARNINGS
linux-4.7.5-i686: WARNINGS
linux-4.8-i686: OK
linux-4.9-rc5-i686: OK
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: OK
linux-3.12.67-x86_64: OK
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16.7-x86_64: WARNINGS
linux-3.17.8-x86_64: WARNINGS
linux-3.18.7-x86_64: WARNINGS
linux-3.19-x86_64: WARNINGS
linux-4.0.9-x86_64: WARNINGS
linux-4.1.33-x86_64: WARNINGS
linux-4.2.8-x86_64: WARNINGS
linux-4.3.6-x86_64: WARNINGS
linux-4.4.22-x86_64: WARNINGS
linux-4.5.7-x86_64: WARNINGS
linux-4.6.7-x86_64: WARNINGS
linux-4.7.5-x86_64: WARNINGS
linux-4.8-x86_64: OK
linux-4.9-rc5-x86_64: OK
apps: WARNINGS
spec-git: OK
smatch: ERRORS
sparse: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html

^ permalink raw reply

* Re: [PATCH v3 3/4] stk1160: Add module param for setting the record gain.
From: Ezequiel Garcia @ 2016-12-03 20:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Marcel Hasler, Mauro Carvalho Chehab, linux-media
In-Reply-To: <20161202090558.29931492@vento.lan>

On 2 December 2016 at 08:05, Mauro Carvalho Chehab
<mchehab@s-opensource.com> wrote:
> Em Sun, 27 Nov 2016 12:11:48 +0100
> Marcel Hasler <mahasler@gmail.com> escreveu:
>
>> Allow setting a custom record gain for the internal AC97 codec (if available). This can be
>> a value between 0 and 15, 8 is the default and should be suitable for most users. The Windows
>> driver also sets this to 8 without any possibility for changing it.
>
> The problem of removing the mixer is that you need this kind of
> crap to setup the volumes on a non-standard way.
>

Right, that's a good point.

> NACK.
>
> Instead, keep the alsa mixer. The way other drivers do (for example,
> em28xx) is that they configure the mixer when an input is selected,
> increasing the volume of the active audio channel to 100% and muting
> the other audio channels. Yet, as the alsa mixer is exported, users
> can change the mixer settings in runtime using some alsa (or pa)
> mixer application.
>

Yeah, the AC97 mixer we are currently leveraging
exposes many controls that have no meaning in this device,
so removing that still looks like an improvement.

I guess the proper way is creating our own mixer
(not using snd_ac97_mixer)  exposing only the record
gain knob.

Marcel, what do you think?
-- 
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar

^ permalink raw reply

* Re: [PATCH v3 4/4] stk1160: Give the chip some time to retrieve data from AC97 codec.
From: Ezequiel Garcia @ 2016-12-03 20:41 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Marcel Hasler, Mauro Carvalho Chehab, linux-media
In-Reply-To: <20161202090948.0efd0678@vento.lan>

On 2 December 2016 at 08:09, Mauro Carvalho Chehab
<mchehab@s-opensource.com> wrote:
> Em Sun, 27 Nov 2016 12:12:36 +0100
> Marcel Hasler <mahasler@gmail.com> escreveu:
>
>> The STK1160 needs some time to transfer data from the AC97 registers into its own. On some
>> systems reading the chip's own registers to soon will return wrong values. The "proper" way to
>> handle this would be to poll STK1160_AC97CTL_0 after every read or write command until the
>> command bit has been cleared, but this may not be worth the hassle.
>>
>> Signed-off-by: Marcel Hasler <mahasler@gmail.com>
>> ---
>>  drivers/media/usb/stk1160/stk1160-ac97.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/media/usb/stk1160/stk1160-ac97.c b/drivers/media/usb/stk1160/stk1160-ac97.c
>> index 60327af..b39f51b 100644
>> --- a/drivers/media/usb/stk1160/stk1160-ac97.c
>> +++ b/drivers/media/usb/stk1160/stk1160-ac97.c
>> @@ -23,6 +23,7 @@
>>   *
>>   */
>>
>> +#include <linux/delay.h>
>>  #include <linux/module.h>
>>
>>  #include "stk1160.h"
>> @@ -64,6 +65,14 @@ static u16 stk1160_read_ac97(struct stk1160 *dev, u16 reg)
>>        */
>>       stk1160_write_reg(dev, STK1160_AC97CTL_0, 0x8b);
>>
>> +     /*
>> +      * Give the chip some time to transfer the data.
>> +      * The proper way would be to poll STK1160_AC97CTL_0
>> +      * until the command bit has been cleared, but this
>> +      * may not be worth the hassle.
>
> Why not? Relying on a fixed amount time is not nice.
>
> Take a look at em28xx_is_ac97_ready() function, at
> drivers/media/usb/em28xx/em28xx-core.c to see how this could be
> implemented instead.
>

We were reluctant to implement this properly because the read reg
function is only used for debugging purposes, to dump registers.

That said, it's not too much of a hassle to do it properly, and
we might have to if we are going to have our own mixer.

>
>> +      */
>> +     usleep_range(20, 40);
>> +
>
>>       /* Retrieve register value */
>>       stk1160_read_reg(dev, STK1160_AC97_CMD, &vall);
>>       stk1160_read_reg(dev, STK1160_AC97_CMD + 1, &valh);
>
>
>
> Thanks,
> Mauro



-- 
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar

^ permalink raw reply

* Initial DVB-T2 scan data file for ke-Nairobi (Nairobi, Kenya)
From: Joseph Zik @ 2016-12-03 19:39 UTC (permalink / raw)
  To: linux-media; +Cc: patchwork, Oliver Schinagl

[-- Attachment #1: Type: text/plain, Size: 4878 bytes --]

Initial DVB-T2 scan data file ke-Nairobi for Nairobi, Kenya.  Please
find patch attached

-- 
Joseph Zikusooka

diff --git a/dvb-t/ke-Nairobi b/dvb-t/ke-Nairobi
new file mode 100644
index 0000000..eb06512
--- /dev/null
+++ b/dvb-t/ke-Nairobi
@@ -0,0 +1,226 @@
+# location and provider	: Nairobi-Kenya
+# date			: 2016-12-03
+# provided by		: Joseph Zikusooka
+# 	               	: http://joseph.zikusooka.com
+# 	               	: josephzik@gmail.com
+#
+#------------------------------------------------------------------------------
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 474000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 2/3
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 8K
+	GUARD_INTERVAL = 1/4
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 506000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 562000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 570000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 586000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 514000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 578000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 602000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 530000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 522000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT22
+	FREQUENCY = 538000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = AUTO
+	CODE_RATE_LP = AUTO
+	MODULATION = QAM/AUTO
+	TRANSMISSION_MODE = 32K
+	GUARD_INTERVAL = 1/16
+	HIERARCHY = AUTO
+	STREAM_ID = 4294967295
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT22
+	FREQUENCY = 554000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = AUTO
+	CODE_RATE_LP = AUTO
+	MODULATION = QAM/AUTO
+	TRANSMISSION_MODE = 32K
+	GUARD_INTERVAL = 1/16
+	HIERARCHY = AUTO
+	STREAM_ID = 4294967295
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 851968000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 3/4
+	CODE_RATE_LP = 3/4
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 4K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = 1
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 1007943680
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 1645032704
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 2/3
+	CODE_RATE_LP = NONE
+	MODULATION = QAM/16
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 5940000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 5060000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 6740000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+

[-- Attachment #2: ke-Nairobi.patch --]
[-- Type: text/x-patch, Size: 4766 bytes --]

diff --git a/dvb-t/ke-Nairobi b/dvb-t/ke-Nairobi
new file mode 100644
index 0000000..eb06512
--- /dev/null
+++ b/dvb-t/ke-Nairobi
@@ -0,0 +1,226 @@
+# location and provider	: Nairobi-Kenya
+# date			: 2016-12-03
+# provided by		: Joseph Zikusooka
+# 	               	: http://joseph.zikusooka.com
+# 	               	: josephzik@gmail.com
+#
+#------------------------------------------------------------------------------
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 474000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 2/3
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 8K
+	GUARD_INTERVAL = 1/4
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 506000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 562000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 570000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 586000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 514000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 578000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 602000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 530000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 522000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT22
+	FREQUENCY = 538000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = AUTO
+	CODE_RATE_LP = AUTO
+	MODULATION = QAM/AUTO
+	TRANSMISSION_MODE = 32K
+	GUARD_INTERVAL = 1/16
+	HIERARCHY = AUTO
+	STREAM_ID = 4294967295
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT22
+	FREQUENCY = 554000000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = AUTO
+	CODE_RATE_LP = AUTO
+	MODULATION = QAM/AUTO
+	TRANSMISSION_MODE = 32K
+	GUARD_INTERVAL = 1/16
+	HIERARCHY = AUTO
+	STREAM_ID = 4294967295
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 851968000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 3/4
+	CODE_RATE_LP = 3/4
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 4K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = 1
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 1007943680
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 1645032704
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 2/3
+	CODE_RATE_LP = NONE
+	MODULATION = QAM/16
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 5940000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 5060000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+
+[CHANNEL]
+	DELIVERY_SYSTEM = DVBT2
+	FREQUENCY = 6740000
+	BANDWIDTH_HZ = 8000000
+	CODE_RATE_HP = 1/2
+	CODE_RATE_LP = NONE
+	MODULATION = QPSK
+	TRANSMISSION_MODE = 2K
+	GUARD_INTERVAL = 1/32
+	HIERARCHY = NONE
+	INVERSION = AUTO
+

^ permalink raw reply related

* Possible Bug in media build WinTV SoloHD
From: ochr @ 2016-12-03 13:47 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]

Hello,
 
first I would like to thank you very much for your continuing effort on making dvb hardware work on old linux kernels. I'm currently using an Odroid C2 as a tv server using Libreelec media build edition and two WinTV SoloHD USB sticks following this thread: http://forum.odroid.com/viewtopic.php?f=144&t=22887[https://deref-gmx.com/mail/client/xYeN3ugPLE8/dereferrer/?redirectUrl=http%3A%2F%2Fforum.odroid.com%2Fviewtopic.php%3Ff%3D144%26t%3D22887]
 
With the release v3 everything was working fine. But v4 does not identify correctly the USB Sticks. I guess it's a problem with the more recent version of media build included that's why I contact you directly.
 
WinTV SoloHD (2040:0264) (Identified as PCTV tripleStick (292e) (card=94)) needs the following kernel modules:
em28xx
si2157
si2168
and firmware of course
 
v3: working release uses mediabuild (2016-08-08-b6aa39228966)

[   11.173668] Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
[   11.173668]     b6aa39228966e0d3f0bc3306be1892f87792903a Merge tag 'v4.8-rc1' into patchwork
[   11.173668]     29b4817d4018df78086157ea3a55c1d9424a7cfc Linux 4.8-rc1
[   11.173668]     857953d72f3744f325de93320cc2673795e9ca89 Merge branch 'for-linus' of
 
...
 
[   13.167012] usbcore: registered new interface driver em28xx
[   13.169126] em28178 #0: Binding DVB extension
 
em28xx, si2157 and si2168 are correctly loaded and shown in lsmod as used.
 
------------------------
 
v4: not working release uses mediabuild (2016-11-22-d3d83ee20afd)

[   11.133420] Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
[   11.133420]     d3d83ee20afda16ad0133ba00f63c11a8d842a35 [media] DaVinci-VPFE-Capture: fix error handling
[   11.133420]     399426cadf5b0539a5b2a4d805257ce8acc6aba2 [media] cx88: make checkpatch.pl happy
[   11.133420]     1d38971438157dc57f0a4be89abf23b472458633 [media] v4l: rcar_fdp1: add FCP dependency
 
...
 
[   13.127857] usbcore: registered new interface driver em28xx
[   13.130001] em28xx: Registered (Em28xx dvb Extension) extension
 
em28xx is loaded correctly and shown in lsmod as used, but si2157 and si2168 dont come up. If they are loaded manually, they aren't used.
 
----
 
My guess: There is something wrong with em28xx. Attached you'll find the dmesg output. If you need additional information, please don't hesitate to ask.
 
Thank you very much in advance
 
Yours sincerly
Olaf
 
 

[-- Attachment #2: dmesg --]
[-- Type: application/octet-stream, Size: 1186 bytes --]

v3: works

LibreELEC:~ #  dmesg | grep -i dvb
[    9.179495] em28xx: DVB interface 0 found: isoc
[   12.103062] em28xx: DVB interface 0 found: isoc
[   14.106936] em28178 #0: dvb set to isoc mode.
[   14.125409] em28178 #0: Binding DVB extension
[   14.169218] DVB: registering new adapter (em28178 #0)
[   14.169230] usb 1-1.4: DVB: registering adapter 0 frontend 0 (Silicon Labs Si2168)...
[   14.169242] dvb_create_media_entity: media entity 'Silicon Labs Si2168' registered.
[   14.170622] dvb_create_media_entity: media entity 'dvb-demux' registered.
[   14.173765] em28178 #0: DVB extension successfully initialized
[   14.173785] em28xx: Registered (Em28xx dvb Extension) extension
[   14.175440] si2168 3-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
[   14.556542] usb 1-1.4: DVB: adapter 0 frontend 0 frequency 0 out of range (42000000..870000000)


v4: doesnt work

 9.124098] usb 1-1.3: DVB interface 0 found: isoc
[   11.127717] usb 1-1.3: em28178#0: dvb set to isoc mode.
[   11.127956] usb 1-1.4: DVB interface 0 found: isoc
[   13.127621] usb 1-1.4: em28178#1: dvb set to isoc mode.
[   13.130001] em28xx: Registered (Em28xx dvb Extension) extension

[-- Attachment #3: v3 --]
[-- Type: application/octet-stream, Size: 13310 bytes --]

[-- Attachment #4: v4 --]
[-- Type: application/octet-stream, Size: 11415 bytes --]

^ permalink raw reply

* [PATCH 1/1] media: platform: sti: return -ENOMEM on errors
From: Pan Bian @ 2016-12-03 12:39 UTC (permalink / raw)
  To: Fabien Dessenne, Mauro Carvalho Chehab, linux-media
  Cc: linux-kernel, Pan Bian

From: Pan Bian <bianpan2016@163.com>

Function bdisp_debugfs_create() returns 0 even on errors. So its caller
cannot detect the errors. It may be better to return "-ENOMEM" on the
exception paths.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188801

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/media/platform/sti/bdisp/bdisp-debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/sti/bdisp/bdisp-debug.c b/drivers/media/platform/sti/bdisp/bdisp-debug.c
index 79c5635..7af6686 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-debug.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-debug.c
@@ -677,7 +677,7 @@ int bdisp_debugfs_create(struct bdisp_dev *bdisp)
 
 err:
 	bdisp_debugfs_remove(bdisp);
-	return 0;
+	return -ENOMEM;
 }
 
 void bdisp_debugfs_remove(struct bdisp_dev *bdisp)
-- 
1.9.1



^ permalink raw reply related

* [PATCH] staging:bcm2048 : Add parentheses around  variable x
From: Tabrez khan @ 2016-12-03  9:44 UTC (permalink / raw)
  To: mchehab; +Cc: linux-media, devel, linux-kernel

Add parentheses around variable x for the readability purpose.

This warning was found using checkpatch.pl.

Signed-off-by: Tabrez khan <khan.tabrez21@gmail.com>
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 4d9bd02..2f28dd0 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -185,7 +185,7 @@
 #define v4l2_to_dev(f)	((f * BCM2048_FREQV4L2_MULTI) / BCM2048_FREQDEV_UNIT)
 
 #define msb(x)                  ((u8)((u16)x >> 8))
-#define lsb(x)                  ((u8)((u16)x &  0x00FF))
+#define lsb(x)                  ((u8)((u16)(x) &  0x00FF))
 #define compose_u16(msb, lsb)	(((u16)msb << 8) | lsb)
 
 #define BCM2048_DEFAULT_POWERING_DELAY	20
-- 
2.7.4


^ permalink raw reply related

* Re: [PATCH] staging: Replaced BUG_ON with warnings
From: Allen @ 2016-12-03  7:06 UTC (permalink / raw)
  To: Shilpa Puttegowda; +Cc: linux-kernel, Greg Kroah-Hartman, linux-media
In-Reply-To: <1480748521-8738-1-git-send-email-shilpapri@gmail.com>

On Sat, Dec 3, 2016 at 12:32 PM, Shilpa Puttegowda <shilpapri@gmail.com> wrote:
> From: Shilpa P <shilpapri@gmail.com>
>
> Don't crash the Kernel for driver errors
>
> Signed-off-by: Shilpa P <shilpapri@gmail.com>
> ---
>  drivers/staging/media/bcm2048/radio-bcm2048.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>

Acked-by: Allen Pais <allen.lkml@gmail.com>

^ permalink raw reply

* [PATCH] staging: Replaced BUG_ON with warnings
From: Shilpa Puttegowda @ 2016-12-03  7:02 UTC (permalink / raw)
  To: linux-kernel, Greg Kroah-Hartman; +Cc: linux-media, Shilpa P

From: Shilpa P <shilpapri@gmail.com>

Don't crash the Kernel for driver errors

Signed-off-by: Shilpa P <shilpapri@gmail.com>
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 4d9bd02..05f5918 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -1538,7 +1538,11 @@ static int bcm2048_parse_rt_match_c(struct bcm2048_device *bdev, int i,
 	if (crc == BCM2048_RDS_CRC_UNRECOVARABLE)
 		return 0;
 
-	BUG_ON((index+2) >= BCM2048_MAX_RDS_RT);
+	if ((index + 2) >= BCM2048_MAX_RDS_RT) {
+		dev_err(&bdev->client->dev,
+			"Incorrect index = %d\n", index);
+		return 0;
+	}
 
 	if ((bdev->rds_info.radio_text[i] & BCM2048_RDS_BLOCK_MASK) ==
 		BCM2048_RDS_BLOCK_C) {
@@ -1561,7 +1565,11 @@ static void bcm2048_parse_rt_match_d(struct bcm2048_device *bdev, int i,
 	if (crc == BCM2048_RDS_CRC_UNRECOVARABLE)
 		return;
 
-	BUG_ON((index+4) >= BCM2048_MAX_RDS_RT);
+	if ((index + 4) >= BCM2048_MAX_RDS_RT) {
+		dev_err(&bdev->client->dev,
+			"Incorrect index = %d\n", index);
+		return;
+	}
 
 	if ((bdev->rds_info.radio_text[i] & BCM2048_RDS_BLOCK_MASK) ==
 	    BCM2048_RDS_BLOCK_D)
-- 
1.9.1


^ permalink raw reply related

* cron job: media_tree daily build: ERRORS
From: Hans Verkuil @ 2016-12-03  5:11 UTC (permalink / raw)
  To: linux-media

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:			Sat Dec  3 05:00:19 CET 2016
media-tree git hash:	365fe4e0ce218dc5ad10df17b150a366b6015499
media_build git hash:	1606032398b1d79149c1507be2029e1a00d8dff0
v4l-utils git hash:	063d1f5d5e60783002d781e8a23911acbda65e99
gcc version:		i686-linux-gcc (GCC) 6.2.0
sparse version:		v0.5.0-3553-g78b2ea6
smatch version:		v0.5.0-3553-g78b2ea6
host hardware:		x86_64
host os:		4.8.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: OK
linux-git-arm-pxa: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: WARNINGS
linux-3.11.1-i686: OK
linux-3.12.67-i686: OK
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: WARNINGS
linux-3.16.7-i686: WARNINGS
linux-3.17.8-i686: WARNINGS
linux-3.18.7-i686: WARNINGS
linux-3.19-i686: WARNINGS
linux-4.0.9-i686: WARNINGS
linux-4.1.33-i686: WARNINGS
linux-4.2.8-i686: WARNINGS
linux-4.3.6-i686: WARNINGS
linux-4.4.22-i686: WARNINGS
linux-4.5.7-i686: WARNINGS
linux-4.6.7-i686: WARNINGS
linux-4.7.5-i686: WARNINGS
linux-4.8-i686: OK
linux-4.9-rc5-i686: OK
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: OK
linux-3.12.67-x86_64: OK
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16.7-x86_64: WARNINGS
linux-3.17.8-x86_64: WARNINGS
linux-3.18.7-x86_64: WARNINGS
linux-3.19-x86_64: WARNINGS
linux-4.0.9-x86_64: WARNINGS
linux-4.1.33-x86_64: WARNINGS
linux-4.2.8-x86_64: WARNINGS
linux-4.3.6-x86_64: WARNINGS
linux-4.4.22-x86_64: WARNINGS
linux-4.5.7-x86_64: WARNINGS
linux-4.6.7-x86_64: WARNINGS
linux-4.7.5-x86_64: WARNINGS
linux-4.8-x86_64: OK
linux-4.9-rc5-x86_64: OK
apps: WARNINGS
spec-git: OK
smatch: ERRORS
sparse: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html

^ permalink raw reply

* Re: [PATCH v4 1/9] media: v4l2-mem2mem: extend m2m APIs for more accurate buffer management
From: kbuild test robot @ 2016-12-03  0:56 UTC (permalink / raw)
  To: Stanimir Varbanov
  Cc: kbuild-all, Mauro Carvalho Chehab, Hans Verkuil, Andy Gross,
	Bjorn Andersson, Stephen Boyd, Srinivas Kandagatla, linux-media,
	linux-kernel, linux-arm-msm, Stanimir Varbanov
In-Reply-To: <1480583001-32236-2-git-send-email-stanimir.varbanov@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 8064 bytes --]

Hi Stanimir,

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.9-rc7 next-20161202]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Stanimir-Varbanov/Qualcomm-video-decoder-encoder-driver/20161203-054705
base:   git://linuxtv.org/media_tree.git master
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
   include/linux/init.h:1: warning: no structured comments found
   include/linux/workqueue.h:392: warning: No description found for parameter '...'
   include/linux/workqueue.h:392: warning: Excess function parameter 'args' description in 'alloc_workqueue'
   include/linux/workqueue.h:413: warning: No description found for parameter '...'
   include/linux/workqueue.h:413: warning: Excess function parameter 'args' description in 'alloc_ordered_workqueue'
   include/linux/kthread.h:26: warning: No description found for parameter '...'
   kernel/sys.c:1: warning: no structured comments found
   drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
   include/linux/fence-array.h:61: warning: No description found for parameter 'fence'
   include/sound/core.h:324: warning: No description found for parameter '...'
   include/sound/core.h:335: warning: No description found for parameter '...'
   include/sound/core.h:388: warning: No description found for parameter '...'
   drivers/media/dvb-core/dvb_frontend.h:677: warning: No description found for parameter 'refcount'
   include/media/media-entity.h:1054: warning: No description found for parameter '...'
>> include/media/v4l2-mem2mem.h:446: warning: No description found for parameter 'b'
   include/media/v4l2-mem2mem.h:454: warning: No description found for parameter 'b'
   include/media/v4l2-mem2mem.h:463: warning: No description found for parameter 'b'
>> include/media/v4l2-mem2mem.h:463: warning: No description found for parameter 'n'
   include/media/v4l2-mem2mem.h:472: warning: No description found for parameter 'b'
   include/media/v4l2-mem2mem.h:472: warning: No description found for parameter 'n'
>> include/media/v4l2-mem2mem.h:533: warning: No description found for parameter 'vbuf'
   include/media/v4l2-mem2mem.h:543: warning: No description found for parameter 'vbuf'
   include/media/v4l2-mem2mem.h:555: warning: No description found for parameter 'vbuf'
   include/net/mac80211.h:3207: ERROR: Unexpected indentation.
   include/net/mac80211.h:3210: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/net/mac80211.h:3212: ERROR: Unexpected indentation.
   include/net/mac80211.h:3213: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/net/mac80211.h:1772: ERROR: Unexpected indentation.
   include/net/mac80211.h:1776: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/sched/fair.c:7259: WARNING: Inline emphasis start-string without end-string.
   kernel/time/timer.c:1240: ERROR: Unexpected indentation.
   kernel/time/timer.c:1242: ERROR: Unexpected indentation.
   kernel/time/timer.c:1243: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:121: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:124: ERROR: Unexpected indentation.
   include/linux/wait.h:126: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/time/hrtimer.c:1021: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/signal.c:317: WARNING: Inline literal start-string without end-string.
   drivers/base/firmware_class.c:1348: WARNING: Bullet list ends without a blank line; unexpected unindent.
   drivers/message/fusion/mptbase.c:5054: WARNING: Definition list ends without a blank line; unexpected unindent.
   drivers/tty/serial/serial_core.c:1893: WARNING: Definition list ends without a blank line; unexpected unindent.
   include/linux/spi/spi.h:369: ERROR: Unexpected indentation.
   WARNING: dvipng command 'dvipng' cannot be run (needed for math display), check the imgmath_dvipng setting

vim +/b +446 include/media/v4l2-mem2mem.h

   440	 * v4l2_m2m_for_each_dst_buf() - iterate over a list of destination ready
   441	 * buffers
   442	 *
   443	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   444	 */
   445	#define v4l2_m2m_for_each_dst_buf(m2m_ctx, b)	\
 > 446		list_for_each_entry(b, &m2m_ctx->cap_q_ctx.rdy_queue, list)
   447	
   448	/**
   449	 * v4l2_m2m_for_each_src_buf() - iterate over a list of source ready buffers
   450	 *
   451	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   452	 */
   453	#define v4l2_m2m_for_each_src_buf(m2m_ctx, b)	\
   454		list_for_each_entry(b, &m2m_ctx->out_q_ctx.rdy_queue, list)
   455	
   456	/**
   457	 * v4l2_m2m_for_each_dst_buf_safe() - iterate over a list of destination ready
   458	 * buffers safely
   459	 *
   460	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   461	 */
   462	#define v4l2_m2m_for_each_dst_buf_safe(m2m_ctx, b, n)	\
 > 463		list_for_each_entry_safe(b, n, &m2m_ctx->cap_q_ctx.rdy_queue, list)
   464	
   465	/**
   466	 * v4l2_m2m_for_each_src_buf_safe() - iterate over a list of source ready
   467	 * buffers safely
   468	 *
   469	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   470	 */
   471	#define v4l2_m2m_for_each_src_buf_safe(m2m_ctx, b, n)	\
   472		list_for_each_entry_safe(b, n, &m2m_ctx->out_q_ctx.rdy_queue, list)
   473	
   474	/**
   475	 * v4l2_m2m_get_src_vq() - return vb2_queue for source buffers
   476	 *
   477	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   478	 */
   479	static inline
   480	struct vb2_queue *v4l2_m2m_get_src_vq(struct v4l2_m2m_ctx *m2m_ctx)
   481	{
   482		return &m2m_ctx->out_q_ctx.q;
   483	}
   484	
   485	/**
   486	 * v4l2_m2m_get_dst_vq() - return vb2_queue for destination buffers
   487	 *
   488	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   489	 */
   490	static inline
   491	struct vb2_queue *v4l2_m2m_get_dst_vq(struct v4l2_m2m_ctx *m2m_ctx)
   492	{
   493		return &m2m_ctx->cap_q_ctx.q;
   494	}
   495	
   496	/**
   497	 * v4l2_m2m_buf_remove() - take off a buffer from the list of ready buffers and
   498	 * return it
   499	 *
   500	 * @q_ctx: pointer to struct @v4l2_m2m_queue_ctx
   501	 */
   502	void *v4l2_m2m_buf_remove(struct v4l2_m2m_queue_ctx *q_ctx);
   503	
   504	/**
   505	 * v4l2_m2m_src_buf_remove() - take off a source buffer from the list of ready
   506	 * buffers and return it
   507	 *
   508	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   509	 */
   510	static inline void *v4l2_m2m_src_buf_remove(struct v4l2_m2m_ctx *m2m_ctx)
   511	{
   512		return v4l2_m2m_buf_remove(&m2m_ctx->out_q_ctx);
   513	}
   514	
   515	/**
   516	 * v4l2_m2m_dst_buf_remove() - take off a destination buffer from the list of
   517	 * ready buffers and return it
   518	 *
   519	 * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx
   520	 */
   521	static inline void *v4l2_m2m_dst_buf_remove(struct v4l2_m2m_ctx *m2m_ctx)
   522	{
   523		return v4l2_m2m_buf_remove(&m2m_ctx->cap_q_ctx);
   524	}
   525	
   526	/**
   527	 * v4l2_m2m_buf_remove_exact() - take off exact buffer from the list of ready
   528	 * buffers
   529	 *
   530	 * @q_ctx: pointer to struct @v4l2_m2m_queue_ctx
   531	 */
   532	void v4l2_m2m_buf_remove_exact(struct v4l2_m2m_queue_ctx *q_ctx,
 > 533				       struct vb2_v4l2_buffer *vbuf);
   534	
   535	/**
   536	 * v4l2_m2m_src_buf_remove_exact() - take off exact source buffer from the list

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6425 bytes --]

^ permalink raw reply

* Re: [PATCH v4 9/9] media: venus: enable building of Venus video driver
From: kbuild test robot @ 2016-12-03  0:07 UTC (permalink / raw)
  To: Stanimir Varbanov
  Cc: kbuild-all, Mauro Carvalho Chehab, Hans Verkuil, Andy Gross,
	Bjorn Andersson, Stephen Boyd, Srinivas Kandagatla, linux-media,
	linux-kernel, linux-arm-msm, Stanimir Varbanov
In-Reply-To: <1480583001-32236-10-git-send-email-stanimir.varbanov@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 3138 bytes --]

Hi Stanimir,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on next-20161202]
[cannot apply to v4.9-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Stanimir-Varbanov/Qualcomm-video-decoder-encoder-driver/20161203-054705
base:   git://linuxtv.org/media_tree.git master
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/media/platform/qcom/venus/hfi_venus.c: In function 'venus_tzbsp_set_video_state':
>> drivers/media/platform/qcom/venus/hfi_venus.c:455:9: error: implicit declaration of function 'qcom_scm_video_set_state' [-Werror=implicit-function-declaration]
     return qcom_scm_video_set_state(state, 0);
            ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/qcom_scm_video_set_state +455 drivers/media/platform/qcom/venus/hfi_venus.c

93fa34d2 Stanimir Varbanov 2016-12-01  439  
93fa34d2 Stanimir Varbanov 2016-12-01  440  	pkt = (struct hfi_sys_set_resource_pkt *) packet;
93fa34d2 Stanimir Varbanov 2016-12-01  441  
93fa34d2 Stanimir Varbanov 2016-12-01  442  	ret = pkt_sys_set_resource(pkt, id, size, addr, cookie);
93fa34d2 Stanimir Varbanov 2016-12-01  443  	if (ret)
93fa34d2 Stanimir Varbanov 2016-12-01  444  		return ret;
93fa34d2 Stanimir Varbanov 2016-12-01  445  
93fa34d2 Stanimir Varbanov 2016-12-01  446  	ret = venus_iface_cmdq_write(hdev, pkt);
93fa34d2 Stanimir Varbanov 2016-12-01  447  	if (ret)
93fa34d2 Stanimir Varbanov 2016-12-01  448  		return ret;
93fa34d2 Stanimir Varbanov 2016-12-01  449  
93fa34d2 Stanimir Varbanov 2016-12-01  450  	return 0;
93fa34d2 Stanimir Varbanov 2016-12-01  451  }
93fa34d2 Stanimir Varbanov 2016-12-01  452  
93fa34d2 Stanimir Varbanov 2016-12-01  453  static int venus_tzbsp_set_video_state(enum tzbsp_video_state state)
93fa34d2 Stanimir Varbanov 2016-12-01  454  {
93fa34d2 Stanimir Varbanov 2016-12-01 @455  	return qcom_scm_video_set_state(state, 0);
93fa34d2 Stanimir Varbanov 2016-12-01  456  }
93fa34d2 Stanimir Varbanov 2016-12-01  457  
93fa34d2 Stanimir Varbanov 2016-12-01  458  static int venus_boot_core(struct venus_hfi_device *hdev)
93fa34d2 Stanimir Varbanov 2016-12-01  459  {
93fa34d2 Stanimir Varbanov 2016-12-01  460  	struct device *dev = hdev->core->dev;
93fa34d2 Stanimir Varbanov 2016-12-01  461  	static const unsigned int max_tries = 100;
93fa34d2 Stanimir Varbanov 2016-12-01  462  	u32 ctrl_status = 0;
93fa34d2 Stanimir Varbanov 2016-12-01  463  	unsigned int count = 0;

:::::: The code at line 455 was first introduced by commit
:::::: 93fa34d264d32979ec1634d8fc366d7cf6ff453d media: venus: hfi: add Venus HFI files

:::::: TO: Stanimir Varbanov <stanimir.varbanov@linaro.org>
:::::: CC: 0day robot <fengguang.wu@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 56966 bytes --]

^ permalink raw reply

* [PATCH v4l-utils 5/6] ir-keytable: "-p all" or "-p mce-kdb" does not work
From: Sean Young @ 2016-12-02 17:20 UTC (permalink / raw)
  To: linux-media

When writing to the sysfs protocols file, use the underscore variant.
The kernel does not accept "mce-kdb" and it never did.

Signed-off-by: Sean Young <sean@mess.org>
---
 utils/keytable/keytable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 202610a..a6ecc9e 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -131,8 +131,8 @@ const struct protocol_map_entry protocol_map[] = {
 	{ "sony20",	NULL,		SYSFS_INVALID	},
 	{ "nec",	"/nec_decoder",	SYSFS_NEC	},
 	{ "sanyo",	NULL,		SYSFS_SANYO	},
-	{ "mce-kbd",	NULL,		SYSFS_MCE_KBD	},
 	{ "mce_kbd",	NULL,		SYSFS_MCE_KBD	},
+	{ "mce-kbd",	NULL,		SYSFS_MCE_KBD	},
 	{ "rc-6",	"/rc6_decoder",	SYSFS_RC6	},
 	{ "rc6",	NULL,		SYSFS_RC6	},
 	{ "rc-6-0",	NULL,		SYSFS_INVALID	},
-- 
2.9.3


^ permalink raw reply related

* [PATCH v4l-utils 4/6] ir-ctl: improve scancode validation
From: Sean Young @ 2016-12-02 17:20 UTC (permalink / raw)
  To: linux-media

Ensure rc6 mce is that just that and that nec32 is not necx or nec.

Signed-off-by: Sean Young <sean@mess.org>
---
 utils/ir-ctl/ir-ctl.c    |  4 ++--
 utils/ir-ctl/ir-encode.c | 18 ++++++++++++++++++
 utils/ir-ctl/ir-encode.h |  1 +
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 768daad..53ff8ca 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -242,7 +242,7 @@ static struct file *read_file(const char *fname)
 				return NULL;
 			}
 
-			if (scancode & ~protocol_scancode_mask(proto)) {
+			if (!protocol_scancode_valid(proto, scancode)) {
 				fprintf(stderr, _("error: %s:%d: invalid scancode '%s' for protocol '%s'\n"), fname, lineno, scancodestr, protocol_name(proto));
 				return NULL;
 			}
@@ -354,7 +354,7 @@ static struct file *read_scancode(const char *name)
 		return NULL;
 	}
 
-	if (scancode & ~protocol_scancode_mask(proto)) {
+	if (!protocol_scancode_valid(proto, scancode)) {
 		fprintf(stderr, _("error: invalid scancode '%s' for protocol '%s'\n"), p + 1, protocol_name(proto));
 		return NULL;
 	}
diff --git a/utils/ir-ctl/ir-encode.c b/utils/ir-ctl/ir-encode.c
index 704ce95..d3ee035 100644
--- a/utils/ir-ctl/ir-encode.c
+++ b/utils/ir-ctl/ir-encode.c
@@ -417,6 +417,24 @@ unsigned protocol_scancode_mask(enum rc_proto proto)
 	return encoders[proto].scancode_mask;
 }
 
+bool protocol_scancode_valid(enum rc_proto p, unsigned s)
+{
+	if (s & ~encoders[p].scancode_mask)
+		return false;
+
+	if (p == RC_PROTO_NECX) {
+		return (((s >> 16) ^ ~(s >> 8)) & 0xff) != 0;
+	} else if (p == RC_PROTO_NEC32) {
+		return (((s >> 24) ^ ~(s >> 16)) & 0xff) != 0;
+	} else if (p == RC_PROTO_RC6_MCE) {
+		return (s & 0xffff0000) == 0x800f0000;
+	} else if (p == RC_PROTO_RC6_6A_32) {
+		return (s & 0xffff0000) != 0x800f0000;
+	}
+
+	return true;
+}
+
 unsigned protocol_encode(enum rc_proto proto, unsigned scancode, unsigned *buf)
 {
 	return encoders[proto].encode(proto, scancode, buf);
diff --git a/utils/ir-ctl/ir-encode.h b/utils/ir-ctl/ir-encode.h
index b2542ec..4a51f1c 100644
--- a/utils/ir-ctl/ir-encode.h
+++ b/utils/ir-ctl/ir-encode.h
@@ -28,6 +28,7 @@ enum rc_proto {
 bool protocol_match(const char *name, enum rc_proto *proto);
 unsigned protocol_carrier(enum rc_proto proto);
 unsigned protocol_max_size(enum rc_proto proto);
+bool protocol_scancode_valid(enum rc_proto proto, unsigned scancode);
 unsigned protocol_scancode_mask(enum rc_proto proto);
 unsigned protocol_encode(enum rc_proto proto, unsigned scancode, unsigned *buf);
 const char *protocol_name(enum rc_proto proto);
-- 
2.9.3


^ permalink raw reply related

* [PATCH v4l-utils 6/6] ir-ctl: rename rc5x to rc5x_20
From: Sean Young @ 2016-12-02 17:20 UTC (permalink / raw)
  To: linux-media

There are many extended rc5 protocols and we can only generate the 20
bit variant.

Signed-off-by: Sean Young <sean@mess.org>
---
 utils/ir-ctl/ir-ctl.1.in | 7 ++++---
 utils/ir-ctl/ir-encode.c | 4 ++--
 utils/ir-ctl/ir-encode.h | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/utils/ir-ctl/ir-ctl.1.in b/utils/ir-ctl/ir-ctl.1.in
index a1d5aeb..c2e0094 100644
--- a/utils/ir-ctl/ir-ctl.1.in
+++ b/utils/ir-ctl/ir-ctl.1.in
@@ -177,9 +177,10 @@ there are limits to what lirc devices can send in one go.
 .SS Supported Protocols
 A scancode with protocol can be specified on the command line or in the
 pulse and space file. The following protocols are supported:
-\fBrc5\fR, \fBrc5x\fR, \fBrc5_sz\fR, \fBjvc\fR, \fBsony12\fR, \fBsony\fB15\fR,
-\fBsony20\fR, \fBnec\fR, \fBnecx\fR, \fBnec32\fR, \fBsanyo\fR, \fBrc6_0\fR,
-\fBrc6_6a_20\fR, \fBrc6_6a_24\fR, \fBrc6_6a_32\fR, \fBrc6_mce\fR, \fBsharp\fR.
+\fBrc5\fR, \fBrc5x_20\fR, \fBrc5_sz\fR, \fBjvc\fR, \fBsony12\fR,
+\fBsony\fB15\fR, \fBsony20\fR, \fBnec\fR, \fBnecx\fR, \fBnec32\fR,
+\fBsanyo\fR, \fBrc6_0\fR, \fBrc6_6a_20\fR, \fBrc6_6a_24\fR, \fBrc6_6a_32\fR,
+\fBrc6_mce\fR, \fBsharp\fR.
 If the scancode starts with 0x it will be interpreted as a
 hexidecimal number, and if it starts with 0 it will be interpreted as an
 octal number.
diff --git a/utils/ir-ctl/ir-encode.c b/utils/ir-ctl/ir-encode.c
index d3ee035..9cc8c5d 100644
--- a/utils/ir-ctl/ir-encode.c
+++ b/utils/ir-ctl/ir-encode.c
@@ -260,7 +260,7 @@ static int rc5_encode(enum rc_proto proto, unsigned scancode, unsigned *buf)
 		add_bits(scancode >> 6, 6);
 		add_bits(scancode, 6);
 		break;
-	case RC_PROTO_RC5X:
+	case RC_PROTO_RC5X_20:
 		add_bits(!(scancode & 0x4000), 1);
 		add_bits(0, 1);
 		add_bits(scancode >> 16, 5);
@@ -350,7 +350,7 @@ static const struct {
 	int (*encode)(enum rc_proto proto, unsigned scancode, unsigned *buf);
 } encoders[RC_PROTO_COUNT] = {
 	[RC_PROTO_RC5] = { "rc5", 0x1f3f, 24, 36000, rc5_encode },
-	[RC_PROTO_RC5X] = { "rc5x", 0x1f7f3f, 40, 36000, rc5_encode },
+	[RC_PROTO_RC5X_20] = { "rc5x_20", 0x1f7f3f, 40, 36000, rc5_encode },
 	[RC_PROTO_RC5_SZ] = { "rc5_sz", 0x2fff, 26, 36000, rc5_encode },
 	[RC_PROTO_SONY12] = { "sony12", 0x1f007f, 25, 40000, sony_encode },
 	[RC_PROTO_SONY15] = { "sony15", 0xff007f, 31, 40000, sony_encode },
diff --git a/utils/ir-ctl/ir-encode.h b/utils/ir-ctl/ir-encode.h
index 4a51f1c..31d81aa 100644
--- a/utils/ir-ctl/ir-encode.h
+++ b/utils/ir-ctl/ir-encode.h
@@ -4,7 +4,7 @@
 
 enum rc_proto {
 	RC_PROTO_RC5,
-	RC_PROTO_RC5X,
+	RC_PROTO_RC5X_20,
 	RC_PROTO_RC5_SZ,
 	RC_PROTO_JVC,
 	RC_PROTO_SONY12,
-- 
2.9.3


^ permalink raw reply related

* [PATCH v4l-utils 3/6] ir-ctl: 0 is valid scancode
From: Sean Young @ 2016-12-02 17:20 UTC (permalink / raw)
  To: linux-media

Same for 0xffffffff.

Signed-off-by: Sean Young <sean@mess.org>
---
 utils/ir-ctl/ir-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index f19bd05..768daad 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -146,7 +146,7 @@ static bool strtoscancode(const char *p, unsigned *ret)
 	if (end == NULL || end[0] != 0)
 		return false;
 
-	if (arg <= 0 || arg >= 0xffffffff)
+	if (arg < 0 || arg > 0xffffffff)
 		return false;
 
 	*ret = arg;
-- 
2.9.3


^ permalink raw reply related

* [PATCH v4l-utils 2/6] ir-ctl: fix rc5x encoding
From: Sean Young @ 2016-12-02 17:20 UTC (permalink / raw)
  To: linux-media

6th command bit was missing.

Signed-off-by: Sean Young <sean@mess.org>
---
 utils/ir-ctl/ir-encode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/ir-ctl/ir-encode.c b/utils/ir-ctl/ir-encode.c
index 1bf0ac6..704ce95 100644
--- a/utils/ir-ctl/ir-encode.c
+++ b/utils/ir-ctl/ir-encode.c
@@ -261,7 +261,7 @@ static int rc5_encode(enum rc_proto proto, unsigned scancode, unsigned *buf)
 		add_bits(scancode, 6);
 		break;
 	case RC_PROTO_RC5X:
-		add_bits(!!(scancode & 0x4000), 1);
+		add_bits(!(scancode & 0x4000), 1);
 		add_bits(0, 1);
 		add_bits(scancode >> 16, 5);
 		advance_space(NS_TO_US(rc5_unit * 4));
@@ -350,7 +350,7 @@ static const struct {
 	int (*encode)(enum rc_proto proto, unsigned scancode, unsigned *buf);
 } encoders[RC_PROTO_COUNT] = {
 	[RC_PROTO_RC5] = { "rc5", 0x1f3f, 24, 36000, rc5_encode },
-	[RC_PROTO_RC5X] = { "rc5x", 0x1f3f3f, 40, 36000, rc5_encode },
+	[RC_PROTO_RC5X] = { "rc5x", 0x1f7f3f, 40, 36000, rc5_encode },
 	[RC_PROTO_RC5_SZ] = { "rc5_sz", 0x2fff, 26, 36000, rc5_encode },
 	[RC_PROTO_SONY12] = { "sony12", 0x1f007f, 25, 40000, sony_encode },
 	[RC_PROTO_SONY15] = { "sony15", 0xff007f, 31, 40000, sony_encode },
-- 
2.9.3


^ permalink raw reply related

* [PATCH v4l-utils 1/6] ir-ctl: uninitialised memory used
From: Sean Young @ 2016-12-02 17:20 UTC (permalink / raw)
  To: linux-media

We might end up with a corrupt rc6.

Signed-off-by: Sean Young <sean@mess.org>
---
 utils/ir-ctl/ir-encode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils/ir-ctl/ir-encode.c b/utils/ir-ctl/ir-encode.c
index a0d2f4c..1bf0ac6 100644
--- a/utils/ir-ctl/ir-encode.c
+++ b/utils/ir-ctl/ir-encode.c
@@ -310,6 +310,7 @@ static int rc6_encode(enum rc_proto proto, unsigned scancode, unsigned *buf)
 
 	buf[n++] = NS_TO_US(rc6_unit * 6);
 	buf[n++] = NS_TO_US(rc6_unit * 2);
+	buf[n] = 0;
 
 	switch (proto) {
 	default:
-- 
2.9.3


^ permalink raw reply related

* [PATCH 8/8] [media] rc5x: document that this is the 20 bit variant
From: Sean Young @ 2016-12-02 17:16 UTC (permalink / raw)
  To: linux-media; +Cc: David Härdeman

There are many variants of extended rc5. This implements the 20 bit
version.

Signed-off-by: Sean Young <sean@mess.org>
Cc: David Härdeman <david@hardeman.nu>
---
 drivers/media/rc/ir-rc5-decoder.c | 6 +++---
 drivers/media/rc/rc-main.c        | 2 +-
 include/media/rc-map.h            | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c
index a95477c..484185e 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -124,7 +124,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
 		if (data->is_rc5x && data->count == RC5X_NBITS) {
 			/* RC5X */
 			u8 xdata, command, system;
-			if (!(dev->enabled_protocols & RC_BIT_RC5X)) {
+			if (!(dev->enabled_protocols & RC_BIT_RC5X_20)) {
 				data->state = STATE_INACTIVE;
 				return 0;
 			}
@@ -134,7 +134,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
 			toggle   = (data->bits & 0x20000) ? 1 : 0;
 			command += (data->bits & 0x40000) ? 0 : 0x40;
 			scancode = system << 16 | command << 8 | xdata;
-			protocol = RC_TYPE_RC5X;
+			protocol = RC_TYPE_RC5X_20;
 
 		} else if (!data->is_rc5x && data->count == RC5_NBITS) {
 			/* RC5 */
@@ -182,7 +182,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
 }
 
 static struct ir_raw_handler rc5_handler = {
-	.protocols	= RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ,
+	.protocols	= RC_BIT_RC5 | RC_BIT_RC5X_20 | RC_BIT_RC5_SZ,
 	.decode		= ir_rc5_decode,
 };
 
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index dedaf38..75bdc49 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -796,7 +796,7 @@ static const struct {
 	{ RC_BIT_OTHER,		"other",	NULL			},
 	{ RC_BIT_UNKNOWN,	"unknown",	NULL			},
 	{ RC_BIT_RC5 |
-	  RC_BIT_RC5X,		"rc-5",		"ir-rc5-decoder"	},
+	  RC_BIT_RC5X_20,	"rc-5",		"ir-rc5-decoder"	},
 	{ RC_BIT_NEC |
 	  RC_BIT_NECX |
 	  RC_BIT_NEC32,		"nec",		"ir-nec-decoder"	},
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index e1cc14c..39c00ef 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -17,7 +17,7 @@
  * @RC_TYPE_UNKNOWN: Protocol not known
  * @RC_TYPE_OTHER: Protocol known but proprietary
  * @RC_TYPE_RC5: Philips RC5 protocol
- * @RC_TYPE_RC5X: Philips RC5x protocol
+ * @RC_TYPE_RC5X_20: Philips RC5x 20 bit protocol
  * @RC_TYPE_RC5_SZ: StreamZap variant of RC5
  * @RC_TYPE_JVC: JVC protocol
  * @RC_TYPE_SONY12: Sony 12 bit protocol
@@ -41,7 +41,7 @@ enum rc_type {
 	RC_TYPE_UNKNOWN		= 0,
 	RC_TYPE_OTHER		= 1,
 	RC_TYPE_RC5		= 2,
-	RC_TYPE_RC5X		= 3,
+	RC_TYPE_RC5X_20		= 3,
 	RC_TYPE_RC5_SZ		= 4,
 	RC_TYPE_JVC		= 5,
 	RC_TYPE_SONY12		= 6,
@@ -66,7 +66,7 @@ enum rc_type {
 #define RC_BIT_UNKNOWN		(1ULL << RC_TYPE_UNKNOWN)
 #define RC_BIT_OTHER		(1ULL << RC_TYPE_OTHER)
 #define RC_BIT_RC5		(1ULL << RC_TYPE_RC5)
-#define RC_BIT_RC5X		(1ULL << RC_TYPE_RC5X)
+#define RC_BIT_RC5X_20		(1ULL << RC_TYPE_RC5X_20)
 #define RC_BIT_RC5_SZ		(1ULL << RC_TYPE_RC5_SZ)
 #define RC_BIT_JVC		(1ULL << RC_TYPE_JVC)
 #define RC_BIT_SONY12		(1ULL << RC_TYPE_SONY12)
@@ -87,7 +87,7 @@ enum rc_type {
 #define RC_BIT_CEC		(1ULL << RC_TYPE_CEC)
 
 #define RC_BIT_ALL	(RC_BIT_UNKNOWN | RC_BIT_OTHER | \
-			 RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \
+			 RC_BIT_RC5 | RC_BIT_RC5X_20 | RC_BIT_RC5_SZ | \
 			 RC_BIT_JVC | \
 			 RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \
 			 RC_BIT_NEC | RC_BIT_NECX | RC_BIT_NEC32 | \
-- 
2.9.3


^ permalink raw reply related

* [PATCH 6/8] [media] rc: allow software timeout to be set
From: Sean Young @ 2016-12-02 17:16 UTC (permalink / raw)
  To: linux-media

Both the iguanair and the technotrend usb ir do not do any timeout
handling in hardware, so timeout is entirely done in
ir_raw_event_store_with_filter(). Any sensible timeout value will
do, so allow it to be set using LIRC_SET_REC_TIMEOUT.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/iguanair.c | 4 +++-
 drivers/media/rc/ttusbir.c  | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
index 5f63454..139a09c 100644
--- a/drivers/media/rc/iguanair.c
+++ b/drivers/media/rc/iguanair.c
@@ -504,7 +504,9 @@ static int iguanair_probe(struct usb_interface *intf,
 	rc->tx_ir = iguanair_tx;
 	rc->driver_name = DRIVER_NAME;
 	rc->map_name = RC_MAP_RC6_MCE;
-	rc->timeout = MS_TO_NS(100);
+	rc->min_timeout = 1;
+	rc->timeout = IR_DEFAULT_TIMEOUT;
+	rc->max_timeout = 10 * IR_DEFAULT_TIMEOUT;
 	rc->rx_resolution = RX_RESOLUTION;
 
 	iguanair_set_tx_carrier(rc, 38000);
diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c
index bc214e2..8393014 100644
--- a/drivers/media/rc/ttusbir.c
+++ b/drivers/media/rc/ttusbir.c
@@ -322,7 +322,10 @@ static int ttusbir_probe(struct usb_interface *intf,
 	rc->priv = tt;
 	rc->driver_name = DRIVER_NAME;
 	rc->map_name = RC_MAP_TT_1500;
-	rc->timeout = MS_TO_NS(100);
+	rc->min_timeout = 1;
+	rc->timeout = IR_DEFAULT_TIMEOUT;
+	rc->max_timeout = 10 * IR_DEFAULT_TIMEOUT;
+
 	/*
 	 * The precision is NS_PER_BIT, but since every 8th bit can be
 	 * overwritten with garbage the accuracy is at best 2 * NS_PER_BIT.
-- 
2.9.3


^ permalink raw reply related

* [PATCH 7/8] [media] rc5x: 6th command bit is S2 bit
From: Sean Young @ 2016-12-02 17:16 UTC (permalink / raw)
  To: linux-media; +Cc: David Härdeman

The 2nd stop bit in rc5 is reused as an inverted 6th command bit in
20 bits rc5x. Currently the rc5x decoder sets the 6th command bit as
an inverted duplicate of the lowest system bit; as a result we do
not have all the command bits.

Note that there are no rc5x keymaps present.

Signed-off-by: Sean Young <sean@mess.org>
Cc: David Härdeman <david@hardeman.nu>
---
 drivers/media/rc/ir-rc5-decoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c
index a0fd4e6..a95477c 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -132,7 +132,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
 			command  = (data->bits & 0x00FC0) >> 6;
 			system   = (data->bits & 0x1F000) >> 12;
 			toggle   = (data->bits & 0x20000) ? 1 : 0;
-			command += (data->bits & 0x01000) ? 0 : 0x40;
+			command += (data->bits & 0x40000) ? 0 : 0x40;
 			scancode = system << 16 | command << 8 | xdata;
 			protocol = RC_TYPE_RC5X;
 
-- 
2.9.3


^ permalink raw reply related

* [PATCH 4/8] [media] em28xx: IR protocol not reported correctly
From: Sean Young @ 2016-12-02 17:16 UTC (permalink / raw)
  To: linux-media

Report the correct NEC variant.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/usb/em28xx/em28xx-input.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index a1904e2..a9a7f16 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -259,18 +259,21 @@ static int em2874_polling_getkey(struct em28xx_IR *ir,
 		break;
 
 	case RC_BIT_NEC:
-		poll_result->protocol = RC_TYPE_RC5;
 		poll_result->scancode = msg[1] << 8 | msg[2];
-		if ((msg[3] ^ msg[4]) != 0xff)		/* 32 bits NEC */
+		if ((msg[3] ^ msg[4]) != 0xff) {	/* 32 bits NEC */
+			poll_result->protocol = RC_TYPE_NEC32;
 			poll_result->scancode = RC_SCANCODE_NEC32((msg[1] << 24) |
 								  (msg[2] << 16) |
 								  (msg[3] << 8)  |
 								  (msg[4]));
-		else if ((msg[1] ^ msg[2]) != 0xff)	/* 24 bits NEC */
+		} else if ((msg[1] ^ msg[2]) != 0xff) {	/* 24 bits NEC */
+			poll_result->protocol = RC_TYPE_NECX;
 			poll_result->scancode = RC_SCANCODE_NECX(msg[1] << 8 |
 								 msg[2], msg[3]);
-		else					/* Normal NEC */
+		} else {				/* Normal NEC */
+			poll_result->protocol = RC_TYPE_NEC;
 			poll_result->scancode = RC_SCANCODE_NEC(msg[1], msg[3]);
+		}
 		break;
 
 	case RC_BIT_RC6_0:
@@ -775,7 +778,7 @@ static int em28xx_ir_init(struct em28xx *dev)
 		case CHIP_ID_EM28178:
 			ir->get_key = em2874_polling_getkey;
 			rc->allowed_protocols = RC_BIT_RC5 | RC_BIT_NEC |
-					     RC_BIT_RC6_0;
+				RC_BIT_NECX | RC_BIT_NEC32 | RC_BIT_RC6_0;
 			break;
 		default:
 			err = -ENODEV;
-- 
2.9.3


^ permalink raw reply related

* [PATCH 2/8] [media] lirc_dev: LIRC_{G,S}ET_REC_MODE do not work
From: Sean Young @ 2016-12-02 17:16 UTC (permalink / raw)
  To: linux-media; +Cc: Andi Shyti, stable

Since "273b902 [media] lirc_dev: use LIRC_CAN_REC() define" these
ioctls no longer work.

Signed-off-by: Sean Young <sean@mess.org>
Cc: Andi Shyti <andi.shyti@samsung.com>
Cc: <stable@vger.kernel.org> # v4.8+
---
 drivers/media/rc/lirc_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 3854809..7f5d109 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -582,7 +582,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		result = put_user(ir->d.features, (__u32 __user *)arg);
 		break;
 	case LIRC_GET_REC_MODE:
-		if (LIRC_CAN_REC(ir->d.features)) {
+		if (!LIRC_CAN_REC(ir->d.features)) {
 			result = -ENOTTY;
 			break;
 		}
@@ -592,7 +592,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 				  (__u32 __user *)arg);
 		break;
 	case LIRC_SET_REC_MODE:
-		if (LIRC_CAN_REC(ir->d.features)) {
+		if (!LIRC_CAN_REC(ir->d.features)) {
 			result = -ENOTTY;
 			break;
 		}
-- 
2.9.3


^ permalink raw reply related

* [PATCH 5/8] [media] serial_ir: generate timeout
From: Sean Young @ 2016-12-02 17:16 UTC (permalink / raw)
  To: linux-media

No timeout is generated by serial_ir since the port only generates
interrupts on edges. Some IR protocols like rc6 and rc5 need a trailing
space or timeout so they know there are no more bits coming.

Without it, the current key will only be reported once some more IR
occurs.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/serial_ir.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c
index 436bd58..2cb6471 100644
--- a/drivers/media/rc/serial_ir.c
+++ b/drivers/media/rc/serial_ir.c
@@ -137,6 +137,7 @@ struct serial_ir {
 	ktime_t lastkt;
 	struct rc_dev *rcdev;
 	struct platform_device *pdev;
+	struct timer_list timeout_timer;
 
 	unsigned int freq;
 	unsigned int duty_cycle;
@@ -395,9 +396,14 @@ static irqreturn_t serial_ir_irq_handler(int i, void *blah)
 			frbwrite(data, !(dcd ^ sense));
 			serial_ir.lastkt = kt;
 			last_dcd = dcd;
-			ir_raw_event_handle(serial_ir.rcdev);
 		}
 	} while (!(sinp(UART_IIR) & UART_IIR_NO_INT)); /* still pending ? */
+
+	mod_timer(&serial_ir.timeout_timer,
+		  jiffies + nsecs_to_jiffies(serial_ir.rcdev->timeout));
+
+	ir_raw_event_handle(serial_ir.rcdev);
+
 	return IRQ_HANDLED;
 }
 
@@ -471,6 +477,16 @@ static int hardware_init_port(void)
 	return 0;
 }
 
+static void serial_ir_timeout(unsigned long arg)
+{
+	DEFINE_IR_RAW_EVENT(ev);
+
+	ev.timeout = true;
+	ev.duration = serial_ir.rcdev->timeout;
+	ir_raw_event_store_with_filter(serial_ir.rcdev, &ev);
+	ir_raw_event_handle(serial_ir.rcdev);
+}
+
 static int serial_ir_probe(struct platform_device *dev)
 {
 	int i, nlow, nhigh, result;
@@ -500,6 +516,9 @@ static int serial_ir_probe(struct platform_device *dev)
 		return -EBUSY;
 	}
 
+	setup_timer(&serial_ir.timeout_timer, serial_ir_timeout,
+		    (unsigned long)&serial_ir);
+
 	result = hardware_init_port();
 	if (result < 0)
 		return result;
@@ -781,7 +800,9 @@ static int __init serial_ir_init_module(void)
 	rcdev->allowed_protocols = RC_BIT_ALL;
 	rcdev->driver_name = KBUILD_MODNAME;
 	rcdev->map_name = RC_MAP_RC6_MCE;
+	rcdev->min_timeout = 1;
 	rcdev->timeout = IR_DEFAULT_TIMEOUT;
+	rcdev->max_timeout = 10 * IR_DEFAULT_TIMEOUT;
 	rcdev->rx_resolution = 250000;
 
 	serial_ir.rcdev = rcdev;
@@ -797,6 +818,7 @@ static int __init serial_ir_init_module(void)
 
 static void __exit serial_ir_exit_module(void)
 {
+	del_timer_sync(&serial_ir.timeout_timer);
 	rc_unregister_device(serial_ir.rcdev);
 	serial_ir_exit();
 }
-- 
2.9.3


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox