Sparse error in s5p_mfc_enc.c

2014-10-30 Thread Hans Verkuil
Hi Kamil,

Can you make a patch to fix this sparse error?

/home/hans/work/build/media-git/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1178:25:
 error: incompatible types in conditional expression (different base types)

s5p_mfc_hw_call should probably be s5p_mfc_hw_call_void.

Regards,

Hans
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103 for supporting the demod of M88RS6000

2014-10-30 Thread Nibble Max
v3:
-reconstruct the codes in set_frontend to keep the same logic for M88RS6000 
and M88DS3103.
-remove calling set_config of tuner to set demod mclk.
-demod mclk will be set in set_params of tuner call back.

v2:
-make demod mclk selection logic simple.
-merge demod mclk and ts mclk into one call back.

M88RS6000 is the integrated chip, which includes tuner and demod.
Its internal demod is similar with M88DS3103 except some registers definition.
The main different part of this internal demod from others is its clock/pll 
generation IP block sitting inside the tuner die.
So clock/pll functions should be configed through its tuner i2c bus, NOT its 
demod i2c bus.
The demod of M88RS6000 need the firmware: dvb-demod-m88rs6000.fw
firmware download link: 
http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz

Signed-off-by: Nibble Max nibble@gmail.com
---
 drivers/media/dvb-frontends/m88ds3103.c  | 242 ++-
 drivers/media/dvb-frontends/m88ds3103_priv.h | 181 
 2 files changed, 345 insertions(+), 78 deletions(-)

diff --git a/drivers/media/dvb-frontends/m88ds3103.c 
b/drivers/media/dvb-frontends/m88ds3103.c
index 81657e9..621d20f 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -1,5 +1,5 @@
 /*
- * Montage M88DS3103 demodulator driver
+ * Montage M88DS3103/M88RS6000 demodulator driver
  *
  * Copyright (C) 2013 Antti Palosaari cr...@iki.fi
  *
@@ -162,7 +162,7 @@ static int m88ds3103_wr_reg_val_tab(struct m88ds3103_priv 
*priv,
 
dev_dbg(priv-i2c-dev, %s: tab_len=%d\n, __func__, tab_len);
 
-   if (tab_len  83) {
+   if (tab_len  86) {
ret = -EINVAL;
goto err;
}
@@ -246,7 +246,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
int ret, len;
const struct m88ds3103_reg_val *init;
u8 u8tmp, u8tmp1, u8tmp2;
-   u8 buf[2];
+   u8 buf[3];
u16 u16tmp, divide_ratio;
u32 tuner_frequency, target_mclk;
s32 s32tmp;
@@ -262,6 +262,22 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
goto err;
}
 
+   /* reset */
+   ret = m88ds3103_wr_reg(priv, 0x07, 0x80);
+   if (ret)
+   goto err;
+
+   ret = m88ds3103_wr_reg(priv, 0x07, 0x00);
+   if (ret)
+   goto err;
+
+   /* Disable demod clock path */
+   if (priv-chip_id == M88RS6000_CHIP_ID) {
+   ret = m88ds3103_wr_reg(priv, 0x06, 0xe0);
+   if (ret)
+   goto err;
+   }
+
/* program tuner */
if (fe-ops.tuner_ops.set_params) {
ret = fe-ops.tuner_ops.set_params(fe);
@@ -282,14 +298,76 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
tuner_frequency = c-frequency;
}
 
-   /* reset */
-   ret = m88ds3103_wr_reg(priv, 0x07, 0x80);
-   if (ret)
-   goto err;
+   /* select M88RS6000 demod main mclk and ts mclk from tuner die. */
+   if (priv-chip_id == M88RS6000_CHIP_ID) {
+   if (c-symbol_rate  4501)
+   priv-mclk_khz = 110250;
+   else
+   priv-mclk_khz = 96000;
 
-   ret = m88ds3103_wr_reg(priv, 0x07, 0x00);
-   if (ret)
-   goto err;
+   if (c-delivery_system == SYS_DVBS)
+   target_mclk = 96000;
+   else
+   target_mclk = 144000;
+
+   /* Enable demod clock path */
+   ret = m88ds3103_wr_reg(priv, 0x06, 0x00);
+   if (ret)
+   goto err;
+   usleep_range(1, 2);
+   } else {
+   /* set M88DS3103 mclk and ts mclk. */
+   priv-mclk_khz = 96000;
+
+   if (c-delivery_system == SYS_DVBS)
+   target_mclk = 96000;
+   else {
+   switch (priv-cfg-ts_mode) {
+   case M88DS3103_TS_SERIAL:
+   case M88DS3103_TS_SERIAL_D7:
+   if (c-symbol_rate  1800)
+   target_mclk = 96000;
+   else
+   target_mclk = 144000;
+   break;
+   case M88DS3103_TS_PARALLEL:
+   case M88DS3103_TS_CI:
+   if (c-symbol_rate  1800)
+   target_mclk = 96000;
+   else if (c-symbol_rate  2800)
+   target_mclk = 144000;
+   else
+   target_mclk = 192000;
+   break;
+   default:
+   dev_dbg(priv-i2c-dev, %s: invalid 
ts_mode\n,
+   

[PATCH v3 2/3] DVBSky V3 PCIe card: add new dvb-s/s2 tuner for integrated chip M88RS6000

2014-10-30 Thread Nibble Max
v3:
-config demod mclk in set_params call back.
-remove set_config.

v2:
-make demod mclk selection logic simple.
-merge demod mclk and ts mclk into one call back.
-make code clean.

M88RS6000 is the integrated chip, which includes tuner and demod.
Here splite its tuner as a standalone driver.
.set_config is used to config its demod clock, which sits inside tuner die.

Signed-off-by: Nibble Max nibble@gmail.com
---
 drivers/media/tuners/Kconfig  |   8 +
 drivers/media/tuners/Makefile |   1 +
 drivers/media/tuners/m88rs6000t.c | 744 ++
 drivers/media/tuners/m88rs6000t.h |  29 ++
 4 files changed, 782 insertions(+)

diff --git a/drivers/media/tuners/Kconfig b/drivers/media/tuners/Kconfig
index f039dc2..42e5a01 100644
--- a/drivers/media/tuners/Kconfig
+++ b/drivers/media/tuners/Kconfig
@@ -232,6 +232,14 @@ config MEDIA_TUNER_M88TS2022
help
  Montage M88TS2022 silicon tuner driver.
 
+config MEDIA_TUNER_M88RS6000T
+   tristate Montage M88RS6000 internal tuner
+   depends on MEDIA_SUPPORT  I2C
+   select REGMAP_I2C
+   default m if !MEDIA_SUBDRV_AUTOSELECT
+   help
+ Montage M88RS6000 internal tuner.
+
 config MEDIA_TUNER_TUA9001
tristate Infineon TUA 9001 silicon tuner
depends on MEDIA_SUPPORT  I2C
diff --git a/drivers/media/tuners/Makefile b/drivers/media/tuners/Makefile
index 49fcf80..da4fe6e 100644
--- a/drivers/media/tuners/Makefile
+++ b/drivers/media/tuners/Makefile
@@ -41,6 +41,7 @@ obj-$(CONFIG_MEDIA_TUNER_IT913X) += it913x.o
 obj-$(CONFIG_MEDIA_TUNER_R820T) += r820t.o
 obj-$(CONFIG_MEDIA_TUNER_MXL301RF) += mxl301rf.o
 obj-$(CONFIG_MEDIA_TUNER_QM1D1C0042) += qm1d1c0042.o
+obj-$(CONFIG_MEDIA_TUNER_M88RS6000T) += m88rs6000t.o
 
 ccflags-y += -I$(srctree)/drivers/media/dvb-core
 ccflags-y += -I$(srctree)/drivers/media/dvb-frontends
diff --git a/drivers/media/tuners/m88rs6000t.c 
b/drivers/media/tuners/m88rs6000t.c
new file mode 100644
index 000..d4c13fe
--- /dev/null
+++ b/drivers/media/tuners/m88rs6000t.c
@@ -0,0 +1,744 @@
+/*
+ * Driver for the internal tuner of Montage M88RS6000
+ *
+ * Copyright (C) 2014 Max nibble nibble@gmail.com
+ *
+ *This program is free software; you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation; either version 2 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *GNU General Public License for more details.
+ */
+
+#include m88rs6000t.h
+#include linux/regmap.h
+
+struct m88rs6000t_dev {
+   struct m88rs6000t_config cfg;
+   struct i2c_client *client;
+   struct regmap *regmap;
+   u32 frequency_khz;
+};
+
+struct m88rs6000t_reg_val {
+   u8 reg;
+   u8 val;
+};
+
+/* set demod main mclk and ts mclk */
+static int m88rs6000t_set_demod_mclk(struct dvb_frontend *fe)
+{
+   struct m88rs6000t_dev *dev = fe-tuner_priv;
+   struct dtv_frontend_properties *c = fe-dtv_property_cache;
+   u8 reg11, reg15, reg16, reg1D, reg1E, reg1F;
+   u8 N, f0 = 0, f1 = 0, f2 = 0, f3 = 0;
+   u16 pll_div_fb;
+   u32 div, ts_mclk;
+   unsigned int utmp;
+   int ret;
+
+   /* select demod main mclk */
+   ret = regmap_read(dev-regmap, 0x15, utmp);
+   if (ret)
+   goto err;
+   reg15 = utmp;
+   if (c-symbol_rate  4501) {
+   reg11 = 0x0E;
+   reg15 |= 0x02;
+   reg16 = 115; /* mclk = 110.25MHz */
+   } else {
+   reg11 = 0x0A;
+   reg15 = ~0x02;
+   reg16 = 96; /* mclk = 96MHz */
+   }
+
+   /* set ts mclk */
+   if (c-delivery_system == SYS_DVBS)
+   ts_mclk = 96000;
+   else
+   ts_mclk = 144000;
+
+   pll_div_fb = (reg15  0x01)  8;
+   pll_div_fb += reg16;
+   pll_div_fb += 32;
+
+   div = 36000 * pll_div_fb;
+   div /= ts_mclk;
+
+   if (div = 32) {
+   N = 2;
+   f0 = 0;
+   f1 = div / 2;
+   f2 = div - f1;
+   f3 = 0;
+   } else if (div = 48) {
+   N = 3;
+   f0 = div / 3;
+   f1 = (div - f0) / 2;
+   f2 = div - f0 - f1;
+   f3 = 0;
+   } else if (div = 64) {
+   N = 4;
+   f0 = div / 4;
+   f1 = (div - f0) / 3;
+   f2 = (div - f0 - f1) / 2;
+   f3 = div - f0 - f1 - f2;
+   } else {
+   N = 4;
+   f0 = 16;
+   f1 = 16;
+   f2 = 16;
+   f3 = 16;
+   }
+
+   if (f0 == 16)
+   f0 = 0;
+   if (f1 == 16)
+   f1 = 0;
+   if (f2 == 16)
+ 

Re: [PATCH] si2157: Add support for delivery system SYS_ATSC

2014-10-30 Thread Mauro Carvalho Chehab
Em Thu, 30 Oct 2014 08:04:29 +0200
Olli Salonen olli.salo...@iki.fi escreveu:

 Hi Mauro,
 
 No, for ClearQAM the delivery_system should be set to 0x10 and this
 patch does not include that. At the time of submission of that patch I
 only had the trace from the ATSC case.

Ah, ok. Are you planning to submit a patch for it, and the patches adding
support for HVR-955Q?

 
 ATSC  ClearQAM USB sniffs here:
 http://trsqr.net/olli/hvr955q/

Thanks!

Regards,
Mauro

 
 Cheers,
 -olli
 
 On 29 October 2014 11:08, Mauro Carvalho Chehab mche...@osg.samsung.com 
 wrote:
  Hi Olli,
 
  Em Sun, 17 Aug 2014 08:24:49 +0300
  Olli Salonen olli.salo...@iki.fi escreveu:
 
  Set the property for delivery system also in case of SYS_ATSC. This
  behaviour is observed in the sniffs taken with Hauppauge HVR-955Q
  Windows driver.
 
  Signed-off-by: Olli Salonen olli.salo...@iki.fi
  ---
   drivers/media/tuners/si2157.c | 3 +++
   1 file changed, 3 insertions(+)
 
  diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
  index 6c53edb..3b86d59 100644
  --- a/drivers/media/tuners/si2157.c
  +++ b/drivers/media/tuners/si2157.c
  @@ -239,6 +239,9 @@ static int si2157_set_params(struct dvb_frontend *fe)
bandwidth = 0x0f;
 
switch (c-delivery_system) {
  + case SYS_ATSC:
  + delivery_system = 0x00;
  + break;
 
  Did you check if it uses the same delivery system also for clear-QAM?
 
  If so, this patch is missing SYS_DVBC_ANNEX_B inside this case.
 
  Ah, FYI, I merged the demod used on HVR-955Q at a separate topic branch
  upstream:
  http://git.linuxtv.org/cgit.cgi/media_tree.git/log/?h=lgdt3306a
 
  Regards,
  Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] rc5-decoder: BZ#85721: Fix RC5-SZ decoding

2014-10-30 Thread Mauro Carvalho Chehab
changeset e87b540be2dd broke RC5-SZ decoding, as it forgot to add
the extra bit check for the enabled protocols at the beginning of
the logic.

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/rc/ir-rc5-decoder.c 
b/drivers/media/rc/ir-rc5-decoder.c
index 2ef763928ca4..84fa6e9b59a1 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -53,7 +53,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct 
ir_raw_event ev)
u32 scancode;
enum rc_type protocol;
 
-   if (!(dev-enabled_protocols  (RC_BIT_RC5 | RC_BIT_RC5X)))
+   if (!(dev-enabled_protocols  (RC_BIT_RC5 | RC_BIT_RC5X | 
RC_BIT_RC5_SZ)))
return 0;
 
if (!is_timing_event(ev)) {
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


AF9035 not builded from git

2014-10-30 Thread kapetr

Hello.

I have:
Bus 001 Device 004: ID 048d:9135 Integrated Technology Express, Inc. 
Zolid Mini DVB-T Stick


This is well supported DVB-T USB card - used successfully with
dvb-usb-af9035 module.

Till now.


After every kernel update I have to rebuild v4l driver.

After last time (with kernel 3.2.0-70-generic #105-Ubuntu SMP Wed Sep 24 
19:49:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux)


the build process has end successfully, but there is not builded this 
module, what I need ?-(


x

git clone --depth=1 git://linuxtv.org/media_build.git
cd media_build/
./build
sudo make install

x there are only these modules installed:

$ ll /lib/modules/3.2.0-70-generic/kernel/drivers/media/usb/dvb-usb/
celkem 1,1M
drwxr-xr-x  2 root root 4,0K říj 30 09:34 ./
drwxr-xr-x 21 root root 4,0K říj 30 09:34 ../
-rw-r--r--  1 root root  61K říj 30 09:34 dvb-usb-af9005.ko
-rw-r--r--  1 root root 7,3K říj 30 09:34 dvb-usb-af9005-remote.ko
-rw-r--r--  1 root root  31K říj 30 09:34 dvb-usb-az6027.ko
-rw-r--r--  1 root root  14K říj 30 09:34 dvb-usb-a800.ko
-rw-r--r--  1 root root  18K říj 30 09:34 dvb-usb-cinergyT2.ko
-rw-r--r--  1 root root 100K říj 30 09:34 dvb-usb-cxusb.ko
-rw-r--r--  1 root root  18K říj 30 09:34 dvb-usb-dibusb-common.ko
-rw-r--r--  1 root root  32K říj 30 09:34 dvb-usb-dibusb-mb.ko
-rw-r--r--  1 root root  14K říj 30 09:34 dvb-usb-dibusb-mc.ko
-rw-r--r--  1 root root 210K říj 30 09:34 dvb-usb-dib0700.ko
-rw-r--r--  1 root root  18K říj 30 09:34 dvb-usb-digitv.ko
-rw-r--r--  1 root root  35K říj 30 09:34 dvb-usb-dtt200u.ko
-rw-r--r--  1 root root  15K říj 30 09:34 dvb-usb-dtv5100.ko
-rw-r--r--  1 root root  82K říj 30 09:34 dvb-usb-dw2102.ko
-rw-r--r--  1 root root  25K říj 30 09:34 dvb-usb-friio.ko
-rw-r--r--  1 root root  26K říj 30 09:34 dvb-usb-gp8psk.ko
-rw-r--r--  1 root root  44K říj 30 09:34 dvb-usb.ko
-rw-r--r--  1 root root  58K říj 30 09:34 dvb-usb-m920x.ko
-rw-r--r--  1 root root  14K říj 30 09:34 dvb-usb-nova-t-usb2.ko
-rw-r--r--  1 root root  21K říj 30 09:34 dvb-usb-opera.ko
-rw-r--r--  1 root root  34K říj 30 09:34 dvb-usb-pctv452e.ko
-rw-r--r--  1 root root  23K říj 30 09:34 dvb-usb-technisat-usb2.ko
-rw-r--r--  1 root root  37K říj 30 09:34 dvb-usb-ttusb2.ko
-rw-r--r--  1 root root  14K říj 30 09:34 dvb-usb-umt-010.ko
-rw-r--r--  1 root root  26K říj 30 09:34 dvb-usb-vp702x.ko
-rw-r--r--  1 root root  21K říj 30 09:34 dvb-usb-vp7045.ko

$ ll /lib/modules/3.2.0-70-generic/kernel/drivers/media/usb/dvb-usb-v2/
celkem 324K
drwxr-xr-x  2 root root 4,0K říj 30 09:34 ./
drwxr-xr-x 21 root root 4,0K říj 30 09:34 ../
-rw-r--r--  1 root root  43K říj 30 09:34 dvb-usb-af9015.ko
-rw-r--r--  1 root root  12K říj 30 09:34 dvb-usb-au6610.ko
-rw-r--r--  1 root root  26K říj 30 09:34 dvb-usb-az6007.ko
-rw-r--r--  1 root root  13K říj 30 09:34 dvb-usb-ce6230.ko
-rw-r--r--  1 root root  15K říj 30 09:34 dvb-usb-ec168.ko
-rw-r--r--  1 root root  12K říj 30 09:34 dvb-usb-gl861.ko
-rw-r--r--  1 root root  36K říj 30 09:34 dvb-usb-lmedm04.ko
-rw-r--r--  1 root root  82K říj 30 09:34 dvb-usb-mxl111sf.ko
-rw-r--r--  1 root root  34K říj 30 09:34 dvb_usb_v2.ko
-rw-r--r--  1 root root  15K říj 30 09:34 mxl111sf-demod.ko
-rw-r--r--  1 root root  13K říj 30 09:34 mxl111sf-tuner.ko

x


Thanks for help

--kapetr
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] fix a warning on avr32 arch

2014-10-30 Thread Mauro Carvalho Chehab
on avr32 arch, those warnings happen:
drivers/media/firewire/firedtv-fw.c: In function 'node_update':
drivers/media/firewire/firedtv-fw.c:329: warning: comparison is always 
true due to limited range of data type

In this particular case, the signal is desired, as the isochannel
var can be initalized with -1 inside the driver.

So, change the type to s8, to avoid issues on archs where char
is unsigned.

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/drivers/media/firewire/firedtv.h b/drivers/media/firewire/firedtv.h
index c2ba085e0d20..346a85be6de2 100644
--- a/drivers/media/firewire/firedtv.h
+++ b/drivers/media/firewire/firedtv.h
@@ -96,7 +96,7 @@ struct firedtv {
 
enum model_type type;
charsubunit;
-   charisochannel;
+   s8  isochannel;
struct fdtv_ir_context  *ir_context;
 
fe_sec_voltage_tvoltage;
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] si2157: Add support for delivery system SYS_ATSC

2014-10-30 Thread Olli Salonen

On Thu, 30 Oct 2014, Mauro Carvalho Chehab wrote:


Ah, ok. Are you planning to submit a patch for it, and the patches adding
support for HVR-955Q?


I can submit a patch for that, no problem. However, I'm not working with 
HVR-955Q at the moment. I don't have access to ATSC/ClearQAM signal.


If someone is working with that, I can put you in contact with someone 
who is interested in that device and is able to test.


Cheers,
-olli
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] rc5-decoder: BZ#85721: Fix RC5-SZ decoding

2014-10-30 Thread David Härdeman

On 2014-10-30 10:54, Mauro Carvalho Chehab wrote:

changeset e87b540be2dd broke RC5-SZ decoding, as it forgot to add
the extra bit check for the enabled protocols at the beginning of
the logic.

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

Acked-by: David Härdeman da...@hardeman.nu



diff --git a/drivers/media/rc/ir-rc5-decoder.c
b/drivers/media/rc/ir-rc5-decoder.c
index 2ef763928ca4..84fa6e9b59a1 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -53,7 +53,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct
ir_raw_event ev)
u32 scancode;
enum rc_type protocol;

-   if (!(dev-enabled_protocols  (RC_BIT_RC5 | RC_BIT_RC5X)))
+	if (!(dev-enabled_protocols  (RC_BIT_RC5 | RC_BIT_RC5X | 
RC_BIT_RC5_SZ)))

return 0;

if (!is_timing_event(ev)) {

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] si2157: add support for SYS_DVBC_ANNEX_B

2014-10-30 Thread Olli Salonen
Set the property for delivery system also in case of SYS_DVBC_ANNEX_B. This 
behaviour is observed in the sniffs taken with Hauppauge HVR-955Q Windows 
driver.

Signed-off-by: Olli Salonen olli.salo...@iki.fi
---
 drivers/media/tuners/si2157.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index cf97142..b086b87 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -250,6 +250,9 @@ static int si2157_set_params(struct dvb_frontend *fe)
case SYS_ATSC:
delivery_system = 0x00;
break;
+   case SYS_DVBC_ANNEX_B:
+   delivery_system = 0x10;
+   break;
case SYS_DVBT:
case SYS_DVBT2: /* it seems DVB-T and DVB-T2 both are 0x20 here */
delivery_system = 0x20;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] Update Auvitek au0828 quirks

2014-10-30 Thread Mauro Carvalho Chehab
There are several Auvitek au0828 listed at sound quirks. However,
the table there is incomplete. Simplify the table using a macro
for au0828 devices and update it to reflect the devices currently
supported at the Linux Kernel by drivers/media/usb/au0828 driver.

Mauro Carvalho Chehab (2):
  [media] sound: simplify au0828 quirk table
  [media] sound: Update au0828 quirks table

 sound/usb/quirks-table.h | 166 +++
 1 file changed, 39 insertions(+), 127 deletions(-)

-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] [media] sound: Update au0828 quirks table

2014-10-30 Thread Mauro Carvalho Chehab
From: Mauro Carvalho Chehab m.che...@samsung.com

The au0828 quirks table is currently not in sync with the au0828
media driver.

Syncronize it and put them on the same order as found at au0828
driver, as all the au0828 devices with analog TV need the
same quirks.

Cc: sta...@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 5ae1d02d17a3..8a6b366f2925 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2827,14 +2827,22 @@ YAMAHA_DEVICE(0x7010, UB99),
 }
 
 AU0828_DEVICE(0x2040, 0x7200, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7240, Hauppauge, HVR-850),
 AU0828_DEVICE(0x2040, 0x7210, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x7217, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x721b, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x721e, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x721f, Hauppauge, HVR-950Q),
-AU0828_DEVICE(0x2040, 0x7240, Hauppauge, HVR-850),
 AU0828_DEVICE(0x2040, 0x7280, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x0fd9, 0x0008, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7201, Hauppauge, HVR-950Q-MXL),
+AU0828_DEVICE(0x2040, 0x7211, Hauppauge, HVR-950Q-MXL),
+AU0828_DEVICE(0x2040, 0x7281, Hauppauge, HVR-950Q-MXL),
+AU0828_DEVICE(0x05e1, 0x0480, Hauppauge, Woodbury),
+AU0828_DEVICE(0x2040, 0x8200, Hauppauge, Woodbury),
+AU0828_DEVICE(0x2040, 0x7260, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7213, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7270, Hauppauge, HVR-950Q),
 
 /* Digidesign Mbox */
 {
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] [media] sound: simplify au0828 quirk table

2014-10-30 Thread Mauro Carvalho Chehab
From: Mauro Carvalho Chehab m.che...@samsung.com

Add a macro to simplify au0828 quirk table. That makes easier
to check it against the USB IDs at drivers/media/usb/au0828-card.c

Cc: sta...@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index c657752a420c..5ae1d02d17a3 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2804,133 +2804,37 @@ YAMAHA_DEVICE(0x7010, UB99),
}
 },
 
-/* Hauppauge HVR-950Q and HVR-850 */
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7200),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
-   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
-   .vendor_name = Hauppauge,
-   .product_name = HVR-950Q,
-   .ifnum = QUIRK_ANY_INTERFACE,
-   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
-   }
-},
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7210),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
-   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
-   .vendor_name = Hauppauge,
-   .product_name = HVR-950Q,
-   .ifnum = QUIRK_ANY_INTERFACE,
-   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
-   }
-},
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7217),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
-   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
-   .vendor_name = Hauppauge,
-   .product_name = HVR-950Q,
-   .ifnum = QUIRK_ANY_INTERFACE,
-   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
-   }
-},
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x721b),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
-   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
-   .vendor_name = Hauppauge,
-   .product_name = HVR-950Q,
-   .ifnum = QUIRK_ANY_INTERFACE,
-   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
-   }
-},
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x721e),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
-   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
-   .vendor_name = Hauppauge,
-   .product_name = HVR-950Q,
-   .ifnum = QUIRK_ANY_INTERFACE,
-   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
-   }
-},
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x721f),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
-   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
-   .vendor_name = Hauppauge,
-   .product_name = HVR-950Q,
-   .ifnum = QUIRK_ANY_INTERFACE,
-   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
-   }
-},
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7240),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
-   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
-   .vendor_name = Hauppauge,
-   .product_name = HVR-850,
-   .ifnum = QUIRK_ANY_INTERFACE,
-   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
-   }
-},
-{
-   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7280),
-   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
-  USB_DEVICE_ID_MATCH_INT_CLASS |
-  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
-   .bInterfaceClass = USB_CLASS_AUDIO,
-   

Re: [PATCH] si2157: Add support for delivery system SYS_ATSC

2014-10-30 Thread Mauro Carvalho Chehab
Hi Olli,

Em Thu, 30 Oct 2014 12:32:33 +0200
Olli Salonen olli.salo...@iki.fi escreveu:

 On Thu, 30 Oct 2014, Mauro Carvalho Chehab wrote:
 
  Ah, ok. Are you planning to submit a patch for it, and the patches adding
  support for HVR-955Q?
 
 I can submit a patch for that, no problem. 

Yes, please do that.

 However, I'm not working with 
 HVR-955Q at the moment. I don't have access to ATSC/ClearQAM signal.

Ah, ok. I have it here and I have ATSC/ClearQAM here, so I can do the
patches. I was just wanting to know if someone else is doing it
already.

 If someone is working with that, I can put you in contact with someone 
 who is interested in that device and is able to test.

Regards,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [media] sound: simplify au0828 quirk table

2014-10-30 Thread Takashi Iwai
At Thu, 30 Oct 2014 08:53:04 -0200,
Mauro Carvalho Chehab wrote:
 
 From: Mauro Carvalho Chehab m.che...@samsung.com
 
 Add a macro to simplify au0828 quirk table. That makes easier
 to check it against the USB IDs at drivers/media/usb/au0828-card.c
 
 Cc: sta...@vger.kernel.org
 Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
 Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

Which sign-off should I take?  Judging from the author line, the
former one?  The second patch had only s-o-b from @samsung.com.


thanks,

Takashi

 
 diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
 index c657752a420c..5ae1d02d17a3 100644
 --- a/sound/usb/quirks-table.h
 +++ b/sound/usb/quirks-table.h
 @@ -2804,133 +2804,37 @@ YAMAHA_DEVICE(0x7010, UB99),
   }
  },
  
 -/* Hauppauge HVR-950Q and HVR-850 */
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7200),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -USB_DEVICE_ID_MATCH_INT_CLASS |
 -USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 - .bInterfaceClass = USB_CLASS_AUDIO,
 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 - .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
 - .vendor_name = Hauppauge,
 - .product_name = HVR-950Q,
 - .ifnum = QUIRK_ANY_INTERFACE,
 - .type = QUIRK_AUDIO_ALIGN_TRANSFER,
 - }
 -},
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7210),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -USB_DEVICE_ID_MATCH_INT_CLASS |
 -USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 - .bInterfaceClass = USB_CLASS_AUDIO,
 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 - .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
 - .vendor_name = Hauppauge,
 - .product_name = HVR-950Q,
 - .ifnum = QUIRK_ANY_INTERFACE,
 - .type = QUIRK_AUDIO_ALIGN_TRANSFER,
 - }
 -},
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7217),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -USB_DEVICE_ID_MATCH_INT_CLASS |
 -USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 - .bInterfaceClass = USB_CLASS_AUDIO,
 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 - .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
 - .vendor_name = Hauppauge,
 - .product_name = HVR-950Q,
 - .ifnum = QUIRK_ANY_INTERFACE,
 - .type = QUIRK_AUDIO_ALIGN_TRANSFER,
 - }
 -},
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x721b),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -USB_DEVICE_ID_MATCH_INT_CLASS |
 -USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 - .bInterfaceClass = USB_CLASS_AUDIO,
 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 - .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
 - .vendor_name = Hauppauge,
 - .product_name = HVR-950Q,
 - .ifnum = QUIRK_ANY_INTERFACE,
 - .type = QUIRK_AUDIO_ALIGN_TRANSFER,
 - }
 -},
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x721e),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -USB_DEVICE_ID_MATCH_INT_CLASS |
 -USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 - .bInterfaceClass = USB_CLASS_AUDIO,
 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 - .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
 - .vendor_name = Hauppauge,
 - .product_name = HVR-950Q,
 - .ifnum = QUIRK_ANY_INTERFACE,
 - .type = QUIRK_AUDIO_ALIGN_TRANSFER,
 - }
 -},
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x721f),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -USB_DEVICE_ID_MATCH_INT_CLASS |
 -USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 - .bInterfaceClass = USB_CLASS_AUDIO,
 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 - .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
 - .vendor_name = Hauppauge,
 - .product_name = HVR-950Q,
 - .ifnum = QUIRK_ANY_INTERFACE,
 - .type = QUIRK_AUDIO_ALIGN_TRANSFER,
 - }
 -},
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7240),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -USB_DEVICE_ID_MATCH_INT_CLASS |
 -USB_DEVICE_ID_MATCH_INT_SUBCLASS,
 - .bInterfaceClass = USB_CLASS_AUDIO,
 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
 - .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
 - .vendor_name = Hauppauge,
 - .product_name = HVR-850,
 - .ifnum = QUIRK_ANY_INTERFACE,
 - .type = QUIRK_AUDIO_ALIGN_TRANSFER,
 - }
 -},
 -{
 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7280),
 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
 -   

Re: [PATCH 1/2] [media] sound: simplify au0828 quirk table

2014-10-30 Thread Mauro Carvalho Chehab
Em Thu, 30 Oct 2014 12:09:07 +0100
Takashi Iwai ti...@suse.de escreveu:

 At Thu, 30 Oct 2014 08:53:04 -0200,
 Mauro Carvalho Chehab wrote:
  
  From: Mauro Carvalho Chehab m.che...@samsung.com
  
  Add a macro to simplify au0828 quirk table. That makes easier
  to check it against the USB IDs at drivers/media/usb/au0828-card.c
  
  Cc: sta...@vger.kernel.org
  Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
  Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com
 
 Which sign-off should I take?  Judging from the author line, the
 former one?

Gah, that's the problem with rebased patches ;) 

I started using mche...@osg.samsung.com for upstream submission
a few months ago.

Both emails are valid, but I prefer if you use this one:
Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

 The second patch had only s-o-b from @samsung.com.

Yeah, I remembered to remove the extra SOB on the second patch,
but didn't notice it on the first one.

 
 
 thanks,
 
 Takashi
 
  
  diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
  index c657752a420c..5ae1d02d17a3 100644
  --- a/sound/usb/quirks-table.h
  +++ b/sound/usb/quirks-table.h
  @@ -2804,133 +2804,37 @@ YAMAHA_DEVICE(0x7010, UB99),
  }
   },
   
  -/* Hauppauge HVR-950Q and HVR-850 */
  -{
  -   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7200),
  -   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
  -  USB_DEVICE_ID_MATCH_INT_CLASS |
  -  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
  -   .bInterfaceClass = USB_CLASS_AUDIO,
  -   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
  -   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
  -   .vendor_name = Hauppauge,
  -   .product_name = HVR-950Q,
  -   .ifnum = QUIRK_ANY_INTERFACE,
  -   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
  -   }
  -},
  -{
  -   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7210),
  -   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
  -  USB_DEVICE_ID_MATCH_INT_CLASS |
  -  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
  -   .bInterfaceClass = USB_CLASS_AUDIO,
  -   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
  -   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
  -   .vendor_name = Hauppauge,
  -   .product_name = HVR-950Q,
  -   .ifnum = QUIRK_ANY_INTERFACE,
  -   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
  -   }
  -},
  -{
  -   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7217),
  -   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
  -  USB_DEVICE_ID_MATCH_INT_CLASS |
  -  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
  -   .bInterfaceClass = USB_CLASS_AUDIO,
  -   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
  -   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
  -   .vendor_name = Hauppauge,
  -   .product_name = HVR-950Q,
  -   .ifnum = QUIRK_ANY_INTERFACE,
  -   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
  -   }
  -},
  -{
  -   USB_DEVICE_VENDOR_SPEC(0x2040, 0x721b),
  -   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
  -  USB_DEVICE_ID_MATCH_INT_CLASS |
  -  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
  -   .bInterfaceClass = USB_CLASS_AUDIO,
  -   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
  -   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
  -   .vendor_name = Hauppauge,
  -   .product_name = HVR-950Q,
  -   .ifnum = QUIRK_ANY_INTERFACE,
  -   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
  -   }
  -},
  -{
  -   USB_DEVICE_VENDOR_SPEC(0x2040, 0x721e),
  -   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
  -  USB_DEVICE_ID_MATCH_INT_CLASS |
  -  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
  -   .bInterfaceClass = USB_CLASS_AUDIO,
  -   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
  -   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
  -   .vendor_name = Hauppauge,
  -   .product_name = HVR-950Q,
  -   .ifnum = QUIRK_ANY_INTERFACE,
  -   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
  -   }
  -},
  -{
  -   USB_DEVICE_VENDOR_SPEC(0x2040, 0x721f),
  -   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
  -  USB_DEVICE_ID_MATCH_INT_CLASS |
  -  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
  -   .bInterfaceClass = USB_CLASS_AUDIO,
  -   .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
  -   .driver_info = (unsigned long) (const struct snd_usb_audio_quirk) {
  -   .vendor_name = Hauppauge,
  -   .product_name = HVR-950Q,
  -   .ifnum = QUIRK_ANY_INTERFACE,
  -   .type = QUIRK_AUDIO_ALIGN_TRANSFER,
  -   }
  -},
  -{
  -   USB_DEVICE_VENDOR_SPEC(0x2040, 0x7240),
  -   .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
  -  USB_DEVICE_ID_MATCH_INT_CLASS |
  -  USB_DEVICE_ID_MATCH_INT_SUBCLASS,
  -   .bInterfaceClass = USB_CLASS_AUDIO,
  -   .bInterfaceSubClass = 

Re: [alsa-devel] [PATCH 1/2] [media] sound: simplify au0828 quirk table

2014-10-30 Thread Clemens Ladisch
Mauro Carvalho Chehab wrote:
 Add a macro to simplify au0828 quirk table. That makes easier
 to check it against the USB IDs at drivers/media/usb/au0828-card.c

 +++ b/sound/usb/quirks-table.h
 ...
 + * This should be kept in sync with drivers/media/usb/au0828-card.c

The file does not exist in that directory.  And when you want to
keep two files in sync, you need such reminders in both of them.


Regards,
Clemens
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCH 1/2] [media] sound: simplify au0828 quirk table

2014-10-30 Thread Mauro Carvalho Chehab
Em Thu, 30 Oct 2014 12:16:13 +0100
Clemens Ladisch clem...@ladisch.de escreveu:

 Mauro Carvalho Chehab wrote:
  Add a macro to simplify au0828 quirk table. That makes easier
  to check it against the USB IDs at drivers/media/usb/au0828-card.c
 
  +++ b/sound/usb/quirks-table.h
  ...
  + * This should be kept in sync with drivers/media/usb/au0828-card.c
 
 The file does not exist in that directory.  And when you want to
 keep two files in sync, you need such reminders in both of them.

Thanks for reviewing it. 

I'm sending an updated version with those fixes.

Regards,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/2] Update Auvitek au0828 quirks

2014-10-30 Thread Mauro Carvalho Chehab
There are several Auvitek au0828 listed at sound quirks. However,
the table there is incomplete. Simplify the table using a macro
for au0828 devices and update it to reflect the devices currently

-

v2: Fix SOB, au0828 driver reference and add a warning at au0828-cards.c.

Mauro Carvalho Chehab (2):
  [media] sound: simplify au0828 quirk table
  [media] sound: Update au0828 quirks table

 drivers/media/usb/au0828/au0828-cards.c |   5 +
 sound/usb/quirks-table.h| 166 
 2 files changed, 44 insertions(+), 127 deletions(-)

-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/2] [media] sound: Update au0828 quirks table

2014-10-30 Thread Mauro Carvalho Chehab
The au0828 quirks table is currently not in sync with the au0828
media driver.

Syncronize it and put them on the same order as found at au0828
driver, as all the au0828 devices with analog TV need the
same quirks.

Cc: sta...@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 8f3e2bf100eb..83bddbdb90e9 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2827,14 +2827,22 @@ YAMAHA_DEVICE(0x7010, UB99),
 }
 
 AU0828_DEVICE(0x2040, 0x7200, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7240, Hauppauge, HVR-850),
 AU0828_DEVICE(0x2040, 0x7210, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x7217, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x721b, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x721e, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x2040, 0x721f, Hauppauge, HVR-950Q),
-AU0828_DEVICE(0x2040, 0x7240, Hauppauge, HVR-850),
 AU0828_DEVICE(0x2040, 0x7280, Hauppauge, HVR-950Q),
 AU0828_DEVICE(0x0fd9, 0x0008, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7201, Hauppauge, HVR-950Q-MXL),
+AU0828_DEVICE(0x2040, 0x7211, Hauppauge, HVR-950Q-MXL),
+AU0828_DEVICE(0x2040, 0x7281, Hauppauge, HVR-950Q-MXL),
+AU0828_DEVICE(0x05e1, 0x0480, Hauppauge, Woodbury),
+AU0828_DEVICE(0x2040, 0x8200, Hauppauge, Woodbury),
+AU0828_DEVICE(0x2040, 0x7260, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7213, Hauppauge, HVR-950Q),
+AU0828_DEVICE(0x2040, 0x7270, Hauppauge, HVR-950Q),
 
 /* Digidesign Mbox */
 {
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media, platform, LLVMLinux: Remove nested function from ti-vpe

2014-10-30 Thread Mauro Carvalho Chehab
Em Fri, 26 Sep 2014 18:11:45 -0700
Behan Webster beh...@converseincode.com escreveu:

 Replace the use of nested functions where a normal function will suffice.
 
 Nested functions are not liked by upstream kernel developers in general. Their
 use breaks the use of clang as a compiler, and doesn't make the code any
 better.
 
 This code now works for both gcc and clang.

I'm ok with this patch, as it makes the code cleaner, but in a few
cases, such functions could be useful, for example for doing things
like typecasting or when we need to use multiple versions of the same
code, one to be used internally and another to be used externally
with a different set of arguments inside the function call
(none of this applies here, it seems).

So, I think clang should be fixed anyway to support it.

Anyway, I'll be applying this patch.

Regards,
Mauro

 
 Signed-off-by: Behan Webster beh...@converseincode.com
 Suggested-by: Arnd Bergmann a...@arndb.de
 Cc: Arnd Bergmann a...@arndb.de
 ---
  drivers/media/platform/ti-vpe/csc.c | 8 ++--
  drivers/media/platform/ti-vpe/sc.c  | 8 ++--
  2 files changed, 4 insertions(+), 12 deletions(-)
 
 diff --git a/drivers/media/platform/ti-vpe/csc.c 
 b/drivers/media/platform/ti-vpe/csc.c
 index 940df40..44fbf41 100644
 --- a/drivers/media/platform/ti-vpe/csc.c
 +++ b/drivers/media/platform/ti-vpe/csc.c
 @@ -93,12 +93,8 @@ void csc_dump_regs(struct csc_data *csc)
  {
   struct device *dev = csc-pdev-dev;
  
 - u32 read_reg(struct csc_data *csc, int offset)
 - {
 - return ioread32(csc-base + offset);
 - }
 -
 -#define DUMPREG(r) dev_dbg(dev, %-35s %08x\n, #r, read_reg(csc, CSC_##r))
 +#define DUMPREG(r) dev_dbg(dev, %-35s %08x\n, #r, \
 + ioread32(csc-base + CSC_##r))
  
   DUMPREG(CSC00);
   DUMPREG(CSC01);
 diff --git a/drivers/media/platform/ti-vpe/sc.c 
 b/drivers/media/platform/ti-vpe/sc.c
 index 6314171..1088381 100644
 --- a/drivers/media/platform/ti-vpe/sc.c
 +++ b/drivers/media/platform/ti-vpe/sc.c
 @@ -24,12 +24,8 @@ void sc_dump_regs(struct sc_data *sc)
  {
   struct device *dev = sc-pdev-dev;
  
 - u32 read_reg(struct sc_data *sc, int offset)
 - {
 - return ioread32(sc-base + offset);
 - }
 -
 -#define DUMPREG(r) dev_dbg(dev, %-35s %08x\n, #r, read_reg(sc, CFG_##r))
 +#define DUMPREG(r) dev_dbg(dev, %-35s %08x\n, #r, \
 + ioread32(sc-base + CFG_##r))
  
   DUMPREG(SC0);
   DUMPREG(SC1);
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/2] [media] sound: Update au0828 quirks table

2014-10-30 Thread Devin Heitmueller
Hi Mauro,

 Syncronize it and put them on the same order as found at au0828
 driver, as all the au0828 devices with analog TV need the
 same quirks.

The MXL and Woodbury boards don't support analog under Linux, so
probably shouldn't be included in the list of quirks.

That said, the MXL and Woodbury versions of the PCBs were prototypes
that never made it into production (and since the Auvitek chips are
EOL, they never will).  I wouldn't object to a patch which removed the
board profiles entirely in the interest of removing dead code.

It was certainly nice of Mike Krufky to work to get support into the
open source driver before the product was released, but after four
years it probably makes sense to remove the entries for products that
never actually shipped.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] xc5000: tuner firmware update

2014-10-30 Thread Devin Heitmueller
 Well, perhaps you could add a printk message warning the user that
 the driver is not using the latest firmware and performance/quality
 could be badly affected.

I wouldn't use the term badly affected.  There are tens of thousands
of units out there for which users are quite happy with the current
firmware.  The firmware fixes an edge case that affected a very small
subset of users when receiving signals from a specific QAM modulator
product.  The vast majority of users would be perfectly fine using the
old firmware indefinitely.

That said, I certainly have no objection to a message stating that
there is newer firmware available than what they are currently
running.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] xc5000: add IF output level control

2014-10-30 Thread Devin Heitmueller
On Sat, Oct 25, 2014 at 4:17 PM, Michael Krufky mkru...@hotmail.com wrote:
 From: Richard Vollkommer li...@hauppauge.com

 Adds control of the IF output level to the xc5000 tuner
 configuration structure.  Increases the IF level to the
 demodulator to fix failure to lock and picture breakup
 issues (with the au8522 demodulator, in the case of the
 Hauppauge HVR950Q).

 This patch works with all XC5000 firmware versions.

 Signed-off-by: Richard Vollkommer li...@hauppauge.com
 Cc: Devin Heitmueller dheitmuel...@kernellabs.com
 Signed-off-by: Michael Ira Krufky mkru...@linuxtv.org

Reviewed-by: Devin Heitmueller dheitmuel...@kernellabs.com

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] fix a warning on avr32 arch

2014-10-30 Thread Stefan Richter
On Oct 30 Mauro Carvalho Chehab wrote:
 on avr32 arch, those warnings happen:
   drivers/media/firewire/firedtv-fw.c: In function 'node_update':
   drivers/media/firewire/firedtv-fw.c:329: warning: comparison is always 
 true due to limited range of data type
 
 In this particular case, the signal is desired, as the isochannel
 var can be initalized with -1 inside the driver.
 
 So, change the type to s8, to avoid issues on archs where char
 is unsigned.
 
 Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com

Reviewed-by: Stefan Richter stef...@s5r6.in-berlin.de

 
 diff --git a/drivers/media/firewire/firedtv.h 
 b/drivers/media/firewire/firedtv.h
 index c2ba085e0d20..346a85be6de2 100644
 --- a/drivers/media/firewire/firedtv.h
 +++ b/drivers/media/firewire/firedtv.h
 @@ -96,7 +96,7 @@ struct firedtv {
  
   enum model_type type;
   charsubunit;
 - charisochannel;
 + s8  isochannel;
   struct fdtv_ir_context  *ir_context;
  
   fe_sec_voltage_tvoltage;

-- 
Stefan Richter
-=-- =-=- -
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/2] [media] sound: Update au0828 quirks table

2014-10-30 Thread Mauro Carvalho Chehab
Hi Devin,

Em Thu, 30 Oct 2014 09:15:31 -0400
Devin Heitmueller dheitmuel...@kernellabs.com escreveu:

 Hi Mauro,
 
  Syncronize it and put them on the same order as found at au0828
  driver, as all the au0828 devices with analog TV need the
  same quirks.
 
 The MXL and Woodbury boards don't support analog under Linux, so
 probably shouldn't be included in the list of quirks.

True.
 
 That said, the MXL and Woodbury versions of the PCBs were prototypes
 that never made it into production (and since the Auvitek chips are
 EOL, they never will).  I wouldn't object to a patch which removed the
 board profiles entirely in the interest of removing dead code.
 
 It was certainly nice of Mike Krufky to work to get support into the
 open source driver before the product was released, but after four
 years it probably makes sense to remove the entries for products that
 never actually shipped.

Yeah, if nobody is using such devices, then we should get rid of them,
but I prefer to have this on a separate patch, in order to give
people the opportunity to complain.

So, if I'm understanding well, you're suggesting to add a patch
removing those 5 entries (and the corresponding quirks on alsa),
right?

{ USB_DEVICE(0x2040, 0x7201),
.driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
{ USB_DEVICE(0x2040, 0x7211),
.driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
{ USB_DEVICE(0x2040, 0x7281),
.driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
{ USB_DEVICE(0x05e1, 0x0480),
.driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
{ USB_DEVICE(0x2040, 0x8200),
.driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
{ USB_DEVICE(0x2040, 0x7260),

Regards,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l: vsp1: Remove support for platform data

2014-10-30 Thread Laurent Pinchart
Now that all platforms instantiate the VSP1 through DT, platform data
support isn't needed anymore.

Signed-off-by: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
---
 drivers/media/platform/Kconfig |  2 +-
 drivers/media/platform/vsp1/vsp1.h | 14 +-
 drivers/media/platform/vsp1/vsp1_drv.c | 81 --
 drivers/media/platform/vsp1/vsp1_wpf.c |  2 +-
 include/linux/platform_data/vsp1.h | 27 
 5 files changed, 43 insertions(+), 83 deletions(-)
 delete mode 100644 include/linux/platform_data/vsp1.h

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 0c61155699f7..0c301d8ded7f 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -231,7 +231,7 @@ config VIDEO_SH_VEU
 config VIDEO_RENESAS_VSP1
tristate Renesas VSP1 Video Processing Engine
depends on VIDEO_V4L2  VIDEO_V4L2_SUBDEV_API  HAS_DMA
-   depends on ARCH_SHMOBILE || COMPILE_TEST
+   depends on (ARCH_SHMOBILE  OF) || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG
---help---
  This is a V4L2 driver for the Renesas VSP1 video processing engine.
diff --git a/drivers/media/platform/vsp1/vsp1.h 
b/drivers/media/platform/vsp1/vsp1.h
index 12467191dff4..989e96f7e360 100644
--- a/drivers/media/platform/vsp1/vsp1.h
+++ b/drivers/media/platform/vsp1/vsp1.h
@@ -16,7 +16,6 @@
 #include linux/io.h
 #include linux/list.h
 #include linux/mutex.h
-#include linux/platform_data/vsp1.h
 
 #include media/media-device.h
 #include media/v4l2-device.h
@@ -40,9 +39,20 @@ struct vsp1_uds;
 #define VSP1_MAX_UDS   3
 #define VSP1_MAX_WPF   4
 
+#define VSP1_HAS_LIF   (1  0)
+#define VSP1_HAS_LUT   (1  1)
+#define VSP1_HAS_SRU   (1  2)
+
+struct vsp1_platform_data {
+   unsigned int features;
+   unsigned int rpf_count;
+   unsigned int uds_count;
+   unsigned int wpf_count;
+};
+
 struct vsp1_device {
struct device *dev;
-   struct vsp1_platform_data *pdata;
+   struct vsp1_platform_data pdata;
 
void __iomem *mmio;
struct clk *clock;
diff --git a/drivers/media/platform/vsp1/vsp1_drv.c 
b/drivers/media/platform/vsp1/vsp1_drv.c
index 3e6601b5b4de..d1911f8f1d55 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -40,7 +40,7 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
irqreturn_t ret = IRQ_NONE;
unsigned int i;
 
-   for (i = 0; i  vsp1-pdata-wpf_count; ++i) {
+   for (i = 0; i  vsp1-pdata.wpf_count; ++i) {
struct vsp1_rwpf *wpf = vsp1-wpf[i];
struct vsp1_pipeline *pipe;
u32 status;
@@ -181,7 +181,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
 
list_add_tail(vsp1-hst-entity.list_dev, vsp1-entities);
 
-   if (vsp1-pdata-features  VSP1_HAS_LIF) {
+   if (vsp1-pdata.features  VSP1_HAS_LIF) {
vsp1-lif = vsp1_lif_create(vsp1);
if (IS_ERR(vsp1-lif)) {
ret = PTR_ERR(vsp1-lif);
@@ -191,7 +191,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
list_add_tail(vsp1-lif-entity.list_dev, vsp1-entities);
}
 
-   if (vsp1-pdata-features  VSP1_HAS_LUT) {
+   if (vsp1-pdata.features  VSP1_HAS_LUT) {
vsp1-lut = vsp1_lut_create(vsp1);
if (IS_ERR(vsp1-lut)) {
ret = PTR_ERR(vsp1-lut);
@@ -201,7 +201,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
list_add_tail(vsp1-lut-entity.list_dev, vsp1-entities);
}
 
-   for (i = 0; i  vsp1-pdata-rpf_count; ++i) {
+   for (i = 0; i  vsp1-pdata.rpf_count; ++i) {
struct vsp1_rwpf *rpf;
 
rpf = vsp1_rpf_create(vsp1, i);
@@ -214,7 +214,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
list_add_tail(rpf-entity.list_dev, vsp1-entities);
}
 
-   if (vsp1-pdata-features  VSP1_HAS_SRU) {
+   if (vsp1-pdata.features  VSP1_HAS_SRU) {
vsp1-sru = vsp1_sru_create(vsp1);
if (IS_ERR(vsp1-sru)) {
ret = PTR_ERR(vsp1-sru);
@@ -224,7 +224,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
list_add_tail(vsp1-sru-entity.list_dev, vsp1-entities);
}
 
-   for (i = 0; i  vsp1-pdata-uds_count; ++i) {
+   for (i = 0; i  vsp1-pdata.uds_count; ++i) {
struct vsp1_uds *uds;
 
uds = vsp1_uds_create(vsp1, i);
@@ -237,7 +237,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
list_add_tail(uds-entity.list_dev, vsp1-entities);
}
 
-   for (i = 0; i  vsp1-pdata-wpf_count; ++i) {
+   for (i = 0; i  vsp1-pdata.wpf_count; ++i) {
struct vsp1_rwpf *wpf;
 
wpf = vsp1_wpf_create(vsp1, i);
@@ -261,7 +261,7 

Re: [PATCH v2 2/2] [media] sound: Update au0828 quirks table

2014-10-30 Thread Devin Heitmueller
On Thu, Oct 30, 2014 at 9:37 AM, Mauro Carvalho Chehab
mche...@osg.samsung.com wrote:
 Yeah, if nobody is using such devices, then we should get rid of them,
 but I prefer to have this on a separate patch, in order to give
 people the opportunity to complain.

Yes, I would definitely suggest a separate patch.  There's no reason
it should be mixed in with your general cleanup of the ALSA quirks.

 So, if I'm understanding well, you're suggesting to add a patch
 removing those 5 entries (and the corresponding quirks on alsa),
 right?

 { USB_DEVICE(0x2040, 0x7201),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x2040, 0x7211),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x2040, 0x7281),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x05e1, 0x0480),
 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
 { USB_DEVICE(0x2040, 0x8200),
 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
 { USB_DEVICE(0x2040, 0x7260),

Exactly.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] cx23885-dvb: Fix some issues at the DVB error handling

2014-10-30 Thread Mauro Carvalho Chehab
As pointed by smatch:
drivers/media/pci/cx23885/cx23885-dvb.c:1066 dvb_register() error: we 
previously assumed 'fe0-dvb.frontend' could be null (see line 1060)
drivers/media/pci/cx23885/cx23885-dvb.c:1990 cx23885_dvb_register() 
error: we previously assumed 'fe0' could be null (see line 1975)

What happens is that the error handling logic when a frontend
register fails sometimes keep doing the work, as if it didn't
fail.

This could potentially cause an OOPS. So, simplify the logic
a little bit and return an error if frontend fails before
trying to setup VB2 queue.

Signed-off-by: Mauro Carvalho Chehab mche...@osg.samsung.com
---
 drivers/media/pci/cx23885/cx23885-dvb.c | 290 
 1 file changed, 145 insertions(+), 145 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index 757854914781..043d9c91fbbd 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -1045,11 +1045,11 @@ static int dvb_register(struct cx23885_tsport *port)
fe0-dvb.frontend = dvb_attach(s5h1409_attach,
hauppauge_generic_config,
i2c_bus-i2c_adap);
-   if (fe0-dvb.frontend != NULL) {
-   dvb_attach(mt2131_attach, fe0-dvb.frontend,
-  i2c_bus-i2c_adap,
-  hauppauge_generic_tunerconfig, 0);
-   }
+   if (fe0-dvb.frontend == NULL)
+   break;
+   dvb_attach(mt2131_attach, fe0-dvb.frontend,
+  i2c_bus-i2c_adap,
+  hauppauge_generic_tunerconfig, 0);
break;
case CX23885_BOARD_HAUPPAUGE_HVR1270:
case CX23885_BOARD_HAUPPAUGE_HVR1275:
@@ -1057,11 +1057,11 @@ static int dvb_register(struct cx23885_tsport *port)
fe0-dvb.frontend = dvb_attach(lgdt3305_attach,
   hauppauge_lgdt3305_config,
   i2c_bus-i2c_adap);
-   if (fe0-dvb.frontend != NULL) {
-   dvb_attach(tda18271_attach, fe0-dvb.frontend,
-  0x60, dev-i2c_bus[1].i2c_adap,
-  hauppauge_hvr127x_config);
-   }
+   if (fe0-dvb.frontend == NULL)
+   break;
+   dvb_attach(tda18271_attach, fe0-dvb.frontend,
+  0x60, dev-i2c_bus[1].i2c_adap,
+  hauppauge_hvr127x_config);
if (dev-board == CX23885_BOARD_HAUPPAUGE_HVR1275)
cx23885_set_frontend_hook(port, fe0-dvb.frontend);
break;
@@ -1071,11 +1071,12 @@ static int dvb_register(struct cx23885_tsport *port)
fe0-dvb.frontend = dvb_attach(s5h1411_attach,
   hcw_s5h1411_config,
   i2c_bus-i2c_adap);
-   if (fe0-dvb.frontend != NULL) {
-   dvb_attach(tda18271_attach, fe0-dvb.frontend,
-  0x60, dev-i2c_bus[1].i2c_adap,
-  hauppauge_tda18271_config);
-   }
+   if (fe0-dvb.frontend == NULL)
+   break;
+
+   dvb_attach(tda18271_attach, fe0-dvb.frontend,
+  0x60, dev-i2c_bus[1].i2c_adap,
+  hauppauge_tda18271_config);
 
tda18271_attach(dev-ts1.analog_fe,
0x60, dev-i2c_bus[1].i2c_adap,
@@ -1090,14 +1091,15 @@ static int dvb_register(struct cx23885_tsport *port)
dvb_attach(s5h1409_attach,
   hauppauge_ezqam_config,
   i2c_bus-i2c_adap);
-   if (fe0-dvb.frontend != NULL) {
-   dvb_attach(tda829x_attach, fe0-dvb.frontend,
-  dev-i2c_bus[1].i2c_adap, 0x42,
-  tda829x_no_probe);
-   dvb_attach(tda18271_attach, fe0-dvb.frontend,
-  0x60, dev-i2c_bus[1].i2c_adap,
-  hauppauge_tda18271_config);
-   }
+   if (fe0-dvb.frontend == NULL)
+   break;
+
+   dvb_attach(tda829x_attach, fe0-dvb.frontend,
+  dev-i2c_bus[1].i2c_adap, 0x42,
+  tda829x_no_probe);
+   dvb_attach(tda18271_attach, fe0-dvb.frontend,
+  0x60, dev-i2c_bus[1].i2c_adap,
+

Re: [PATCH] si2157: add support for SYS_DVBC_ANNEX_B

2014-10-30 Thread Antti Palosaari

Acked-by: Antti Palosaari cr...@iki.fi
Reviewed-by: Antti Palosaari cr...@iki.fi

Antti

On 10/30/2014 12:43 PM, Olli Salonen wrote:

Set the property for delivery system also in case of SYS_DVBC_ANNEX_B. This 
behaviour is observed in the sniffs taken with Hauppauge HVR-955Q Windows 
driver.

Signed-off-by: Olli Salonen olli.salo...@iki.fi
---
  drivers/media/tuners/si2157.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index cf97142..b086b87 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -250,6 +250,9 @@ static int si2157_set_params(struct dvb_frontend *fe)
case SYS_ATSC:
delivery_system = 0x00;
break;
+   case SYS_DVBC_ANNEX_B:
+   delivery_system = 0x10;
+   break;
case SYS_DVBT:
case SYS_DVBT2: /* it seems DVB-T and DVB-T2 both are 0x20 here */
delivery_system = 0x20;



--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103for supporting the demod of M88RS6000

2014-10-30 Thread Antti Palosaari



On 10/30/2014 06:38 AM, Nibble Max wrote:


-   if (tab_len  83) {
+   if (tab_len  86) {


That is not nice, but I could try find better solution and fix it later.


What is the reason to check this parameter?
How about remove this check?


It is just to check you will not overwrite buffer accidentally. Buffer 
is 83 bytes long, which should be also increased...
The correct solution is somehow calculate max possible tab size on 
compile time. It should be possible as init tabs are static const 
tables. Use some macro to calculate max value and use it - not plain 
numbers.


Something like that
#define BUF_SIZE   MAX(m88ds3103_tab_dvbs, m88ds3103_tab_dvbs2, 
m88rs6000_tab_dvbs, m88rs6000_tab_dvbs2)




Clock selection. What this does:
* select mclk_khz
* select target_mclk
* calls set_config() in order to pass target_mclk to tuner driver
* + some strange looking sleep, which is not likely needed


The clock of M88RS6000's demod comes from tuner dies.
So the first thing is turning on the demod main clock from tuner die after the 
demod reset.
Without this clock, the following register's content will fail to update.
Before changing the demod main clock, it should close clock path.
After changing the demod main clock, it open clock path and wait the clock to 
stable.



One thing what I don't like this is that you have implemented M88RS6000
things here and M88DS3103 elsewhere. Generally speaking, code must have
some logic where same things are done in same place. So I expect to see
both M88DS3103 and M88RS6000 target_mclk and mclk_khz selection
implemented here or these moved to place where M88DS3103 implementation is.



I will move M88DS3103 implementation to here.


Also, even set_config() is somehow logically correctly used here, I
prefer to duplicate that 4 line long target_mclk selection to tuner
driver and get rid of whole set_config(). Even better solution could be
to register M88RS6000 as a clock provider using clock framework, but
imho it is not worth  that simple case.


Do you suggest to set demod main clock and ts clock in tuner's set_params call 
back?


Yes, and you did it already on that latest patch, thanks. It is not 
logically correct, but a bit hackish solution, but I think it is best in 
that special case in order to keep things simple here.




One thing with that new patch I would like to check is this 10us delay 
after clock path is enabled. You enable clock just before mcu is stopped 
and demod is configured during mcu is on freeze. 10us is almost nothing 
and it sounds like having no need in a situation you stop even mcu. It 
is about one I2C command which will took longer than 10us. Hard to see 
why you need wait 10us to settle clock in such case. What happens if you 
don't wait? I assume nothing, it works just as it should as stable 
clocks are needed a long after that, when mcu is take out of reset.


regards
Antti

--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Milky LED BULBS Ceramic ceiling lamps LED FLOOD LIGHTS

2014-10-30 Thread LED Light
Dear Purchasing Manage, 

Good morning., How are you?

As knowing that you are in the LED lighting market . Now I am writing to 
establish business relationship with you . The following RGB flood light, 
sensor flood lighting has been shipped to Germany , Switzerland, Romania , 
Russian , France , Canada, UK . And I would like to ask you to try in your 
target market also :
 

10W flood light / RGB / CW or WW 12.5$usd each pcs.

20W flood light / RGB / CW or WW 16.4$usd each pcs

30W flood light / RGB / CW or WW 25$usd each pcs

50W flood light / RGB / CW or WW 33$usd each pcs

Pls feel free to contact with me if you would like to know more ! Thanks ! 

Sincerely
JRS Technology Co.,Ltd
Shadow

Email:  sha...@jrs-tech.net
Skype:  techjrsb
MSN:techj...@msn.cn
Websit: www.jrs-LED.net


we would be grateful if you will be our led lamps catalogue reserved for your 
supervisor.

Re: [PATCH V3 10/13] cx231xx: change usage of I2C_1 to the real i2c port

2014-10-30 Thread Mauro Carvalho Chehab
Em Thu,  2 Oct 2014 07:21:02 +0200
Matthias Schwarzott z...@gentoo.org escreveu:

 change almost all instances of I2C_1 to I2C_1_MUX_3

So far, this is likely the most dangerous patch on this series ;)

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

I think Pixelview SBTVD Hybrid also doesn't use MUX_3 for tuner. Thankfully,
I have such tuner. So, I'll test and fix it if needed.

 
 Signed-off-by: Matthias Schwarzott z...@gentoo.org
 Reviewed-by: Antti Palosaari cr...@iki.fi
 ---
  drivers/media/usb/cx231xx/cx231xx-cards.c | 30 +++---
  1 file changed, 15 insertions(+), 15 deletions(-)
 
 diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
 b/drivers/media/usb/cx231xx/cx231xx-cards.c
 index f5fb93a..4eb2057 100644
 --- a/drivers/media/usb/cx231xx/cx231xx-cards.c
 +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
 @@ -104,7 +104,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .ctl_pin_status_mask = 0xFFC4,
   .agc_analog_digital_select_gpio = 0x0c,
   .gpio_pin_status_mask = 0x4001000,
 - .tuner_i2c_master = I2C_1,
 + .tuner_i2c_master = I2C_1_MUX_3,
   .demod_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x02,
 @@ -144,7 +144,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .ctl_pin_status_mask = 0xFFC4,
   .agc_analog_digital_select_gpio = 0x0c,
   .gpio_pin_status_mask = 0x4001000,
 - .tuner_i2c_master = I2C_1,
 + .tuner_i2c_master = I2C_1_MUX_3,
   .demod_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x32,
 @@ -184,7 +184,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .ctl_pin_status_mask = 0xFFC4,
   .agc_analog_digital_select_gpio = 0x1c,
   .gpio_pin_status_mask = 0x4001000,
 - .tuner_i2c_master = I2C_1,
 + .tuner_i2c_master = I2C_1_MUX_3,
   .demod_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x02,
 @@ -225,7 +225,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .ctl_pin_status_mask = 0xFFC4,
   .agc_analog_digital_select_gpio = 0x1c,
   .gpio_pin_status_mask = 0x4001000,
 - .tuner_i2c_master = I2C_1,
 + .tuner_i2c_master = I2C_1_MUX_3,
   .demod_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x02,
 @@ -297,7 +297,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .ctl_pin_status_mask = 0xFFC4,
   .agc_analog_digital_select_gpio = 0x0c,
   .gpio_pin_status_mask = 0x4001000,
 - .tuner_i2c_master = I2C_1,
 + .tuner_i2c_master = I2C_1_MUX_3,
   .demod_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x02,
 @@ -325,7 +325,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .ctl_pin_status_mask = 0xFFC4,
   .agc_analog_digital_select_gpio = 0x0c,
   .gpio_pin_status_mask = 0x4001000,
 - .tuner_i2c_master = I2C_1,
 + .tuner_i2c_master = I2C_1_MUX_3,
   .demod_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x32,
 @@ -353,7 +353,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .ctl_pin_status_mask = 0xFFC4,
   .agc_analog_digital_select_gpio = 0x0c,
   .gpio_pin_status_mask = 0x4001000,
 - .tuner_i2c_master = I2C_1,
 + .tuner_i2c_master = I2C_1_MUX_1,
   .demod_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x0e,
 @@ -419,7 +419,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .tuner_sda_gpio = -1,
   .gpio_pin_status_mask = 0x4001000,
   .tuner_i2c_master = I2C_2,
 - .demod_i2c_master = I2C_1,
 + .demod_i2c_master = I2C_1_MUX_3,
   .ir_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x10,
 @@ -457,7 +457,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .tuner_sda_gpio = -1,
   .gpio_pin_status_mask = 0x4001000,
   .tuner_i2c_master = I2C_2,
 - .demod_i2c_master = I2C_1,
 + .demod_i2c_master = I2C_1_MUX_3,
   .ir_i2c_master = I2C_2,
   .has_dvb = 1,
   .demod_addr = 0x10,
 @@ -495,7 +495,7 @@ struct cx231xx_board cx231xx_boards[] = {
   .tuner_sda_gpio = -1,
   .gpio_pin_status_mask = 0x4001000,
   .tuner_i2c_master = I2C_2,
 - .demod_i2c_master = I2C_1,
 + .demod_i2c_master = I2C_1_MUX_3,
   .ir_i2c_master = I2C_2,
  

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

2014-10-30 Thread Olli Salonen

Reviewed-by: Olli Salonen olli.salo...@iki.fi

On Thu, 23 Oct 2014, Nibble Max wrote:


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

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

Signed-off-by: Nibble Max nibble@gmail.com
---
drivers/media/pci/cx23885/cx23885-cards.c | 11 +
drivers/media/pci/cx23885/cx23885-dvb.c   | 79 ++-
drivers/media/pci/cx23885/cx23885.h   |  1 +
3 files changed, 80 insertions(+), 11 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-cards.c 
b/drivers/media/pci/cx23885/cx23885-cards.c
index c4a69e4..ac34c27 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -684,6 +684,10 @@ struct cx23885_board cx23885_boards[] = {
.name   = DVBSky T980C,
.portb  = CX23885_MPEG_DVB,
},
+   [CX23885_BOARD_DVBSKY_S950C] = {
+   .name   = DVBSky S950C,
+   .portb  = CX23885_MPEG_DVB,
+   },
};
const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);

@@ -947,6 +951,10 @@ struct cx23885_subid cx23885_subids[] = {
.subvendor = 0x4254,
.subdevice = 0x980c,
.card  = CX23885_BOARD_DVBSKY_T980C,
+   }, {
+   .subvendor = 0x4254,
+   .subdevice = 0x950c,
+   .card  = CX23885_BOARD_DVBSKY_S950C,
},
};
const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -1550,6 +1558,7 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
cx23885_gpio_set(dev, GPIO_2 | GPIO_11);
break;
case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
/*
 * GPIO-0 INTA from CiMax, input
 * GPIO-1 reset CiMax, output, high active
@@ -1859,6 +1868,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_DVBWORLD_2005:
case CX23885_BOARD_PROF_8000:
case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
ts1-gen_ctrl_val  = 0x5; /* Parallel */
ts1-ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts1-src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
@@ -1978,6 +1988,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_TBS_6981:
case CX23885_BOARD_DVBSKY_T9580:
case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
dev-sd_cx25840 = v4l2_i2c_new_subdev(dev-v4l2_dev,
dev-i2c_bus[2].i2c_adap,
cx25840, 0x88  1, NULL);
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index efa05ee..f86b7c79 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -635,7 +635,7 @@ static int cx23885_sp2_ci_ctrl(void *priv, u8 read, int 
addr,
struct cx23885_tsport *port = priv;
struct cx23885_dev *dev = port-dev;
int ret;
-   int tmp;
+   int tmp = 0;
unsigned long timeout;

mutex_lock(dev-gpio_lock);
@@ -865,6 +865,19 @@ static const struct m88ds3103_config 
dvbsky_t9580_m88ds3103_config = {
.agc = 0x99,
};

+static const struct m88ds3103_config dvbsky_s950c_m88ds3103_config = {
+   .i2c_addr = 0x68,
+   .clock = 2700,
+   .i2c_wr_max = 33,
+   .clock_out = 0,
+   .ts_mode = M88DS3103_TS_CI,
+   .ts_clk = 1,
+   .ts_clk_pol = 1,
+   .lnb_en_pol = 1,
+   .lnb_hv_pol = 0,
+   .agc = 0x99,
+};
+
static int netup_altera_fpga_rw(void *device, int flag, int data, int read)
{
struct cx23885_dev *dev = (struct cx23885_dev *)device;
@@ -1020,7 +1033,7 @@ static int dvb_register(struct cx23885_tsport *port)
struct m88ts2022_config m88ts2022_config;
struct i2c_board_info info;
struct i2c_adapter *adapter;
-   struct i2c_client *client_demod, *client_tuner, *client_ci;
+   struct i2c_client *client_demod = NULL, *client_tuner = NULL, 
*client_ci = NULL;
int mfe_shared = 0; /* bus not shared by default */
int ret;

@@ -1796,6 +1809,41 @@ static int dvb_register(struct cx23885_tsport *port)
}
port-i2c_client_tuner = client_tuner;
break;
+   case CX23885_BOARD_DVBSKY_S950C:
+   i2c_bus = dev-i2c_bus[1];
+   i2c_bus2 = dev-i2c_bus[0];
+
+   /* attach frontend */
+   fe0-dvb.frontend = dvb_attach(m88ds3103_attach,
+   

Re: [PATCH 2/2] cx23885: add DVBSky S950C and T980C RC support

2014-10-30 Thread Olli Salonen

Reviewed-by: Olli Salonen olli.salo...@iki.fi

On Thu, 23 Oct 2014, Nibble Max wrote:


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

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

Signed-off-by: Nibble Max nibble@gmail.com
---
drivers/media/pci/cx23885/cx23885-cards.c | 6 ++
drivers/media/pci/cx23885/cx23885-input.c | 6 ++
2 files changed, 12 insertions(+)

diff --git a/drivers/media/pci/cx23885/cx23885-cards.c 
b/drivers/media/pci/cx23885/cx23885-cards.c
index ac34c27..d9ba48c 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -1669,6 +1669,8 @@ int cx23885_ir_init(struct cx23885_dev *dev)
case CX23885_BOARD_TBS_6980:
case CX23885_BOARD_TBS_6981:
case CX23885_BOARD_DVBSKY_T9580:
+   case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
if (!enable_885_ir)
break;
dev-sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE);
@@ -1716,6 +1718,8 @@ void cx23885_ir_fini(struct cx23885_dev *dev)
case CX23885_BOARD_TBS_6980:
case CX23885_BOARD_TBS_6981:
case CX23885_BOARD_DVBSKY_T9580:
+   case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
cx23885_irq_remove(dev, PCI_MSK_AV_CORE);
/* sd_ir is a duplicate pointer to the AV Core, just clear it */
dev-sd_ir = NULL;
@@ -1764,6 +1768,8 @@ void cx23885_ir_pci_int_enable(struct cx23885_dev *dev)
case CX23885_BOARD_TBS_6980:
case CX23885_BOARD_TBS_6981:
case CX23885_BOARD_DVBSKY_T9580:
+   case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
if (dev-sd_ir)
cx23885_irq_add_enable(dev, PCI_MSK_AV_CORE);
break;
diff --git a/drivers/media/pci/cx23885/cx23885-input.c 
b/drivers/media/pci/cx23885/cx23885-input.c
index f81c2f9..0bf6839 100644
--- a/drivers/media/pci/cx23885/cx23885-input.c
+++ b/drivers/media/pci/cx23885/cx23885-input.c
@@ -88,6 +88,8 @@ void cx23885_input_rx_work_handler(struct cx23885_dev *dev, 
u32 events)
case CX23885_BOARD_TBS_6980:
case CX23885_BOARD_TBS_6981:
case CX23885_BOARD_DVBSKY_T9580:
+   case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
/*
 * The only boards we handle right now.  However other boards
 * using the CX2388x integrated IR controller should be similar
@@ -141,6 +143,8 @@ static int cx23885_input_ir_start(struct cx23885_dev *dev)
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_MYGICA_X8507:
case CX23885_BOARD_DVBSKY_T9580:
+   case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
/*
 * The IR controller on this board only returns pulse widths.
 * Any other mode setting will fail to set up the device.
@@ -308,6 +312,8 @@ int cx23885_input_init(struct cx23885_dev *dev)
rc_map = RC_MAP_TBS_NEC;
break;
case CX23885_BOARD_DVBSKY_T9580:
+   case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_DVBSKY_S950C:
/* Integrated CX23885 IR controller */
driver_type = RC_DRIVER_IR_RAW;
allowed_protos = RC_BIT_ALL;

--
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/2] [media] sound: Update au0828 quirks table

2014-10-30 Thread Michael Ira Krufky
On Thu, Oct 30, 2014 at 9:37 AM, Mauro Carvalho Chehab
mche...@osg.samsung.com wrote:
 Hi Devin,

 Em Thu, 30 Oct 2014 09:15:31 -0400
 Devin Heitmueller dheitmuel...@kernellabs.com escreveu:

 Hi Mauro,

  Syncronize it and put them on the same order as found at au0828
  driver, as all the au0828 devices with analog TV need the
  same quirks.

 The MXL and Woodbury boards don't support analog under Linux, so
 probably shouldn't be included in the list of quirks.

 True.

 That said, the MXL and Woodbury versions of the PCBs were prototypes
 that never made it into production (and since the Auvitek chips are
 EOL, they never will).  I wouldn't object to a patch which removed the
 board profiles entirely in the interest of removing dead code.

 It was certainly nice of Mike Krufky to work to get support into the
 open source driver before the product was released, but after four
 years it probably makes sense to remove the entries for products that
 never actually shipped.

 Yeah, if nobody is using such devices, then we should get rid of them,
 but I prefer to have this on a separate patch, in order to give
 people the opportunity to complain.

 So, if I'm understanding well, you're suggesting to add a patch
 removing those 5 entries (and the corresponding quirks on alsa),
 right?

 { USB_DEVICE(0x2040, 0x7201),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x2040, 0x7211),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x2040, 0x7281),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x05e1, 0x0480),
 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
 { USB_DEVICE(0x2040, 0x8200),
 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
 { USB_DEVICE(0x2040, 0x7260),

 Regards,
 Mauro
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


Let's *not* remove DTV support for WOODBURY board -- it is not the
business of the public whether or not the board shipped in
mass-production.  The board profile is in fact being used for some
reference designs, and I still use my woodbury prototype to test the
MXL tuner.

I am not the only person using this profile -- no not remove it, please.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/2] [media] sound: Update au0828 quirks table

2014-10-30 Thread Michael Ira Krufky
On Thu, Oct 30, 2014 at 3:52 PM, Michael Ira Krufky mkru...@linuxtv.org wrote:
 On Thu, Oct 30, 2014 at 9:37 AM, Mauro Carvalho Chehab
 mche...@osg.samsung.com wrote:
 Hi Devin,

 Em Thu, 30 Oct 2014 09:15:31 -0400
 Devin Heitmueller dheitmuel...@kernellabs.com escreveu:

 Hi Mauro,

  Syncronize it and put them on the same order as found at au0828
  driver, as all the au0828 devices with analog TV need the
  same quirks.

 The MXL and Woodbury boards don't support analog under Linux, so
 probably shouldn't be included in the list of quirks.

 True.

 That said, the MXL and Woodbury versions of the PCBs were prototypes
 that never made it into production (and since the Auvitek chips are
 EOL, they never will).  I wouldn't object to a patch which removed the
 board profiles entirely in the interest of removing dead code.

 It was certainly nice of Mike Krufky to work to get support into the
 open source driver before the product was released, but after four
 years it probably makes sense to remove the entries for products that
 never actually shipped.

 Yeah, if nobody is using such devices, then we should get rid of them,
 but I prefer to have this on a separate patch, in order to give
 people the opportunity to complain.

 So, if I'm understanding well, you're suggesting to add a patch
 removing those 5 entries (and the corresponding quirks on alsa),
 right?

 { USB_DEVICE(0x2040, 0x7201),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x2040, 0x7211),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x2040, 0x7281),
 .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL },
 { USB_DEVICE(0x05e1, 0x0480),
 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
 { USB_DEVICE(0x2040, 0x8200),
 .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY },
 { USB_DEVICE(0x2040, 0x7260),

 Regards,
 Mauro
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


 Let's *not* remove DTV support for WOODBURY board -- it is not the
 business of the public whether or not the board shipped in
 mass-production.  The board profile is in fact being used for some
 reference designs, and I still use my woodbury prototype to test the
 MXL tuner.

 I am not the only person using this profile -- no not remove it, please.

correction:  I still use both the woodbury prototype (to test the
reference design) *and* the MXL version for testing the mxl tuner.

There is no reason to remove these profiles, the USB IDs will not be recycled
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 00/14] cx231xx: Use muxed i2c adapters instead of custom switching

2014-10-30 Thread Matthias Schwarzott
Hi!

This time the series got only small updates from Antti's review.

Additionally I added a patch to no longer directly modify
the content of the port3 switch bit in PWR_CTL_EN (from function 
cx231xx_set_power_mode).

Now there are two places where I wonder what happens:
1. cx231xx_set_Colibri_For_LowIF writes a fixed number into all 8bit parts of 
PWR_CTL_EN
   What is this for?
2. I guess, cx231xx_demod_reset should reset the digital demod. For this it 
should toggle the bits 0 and 1 of PWR_CTL_EN. 
   But instead it touches but 8 and 9.
   Does someone know what this is?

3. Is remembering the last status of the port3 bit working good enough?
   Currently it is only used for the is_tuner hack function.

Regards
Matthias

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 02/14] cx231xx: use own i2c_client for eeprom access

2014-10-30 Thread Matthias Schwarzott
This is a preparation for deleting the otherwise useless i2c_clients
that are allocated for all the i2c master adapters.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-cards.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 791f00c..092fb85 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -980,23 +980,20 @@ static void cx231xx_config_tuner(struct cx231xx *dev)
 
 }
 
-static int read_eeprom(struct cx231xx *dev, u8 *eedata, int len)
+static int read_eeprom(struct cx231xx *dev, struct i2c_client *client,
+  u8 *eedata, int len)
 {
int ret = 0;
-   u8 addr = 0xa0  1;
u8 start_offset = 0;
int len_todo = len;
u8 *eedata_cur = eedata;
int i;
-   struct i2c_msg msg_write = { .addr = addr, .flags = 0,
+   struct i2c_msg msg_write = { .addr = client-addr, .flags = 0,
.buf = start_offset, .len = 1 };
-   struct i2c_msg msg_read = { .addr = addr, .flags = I2C_M_RD };
-
-   /* mutex_lock(dev-i2c_lock); */
-   cx231xx_enable_i2c_port_3(dev, false);
+   struct i2c_msg msg_read = { .addr = client-addr, .flags = I2C_M_RD };
 
/* start reading at offset 0 */
-   ret = i2c_transfer(dev-i2c_bus[1].i2c_adap, msg_write, 1);
+   ret = i2c_transfer(client-adapter, msg_write, 1);
if (ret  0) {
cx231xx_err(Can't read eeprom\n);
return ret;
@@ -1006,7 +1003,7 @@ static int read_eeprom(struct cx231xx *dev, u8 *eedata, 
int len)
msg_read.len = (len_todo  64) ? 64 : len_todo;
msg_read.buf = eedata_cur;
 
-   ret = i2c_transfer(dev-i2c_bus[1].i2c_adap, msg_read, 1);
+   ret = i2c_transfer(client-adapter, msg_read, 1);
if (ret  0) {
cx231xx_err(Can't read eeprom\n);
return ret;
@@ -1062,9 +1059,14 @@ void cx231xx_card_setup(struct cx231xx *dev)
{
struct tveeprom tvee;
static u8 eeprom[256];
+   struct i2c_client client;
+
+   memset(client, 0, sizeof(client));
+   client.adapter = dev-i2c_bus[1].i2c_adap;
+   client.addr = 0xa0  1;
 
-   read_eeprom(dev, eeprom, sizeof(eeprom));
-   tveeprom_hauppauge_analog(dev-i2c_bus[1].i2c_client,
+   read_eeprom(dev, client, eeprom, sizeof(eeprom));
+   tveeprom_hauppauge_analog(client,
tvee, eeprom + 0xc0);
break;
}
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 03/14] cx231xx: delete i2c_client per bus

2014-10-30 Thread Matthias Schwarzott
For each i2c master there is a i2c_client allocated that could be
deleted now that its only two users have been changed to use their
own i2c_client.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-i2c.c | 7 ---
 drivers/media/usb/cx231xx/cx231xx.h | 1 -
 2 files changed, 8 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 67a1391..a30d400 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -455,10 +455,6 @@ static struct i2c_adapter cx231xx_adap_template = {
.algo = cx231xx_algo,
 };
 
-static struct i2c_client cx231xx_client_template = {
-   .name = cx231xx internal,
-};
-
 /* --- */
 
 /*
@@ -514,7 +510,6 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
BUG_ON(!dev-cx231xx_send_usb_command);
 
bus-i2c_adap = cx231xx_adap_template;
-   bus-i2c_client = cx231xx_client_template;
bus-i2c_adap.dev.parent = dev-udev-dev;
 
strlcpy(bus-i2c_adap.name, bus-dev-name, sizeof(bus-i2c_adap.name));
@@ -523,8 +518,6 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
i2c_set_adapdata(bus-i2c_adap, dev-v4l2_dev);
i2c_add_adapter(bus-i2c_adap);
 
-   bus-i2c_client.adapter = bus-i2c_adap;
-
if (0 == bus-i2c_rc) {
if (i2c_scan)
cx231xx_do_i2c_scan(dev, bus-nr);
diff --git a/drivers/media/usb/cx231xx/cx231xx.h 
b/drivers/media/usb/cx231xx/cx231xx.h
index 5efc93e..c92382f 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -472,7 +472,6 @@ struct cx231xx_i2c {
 
/* i2c i/o */
struct i2c_adapter i2c_adap;
-   struct i2c_client i2c_client;
u32 i2c_rc;
 
/* different settings for each bus */
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 12/14] cx231xx: remove direct register PWR_CTL_EN modification that switches port3

2014-10-30 Thread Matthias Schwarzott
The only remaining place that modifies the relevant bit is in function
cx231xx_set_Colibri_For_LowIF

Signed-off-by: Matthias Schwarzott z...@gentoo.org
---
 drivers/media/usb/cx231xx/cx231xx-avcore.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-avcore.c 
b/drivers/media/usb/cx231xx/cx231xx-avcore.c
index 0a5fec4..a3e4915 100644
--- a/drivers/media/usb/cx231xx/cx231xx-avcore.c
+++ b/drivers/media/usb/cx231xx/cx231xx-avcore.c
@@ -2276,7 +2276,6 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum 
AV_MODE mode)
case POLARIS_AVMODE_ANALOGT_TV:
 
tmp |= PWR_DEMOD_EN;
-   tmp |= (I2C_DEMOD_EN);
value[0] = (u8) tmp;
value[1] = (u8) (tmp  8);
value[2] = (u8) (tmp  16);
@@ -2375,7 +2374,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum 
AV_MODE mode)
}
 
tmp = (~PWR_AV_MODE);
-   tmp |= POLARIS_AVMODE_DIGITAL | I2C_DEMOD_EN;
+   tmp |= POLARIS_AVMODE_DIGITAL;
value[0] = (u8) tmp;
value[1] = (u8) (tmp  8);
value[2] = (u8) (tmp  16);
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 13/14] cx231xx: drop unconditional port3 switching

2014-10-30 Thread Matthias Schwarzott
All switching should be done by i2c mux adapters.
Drop explicit dont_use_port_3 flag.
Drop info message about switch.

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

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-avcore.c | 18 --
 drivers/media/usb/cx231xx/cx231xx-cards.c  |  8 
 drivers/media/usb/cx231xx/cx231xx-core.c   |  4 +---
 drivers/media/usb/cx231xx/cx231xx-dvb.c|  4 
 drivers/media/usb/cx231xx/cx231xx.h|  1 -
 5 files changed, 1 insertion(+), 34 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-avcore.c 
b/drivers/media/usb/cx231xx/cx231xx-avcore.c
index a3e4915..781908b 100644
--- a/drivers/media/usb/cx231xx/cx231xx-avcore.c
+++ b/drivers/media/usb/cx231xx/cx231xx-avcore.c
@@ -1270,9 +1270,6 @@ int cx231xx_enable_i2c_port_3(struct cx231xx *dev, bool 
is_port_3)
int status = 0;
bool current_is_port_3;
 
-   if (dev-board.dont_use_port_3)
-   is_port_3 = false;
-
/*
 * Should this code check dev-port_3_switch_enabled first
 * to skip unnecessary reading of the register?
@@ -1296,9 +1293,6 @@ int cx231xx_enable_i2c_port_3(struct cx231xx *dev, bool 
is_port_3)
else
value[0] = ~I2C_DEMOD_EN;
 
-   cx231xx_info(Changing the i2c master port to %d\n,
-is_port_3 ?  3 : 1);
-
status = cx231xx_write_ctrl_reg(dev, VRT_SET_REGISTER,
PWR_CTL_EN, value, 4);
 
@@ -2328,9 +2322,6 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum 
AV_MODE mode)
}
 
if (dev-board.tuner_type != TUNER_ABSENT) {
-   /* Enable tuner */
-   cx231xx_enable_i2c_port_3(dev, true);
-
/* reset the Tuner */
if (dev-board.tuner_gpio)
cx231xx_gpio_set(dev, dev-board.tuner_gpio);
@@ -2395,15 +2386,6 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum 
AV_MODE mode)
}
 
if (dev-board.tuner_type != TUNER_ABSENT) {
-   /*
-* Enable tuner
-*  Hauppauge Exeter seems to need to do something 
different!
-*/
-   if (dev-model == CX231XX_BOARD_HAUPPAUGE_EXETER)
-   cx231xx_enable_i2c_port_3(dev, false);
-   else
-   cx231xx_enable_i2c_port_3(dev, true);
-
/* reset the Tuner */
if (dev-board.tuner_gpio)
cx231xx_gpio_set(dev, dev-board.tuner_gpio);
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 4eb2057..432cbcf 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -262,7 +262,6 @@ struct cx231xx_board cx231xx_boards[] = {
.norm = V4L2_STD_PAL,
.no_alt_vanc = 1,
.external_av = 1,
-   .dont_use_port_3 = 1,
/* Actually, it has a 417, but it isn't working correctly.
 * So set to 0 for now until someone can manage to get this
 * to work reliably. */
@@ -390,7 +389,6 @@ struct cx231xx_board cx231xx_boards[] = {
.norm = V4L2_STD_NTSC,
.no_alt_vanc = 1,
.external_av = 1,
-   .dont_use_port_3 = 1,
.input = {{
.type = CX231XX_VMUX_COMPOSITE1,
.vmux = CX231XX_VIN_2_1,
@@ -532,7 +530,6 @@ struct cx231xx_board cx231xx_boards[] = {
.norm = V4L2_STD_NTSC,
.no_alt_vanc = 1,
.external_av = 1,
-   .dont_use_port_3 = 1,
 
.input = {{
.type = CX231XX_VMUX_COMPOSITE1,
@@ -656,7 +653,6 @@ struct cx231xx_board cx231xx_boards[] = {
.norm = V4L2_STD_NTSC,
.no_alt_vanc = 1,
.external_av = 1,
-   .dont_use_port_3 = 1,
.input = {{
.type = CX231XX_VMUX_COMPOSITE1,
.vmux = CX231XX_VIN_2_1,
@@ -683,7 +679,6 @@ struct cx231xx_board cx231xx_boards[] = {
.norm = V4L2_STD_NTSC,
.no_alt_vanc = 1,
.external_av = 1,
-   .dont_use_port_3 = 1,
/*.has_417 = 1, */
/* This board is believed to have a hardware encoding chip
 * supporting mpeg1/2/4, but as the 417 is apparently not
@@ -1012,9 +1007,6 @@ static int read_eeprom(struct cx231xx *dev, struct 
i2c_client *client,
len_todo -= msg_read.len;

[PATCH v4 07/14] cx231xx: add wrapper to get the i2c_adapter pointer

2014-10-30 Thread Matthias Schwarzott
This is a preparation for mapping I2C_1_MUX_1 and I2C_1_MUX_3 later to the 
seperate
muxed i2c adapters.

Map mux adapters to I2C_1 for now.

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

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-cards.c |  8 +++---
 drivers/media/usb/cx231xx/cx231xx-dvb.c   | 42 +--
 drivers/media/usb/cx231xx/cx231xx-i2c.c   | 20 ++-
 drivers/media/usb/cx231xx/cx231xx-input.c |  3 ++-
 drivers/media/usb/cx231xx/cx231xx.h   |  1 +
 5 files changed, 50 insertions(+), 24 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 2f027c7..f5fb93a 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -1033,7 +1033,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
/* request some modules */
if (dev-board.decoder == CX231XX_AVDECODER) {
dev-sd_cx25840 = v4l2_i2c_new_subdev(dev-v4l2_dev,
-   dev-i2c_bus[I2C_0].i2c_adap,
+   cx231xx_get_i2c_adap(dev, I2C_0),
cx25840, 0x88  1, NULL);
if (dev-sd_cx25840 == NULL)
cx231xx_info(cx25840 subdev registration failure\n);
@@ -1043,8 +1043,10 @@ void cx231xx_card_setup(struct cx231xx *dev)
 
/* Initialize the tuner */
if (dev-board.tuner_type != TUNER_ABSENT) {
+   struct i2c_adapter *tuner_i2c = cx231xx_get_i2c_adap(dev,
+   dev-board.tuner_i2c_master);
dev-sd_tuner = v4l2_i2c_new_subdev(dev-v4l2_dev,
-   
dev-i2c_bus[dev-board.tuner_i2c_master].i2c_adap,
+   tuner_i2c,
tuner,
dev-tuner_addr, NULL);
if (dev-sd_tuner == NULL)
@@ -1062,7 +1064,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
struct i2c_client client;
 
memset(client, 0, sizeof(client));
-   client.adapter = dev-i2c_bus[I2C_1].i2c_adap;
+   client.adapter = cx231xx_get_i2c_adap(dev, I2C_1);
client.addr = 0xa0  1;
 
read_eeprom(dev, client, eeprom, sizeof(eeprom));
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c 
b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 6c7b5e2..869c433 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -378,7 +378,7 @@ static int attach_xc5000(u8 addr, struct cx231xx *dev)
struct xc5000_config cfg;
 
memset(cfg, 0, sizeof(cfg));
-   cfg.i2c_adap = dev-i2c_bus[dev-board.tuner_i2c_master].i2c_adap;
+   cfg.i2c_adap = cx231xx_get_i2c_adap(dev, dev-board.tuner_i2c_master);
cfg.i2c_addr = addr;
 
if (!dev-dvb-frontend) {
@@ -583,6 +583,8 @@ static int dvb_init(struct cx231xx *dev)
 {
int result = 0;
struct cx231xx_dvb *dvb;
+   struct i2c_adapter *tuner_i2c;
+   struct i2c_adapter *demod_i2c;
 
if (!dev-board.has_dvb) {
/* This device does not support the extension */
@@ -599,6 +601,8 @@ static int dvb_init(struct cx231xx *dev)
dev-cx231xx_set_analog_freq = cx231xx_set_analog_freq;
dev-cx231xx_reset_analog_tuner = cx231xx_reset_analog_tuner;
 
+   tuner_i2c = cx231xx_get_i2c_adap(dev, dev-board.tuner_i2c_master);
+   demod_i2c = cx231xx_get_i2c_adap(dev, dev-board.demod_i2c_master);
mutex_lock(dev-lock);
cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE);
cx231xx_demod_reset(dev);
@@ -609,7 +613,7 @@ static int dvb_init(struct cx231xx *dev)
 
dev-dvb-frontend = dvb_attach(s5h1432_attach,
dvico_s5h1432_config,
-   
dev-i2c_bus[dev-board.demod_i2c_master].i2c_adap);
+   demod_i2c);
 
if (dev-dvb-frontend == NULL) {
printk(DRIVER_NAME
@@ -622,7 +626,7 @@ static int dvb_init(struct cx231xx *dev)
dvb-frontend-callback = cx231xx_tuner_callback;
 
if (!dvb_attach(xc5000_attach, dev-dvb-frontend,
-  
dev-i2c_bus[dev-board.tuner_i2c_master].i2c_adap,
+  tuner_i2c,
   cnxt_rde250_tunerconfig)) {
result = -EINVAL;
goto out_free;
@@ -634,7 +638,7 @@ static int dvb_init(struct cx231xx *dev)
 
dev-dvb-frontend = dvb_attach(s5h1411_attach,

[PATCH v4 04/14] cx231xx: give each master i2c bus a seperate name

2014-10-30 Thread Matthias Schwarzott
V2: Use snprintf to construct the complete name
V3: Remove unneeded variable.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index a30d400..4505716 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -512,7 +512,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
bus-i2c_adap = cx231xx_adap_template;
bus-i2c_adap.dev.parent = dev-udev-dev;
 
-   strlcpy(bus-i2c_adap.name, bus-dev-name, sizeof(bus-i2c_adap.name));
+   snprintf(bus-i2c_adap.name, sizeof(bus-i2c_adap.name), %s-%d, 
bus-dev-name, bus-nr);
 
bus-i2c_adap.algo_data = bus;
i2c_set_adapdata(bus-i2c_adap, dev-v4l2_dev);
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 11/14] cx231xx: register i2c mux adapters for master1 and use as I2C_1_MUX_1 and I2C_1_MUX_3

2014-10-30 Thread Matthias Schwarzott
Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/Kconfig|  1 +
 drivers/media/usb/cx231xx/cx231xx-core.c |  5 
 drivers/media/usb/cx231xx/cx231xx-i2c.c  | 44 +++-
 drivers/media/usb/cx231xx/cx231xx.h  |  4 +++
 4 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/cx231xx/Kconfig 
b/drivers/media/usb/cx231xx/Kconfig
index 569aa29..173c0e2 100644
--- a/drivers/media/usb/cx231xx/Kconfig
+++ b/drivers/media/usb/cx231xx/Kconfig
@@ -7,6 +7,7 @@ config VIDEO_CX231XX
select VIDEOBUF_VMALLOC
select VIDEO_CX25840
select VIDEO_CX2341X
+   select I2C_MUX
 
---help---
  This is a video4linux driver for Conexant 231xx USB based TV cards.
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c 
b/drivers/media/usb/cx231xx/cx231xx-core.c
index 180103e..c8a6d20 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -1300,6 +1300,9 @@ int cx231xx_dev_init(struct cx231xx *dev)
cx231xx_i2c_register(dev-i2c_bus[1]);
cx231xx_i2c_register(dev-i2c_bus[2]);
 
+   cx231xx_i2c_mux_register(dev, 0);
+   cx231xx_i2c_mux_register(dev, 1);
+
/* init hardware */
/* Note : with out calling set power mode function,
afe can not be set up correctly */
@@ -1414,6 +1417,8 @@ EXPORT_SYMBOL_GPL(cx231xx_dev_init);
 void cx231xx_dev_uninit(struct cx231xx *dev)
 {
/* Un Initialize I2C bus */
+   cx231xx_i2c_mux_unregister(dev, 1);
+   cx231xx_i2c_mux_unregister(dev, 0);
cx231xx_i2c_unregister(dev-i2c_bus[2]);
cx231xx_i2c_unregister(dev-i2c_bus[1]);
cx231xx_i2c_unregister(dev-i2c_bus[0]);
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 9ade3ac..3e9dfd8 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -24,6 +24,7 @@
 #include linux/kernel.h
 #include linux/usb.h
 #include linux/i2c.h
+#include linux/i2c-mux.h
 #include media/v4l2-common.h
 #include media/tuner.h
 
@@ -547,6 +548,46 @@ int cx231xx_i2c_unregister(struct cx231xx_i2c *bus)
return 0;
 }
 
+/*
+ * cx231xx_i2c_mux_select()
+ * switch i2c master number 1 between port1 and port3
+ */
+static int cx231xx_i2c_mux_select(struct i2c_adapter *adap,
+   void *mux_priv, u32 chan_id)
+{
+   struct cx231xx *dev = mux_priv;
+
+   return cx231xx_enable_i2c_port_3(dev, chan_id);
+}
+
+int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
+{
+   struct i2c_adapter *i2c_parent = dev-i2c_bus[1].i2c_adap;
+   /* what is the correct mux_dev? */
+   struct device *mux_dev = dev-udev-dev;
+
+   dev-i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent,
+   mux_dev,
+   dev /* mux_priv */,
+   0,
+   mux_no /* chan_id */,
+   0 /* class */,
+   cx231xx_i2c_mux_select,
+   NULL);
+
+   if (!dev-i2c_mux_adap[mux_no])
+   cx231xx_warn(%s: i2c mux %d register FAILED\n,
+dev-name, mux_no);
+
+   return 0;
+}
+
+void cx231xx_i2c_mux_unregister(struct cx231xx *dev, int mux_no)
+{
+   i2c_del_mux_adapter(dev-i2c_mux_adap[mux_no]);
+   dev-i2c_mux_adap[mux_no] = NULL;
+}
+
 struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port)
 {
switch (i2c_port) {
@@ -557,8 +598,9 @@ struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx 
*dev, int i2c_port)
case I2C_2:
return dev-i2c_bus[2].i2c_adap;
case I2C_1_MUX_1:
+   return dev-i2c_mux_adap[0];
case I2C_1_MUX_3:
-   return dev-i2c_bus[1].i2c_adap;
+   return dev-i2c_mux_adap[1];
default:
return NULL;
}
diff --git a/drivers/media/usb/cx231xx/cx231xx.h 
b/drivers/media/usb/cx231xx/cx231xx.h
index 8a3c97b..c90aa44 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -628,6 +628,8 @@ struct cx231xx {
 
/* I2C adapters: Master 1  2 (External)  Master 3 (Internal only) */
struct cx231xx_i2c i2c_bus[3];
+   struct i2c_adapter *i2c_mux_adap[2];
+
unsigned int xc_fw_load_done:1;
unsigned int port_3_switch_enabled:1;
/* locks */
@@ -755,6 +757,8 @@ int cx231xx_reset_analog_tuner(struct cx231xx *dev);
 void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port);
 int cx231xx_i2c_register(struct cx231xx_i2c *bus);
 int cx231xx_i2c_unregister(struct cx231xx_i2c *bus);
+int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no);
+void cx231xx_i2c_mux_unregister(struct cx231xx *dev, int mux_no);
 struct i2c_adapter 

[PATCH v4 14/14] cx231xx: scan all four existing i2c busses instead of the 3 masters

2014-10-30 Thread Matthias Schwarzott
The scanning itself just fails (as before this series) but now the correct 
busses are scanned.

V2: Changed to symbolic names where muxed adapters can be seen directly.
V3: Comment about scanning busses ordered by physical port numbers.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-core.c | 6 ++
 drivers/media/usb/cx231xx/cx231xx-i2c.c  | 8 
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c 
b/drivers/media/usb/cx231xx/cx231xx-core.c
index c49022f..9b5cd9e 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -1303,6 +1303,12 @@ int cx231xx_dev_init(struct cx231xx *dev)
cx231xx_i2c_mux_register(dev, 0);
cx231xx_i2c_mux_register(dev, 1);
 
+   /* scan the real bus segments in the order of physical port numbers */
+   cx231xx_do_i2c_scan(dev, I2C_0);
+   cx231xx_do_i2c_scan(dev, I2C_1_MUX_1);
+   cx231xx_do_i2c_scan(dev, I2C_2);
+   cx231xx_do_i2c_scan(dev, I2C_1_MUX_3);
+
/* init hardware */
/* Note : with out calling set power mode function,
afe can not be set up correctly */
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 3e9dfd8..d1003c7 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -492,6 +492,9 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
int i, rc;
struct i2c_client client;
 
+   if (!i2c_scan)
+   return;
+
memset(client, 0, sizeof(client));
client.adapter = cx231xx_get_i2c_adap(dev, i2c_port);
 
@@ -528,10 +531,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
i2c_set_adapdata(bus-i2c_adap, dev-v4l2_dev);
i2c_add_adapter(bus-i2c_adap);
 
-   if (0 == bus-i2c_rc) {
-   if (i2c_scan)
-   cx231xx_do_i2c_scan(dev, bus-nr);
-   } else
+   if (0 != bus-i2c_rc)
cx231xx_warn(%s: i2c bus %d register FAILED\n,
 dev-name, bus-nr);
 
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 08/14] cx231xx: remember status of i2c port_3 switch

2014-10-30 Thread Matthias Schwarzott
This is used later for is_tuner function that switches i2c behaviour for
some tuners.

V2: Add comments about possible improvements for port_3 switch function.
V3: Fix coding style.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
---
 drivers/media/usb/cx231xx/cx231xx-avcore.c | 12 
 drivers/media/usb/cx231xx/cx231xx.h|  1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/media/usb/cx231xx/cx231xx-avcore.c 
b/drivers/media/usb/cx231xx/cx231xx-avcore.c
index 40a6987..0a5fec4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-avcore.c
+++ b/drivers/media/usb/cx231xx/cx231xx-avcore.c
@@ -1272,6 +1272,14 @@ int cx231xx_enable_i2c_port_3(struct cx231xx *dev, bool 
is_port_3)
 
if (dev-board.dont_use_port_3)
is_port_3 = false;
+
+   /*
+* Should this code check dev-port_3_switch_enabled first
+* to skip unnecessary reading of the register?
+* If yes, the flag dev-port_3_switch_enabled must be initialized
+* correctly.
+*/
+
status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER,
   PWR_CTL_EN, value, 4);
if (status  0)
@@ -1294,6 +1302,10 @@ int cx231xx_enable_i2c_port_3(struct cx231xx *dev, bool 
is_port_3)
status = cx231xx_write_ctrl_reg(dev, VRT_SET_REGISTER,
PWR_CTL_EN, value, 4);
 
+   /* remember status of the switch for usage in is_tuner */
+   if (status = 0)
+   dev-port_3_switch_enabled = is_port_3;
+
return status;
 
 }
diff --git a/drivers/media/usb/cx231xx/cx231xx.h 
b/drivers/media/usb/cx231xx/cx231xx.h
index f03338b..8a3c97b 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -629,6 +629,7 @@ struct cx231xx {
/* I2C adapters: Master 1  2 (External)  Master 3 (Internal only) */
struct cx231xx_i2c i2c_bus[3];
unsigned int xc_fw_load_done:1;
+   unsigned int port_3_switch_enabled:1;
/* locks */
struct mutex gpio_i2c_lock;
struct mutex i2c_lock;
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 09/14] cx231xx: let is_tuner check the real i2c port and not the i2c master number

2014-10-30 Thread Matthias Schwarzott
Get used i2c port from bus_nr and status of port_3 switch.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
---
 drivers/media/usb/cx231xx/cx231xx-i2c.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index af9180f..9ade3ac 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -54,10 +54,19 @@ do {
\
   }\
 } while (0)
 
+static inline int get_real_i2c_port(struct cx231xx *dev, int bus_nr)
+{
+   if (bus_nr == 1)
+   return dev-port_3_switch_enabled ? I2C_1_MUX_3 : I2C_1_MUX_1;
+   return bus_nr;
+}
+
 static inline bool is_tuner(struct cx231xx *dev, struct cx231xx_i2c *bus,
const struct i2c_msg *msg, int tuner_type)
 {
-   if (bus-nr != dev-board.tuner_i2c_master)
+   int i2c_port = get_real_i2c_port(dev, bus-nr);
+
+   if (i2c_port != dev-board.tuner_i2c_master)
return false;
 
if (msg-addr != dev-board.tuner_addr)
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 01/14] cx231xx: let i2c bus scanning use its own i2c_client

2014-10-30 Thread Matthias Schwarzott
This is a preparation for deleting the otherwise useless i2c_clients
that are allocated for all the i2c master adapters.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-i2c.c | 17 +++--
 drivers/media/usb/cx231xx/cx231xx.h |  2 +-
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 7c0f797..67a1391 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -480,22 +480,27 @@ static char *i2c_devs[128] = {
  * cx231xx_do_i2c_scan()
  * check i2c address range for devices
  */
-void cx231xx_do_i2c_scan(struct cx231xx *dev, struct i2c_client *c)
+void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
 {
unsigned char buf;
int i, rc;
+   struct i2c_client client;
 
-   cx231xx_info(: Checking for I2C devices ..\n);
+   memset(client, 0, sizeof(client));
+   client.adapter = dev-i2c_bus[i2c_port].i2c_adap;
+
+   cx231xx_info(: Checking for I2C devices on port=%d ..\n, i2c_port);
for (i = 0; i  128; i++) {
-   c-addr = i;
-   rc = i2c_master_recv(c, buf, 0);
+   client.addr = i;
+   rc = i2c_master_recv(client, buf, 0);
if (rc  0)
continue;
cx231xx_info(%s: i2c scan: found device @ 0x%x  [%s]\n,
 dev-name, i  1,
 i2c_devs[i] ? i2c_devs[i] : ???);
}
-   cx231xx_info(: Completed Checking for I2C devices.\n);
+   cx231xx_info(: Completed Checking for I2C devices on port=%d.\n,
+   i2c_port);
 }
 
 /*
@@ -522,7 +527,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
 
if (0 == bus-i2c_rc) {
if (i2c_scan)
-   cx231xx_do_i2c_scan(dev, bus-i2c_client);
+   cx231xx_do_i2c_scan(dev, bus-nr);
} else
cx231xx_warn(%s: i2c bus %d register FAILED\n,
 dev-name, bus-nr);
diff --git a/drivers/media/usb/cx231xx/cx231xx.h 
b/drivers/media/usb/cx231xx/cx231xx.h
index aeb1bf4..5efc93e 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -751,7 +751,7 @@ int cx231xx_set_analog_freq(struct cx231xx *dev, u32 freq);
 int cx231xx_reset_analog_tuner(struct cx231xx *dev);
 
 /* Provided by cx231xx-i2c.c */
-void cx231xx_do_i2c_scan(struct cx231xx *dev, struct i2c_client *c);
+void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port);
 int cx231xx_i2c_register(struct cx231xx_i2c *bus);
 int cx231xx_i2c_unregister(struct cx231xx_i2c *bus);
 
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 05/14] cx231xx: Modifiy the symbolic constants for i2c ports and describe

2014-10-30 Thread Matthias Schwarzott
Change to I2C_0 ... I2C_2 for the master ports
and add I2C_1_MUX_1 and I2C_1_MUX_3 for the muxed ones.

V2: Renamed mux adapters to seperate them from master adapters.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx.h | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx.h 
b/drivers/media/usb/cx231xx/cx231xx.h
index c92382f..377216b 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -322,10 +322,11 @@ enum cx231xx_decoder {
 };
 
 enum CX231XX_I2C_MASTER_PORT {
-   I2C_0 = 0,
-   I2C_1 = 1,
-   I2C_2 = 2,
-   I2C_3 = 3
+   I2C_0 = 0,   /* master 0 - internal connection */
+   I2C_1 = 1,   /* master 1 - used with mux */
+   I2C_2 = 2,   /* master 2 */
+   I2C_1_MUX_1 = 3, /* master 1 - port 1 (I2C_DEMOD_EN = 0) */
+   I2C_1_MUX_3 = 4  /* master 1 - port 3 (I2C_DEMOD_EN = 1) */
 };
 
 struct cx231xx_board {
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 06/14] cx231xx: Use symbolic constants for i2c ports instead of numbers

2014-10-30 Thread Matthias Schwarzott
Replace numbers by the constants of same value and same meaning.

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-cards.c | 62 +++
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 092fb85..2f027c7 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -104,8 +104,8 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 1,
-   .demod_i2c_master = 2,
+   .tuner_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
.norm = V4L2_STD_PAL,
@@ -144,8 +144,8 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 1,
-   .demod_i2c_master = 2,
+   .tuner_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x32,
.norm = V4L2_STD_NTSC,
@@ -184,8 +184,8 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x1c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 1,
-   .demod_i2c_master = 2,
+   .tuner_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
.norm = V4L2_STD_PAL,
@@ -225,8 +225,8 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x1c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 1,
-   .demod_i2c_master = 2,
+   .tuner_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
.norm = V4L2_STD_PAL,
@@ -297,8 +297,8 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 1,
-   .demod_i2c_master = 2,
+   .tuner_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
.norm = V4L2_STD_PAL,
@@ -325,8 +325,8 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 1,
-   .demod_i2c_master = 2,
+   .tuner_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x32,
.norm = V4L2_STD_NTSC,
@@ -353,8 +353,8 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 1,
-   .demod_i2c_master = 2,
+   .tuner_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x0e,
.norm = V4L2_STD_NTSC,
@@ -418,9 +418,9 @@ struct cx231xx_board cx231xx_boards[] = {
.tuner_scl_gpio = -1,
.tuner_sda_gpio = -1,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 2,
-   .demod_i2c_master = 1,
-   .ir_i2c_master = 2,
+   .tuner_i2c_master = I2C_2,
+   .demod_i2c_master = I2C_1,
+   .ir_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x10,
.norm = V4L2_STD_PAL_M,
@@ -456,9 +456,9 @@ struct cx231xx_board cx231xx_boards[] = {
.tuner_scl_gpio = -1,
.tuner_sda_gpio = -1,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = 2,
-   .demod_i2c_master = 1,
-   .ir_i2c_master = 2,
+   .tuner_i2c_master = I2C_2,
+   .demod_i2c_master = I2C_1,
+   .ir_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x10,
.norm = 

[PATCH v4 10/14] cx231xx: change usage of I2C_1 to the real i2c port

2014-10-30 Thread Matthias Schwarzott
change almost all instances of I2C_1 to I2C_1_MUX_3

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

Signed-off-by: Matthias Schwarzott z...@gentoo.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/cx231xx/cx231xx-cards.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
b/drivers/media/usb/cx231xx/cx231xx-cards.c
index f5fb93a..4eb2057 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -104,7 +104,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = I2C_1,
+   .tuner_i2c_master = I2C_1_MUX_3,
.demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
@@ -144,7 +144,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = I2C_1,
+   .tuner_i2c_master = I2C_1_MUX_3,
.demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x32,
@@ -184,7 +184,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x1c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = I2C_1,
+   .tuner_i2c_master = I2C_1_MUX_3,
.demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
@@ -225,7 +225,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x1c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = I2C_1,
+   .tuner_i2c_master = I2C_1_MUX_3,
.demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
@@ -297,7 +297,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = I2C_1,
+   .tuner_i2c_master = I2C_1_MUX_3,
.demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x02,
@@ -325,7 +325,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = I2C_1,
+   .tuner_i2c_master = I2C_1_MUX_3,
.demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x32,
@@ -353,7 +353,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
-   .tuner_i2c_master = I2C_1,
+   .tuner_i2c_master = I2C_1_MUX_1,
.demod_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x0e,
@@ -419,7 +419,7 @@ struct cx231xx_board cx231xx_boards[] = {
.tuner_sda_gpio = -1,
.gpio_pin_status_mask = 0x4001000,
.tuner_i2c_master = I2C_2,
-   .demod_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_1_MUX_3,
.ir_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x10,
@@ -457,7 +457,7 @@ struct cx231xx_board cx231xx_boards[] = {
.tuner_sda_gpio = -1,
.gpio_pin_status_mask = 0x4001000,
.tuner_i2c_master = I2C_2,
-   .demod_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_1_MUX_3,
.ir_i2c_master = I2C_2,
.has_dvb = 1,
.demod_addr = 0x10,
@@ -495,7 +495,7 @@ struct cx231xx_board cx231xx_boards[] = {
.tuner_sda_gpio = -1,
.gpio_pin_status_mask = 0x4001000,
.tuner_i2c_master = I2C_2,
-   .demod_i2c_master = I2C_1,
+   .demod_i2c_master = I2C_1_MUX_3,
.ir_i2c_master = I2C_2,
.rc_map_name = RC_MAP_PIXELVIEW_002T,
.has_dvb = 1,
@@ -587,7 +587,7 @@ struct cx231xx_board cx231xx_boards[] = {
.ctl_pin_status_mask = 0xFFC4,
.agc_analog_digital_select_gpio = 

Re: [PATCH v4 00/14] cx231xx: Use muxed i2c adapters instead of custom switching

2014-10-30 Thread Mauro Carvalho Chehab
Em Thu, 30 Oct 2014 21:12:21 +0100
Matthias Schwarzott z...@gentoo.org escreveu:

 Hi!
 
 This time the series got only small updates from Antti's review.

Oh, no! I just merged the v3 patch series. I manually fixed the
points that Antti has made.

I'm also testing it already.

Could you, instead, rebase it on the top of my merge?

I added it at:
ssh://linuxtv.org/git/mchehab/experimental.git cx231xx

While I'm still at the test phases.

 
 Additionally I added a patch to no longer directly modify
 the content of the port3 switch bit in PWR_CTL_EN (from function 
 cx231xx_set_power_mode).
 
 Now there are two places where I wonder what happens:
 1. cx231xx_set_Colibri_For_LowIF writes a fixed number into all 8bit parts of 
 PWR_CTL_EN
What is this for?
 2. I guess, cx231xx_demod_reset should reset the digital demod. For this it 
 should toggle the bits 0 and 1 of PWR_CTL_EN. 
But instead it touches but 8 and 9.
Does someone know what this is?
 
 3. Is remembering the last status of the port3 bit working good enough?
Currently it is only used for the is_tuner hack function.
 
 Regards
 Matthias
 
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

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

Signed-off-by: Olli Salonen olli.salo...@iki.fi
---
 drivers/media/pci/cx23885/cx23885-cards.c | 14 ++
 drivers/media/pci/cx23885/cx23885-dvb.c   |  8 +---
 drivers/media/pci/cx23885/cx23885-input.c |  8 
 drivers/media/pci/cx23885/cx23885.h   |  1 +
 4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-cards.c 
b/drivers/media/pci/cx23885/cx23885-cards.c
index d9ba48c..9c7e8ac 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -688,6 +688,10 @@ struct cx23885_board cx23885_boards[] = {
.name   = DVBSky S950C,
.portb  = CX23885_MPEG_DVB,
},
+   [CX23885_BOARD_TT_CT2_4500_CI] = {
+   .name   = Technotrend TT-budget CT2-4500 CI,
+   .portb  = CX23885_MPEG_DVB,
+   },
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -955,6 +959,10 @@ struct cx23885_subid cx23885_subids[] = {
.subvendor = 0x4254,
.subdevice = 0x950c,
.card  = CX23885_BOARD_DVBSKY_S950C,
+   }, {
+   .subvendor = 0x13c2,
+   .subdevice = 0x3013,
+   .card  = CX23885_BOARD_TT_CT2_4500_CI,
},
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -1559,6 +1567,7 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
break;
case CX23885_BOARD_DVBSKY_T980C:
case CX23885_BOARD_DVBSKY_S950C:
+   case CX23885_BOARD_TT_CT2_4500_CI:
/*
 * GPIO-0 INTA from CiMax, input
 * GPIO-1 reset CiMax, output, high active
@@ -1671,6 +1680,7 @@ int cx23885_ir_init(struct cx23885_dev *dev)
case CX23885_BOARD_DVBSKY_T9580:
case CX23885_BOARD_DVBSKY_T980C:
case CX23885_BOARD_DVBSKY_S950C:
+   case CX23885_BOARD_TT_CT2_4500_CI:
if (!enable_885_ir)
break;
dev-sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE);
@@ -1720,6 +1730,7 @@ void cx23885_ir_fini(struct cx23885_dev *dev)
case CX23885_BOARD_DVBSKY_T9580:
case CX23885_BOARD_DVBSKY_T980C:
case CX23885_BOARD_DVBSKY_S950C:
+   case CX23885_BOARD_TT_CT2_4500_CI:
cx23885_irq_remove(dev, PCI_MSK_AV_CORE);
/* sd_ir is a duplicate pointer to the AV Core, just clear it */
dev-sd_ir = NULL;
@@ -1770,6 +1781,7 @@ void cx23885_ir_pci_int_enable(struct cx23885_dev *dev)
case CX23885_BOARD_DVBSKY_T9580:
case CX23885_BOARD_DVBSKY_T980C:
case CX23885_BOARD_DVBSKY_S950C:
+   case CX23885_BOARD_TT_CT2_4500_CI:
if (dev-sd_ir)
cx23885_irq_add_enable(dev, PCI_MSK_AV_CORE);
break;
@@ -1875,6 +1887,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_PROF_8000:
case CX23885_BOARD_DVBSKY_T980C:
case CX23885_BOARD_DVBSKY_S950C:
+   case CX23885_BOARD_TT_CT2_4500_CI:
ts1-gen_ctrl_val  = 0x5; /* Parallel */
ts1-ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts1-src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
@@ -1995,6 +2008,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_DVBSKY_T9580:
case CX23885_BOARD_DVBSKY_T980C:
case CX23885_BOARD_DVBSKY_S950C:
+   case CX23885_BOARD_TT_CT2_4500_CI:
dev-sd_cx25840 = v4l2_i2c_new_subdev(dev-v4l2_dev,
dev-i2c_bus[2].i2c_adap,
cx25840, 0x88  1, NULL);
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index f82eb18..5e6caed 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -1766,6 +1766,7 @@ static int dvb_register(struct cx23885_tsport *port)
}
break;
case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_TT_CT2_4500_CI:
i2c_bus = dev-i2c_bus[1];
i2c_bus2 = dev-i2c_bus[0];
 
@@ -1938,7 +1939,8 @@ static int dvb_register(struct cx23885_tsport *port)
break;
}
case CX23885_BOARD_DVBSKY_S950C:
-   case CX23885_BOARD_DVBSKY_T980C: {
+   case CX23885_BOARD_DVBSKY_T980C:
+   case CX23885_BOARD_TT_CT2_4500_CI: {
u8 eeprom[256]; /* 24C02 i2c eeprom */
 
/* attach CI */
@@ -1985,8 +1987,8 @@ static int dvb_register(struct cx23885_tsport *port)
dev-i2c_bus[0].i2c_client.addr = 0xa0  1;
tveeprom_read(dev-i2c_bus[0].i2c_client, eeprom,

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

2014-10-30 Thread Olli Salonen

On Thu, 30 Oct 2014, Olli Salonen wrote:

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


Additional note, this should be applied on top of Max Nibble's commits:
http://www.mail-archive.com/linux-media@vger.kernel.org/msg80865.html
http://www.mail-archive.com/linux-media@vger.kernel.org/msg80866.html

In patchwork they're 26538 and 26539.

Cheers,
-olli
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: cx23885 0000:01:00.0: DVB: adapter 0 frontend 0 frequency 0 out of range (950000..2150000)

2014-10-30 Thread beta992
Is there any update on DVB-C support? It seems that the patch that
ZZram made, works on lower versions, but not on the current branch.

I have looked in the media_tree.git branch, and see that the (needed)
flags are their, but still it says 'DVB-C not supported'. Would be
great if you guys could implement this.

Thanks and waiting for a replay!
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] cx231xx: remove direct register PWR_CTL_EN modification that switches port3

2014-10-30 Thread Matthias Schwarzott
The only remaining place that modifies the relevant bit is in function
cx231xx_set_Colibri_For_LowIF

Signed-off-by: Matthias Schwarzott z...@gentoo.org
---
 drivers/media/usb/cx231xx/cx231xx-avcore.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-avcore.c 
b/drivers/media/usb/cx231xx/cx231xx-avcore.c
index b56bc87..781908b 100644
--- a/drivers/media/usb/cx231xx/cx231xx-avcore.c
+++ b/drivers/media/usb/cx231xx/cx231xx-avcore.c
@@ -2270,7 +2270,6 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum 
AV_MODE mode)
case POLARIS_AVMODE_ANALOGT_TV:
 
tmp |= PWR_DEMOD_EN;
-   tmp |= (I2C_DEMOD_EN);
value[0] = (u8) tmp;
value[1] = (u8) (tmp  8);
value[2] = (u8) (tmp  16);
@@ -2366,7 +2365,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum 
AV_MODE mode)
}
 
tmp = (~PWR_AV_MODE);
-   tmp |= POLARIS_AVMODE_DIGITAL | I2C_DEMOD_EN;
+   tmp |= POLARIS_AVMODE_DIGITAL;
value[0] = (u8) tmp;
value[1] = (u8) (tmp  8);
value[2] = (u8) (tmp  16);
-- 
2.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] cx231xx: remove direct register PWR_CTL_EN modification that switches port3

2014-10-30 Thread Matthias Schwarzott
Hi Mauro,

this one is now based on your cx231xx branch.

Regards
Matthias

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Re: [PATCH v2 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103forsupporting the demod of M88RS6000

2014-10-30 Thread Nibble Max
Hello Antti,

On 2014-10-31 01:36:14, Antti Palosaari wrote:


On 10/30/2014 06:38 AM, Nibble Max wrote:

 -  if (tab_len  83) {
 +  if (tab_len  86) {

 That is not nice, but I could try find better solution and fix it later.

 What is the reason to check this parameter?
 How about remove this check?

It is just to check you will not overwrite buffer accidentally. Buffer 
is 83 bytes long, which should be also increased...
The correct solution is somehow calculate max possible tab size on 
compile time. It should be possible as init tabs are static const 
tables. Use some macro to calculate max value and use it - not plain 
numbers.

Something like that
#define BUF_SIZE   MAX(m88ds3103_tab_dvbs, m88ds3103_tab_dvbs2, 
m88rs6000_tab_dvbs, m88rs6000_tab_dvbs2)


 Clock selection. What this does:
 * select mclk_khz
 * select target_mclk
 * calls set_config() in order to pass target_mclk to tuner driver
 * + some strange looking sleep, which is not likely needed

 The clock of M88RS6000's demod comes from tuner dies.
 So the first thing is turning on the demod main clock from tuner die after 
 the demod reset.
 Without this clock, the following register's content will fail to update.
 Before changing the demod main clock, it should close clock path.
 After changing the demod main clock, it open clock path and wait the clock 
 to stable.


 One thing what I don't like this is that you have implemented M88RS6000
 things here and M88DS3103 elsewhere. Generally speaking, code must have
 some logic where same things are done in same place. So I expect to see
 both M88DS3103 and M88RS6000 target_mclk and mclk_khz selection
 implemented here or these moved to place where M88DS3103 implementation is.


 I will move M88DS3103 implementation to here.

 Also, even set_config() is somehow logically correctly used here, I
 prefer to duplicate that 4 line long target_mclk selection to tuner
 driver and get rid of whole set_config(). Even better solution could be
 to register M88RS6000 as a clock provider using clock framework, but
 imho it is not worth  that simple case.

 Do you suggest to set demod main clock and ts clock in tuner's set_params 
 call back?

Yes, and you did it already on that latest patch, thanks. It is not 
logically correct, but a bit hackish solution, but I think it is best in 
that special case in order to keep things simple here.



One thing with that new patch I would like to check is this 10us delay 
after clock path is enabled. You enable clock just before mcu is stopped 
and demod is configured during mcu is on freeze. 10us is almost nothing 
and it sounds like having no need in a situation you stop even mcu. It 
is about one I2C command which will took longer than 10us. Hard to see 
why you need wait 10us to settle clock in such case. What happens if you 
don't wait? I assume nothing, it works just as it should as stable 
clocks are needed a long after that, when mcu is take out of reset.


usleep_range(1, 2);
This delay time at least is 10ms, not 10us. 

regards
Antti

-- 
http://palosaari.fi/
BR,
Max

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103forsupporting the demod of M88RS6000

2014-10-30 Thread Antti Palosaari



On 10/31/2014 04:34 AM, Nibble Max wrote:

Hello Antti,

On 2014-10-31 01:36:14, Antti Palosaari wrote:



On 10/30/2014 06:38 AM, Nibble Max wrote:


-   if (tab_len  83) {
+   if (tab_len  86) {


That is not nice, but I could try find better solution and fix it later.


What is the reason to check this parameter?
How about remove this check?


It is just to check you will not overwrite buffer accidentally. Buffer
is 83 bytes long, which should be also increased...
The correct solution is somehow calculate max possible tab size on
compile time. It should be possible as init tabs are static const
tables. Use some macro to calculate max value and use it - not plain
numbers.

Something like that
#define BUF_SIZE   MAX(m88ds3103_tab_dvbs, m88ds3103_tab_dvbs2,
m88rs6000_tab_dvbs, m88rs6000_tab_dvbs2)



Clock selection. What this does:
* select mclk_khz
* select target_mclk
* calls set_config() in order to pass target_mclk to tuner driver
* + some strange looking sleep, which is not likely needed


The clock of M88RS6000's demod comes from tuner dies.
So the first thing is turning on the demod main clock from tuner die after the 
demod reset.
Without this clock, the following register's content will fail to update.
Before changing the demod main clock, it should close clock path.
After changing the demod main clock, it open clock path and wait the clock to 
stable.



One thing what I don't like this is that you have implemented M88RS6000
things here and M88DS3103 elsewhere. Generally speaking, code must have
some logic where same things are done in same place. So I expect to see
both M88DS3103 and M88RS6000 target_mclk and mclk_khz selection
implemented here or these moved to place where M88DS3103 implementation is.



I will move M88DS3103 implementation to here.


Also, even set_config() is somehow logically correctly used here, I
prefer to duplicate that 4 line long target_mclk selection to tuner
driver and get rid of whole set_config(). Even better solution could be
to register M88RS6000 as a clock provider using clock framework, but
imho it is not worth  that simple case.


Do you suggest to set demod main clock and ts clock in tuner's set_params call 
back?


Yes, and you did it already on that latest patch, thanks. It is not
logically correct, but a bit hackish solution, but I think it is best in
that special case in order to keep things simple here.



One thing with that new patch I would like to check is this 10us delay
after clock path is enabled. You enable clock just before mcu is stopped
and demod is configured during mcu is on freeze. 10us is almost nothing
and it sounds like having no need in a situation you stop even mcu. It
is about one I2C command which will took longer than 10us. Hard to see
why you need wait 10us to settle clock in such case. What happens if you
don't wait? I assume nothing, it works just as it should as stable
clocks are needed a long after that, when mcu is take out of reset.



usleep_range(1, 2);
This delay time at least is 10ms, not 10us.


ah, yes, you were correct. 10ms is indeed a much larger, it is about 
century on a digital logic signal path where frequency is around 100MHz. 
100MHz clock means clock cycle is 10ns, 10ms is 1000ns = 1,000,000 
- one million clock cycles. Whilst I don't know how chip designed in a 
logic level, I have still done some digital logic designing myself and 
this sounds long.
If you don't enable clock path, what is next command which will fail? 
Probably it will not even fail, but never lock to signal as demod core 
is not clocked at all.


regards
Antti

--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


az6027.c:undefined reference to `stb6100_attach'

2014-10-30 Thread kbuild test robot
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3a2f22b7d0cc64482a91529e23c2570aa0602fa6
commit: 7b34be71db533f3e0cf93d53cf62d036cdb5418a [media] use IS_ENABLED() macro
date:   1 year, 9 months ago
config: x86_64-randconfig-iv0-10311039 (attached as .config)
reproduce:
  git checkout 7b34be71db533f3e0cf93d53cf62d036cdb5418a
  # save the attached .config to linux build tree
  make ARCH=x86_64 

All error/warnings:

   drivers/built-in.o: In function `az6027_frontend_attach':
 az6027.c:(.text+0x1c8fb7): undefined reference to `stb6100_attach'

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.8.0-rc3 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT=elf64-x86-64
CONFIG_ARCH_DEFCONFIG=arch/x86/configs/x86_64_defconfig
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS=-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx 
-fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 
-fcall-saved-r11
CONFIG_ARCH_CPU_PROBE_RELEASE=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
CONFIG_CONSTRUCTORS=y
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
# CONFIG_EXPERIMENTAL is not set
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=
CONFIG_LOCALVERSION=
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME=(none)
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_FHANDLE is not set
# CONFIG_AUDIT is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
# CONFIG_NO_HZ is not set
# CONFIG_HIGH_RES_TIMERS is not set

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
# CONFIG_BSD_PROCESS_ACCT_V3 is not set
# CONFIG_TASKSTATS is not set

#
# RCU Subsystem
#
CONFIG_TREE_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_RCU_USER_QS=y
CONFIG_CONTEXT_TRACKING_FORCE=y
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RCU_FANOUT_EXACT is not set
CONFIG_TREE_RCU_TRACE=y
CONFIG_RCU_BOOST=y
CONFIG_RCU_BOOST_PRIO=1
CONFIG_RCU_BOOST_DELAY=500
CONFIG_RCU_NOCB_CPU=y
CONFIG_IKCONFIG=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_WANTS_PROT_NUMA_PROT_NONE=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_RESOURCE_COUNTERS is not set
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
# CONFIG_CHECKPOINT_RESTORE is not set
# CONFIG_NAMESPACES is not set
CONFIG_SCHED_AUTOGROUP=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_ANON_INODES=y
CONFIG_EXPERT=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
# 

Re: [PATCH v2 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103forsupporting the demod of M88RS6000

2014-10-30 Thread Antti Palosaari



On 10/31/2014 04:55 AM, Antti Palosaari wrote:



On 10/31/2014 04:34 AM, Nibble Max wrote:

Hello Antti,

On 2014-10-31 01:36:14, Antti Palosaari wrote:



On 10/30/2014 06:38 AM, Nibble Max wrote:


-if (tab_len  83) {
+if (tab_len  86) {


That is not nice, but I could try find better solution and fix it
later.


What is the reason to check this parameter?
How about remove this check?


It is just to check you will not overwrite buffer accidentally. Buffer
is 83 bytes long, which should be also increased...
The correct solution is somehow calculate max possible tab size on
compile time. It should be possible as init tabs are static const
tables. Use some macro to calculate max value and use it - not plain
numbers.

Something like that
#define BUF_SIZE   MAX(m88ds3103_tab_dvbs, m88ds3103_tab_dvbs2,
m88rs6000_tab_dvbs, m88rs6000_tab_dvbs2)



Clock selection. What this does:
* select mclk_khz
* select target_mclk
* calls set_config() in order to pass target_mclk to tuner driver
* + some strange looking sleep, which is not likely needed


The clock of M88RS6000's demod comes from tuner dies.
So the first thing is turning on the demod main clock from tuner die
after the demod reset.
Without this clock, the following register's content will fail to
update.
Before changing the demod main clock, it should close clock path.
After changing the demod main clock, it open clock path and wait the
clock to stable.



One thing what I don't like this is that you have implemented
M88RS6000
things here and M88DS3103 elsewhere. Generally speaking, code must
have
some logic where same things are done in same place. So I expect to
see
both M88DS3103 and M88RS6000 target_mclk and mclk_khz selection
implemented here or these moved to place where M88DS3103
implementation is.



I will move M88DS3103 implementation to here.


Also, even set_config() is somehow logically correctly used here, I
prefer to duplicate that 4 line long target_mclk selection to tuner
driver and get rid of whole set_config(). Even better solution
could be
to register M88RS6000 as a clock provider using clock framework, but
imho it is not worth  that simple case.


Do you suggest to set demod main clock and ts clock in tuner's
set_params call back?


Yes, and you did it already on that latest patch, thanks. It is not
logically correct, but a bit hackish solution, but I think it is best in
that special case in order to keep things simple here.



One thing with that new patch I would like to check is this 10us delay
after clock path is enabled. You enable clock just before mcu is stopped
and demod is configured during mcu is on freeze. 10us is almost nothing
and it sounds like having no need in a situation you stop even mcu. It
is about one I2C command which will took longer than 10us. Hard to see
why you need wait 10us to settle clock in such case. What happens if you
don't wait? I assume nothing, it works just as it should as stable
clocks are needed a long after that, when mcu is take out of reset.



usleep_range(1, 2);
This delay time at least is 10ms, not 10us.


ah, yes, you were correct. 10ms is indeed a much larger, it is about
century on a digital logic signal path where frequency is around 100MHz.
100MHz clock means clock cycle is 10ns, 10ms is 1000ns = 1,000,000
- one million clock cycles. Whilst I don't know how chip designed in a
logic level, I have still done some digital logic designing myself and
this sounds long.
If you don't enable clock path, what is next command which will fail?
Probably it will not even fail, but never lock to signal as demod core
is not clocked at all.


But if you want keep that delay then keep it. For my eyes it sounds 
weird to wait that long after clock path is enabled. I have feeling it 
is clock which is needed much later, but I may be wrong and I cannot 
even make any tests without hardware. It is also possible that master 
clock is needed in order to perform all the next commands.


regards
Antti

--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: ERRORS

2014-10-30 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:   Fri Oct 31 04:00:17 CET 2014
git branch: test
git hash:   37fa8716e2d4c4155205aa4a904835de09edbb88
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-34-g71e642a
host hardware:  x86_64
host os:3.17-1.slh.5-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: 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.32.27-i686: ERRORS
linux-2.6.33.7-i686: ERRORS
linux-2.6.34.7-i686: ERRORS
linux-2.6.35.9-i686: ERRORS
linux-2.6.36.4-i686: ERRORS
linux-2.6.37.6-i686: ERRORS
linux-2.6.38.8-i686: ERRORS
linux-2.6.39.4-i686: ERRORS
linux-3.0.60-i686: ERRORS
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16-i686: OK
linux-3.17-i686: OK
linux-3.18-rc1-i686: ERRORS
linux-2.6.32.27-x86_64: ERRORS
linux-2.6.33.7-x86_64: ERRORS
linux-2.6.34.7-x86_64: ERRORS
linux-2.6.35.9-x86_64: ERRORS
linux-2.6.36.4-x86_64: ERRORS
linux-2.6.37.6-x86_64: ERRORS
linux-2.6.38.8-x86_64: ERRORS
linux-2.6.39.4-x86_64: ERRORS
linux-3.0.60-x86_64: ERRORS
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
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: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16-x86_64: OK
linux-3.17-x86_64: OK
linux-3.18-rc1-x86_64: ERRORS
apps: OK
spec-git: OK
sparse: ERRORS
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Re: [PATCH v2 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103forsupportingthe demod of M88RS6000

2014-10-30 Thread Nibble Max
Hello Antti,
On 2014-10-31 11:13:59, Antti Palosaari wrote:


On 10/31/2014 04:55 AM, Antti Palosaari wrote:


 On 10/31/2014 04:34 AM, Nibble Max wrote:
 Hello Antti,

 On 2014-10-31 01:36:14, Antti Palosaari wrote:


 On 10/30/2014 06:38 AM, Nibble Max wrote:

 -if (tab_len  83) {
 +if (tab_len  86) {

 That is not nice, but I could try find better solution and fix it
 later.

 What is the reason to check this parameter?
 How about remove this check?

 It is just to check you will not overwrite buffer accidentally. Buffer
 is 83 bytes long, which should be also increased...
 The correct solution is somehow calculate max possible tab size on
 compile time. It should be possible as init tabs are static const
 tables. Use some macro to calculate max value and use it - not plain
 numbers.

 Something like that
 #define BUF_SIZE   MAX(m88ds3103_tab_dvbs, m88ds3103_tab_dvbs2,
 m88rs6000_tab_dvbs, m88rs6000_tab_dvbs2)


 Clock selection. What this does:
 * select mclk_khz
 * select target_mclk
 * calls set_config() in order to pass target_mclk to tuner driver
 * + some strange looking sleep, which is not likely needed

 The clock of M88RS6000's demod comes from tuner dies.
 So the first thing is turning on the demod main clock from tuner die
 after the demod reset.
 Without this clock, the following register's content will fail to
 update.
 Before changing the demod main clock, it should close clock path.
 After changing the demod main clock, it open clock path and wait the
 clock to stable.


 One thing what I don't like this is that you have implemented
 M88RS6000
 things here and M88DS3103 elsewhere. Generally speaking, code must
 have
 some logic where same things are done in same place. So I expect to
 see
 both M88DS3103 and M88RS6000 target_mclk and mclk_khz selection
 implemented here or these moved to place where M88DS3103
 implementation is.


 I will move M88DS3103 implementation to here.

 Also, even set_config() is somehow logically correctly used here, I
 prefer to duplicate that 4 line long target_mclk selection to tuner
 driver and get rid of whole set_config(). Even better solution
 could be
 to register M88RS6000 as a clock provider using clock framework, but
 imho it is not worth  that simple case.

 Do you suggest to set demod main clock and ts clock in tuner's
 set_params call back?

 Yes, and you did it already on that latest patch, thanks. It is not
 logically correct, but a bit hackish solution, but I think it is best in
 that special case in order to keep things simple here.



 One thing with that new patch I would like to check is this 10us delay
 after clock path is enabled. You enable clock just before mcu is stopped
 and demod is configured during mcu is on freeze. 10us is almost nothing
 and it sounds like having no need in a situation you stop even mcu. It
 is about one I2C command which will took longer than 10us. Hard to see
 why you need wait 10us to settle clock in such case. What happens if you
 don't wait? I assume nothing, it works just as it should as stable
 clocks are needed a long after that, when mcu is take out of reset.


 usleep_range(1, 2);
 This delay time at least is 10ms, not 10us.

 ah, yes, you were correct. 10ms is indeed a much larger, it is about
 century on a digital logic signal path where frequency is around 100MHz.
 100MHz clock means clock cycle is 10ns, 10ms is 1000ns = 1,000,000
 - one million clock cycles. Whilst I don't know how chip designed in a
 logic level, I have still done some digital logic designing myself and
 this sounds long.
 If you don't enable clock path, what is next command which will fail?
 Probably it will not even fail, but never lock to signal as demod core
 is not clocked at all.

But if you want keep that delay then keep it. For my eyes it sounds 
weird to wait that long after clock path is enabled. I have feeling it 
is clock which is needed much later, but I may be wrong and I cannot 
even make any tests without hardware. It is also possible that master 
clock is needed in order to perform all the next commands.


If don't enable clock path, the next I2C commands looks ok, no error message.
But the demod can not lock to the signal any more.
I am not the chip designer so I do not know the exact detail information of 
this internal logic.

regards
Antti

-- 
http://palosaari.fi/
BR,
Max

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html