[PATCH 1/2] lgdt3305: we only need to pass state into lgdt3305_mpeg_mode_polarity()

2015-01-11 Thread Michael Krufky
From: Michael Ira Krufky mkru...@linuxtv.org

Signed-off-by: Michael Ira Krufky mkru...@linuxtv.org
---
 drivers/media/dvb-frontends/lgdt3305.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/media/dvb-frontends/lgdt3305.c 
b/drivers/media/dvb-frontends/lgdt3305.c
index 92c891a..b42d649 100644
--- a/drivers/media/dvb-frontends/lgdt3305.c
+++ b/drivers/media/dvb-frontends/lgdt3305.c
@@ -236,12 +236,12 @@ static inline int lgdt3305_mpeg_mode(struct 
lgdt3305_state *state,
return lgdt3305_set_reg_bit(state, LGDT3305_TP_CTRL_1, 5, mode);
 }
 
-static int lgdt3305_mpeg_mode_polarity(struct lgdt3305_state *state,
-  enum lgdt3305_tp_clock_edge edge,
-  enum lgdt3305_tp_valid_polarity valid)
+static int lgdt3305_mpeg_mode_polarity(struct lgdt3305_state *state)
 {
u8 val;
int ret;
+   enum lgdt3305_tp_clock_edge edge = state-cfg-tpclk_edge;
+   enum lgdt3305_tp_valid_polarity valid = state-cfg-tpvalid_polarity;
 
lg_dbg(edge = %d, valid = %d\n, edge, valid);
 
@@ -740,9 +740,7 @@ static int lgdt3304_set_parameters(struct dvb_frontend *fe)
goto fail;
 
/* lgdt3305_mpeg_mode_polarity calls lgdt3305_soft_reset */
-   ret = lgdt3305_mpeg_mode_polarity(state,
- state-cfg-tpclk_edge,
- state-cfg-tpvalid_polarity);
+   ret = lgdt3305_mpeg_mode_polarity(state);
 fail:
return ret;
 }
@@ -806,9 +804,7 @@ static int lgdt3305_set_parameters(struct dvb_frontend *fe)
goto fail;
 
/* lgdt3305_mpeg_mode_polarity calls lgdt3305_soft_reset */
-   ret = lgdt3305_mpeg_mode_polarity(state,
- state-cfg-tpclk_edge,
- state-cfg-tpvalid_polarity);
+   ret = lgdt3305_mpeg_mode_polarity(state);
 fail:
return ret;
 }
-- 
2.1.0

--
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] lgdt3305: add support for fixed tp clock mode

2015-01-11 Thread Michael Krufky
From: Michael Ira Krufky mkru...@linuxtv.org

Add support for controlling TP clock mode for VSB and QAM annex-B/C mode.
Gated clock mode is the default value, and does not support QAM annex-C.
The patch enables setting this control to fixed clock mode.

Signed-off-by: Michael Ira Krufky mkru...@linuxtv.org
---
 drivers/media/dvb-frontends/lgdt3305.c | 3 +++
 drivers/media/dvb-frontends/lgdt3305.h | 6 ++
 2 files changed, 9 insertions(+)

diff --git a/drivers/media/dvb-frontends/lgdt3305.c 
b/drivers/media/dvb-frontends/lgdt3305.c
index b42d649..873c63a 100644
--- a/drivers/media/dvb-frontends/lgdt3305.c
+++ b/drivers/media/dvb-frontends/lgdt3305.c
@@ -241,6 +241,7 @@ static int lgdt3305_mpeg_mode_polarity(struct 
lgdt3305_state *state)
u8 val;
int ret;
enum lgdt3305_tp_clock_edge edge = state-cfg-tpclk_edge;
+   enum lgdt3305_tp_clock_mode mode = state-cfg-tpclk_mode;
enum lgdt3305_tp_valid_polarity valid = state-cfg-tpvalid_polarity;
 
lg_dbg(edge = %d, valid = %d\n, edge, valid);
@@ -253,6 +254,8 @@ static int lgdt3305_mpeg_mode_polarity(struct 
lgdt3305_state *state)
 
if (edge)
val |= 0x08;
+   if (mode)
+   val |= 0x40;
if (valid)
val |= 0x01;
 
diff --git a/drivers/media/dvb-frontends/lgdt3305.h 
b/drivers/media/dvb-frontends/lgdt3305.h
index d9ab556..9c03e53 100644
--- a/drivers/media/dvb-frontends/lgdt3305.h
+++ b/drivers/media/dvb-frontends/lgdt3305.h
@@ -37,6 +37,11 @@ enum lgdt3305_tp_clock_edge {
LGDT3305_TPCLK_FALLING_EDGE = 1,
 };
 
+enum lgdt3305_tp_clock_mode {
+   LGDT3305_TPCLK_GATED = 0,
+   LGDT3305_TPCLK_FIXED = 1,
+};
+
 enum lgdt3305_tp_valid_polarity {
LGDT3305_TP_VALID_LOW = 0,
LGDT3305_TP_VALID_HIGH = 1,
@@ -70,6 +75,7 @@ struct lgdt3305_config {
 
enum lgdt3305_mpeg_mode mpeg_mode;
enum lgdt3305_tp_clock_edge tpclk_edge;
+   enum lgdt3305_tp_clock_mode tpclk_mode;
enum lgdt3305_tp_valid_polarity tpvalid_polarity;
enum lgdt_demod_chip_type demod_chip;
 };
-- 
2.1.0

--
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 3/3] au8522: improve lock performance with ZeeVee modulators

2014-10-25 Thread Michael Krufky
From: Richard Vollkommer li...@hauppauge.com

Improves lock performance with signals from the ZeeVee family
of modulators.

Signed-off-by: Richard Vollkommer li...@hauppauge.com
Cc: Devin Heitmueller dheitmuel...@kernellabs.com
Signed-off-by: Michael Ira Krufky mkru...@linuxtv.org
---
 drivers/media/dvb-frontends/au8522_dig.c | 117 +--
 1 file changed, 110 insertions(+), 7 deletions(-)

diff --git a/drivers/media/dvb-frontends/au8522_dig.c 
b/drivers/media/dvb-frontends/au8522_dig.c
index a68974f..5d06c99 100644
--- a/drivers/media/dvb-frontends/au8522_dig.c
+++ b/drivers/media/dvb-frontends/au8522_dig.c
@@ -29,6 +29,7 @@
 #include au8522_priv.h
 
 static int debug;
+static int zv_mode = 1; /* default to on */
 
 #define dprintk(arg...)\
do { if (debug)\
@@ -469,6 +470,87 @@ static struct {
{ 0x8526, 0x01 },
 };
 
+static struct {
+   u16 reg;
+   u16 data;
+} QAM256_mod_tab_zv_mode[] = {
+   { 0x80a3, 0x09 },
+   { 0x80a4, 0x00 },
+   { 0x8081, 0xc4 },
+   { 0x80a5, 0x40 },
+   { 0x80b5, 0xfb },
+   { 0x80b6, 0x8e },
+   { 0x80b7, 0x39 },
+   { 0x80aa, 0x77 },
+   { 0x80ad, 0x77 },
+   { 0x80a6, 0x67 },
+   { 0x8262, 0x20 },
+   { 0x821c, 0x30 },
+   { 0x80b8, 0x3e },
+   { 0x80b9, 0xf0 },
+   { 0x80ba, 0x01 },
+   { 0x80bb, 0x18 },
+   { 0x80bc, 0x50 },
+   { 0x80bd, 0x00 },
+   { 0x80be, 0xea },
+   { 0x80bf, 0xef },
+   { 0x80c0, 0xfc },
+   { 0x80c1, 0xbd },
+   { 0x80c2, 0x1f },
+   { 0x80c3, 0xfc },
+   { 0x80c4, 0xdd },
+   { 0x80c5, 0xaf },
+   { 0x80c6, 0x00 },
+   { 0x80c7, 0x38 },
+   { 0x80c8, 0x30 },
+   { 0x80c9, 0x05 },
+   { 0x80ca, 0x4a },
+   { 0x80cb, 0xd0 },
+   { 0x80cc, 0x01 },
+   { 0x80cd, 0xd9 },
+   { 0x80ce, 0x6f },
+   { 0x80cf, 0xf9 },
+   { 0x80d0, 0x70 },
+   { 0x80d1, 0xdf },
+   { 0x80d2, 0xf7 },
+   { 0x80d3, 0xc2 },
+   { 0x80d4, 0xdf },
+   { 0x80d5, 0x02 },
+   { 0x80d6, 0x9a },
+   { 0x80d7, 0xd0 },
+   { 0x8250, 0x0d },
+   { 0x8251, 0xcd },
+   { 0x8252, 0xe0 },
+   { 0x8253, 0x05 },
+   { 0x8254, 0xa7 },
+   { 0x8255, 0xff },
+   { 0x8256, 0xed },
+   { 0x8257, 0x5b },
+   { 0x8258, 0xae },
+   { 0x8259, 0xe6 },
+   { 0x825a, 0x3d },
+   { 0x825b, 0x0f },
+   { 0x825c, 0x0d },
+   { 0x825d, 0xea },
+   { 0x825e, 0xf2 },
+   { 0x825f, 0x51 },
+   { 0x8260, 0xf5 },
+   { 0x8261, 0x06 },
+   { 0x821a, 0x01 },
+   { 0x8546, 0x40 },
+   { 0x8210, 0x26 },
+   { 0x8211, 0xf6 },
+   { 0x8212, 0x84 },
+   { 0x8213, 0x02 },
+   { 0x8502, 0x01 },
+   { 0x8121, 0x04 },
+   { 0x8122, 0x04 },
+   { 0x852e, 0x10 },
+   { 0x80a4, 0xca },
+   { 0x80a7, 0x40 },
+   { 0x8526, 0x01 },
+};
+
 static int au8522_enable_modulation(struct dvb_frontend *fe,
fe_modulation_t m)
 {
@@ -495,12 +577,23 @@ static int au8522_enable_modulation(struct dvb_frontend 
*fe,
au8522_set_if(fe, state-config-qam_if);
break;
case QAM_256:
-   dprintk(%s() QAM 256\n, __func__);
-   for (i = 0; i  ARRAY_SIZE(QAM256_mod_tab); i++)
-   au8522_writereg(state,
-   QAM256_mod_tab[i].reg,
-   QAM256_mod_tab[i].data);
-   au8522_set_if(fe, state-config-qam_if);
+   if (zv_mode) {
+   dprintk(%s() QAM 256 (zv_mode)\n, __func__);
+   for (i = 0; i  ARRAY_SIZE(QAM256_mod_tab_zv_mode); i++)
+   au8522_writereg(state,
+   QAM256_mod_tab_zv_mode[i].reg,
+   QAM256_mod_tab_zv_mode[i].data);
+   au8522_set_if(fe, state-config-qam_if);
+   msleep(100);
+   au8522_writereg(state, 0x821a, 0x00);
+   } else {
+   dprintk(%s() QAM 256\n, __func__);
+   for (i = 0; i  ARRAY_SIZE(QAM256_mod_tab); i++)
+   au8522_writereg(state,
+   QAM256_mod_tab[i].reg,
+   QAM256_mod_tab[i].data);
+   au8522_set_if(fe, state-config-qam_if);
+   }
break;
default:
dprintk(%s() Invalid modulation\n, __func__);
@@ -537,7 +630,12 @@ static int au8522_set_frontend(struct dvb_frontend *fe)
return ret;
 
/* Allow the tuner to settle */
-   msleep(100);
+   if (zv_mode) {
+   dprintk(%s() increase tuner settling time for zv_mode\n,
+   __func__);
+   msleep(250);
+   } else
+   msleep(100);
 

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

2014-10-25 Thread Michael Krufky
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
---
 drivers/media/tuners/xc5000.c | 14 +-
 drivers/media/tuners/xc5000.h |  1 +
 drivers/media/usb/au0828/au0828-dvb.c |  2 ++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index fafff4c..cd55110 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -62,6 +62,7 @@ struct xc5000_priv {
unsigned int mode;
u8  rf_mode;
u8  radio_input;
+   u16  output_amp;
 
int chip_id;
u16 pll_register_no;
@@ -744,7 +745,9 @@ static int xc5000_tune_digital(struct dvb_frontend *fe)
return -EIO;
}
 
-   xc_write_reg(priv, XREG_OUTPUT_AMP, 0x8a);
+   dprintk(1, %s() setting OUTPUT_AMP to 0x%x\n,
+   __func__, priv-output_amp);
+   xc_write_reg(priv, XREG_OUTPUT_AMP, priv-output_amp);
 
xc_tune_channel(priv, priv-freq_hz, XC_TUNE_DIGITAL);
 
@@ -1358,6 +1361,9 @@ static int xc5000_set_config(struct dvb_frontend *fe, 
void *priv_cfg)
if (p-radio_input)
priv-radio_input = p-radio_input;
 
+   if (p-output_amp)
+   priv-output_amp = p-output_amp;
+
return 0;
 }
 
@@ -1438,6 +1444,12 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend 
*fe,
   it can be overridden if this is a hybrid driver */
priv-chip_id = (cfg-chip_id) ? cfg-chip_id : 0;
 
+   /* don't override output_amp if it's already been set
+  unless explicitly specified */
+   if ((priv-output_amp == 0) || (cfg-output_amp))
+   /* use default output_amp value if none specified */
+   priv-output_amp = (cfg-output_amp) ? cfg-output_amp : 0x8a;
+
/* Check if firmware has been loaded. It is possible that another
   instance of the driver has loaded the firmware.
 */
diff --git a/drivers/media/tuners/xc5000.h b/drivers/media/tuners/xc5000.h
index 7245cae..6aa534f 100644
--- a/drivers/media/tuners/xc5000.h
+++ b/drivers/media/tuners/xc5000.h
@@ -36,6 +36,7 @@ struct xc5000_config {
u32  if_khz;
u8   radio_input;
u16  xtal_khz;
+   u16  output_amp;
 
int chip_id;
 };
diff --git a/drivers/media/usb/au0828/au0828-dvb.c 
b/drivers/media/usb/au0828/au0828-dvb.c
index 00ab156..c267d76 100644
--- a/drivers/media/usb/au0828/au0828-dvb.c
+++ b/drivers/media/usb/au0828/au0828-dvb.c
@@ -88,12 +88,14 @@ static struct xc5000_config hauppauge_xc5000a_config = {
.i2c_address  = 0x61,
.if_khz   = 6000,
.chip_id  = XC5000A,
+   .output_amp   = 0x8f,
 };
 
 static struct xc5000_config hauppauge_xc5000c_config = {
.i2c_address  = 0x61,
.if_khz   = 6000,
.chip_id  = XC5000C,
+   .output_amp   = 0x8f,
 };
 
 static struct mxl5007t_config mxl5007t_hvr950q_config = {
-- 
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 1/3] xc5000: tuner firmware update

2014-10-25 Thread Michael Krufky
From: Richard Vollkommer li...@hauppauge.com

- Update the xc5000 tuner firmware to version 1.6.821

- Update the xc5000c tuner firmware to version 4.1.33

Firmware files can be downloaded from:

- http://hauppauge.lightpath.net/software/hvr950q/xc5000c-4.1.33.zip
- http://hauppauge.lightpath.net/software/hvr950q/xc5000-1.6.821.zip

Signed-off-by: Richard Vollkommer li...@hauppauge.com
Cc: Devin Heitmueller dheitmuel...@kernellabs.com
Signed-off-by: Michael Ira Krufky mkru...@linuxtv.org
---
 drivers/media/tuners/xc5000.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index e44c8ab..fafff4c 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -222,15 +222,15 @@ struct xc5000_fw_cfg {
u8 fw_checksum_supported;
 };
 
-#define XC5000A_FIRMWARE dvb-fe-xc5000-1.6.114.fw
-static const struct xc5000_fw_cfg xc5000a_1_6_114 = {
+#define XC5000A_FIRMWARE dvb-fe-xc5000-1.6.821.fw
+static const struct xc5000_fw_cfg xc5000a_fw_cfg = {
.name = XC5000A_FIRMWARE,
.size = 12401,
-   .pll_reg = 0x806c,
+   .pll_reg = 0x8067,
 };
 
-#define XC5000C_FIRMWARE dvb-fe-xc5000c-4.1.30.7.fw
-static const struct xc5000_fw_cfg xc5000c_41_024_5 = {
+#define XC5000C_FIRMWARE dvb-fe-xc5000c-4.1.33.fw
+static const struct xc5000_fw_cfg xc5000c_fw_cfg = {
.name = XC5000C_FIRMWARE,
.size = 16497,
.pll_reg = 0x13,
@@ -243,9 +243,9 @@ static inline const struct xc5000_fw_cfg 
*xc5000_assign_firmware(int chip_id)
switch (chip_id) {
default:
case XC5000A:
-   return xc5000a_1_6_114;
+   return xc5000a_fw_cfg;
case XC5000C:
-   return xc5000c_41_024_5;
+   return xc5000c_fw_cfg;
}
 }
 
-- 
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


[GIT PULL] DVB / tuner fixes: git://linuxtv.org/mkrufky/dvb fixes

2014-04-06 Thread Michael Krufky
The following changes since commit
a83b93a7480441a47856dc9104bea970e84cda87:

  [media] em28xx-dvb: fix PCTV 461e tuner I2C binding (2014-03-31
  08:02:16 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb fixes

for you to fetch changes up to 45a55dc31e497027b99c8278bcc778a4aff76a2f:

  lgdt3305: include sleep functionality in lgdt3304_ops (2014-04-06
  15:06:52 -0400)


Benjamin Larsson (1):
  r820t: fix size and init values

Malcolm Priestley (1):
  m88rs2000: fix sparse static warnings

Paul Bolle (1):
  drx-j: use customise option correctly

Shuah Khan (1):
  lgdt3305: include sleep functionality in lgdt3304_ops

 drivers/media/dvb-frontends/drx39xyj/Kconfig | 2 +-
 drivers/media/dvb-frontends/lgdt3305.c   | 1 +
 drivers/media/dvb-frontends/m88rs2000.c  | 8 
 drivers/media/tuners/r820t.c | 3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)
--
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


[GIT PULL] feb27 - git://linuxtv.org/mkrufky/dvb dvb

2014-02-27 Thread Michael Krufky
I added two patches to this branch - This request supersedes yesterday's
pull request.

The following changes since commit
efab6b6a6ea9364ececb955f69a9d3ffc6b782a1:

  [media] vivi: queue_setup improvements (2014-02-24 10:59:15 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb dvb

for you to fetch changes up to 121be88a350f841083c9a84aab5ca06dea49736d:

  au0828: rework GPIO management for HVR-950q. (2014-02-27 21:19:18
  -0500)


Alexander Shiyan (1):
  stb6100: fix buffer length check in stb6100_write_reg_range()

Dan Carpenter (1):
  stv0900: remove an unneeded check

Devin Heitmueller (1):
  au0828: rework GPIO management for HVR-950q.

Heinrich Schuchardt (1):
  ds3000: fix reading array out of bound in ds3000_read_snr

Malcolm Priestley (2):
  m88rs2000: add caps FE_CAN_INVERSION_AUTO
  m88rs2000: prevent frontend crash on continuous transponder scans

 drivers/media/dvb-frontends/ds3000.c |  2 +-
 drivers/media/dvb-frontends/m88rs2000.c  | 19 ++-
 drivers/media/dvb-frontends/stb6100.c|  2 +-
 drivers/media/dvb-frontends/stv0900_sw.c |  2 +-
 drivers/media/usb/au0828/au0828-cards.c  | 21 ++---
 5 files changed, 35 insertions(+), 11 deletions(-)
--
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


[GIT PULL] git://linuxtv.org/mkrufky/dvb dvb

2014-02-25 Thread Michael Krufky
The following changes since commit
efab6b6a6ea9364ececb955f69a9d3ffc6b782a1:

  [media] vivi: queue_setup improvements (2014-02-24 10:59:15 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb dvb

for you to fetch changes up to e9abfeefb9d35229669f4d899832070ee623058e:

  stb6100: fix buffer length check in stb6100_write_reg_range()
  (2014-02-25 21:41:14 -0500)


Alexander Shiyan (1):
  stb6100: fix buffer length check in stb6100_write_reg_range()

Dan Carpenter (1):
  stv0900: remove an unneeded check

Malcolm Priestley (2):
  m88rs2000: add caps FE_CAN_INVERSION_AUTO
  m88rs2000: prevent frontend crash on continuous transponder scans

 drivers/media/dvb-frontends/m88rs2000.c  | 19 ++-
 drivers/media/dvb-frontends/stb6100.c|  2 +-
 drivers/media/dvb-frontends/stv0900_sw.c |  2 +-
 3 files changed, 20 insertions(+), 3 deletions(-)
--
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] update Michael Krufky's email address

2014-01-29 Thread Michael Krufky
I am no longer available at the kernellabs.com or m1k.net email
addresses.  Update each instance of my email to my linuxtv.org
account.

Signed-off-by: Michael Krufky mkru...@linuxtv.org

diff --git a/Documentation/dvb/contributors.txt
b/Documentation/dvb/contributors.txt index 47c3009..731a009 100644
--- a/Documentation/dvb/contributors.txt
+++ b/Documentation/dvb/contributors.txt
@@ -78,7 +78,7 @@ Peter Beutner p.beut...@gmx.net
 Wilson Michaels wilsonmicha...@earthlink.net
   for the lgdt330x frontend driver, and various bugfixes
 
-Michael Krufky mkru...@m1k.net
+Michael Krufky mkru...@linuxtv.org
   for maintaining v4l/dvb inter-tree dependencies
 
 Taylor Jacob rtja...@earthlink.net
diff --git a/drivers/media/dvb-frontends/nxt200x.c
b/drivers/media/dvb-frontends/nxt200x.c index fbca985..67bdb5b 100644
--- a/drivers/media/dvb-frontends/nxt200x.c
+++ b/drivers/media/dvb-frontends/nxt200x.c
@@ -2,7 +2,7 @@
  *Support for NXT2002 and NXT2004 - VSB/QAM
  *
  *Copyright (C) 2005 Kirk Lapray kirk.lap...@gmail.com
- *Copyright (C) 2006 Michael Krufky mkru...@m1k.net
+ *Copyright (C) 2006-2014 Michael Krufky mkru...@linuxtv.org
  *based on nxt2002 by Taylor Jacob rtja...@earthlink.net
  *and nxt2004 by Jean-Francois Thibert jeanfranc...@sagetv.com
  *
diff --git a/drivers/media/pci/bt8xx/bttv-cards.c
b/drivers/media/pci/bt8xx/bttv-cards.c index d85cb0a..6662b49 100644
--- a/drivers/media/pci/bt8xx/bttv-cards.c
+++ b/drivers/media/pci/bt8xx/bttv-cards.c
@@ -2426,7 +2426,7 @@ struct tvcard bttv_tvcards[] = {
},
/*  card 0x87-- */
[BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
-   /* Michael Krufky mkru...@m1k.net */
+   /* Michael Krufky mkru...@linuxtv.org */
.name   = DViCO FusionHDTV 5 Lite,
.tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
.tuner_addr = ADDR_UNSET,
diff --git a/drivers/media/pci/saa7134/saa7134-cards.c
b/drivers/media/pci/saa7134/saa7134-cards.c index d45e7f6..c9b2350
100644 --- a/drivers/media/pci/saa7134/saa7134-cards.c
+++ b/drivers/media/pci/saa7134/saa7134-cards.c
@@ -2590,7 +2590,7 @@ struct saa7134_board saa7134_boards[] = {
}},
},
[SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180] = {
-   /* Michael Krufky mkru...@m1k.net
+   /* Michael Krufky mkru...@linuxtv.org
 * Uses Alps Electric TDHU2, containing NXT2004 ATSC
Decoder
 * AFAIK, there is no analog demod, thus,
 * no support for analog television.
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c index d83df4b..0a98d04
100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
@@ -1,7 +1,7 @@
 /*
  *  mxl111sf-demod.c - driver for the MaxLinear MXL111SF DVB-T
demodulator *
- *  Copyright (C) 2010 Michael Krufky mkru...@kernellabs.com
+ *  Copyright (C) 2010-2014 Michael Krufky mkru...@linuxtv.org
  *
  *  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 @@ -601,7 +601,7 @@ struct dvb_frontend
*mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
EXPORT_SYMBOL_GPL(mxl111sf_demod_attach); 
 MODULE_DESCRIPTION(MaxLinear MxL111SF DVB-T demodulator driver);
-MODULE_AUTHOR(Michael Krufky mkru...@kernellabs.com);
+MODULE_AUTHOR(Michael Krufky mkru...@linuxtv.org);
 MODULE_LICENSE(GPL);
 MODULE_VERSION(0.1);
 
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h index 3f3f8bf..2d4530f
100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
@@ -1,7 +1,7 @@
 /*
  *  mxl111sf-demod.h - driver for the MaxLinear MXL111SF DVB-T
demodulator *
- *  Copyright (C) 2010 Michael Krufky mkru...@kernellabs.com
+ *  Copyright (C) 2010-2014 Michael Krufky mkru...@linuxtv.org
  *
  *  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 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c
b/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c index e4121cb..a619410
100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c
@@ -1,7 +1,7 @@
 /*
  *  mxl111sf-gpio.c - driver for the MaxLinear MXL111SF
  *
- *  Copyright (C) 2010 Michael Krufky mkru...@kernellabs.com
+ *  Copyright (C) 2010-2014 Michael Krufky mkru...@linuxtv.org
  *
  *  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 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h
b/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h index 0220f54..b85a577
100644 --- a/drivers/media/usb/dvb-usb-v2

Re: [PATCH] update Michael Krufky's email address

2014-01-29 Thread Michael Krufky
Mauro,

On Wed, Jan 29, 2014 at 8:57 PM, Michael Krufky mkru...@linuxtv.org wrote:
[snip]


My mailer seems to have mangled my patch. :-/ Please just pull my
email address update patch from my tree:

The following changes since commit 0e47c969c65e213421450c31043353ebe3c67e0c:

  Merge tag 'for-linus-20140127' of git://git.infradead.org/linux-mtd
(2014-01-28 18:56:37 -0800)

are available in the git repository at:


  git://linuxtv.org/mkrufky/dvb krufky

for you to fetch changes up to cb0ceb4bc7a297246dd26e55c3fb7a5fc42561f6:

  update Michael Krufky's email address (2014-01-29 21:10:11 -0500)


Michael Krufky (1):
  update Michael Krufky's email address

 Documentation/dvb/contributors.txt| 2 +-
 drivers/media/dvb-frontends/nxt200x.c | 2 +-
 drivers/media/pci/bt8xx/bttv-cards.c  | 2 +-
 drivers/media/pci/saa7134/saa7134-cards.c | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c | 4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c  | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h  | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.h   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-phy.c   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-phy.h   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-reg.h   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c | 4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf.c   | 4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf.h   | 2 +-
 17 files changed, 20 insertions(+), 20 deletions(-)

Cheers,

Mike
--
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


[GIT PULL] update Michael Krufky's email address

2014-01-29 Thread Michael Krufky
Mauro,

My mailer seems to have mangled my patch. :-/ Please just pull my email
address update patch from my tree.

I am no longer available at the kernellabs.com or m1k.net email
addresses.  Update each instance of my email to my linuxtv.org account.

The following changes since commit
0e47c969c65e213421450c31043353ebe3c67e0c:

  Merge tag 'for-linus-20140127' of git://git.infradead.org/linux-mtd
  (2014-01-28 18:56:37 -0800)

are available in the git repository at:


  git://linuxtv.org/mkrufky/dvb krufky

for you to fetch changes up to cb0ceb4bc7a297246dd26e55c3fb7a5fc42561f6:

  update Michael Krufky's email address (2014-01-29 21:10:11 -0500)


Michael Krufky (1):
  update Michael Krufky's email address

 Documentation/dvb/contributors.txt| 2 +-
 drivers/media/dvb-frontends/nxt200x.c | 2 +-
 drivers/media/pci/bt8xx/bttv-cards.c  | 2 +-
 drivers/media/pci/saa7134/saa7134-cards.c | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c | 4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c  | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h  | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.h   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-phy.c   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-phy.h   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-reg.h   | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c | 4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h | 2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf.c   | 4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf.h   | 2 +-
 17 files changed, 20 insertions(+), 20 deletions(-)
--
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


[GIT PULL] cx24117 mxl111sf fixes

2014-01-29 Thread Michael Krufky
The following changes since commit
587d1b06e07b4a079453c74ba9edf17d21931049:

  [media] rc-core: reuse device numbers (2014-01-15 11:46:37 -0200)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb dvb

for you to fetch changes up to 07f717f6ace478c462ecd65ddad5b7912a082044:

  mxl111sf: Fix compile when CONFIG_DVB_USB_MXL111SF is unset
  (2014-01-29 22:17:09 -0500)


Andi Shyti (2):
  cx24117: remove dead code in always 'false' if statement
  cx24117: use a valid dev pointer for dev_err printout

Dave Jones (2):
  mxl111sf: Fix unintentional garbage stack read
  mxl111sf: Fix compile when CONFIG_DVB_USB_MXL111SF is unset

 drivers/media/dvb-frontends/cx24117.c | 10 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h |  2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf.c   |  2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)
--
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] e4000: convert DVB tuner to I2C driver model

2014-01-27 Thread Michael Krufky
On Sun, Jan 26, 2014 at 7:39 PM, Antti Palosaari cr...@iki.fi wrote:
 On 27.01.2014 02:28, Devin Heitmueller wrote:

 On Sun, Jan 26, 2014 at 7:16 PM, Antti Palosaari cr...@iki.fi wrote:

 Driver conversion from proprietary DVB tuner model to more
 general I2C driver model.


 Mike should definitely weigh in on this.  Eliminating the existing
 model of using dvb_attach() for tuners is something that needs to be
 considered carefully, and this course of action should be agreed on by
 the subsystem maintainers before we start converting drivers.  This
 could be particularly relevant for hybrid tuners where the driver
 instance is instantiated via tuner-core using dvb_attach() for the
 analog side.

 In the meantime, this change makes this driver work differently than
 every other tuner in the tree.


 Heh, it is quite stupid to do things otherwise than rest of the kernel and
 also I think it is against i2c documentation. For more we refuse to use
 kernel standard practices the more there will be problems in a long ran.

 There is things that are build top of these standard models and if you are
 using some proprietary method, then you are without these services. I think
 it was regmap which I was looking once, but dropped it as it requires i2c
 client.

 Also, I already implemented one tuner driver using standard I2C model. If
 there will be problems then those are surely fixable.

 regards
 Antti

Devin is right-  I should have been cc'd on this.  Please remember to
cc me on any DVB or tuner (both analog and digital) subsystem-level
changes.

What Devin probably doesn't realize, however, is that I have basically
already agreed on this change -- this, overall, will be a very
positive move for the media subsystem.  We just need to do it
correctly, subsystem-wide.

But just because this is a good idea, its no reason to call the
current mechanism 'quite stupid' .. We're all working together here,
let's not belittle the work that others have done in the past.  I'd
rather just look forward and build a better codebase for the future
:-)

Antti submitted similar patches a few months ago - I have to review
his newer series and see if anything has changed.  My goal would be to
commit these patches into a new branch and work on converting the
entire tuner tree to the newer method, only merging to master once all
is done and tested.

-Mike
--
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: [GIT PULL] git://linuxtv.org/mkrufky/dvb cx24117

2013-12-08 Thread Michael Krufky
Mauro,

What is the status of this pull request?  Patchwork says changes
requested but I have no record of any changes requested

https://patchwork.linuxtv.org/patch/20728/

Thanks,

Mike

On Wed, Nov 13, 2013 at 6:01 PM, Michael Krufky mkru...@linuxtv.org wrote:
 The following changes since commit
 80f93c7b0f4599ffbdac8d964ecd1162b8b618b9:

   [media] media: st-rc: Add ST remote control driver (2013-10-31
   08:20:08 -0200)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/dvb cx24117

 for you to fetch changes up to 1c468cec3701eb6e26c4911f8a9e8e35cbdebc01:

   cx24117: Fix LNB set_voltage function (2013-11-13 13:06:44 -0500)

 
 Luis Alves (2):
   cx24117: Add complete demod command list
   cx24117: Fix LNB set_voltage function

  drivers/media/dvb-frontends/cx24117.c | 121
  -- 1 file changed, 71 insertions(+),
  50 deletions(-)
--
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


[GIT PULL] git://linuxtv.org/mkrufky/dvb cx24117

2013-11-13 Thread Michael Krufky
The following changes since commit
80f93c7b0f4599ffbdac8d964ecd1162b8b618b9:

  [media] media: st-rc: Add ST remote control driver (2013-10-31
  08:20:08 -0200)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb cx24117

for you to fetch changes up to 1c468cec3701eb6e26c4911f8a9e8e35cbdebc01:

  cx24117: Fix LNB set_voltage function (2013-11-13 13:06:44 -0500)


Luis Alves (2):
  cx24117: Add complete demod command list
  cx24117: Fix LNB set_voltage function

 drivers/media/dvb-frontends/cx24117.c | 121
 -- 1 file changed, 71 insertions(+),
 50 deletions(-)
--
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


[GIT PULL] git://linuxtv.org/mkrufky/dvb fixes

2013-11-09 Thread Michael Krufky
The following changes since commit
80f93c7b0f4599ffbdac8d964ecd1162b8b618b9:

  [media] media: st-rc: Add ST remote control driver (2013-10-31
  08:20:08 -0200)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb fixes

for you to fetch changes up to 714fd7f9e8465eda25cce038c642d75a1d84106d:

  cxd2820r_c: fix if_ctl calculation (2013-11-09 16:45:57 -0500)


Alexey Khoroshilov (1):
  dvb_demux: fix deadlock in dmx_section_feed_release_filter()

Evgeny Plehov (1):
  cxd2820r_c: fix if_ctl calculation

Felipe Pena (1):
  technisat-usb2: fix typo in variable name

Michael Krufky (1):
  dvb_demux: clean up whitespace in comments from previous patch
(trivial)

 drivers/media/dvb-core/dvb_demux.c | 7 ++-
 drivers/media/dvb-frontends/cxd2820r_c.c   | 2 +-
 drivers/media/usb/dvb-usb/technisat-usb2.c | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)
--
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] Full DVB driver package for Earthsoft PT3 (ISDB-S/T) cards

2013-11-06 Thread Michael Krufky
On Tue, Nov 5, 2013 at 5:30 PM, ほち knightri...@are.ma wrote:
 Michael Krufky mkrufky at linuxtv.org writes:

 As the DVB maintainer, I am telling you that I won't merge this as a
 monolithic driver.  The standard is to separate the driver into
 modules where possible, unless there is a valid reason for doing
 otherwise.

 I understand that you used the PT1 driver as a reference, but we're
 trying to enforce a standard of codingstyle within the kernel.  I
 recommend looking at the other DVB drivers as well.

 OK Sir. Any good / latest examples?

There are plenty of DVB drivers to look at under drivers/media/  ...
you may notice that there are v4l and dvb device drivers together
under this hierarchy.  It's easy to tell which drivers support DVB
when you look at the source.

I could name a few specific ones, but i'd really recommend for you to
take a look at a bunch of them.  No single driver should be considered
a 'prefect example' as they are all under constant maintenance.

Also, many of these drivers are for devices that support both v4l and
DVB interfaces.  One example is the cx23885 driver.  Still, please try
to look over the entire media tree, as that would give a better idea
of how the drivers are structured.

Best regards,

Mike Krufky
--
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] Full DVB driver package for Earthsoft PT3 (ISDB-S/T) cards

2013-11-05 Thread Michael Krufky
On Tue, Nov 5, 2013 at 3:56 PM, ほち knightri...@are.ma wrote:
 see inline

 2013/11/6 Michael Krufky mkru...@linuxtv.org:
 responding inline:

 Mauro Carvalho Chehab asked to put tuner code as an I2C driver, under 
 drivers/media/tuners, frontends at drivers/media/dvb-
 However, to keep package integrity  compatibility with PT1/PT2 user apps, 
 FE etc. are still placed in the same directory.

 A userspace application doesn't care  where file are places within the
 kernel tree.  You are to use standard linux-dvb api's and the
 codingstyle of the driver shall comply with that of the linux kernel's
 DVB subsystem, including the proper placement of files.

 As stated in my (previous) mails, I took PT1 module as a reference.
 Everything is located in single directory ...pt1/, including the frontends.
 They are built as a single integrated module, earth-pt1.ko

 Sure I can split the FEs out to .../dvb-frontends/, build there as a separated
 (FE only) module that would be hot-linked with the main module. However
 I'm afraid ( sure) this will only make people confused with complex
 dependencies leading to annoying bugs... The simpler the better...

 Guys I need more opinions from other people before splitting the module.
 IMHO even Linus won't like this...


As the DVB maintainer, I am telling you that I won't merge this as a
monolithic driver.  The standard is to separate the driver into
modules where possible, unless there is a valid reason for doing
otherwise.

I understand that you used the PT1 driver as a reference, but we're
trying to enforce a standard of codingstyle within the kernel.  I
recommend looking at the other DVB drivers as well.

 diff --git a/drivers/media/pci/pt3_dvb/Kconfig 
 b/drivers/media/pci/pt3_dvb/Kconfig
 new file mode 100644
 index 000..f9ba00d
 --- /dev/null
 +++ b/drivers/media/pci/pt3_dvb/Kconfig
 @@ -0,0 +1,12 @@
 +config PT3_DVB
 +   tristate Earthsoft PT3 cards
 +   depends on DVB_CORE  PCI
 +   help
 + Support for Earthsoft PT3 PCI-Express cards.
 +
 + Since these cards have no MPEG decoder onboard, they transmit
 + only compressed MPEG data over the PCI bus, so you need
 + an external software decoder to watch TV on your computer.
 +
 + Say Y or M if you own such a device and want to use it.

 Very few of these digital tuner boards have onboard mpeg decoders.  We
 can do without this extra information here.

 ok, will change to:
 These cards transmit only compressed MPEG data over the PCI bus.
 You need external software decoder to watch TV on your computer.

This is superfluous information.  Please look at the Kconfig
description for the many other DVB drivers supported in the kernel.
There are very few that contain their own hardware decoders, and
almosy all of them require a software decoder for playback on a PC.
Please shorten it to something more along the lines of:

Support for Earthsoft PT3 PCI-Express cards.

Say Y or M to enable support for this device.


 diff --git a/drivers/media/pci/pt3_dvb/Makefile 
 b/drivers/media/pci/pt3_dvb/Makefile
 new file mode 100644
 index 000..7087c90
 --- /dev/null
 +++ b/drivers/media/pci/pt3_dvb/Makefile
 @@ -0,0 +1,6 @@
 +pt3_dvb-objs := pt3.o pt3_fe.o pt3_dma.o pt3_tc.o pt3_i2c.o pt3_bus.o
 +
 +obj-$(CONFIG_PT3_DVB) += pt3_dvb.o
 +
 +ccflags-y += -Idrivers/media/dvb-core -Idrivers/media/dvb-frontends 
 -Idrivers/media/tuners
 +

 Ususally, the driver would be named 'pt3.ko' and the object file that
 handles the DVB api would be called pt3_dvb.o

 This isn't any rule, but the way that you've named them seems a bit
 awkward to me.  I don't require that you change this, just stating my
 awkward feeling on the matter.

 FYI, there is another version of PT3 driver, named pt3_drv.ko, that
 utilize character devices as the I/O. I'd rather use pt3_dvb.ko to
 distinguish.


we're not interested in multiple drivers for the same hardware.  Only
one will be merged into the kernel, if any at all, and users need not
think about the names of these drivers.  One of the beauties of
merging a driver into the kernel is that users gain automatic support
for the hardware without having to think or care about the name of the
driver.

 Maybe I'd like to change the dirname:
 drivers/media/pci/pt3_dvb = drivers/media/pci/pt3

not a bad idea ;-)


 +static int lnb = 2;/* used if not set by frontend / the value is 
 invalid */
 +module_param(lnb, int, 0);
 +MODULE_PARM_DESC(lnb, LNB level (0:OFF 1:+11V 2:+15V));

 Take these above three statements out of the header file and move them
 into a .c file

 OK Sir

 +struct dvb_frontend *pt3_fe_s_attach(struct pt3_adapter *adap);
 +struct dvb_frontend *pt3_fe_t_attach(struct pt3_adapter *adap);

 Please create separate headers corresponding to the .c file that
 contains the function.  Don't put them all in one, as the tuner and
 demodulator should be separate modules

 Splitting the protos? Well I will consider...

No need to consider it for very long

Re: [PATCHv2 28/29] mxl111sf: Don't use dynamic static allocation

2013-11-04 Thread Michael Krufky
On Mon, Nov 4, 2013 at 5:58 AM, Mauro Carvalho Chehab
m.che...@samsung.com wrote:
 Em Sun, 3 Nov 2013 19:50:02 -0500
 Michael Krufky mkru...@kernellabs.com escreveu:

 On Sat, Nov 2, 2013 at 9:31 AM, Mauro Carvalho Chehab
 m.che...@samsung.com wrote:
  Dynamic static allocation is evil, as Kernel stack is too low, and
  compilation complains about it on some archs:
 
  drivers/media/usb/dvb-usb-v2/mxl111sf.c:74:1: warning: 
  'mxl111sf_ctrl_msg' uses dynamic stack allocation [enabled by default]
 
  Instead, let's enforce a limit for the buffer to be the max size of
  a control URB payload data (80 bytes).
 
  Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
  Cc: Michael Krufky mkru...@kernellabs.com
  ---
   drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 ++-
   1 file changed, 6 insertions(+), 1 deletion(-)
 
  diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c 
  b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
  index e97964ef7f56..6538fd54c84e 100644
  --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
  +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
  @@ -57,7 +57,12 @@ int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
   {
  int wo = (rbuf == NULL || rlen == 0); /* write-only */
  int ret;
  -   u8 sndbuf[1+wlen];
  +   u8 sndbuf[80];
  +
  +   if (1 + wlen  sizeof(sndbuf)) {
  +   pr_warn(%s: len=%d is too big!\n, __func__, wlen);
  +   return -EREMOTEIO;
  +   }
 
  pr_debug(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen);
 
  --
  1.8.3.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

 I don't really love this, but I see your point. You're right - this
 needs to be fixed.

 AFAIK, the largest transfer the driver ever does is 61 bytes, but I'd
 have to double check to be sure...

 Is there a #define'd macro that we could place there instead of the
 hardcoded '80' ?  I really don't like the number '80' there,
 *especially* not without a comment explaining it.  Is 80 even the
 maximum size of control urb payload data?  Are you sure it isn't 64?

 http://wiki.osdev.org/Universal_Serial_Bus#Maximum_Data_Payload_Size

 ...as per the article above, we should be able to read the actual
 maximum size from the USB endpoint itself, but then again, that would
 leave us with another dynamic static allocation.

 There's one driver using 80 bytes for payload (tm6000). Anyway,
 I double-checked at USB 2.0 specification: the max size for
 control endpoints is 64 bytes for full-speed devices:

 All Host Controllers are required to have support for 8-, 16-, 32-, 
 and 64-byte maximum data payload sizes
  for full-speed control endpoints, only 8-byte maximum data payload 
 sizes for low-speed control endpoints,
  and only 64-byte maximum data payload size for high-speed control 
 endpoints. No Host Controller is
  required to support larger or smaller maximum data payload sizes.

 Source: USB revision 2.0 - chapter 5.5.3 Control Transfer Packet Size 
 Constraints
 http://www.usb.org/developers/docs/usb_20_070113.zip

 So, except for devices that violates that, the worse case scenario is
 64 bytes.

 It should be noticed that the I2C bus could use a different limit,
 so, on PCI devices, in theory, it would be possible to use a larger
 window.

 Yet, I doubt that any sane tuner/frontend design would require a
 packet size bigger than the max size supported by the USB bus, as
 that would limit their usage. Also, most (if not all) of those
 tuners/frontends were added due to USB devices, anyway.


 How about if we kzalloc the buffer instead?  (maybe not - that isn't
 very efficient either)

 Seems an overkill to me to create/delete a buffer for every single I2C
 transfer. Of course, a latter patch could optimize the buffer size to
 match what's supported by the hardware, or to use a pre-allocated buffer,
 but this is out of my scope: all I want is to get rid of dynamically
 allocated buffers. I don't intend to read all those datasheets and
 optimize each of those drivers, especially since I may not have the
 hardware here for testing.

 If it has to be a static allocation (and it probably should be),
 please #define the size rather than sticking in the number 80.

 Ok.

 This feedback applies to your entire Don't use dynamic static
 allocation patch series.  Please don't merge those without at least
 #define'ing the size value and adding an appropriate inline comment to
 explain why the maximum is defined as such.

 Well, a comment is provided already at the commit message. I don't
 see any need to overbloat the code with a comment like that. In any
 case, if I were to add a comment, it would be something like:
 I guess x bytes would be enough

 As only doing a deep code inspection and reading the datasheets, we'll
 know for sure

Re: [PATCHv2 28/29] mxl111sf: Don't use dynamic static allocation

2013-11-03 Thread Michael Krufky
On Sat, Nov 2, 2013 at 9:31 AM, Mauro Carvalho Chehab
m.che...@samsung.com wrote:
 Dynamic static allocation is evil, as Kernel stack is too low, and
 compilation complains about it on some archs:

 drivers/media/usb/dvb-usb-v2/mxl111sf.c:74:1: warning: 
 'mxl111sf_ctrl_msg' uses dynamic stack allocation [enabled by default]

 Instead, let's enforce a limit for the buffer to be the max size of
 a control URB payload data (80 bytes).

 Signed-off-by: Mauro Carvalho Chehab m.che...@samsung.com
 Cc: Michael Krufky mkru...@kernellabs.com
 ---
  drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c 
 b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
 index e97964ef7f56..6538fd54c84e 100644
 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
 +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
 @@ -57,7 +57,12 @@ int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
  {
 int wo = (rbuf == NULL || rlen == 0); /* write-only */
 int ret;
 -   u8 sndbuf[1+wlen];
 +   u8 sndbuf[80];
 +
 +   if (1 + wlen  sizeof(sndbuf)) {
 +   pr_warn(%s: len=%d is too big!\n, __func__, wlen);
 +   return -EREMOTEIO;
 +   }

 pr_debug(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen);

 --
 1.8.3.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

I don't really love this, but I see your point. You're right - this
needs to be fixed.

AFAIK, the largest transfer the driver ever does is 61 bytes, but I'd
have to double check to be sure...

Is there a #define'd macro that we could place there instead of the
hardcoded '80' ?  I really don't like the number '80' there,
*especially* not without a comment explaining it.  Is 80 even the
maximum size of control urb payload data?  Are you sure it isn't 64?

http://wiki.osdev.org/Universal_Serial_Bus#Maximum_Data_Payload_Size

...as per the article above, we should be able to read the actual
maximum size from the USB endpoint itself, but then again, that would
leave us with another dynamic static allocation.

How about if we kzalloc the buffer instead?  (maybe not - that isn't
very efficient either)

If it has to be a static allocation (and it probably should be),
please #define the size rather than sticking in the number 80.

This feedback applies to your entire Don't use dynamic static
allocation patch series.  Please don't merge those without at least
#define'ing the size value and adding an appropriate inline comment to
explain why the maximum is defined as such.

Cheers,

Mike
--
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 REVIEW] e4000: convert DVB tuner to I2C driver model

2013-10-16 Thread Michael Krufky
This kinda makes me a bit nervous.  The patch itself looks OK but the
cascading effects that it will have across the DVB subsystem need to
be discussed.

Is there a discussion about this kind of conversion on the mailing
list somewhere that I've missed?

-Mike

On Tue, Oct 15, 2013 at 7:33 PM, Mauro Carvalho Chehab
m.che...@samsung.com wrote:
 Em Wed, 16 Oct 2013 01:31:04 +0300
 Antti Palosaari cr...@iki.fi escreveu:

 Initial driver conversion from proprietary DVB tuner model to more
 general I2C driver model.

 That commit has just basic binding stuff and driver itself still
 needs to be converted more complete later.

 Cc: Jean Delvare kh...@linux-fr.org
 Signed-off-by: Antti Palosaari cr...@iki.fi
 ---
  drivers/media/tuners/e4000.c| 73 
 ++---
  drivers/media/tuners/e4000.h|  9 +++-
  drivers/media/tuners/e4000_priv.h   |  4 +-
  drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 31 +-
  4 files changed, 78 insertions(+), 39 deletions(-)

 diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c
 index 54e2d8a..f6a5dbd 100644
 --- a/drivers/media/tuners/e4000.c
 +++ b/drivers/media/tuners/e4000.c
 @@ -27,7 +27,7 @@ static int e4000_wr_regs(struct e4000_priv *priv, u8 reg, 
 u8 *val, int len)
   u8 buf[1 + len];
   struct i2c_msg msg[1] = {
   {
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
   .flags = 0,
   .len = sizeof(buf),
   .buf = buf,
 @@ -56,12 +56,12 @@ static int e4000_rd_regs(struct e4000_priv *priv, u8 
 reg, u8 *val, int len)
   u8 buf[len];
   struct i2c_msg msg[2] = {
   {
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
   .flags = 0,
   .len = 1,
   .buf = reg,
   }, {
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
   .flags = I2C_M_RD,
   .len = sizeof(buf),
   .buf = buf,
 @@ -233,8 +233,8 @@ static int e4000_set_params(struct dvb_frontend *fe)
* or more.
*/
   f_vco = c-frequency * e4000_pll_lut[i].mul;
 - sigma_delta = div_u64(0x1ULL * (f_vco % priv-cfg-clock), 
 priv-cfg-clock);
 - buf[0] = f_vco / priv-cfg-clock;
 + sigma_delta = div_u64(0x1ULL * (f_vco % priv-clock), priv-clock);
 + buf[0] = f_vco / priv-clock;
   buf[1] = (sigma_delta  0)  0xff;
   buf[2] = (sigma_delta  8)  0xff;
   buf[3] = 0x00;
 @@ -358,17 +358,6 @@ static int e4000_get_if_frequency(struct dvb_frontend 
 *fe, u32 *frequency)
   return 0;
  }

 -static int e4000_release(struct dvb_frontend *fe)
 -{
 - struct e4000_priv *priv = fe-tuner_priv;
 -
 - dev_dbg(priv-i2c-dev, %s:\n, __func__);
 -
 - kfree(fe-tuner_priv);
 -
 - return 0;
 -}
 -
  static const struct dvb_tuner_ops e4000_tuner_ops = {
   .info = {
   .name   = Elonics E4000,
 @@ -376,8 +365,6 @@ static const struct dvb_tuner_ops e4000_tuner_ops = {
   .frequency_max  = 86200,
   },

 - .release = e4000_release,
 -
   .init = e4000_init,
   .sleep = e4000_sleep,
   .set_params = e4000_set_params,
 @@ -385,9 +372,12 @@ static const struct dvb_tuner_ops e4000_tuner_ops = {
   .get_if_frequency = e4000_get_if_frequency,
  };

 -struct dvb_frontend *e4000_attach(struct dvb_frontend *fe,
 - struct i2c_adapter *i2c, const struct e4000_config *cfg)
 +static int e4000_probe(struct i2c_client *client,
 + const struct i2c_device_id *id)
  {
 + struct e4000_config *cfg = client-dev.platform_data;
 + struct dvb_frontend *fe = cfg-fe;
 + struct i2c_adapter *i2c = client-adapter;
   struct e4000_priv *priv;
   int ret;
   u8 chip_id;
 @@ -402,7 +392,9 @@ struct dvb_frontend *e4000_attach(struct dvb_frontend 
 *fe,
   goto err;
   }

 - priv-cfg = cfg;
 + priv-i2c_addr = cfg-i2c_addr;
 + priv-clock = cfg-clock;
 + priv-i2c_client = client;
   priv-i2c = i2c;

   /* check if the tuner is there */
 @@ -412,8 +404,10 @@ struct dvb_frontend *e4000_attach(struct dvb_frontend 
 *fe,

   dev_dbg(priv-i2c-dev, %s: chip_id=%02x\n, __func__, chip_id);

 - if (chip_id != 0x40)
 + if (chip_id != 0x40) {
 + ret = -ENODEV;
   goto err;
 + }

   /* put sleep as chip seems to be in normal mode by default */
   ret = e4000_wr_reg(priv, 0x00, 0x00);
 @@ -431,16 +425,45 @@ struct dvb_frontend *e4000_attach(struct dvb_frontend 
 *fe,
   if (fe-ops.i2c_gate_ctrl)
   fe-ops.i2c_gate_ctrl(fe, 0);

 - return fe;
 + i2c_set_clientdata(client, priv);
 +
 + return 0;
  err:
   if (fe-ops.i2c_gate_ctrl)
   fe-ops.i2c_gate_ctrl(fe, 0);

Re: [PATCH REVIEW] e4000: convert DVB tuner to I2C driver model

2013-10-16 Thread Michael Krufky
On Wed, Oct 16, 2013 at 12:43 PM, Antti Palosaari cr...@iki.fi wrote:
 On 16.10.2013 18:54, Michael Krufky wrote:

 This kinda makes me a bit nervous.  The patch itself looks OK but the
 cascading effects that it will have across the DVB subsystem need to
 be discussed.


 Basically, the only effect is that you must use i2c_new_device() or
 i2c_new_probed_device() instead of old proprietary dvb_attach(). Convert old
 proprietary method with Kernel standard one.

 But thats not all. It was only first step. My final goal is to study, test
 and finally make radio tuners as a own standalone I2C drivers. This means
 that I will remove DVB frontend dependency next from the given tuner driver.
 And before you ask why: I need some more sophisticated access to tuner in
 order to meet SDR needs. Also I don't see any reason why those tuners should
 be a part of DVB API or part of V4L2 API (or even both in case of hybrid
 model). Actual reasons are likely payload from the history, but as of today
 view it is stupid design :]


 Is there a discussion about this kind of conversion on the mailing
 list somewhere that I've missed?


 There has been many times around the years. i2c_new_probed_device() function
 [1] seems to be added for somehow for out needs too...

 [1] http://lists.lm-sensors.org/pipermail/i2c/2007-March/000990.html


 regards
 Antti



 -Mike

 On Tue, Oct 15, 2013 at 7:33 PM, Mauro Carvalho Chehab
 m.che...@samsung.com wrote:

 Em Wed, 16 Oct 2013 01:31:04 +0300
 Antti Palosaari cr...@iki.fi escreveu:

 Initial driver conversion from proprietary DVB tuner model to more
 general I2C driver model.

 That commit has just basic binding stuff and driver itself still
 needs to be converted more complete later.

 Cc: Jean Delvare kh...@linux-fr.org
 Signed-off-by: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/tuners/e4000.c| 73
 ++---
   drivers/media/tuners/e4000.h|  9 +++-
   drivers/media/tuners/e4000_priv.h   |  4 +-
   drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 31 +-
   4 files changed, 78 insertions(+), 39 deletions(-)

 diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c
 index 54e2d8a..f6a5dbd 100644
 --- a/drivers/media/tuners/e4000.c
 +++ b/drivers/media/tuners/e4000.c
 @@ -27,7 +27,7 @@ static int e4000_wr_regs(struct e4000_priv *priv, u8
 reg, u8 *val, int len)
u8 buf[1 + len];
struct i2c_msg msg[1] = {
{
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
.flags = 0,
.len = sizeof(buf),
.buf = buf,
 @@ -56,12 +56,12 @@ static int e4000_rd_regs(struct e4000_priv *priv, u8
 reg, u8 *val, int len)
u8 buf[len];
struct i2c_msg msg[2] = {
{
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
.flags = 0,
.len = 1,
.buf = reg,
}, {
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
.flags = I2C_M_RD,
.len = sizeof(buf),
.buf = buf,
 @@ -233,8 +233,8 @@ static int e4000_set_params(struct dvb_frontend *fe)
 * or more.
 */
f_vco = c-frequency * e4000_pll_lut[i].mul;
 - sigma_delta = div_u64(0x1ULL * (f_vco % priv-cfg-clock),
 priv-cfg-clock);
 - buf[0] = f_vco / priv-cfg-clock;
 + sigma_delta = div_u64(0x1ULL * (f_vco % priv-clock),
 priv-clock);
 + buf[0] = f_vco / priv-clock;
buf[1] = (sigma_delta  0)  0xff;
buf[2] = (sigma_delta  8)  0xff;
buf[3] = 0x00;
 @@ -358,17 +358,6 @@ static int e4000_get_if_frequency(struct
 dvb_frontend *fe, u32 *frequency)
return 0;
   }

 -static int e4000_release(struct dvb_frontend *fe)
 -{
 - struct e4000_priv *priv = fe-tuner_priv;
 -
 - dev_dbg(priv-i2c-dev, %s:\n, __func__);
 -
 - kfree(fe-tuner_priv);
 -
 - return 0;
 -}
 -
   static const struct dvb_tuner_ops e4000_tuner_ops = {
.info = {
.name   = Elonics E4000,
 @@ -376,8 +365,6 @@ static const struct dvb_tuner_ops e4000_tuner_ops =
 {
.frequency_max  = 86200,
},

 - .release = e4000_release,
 -
.init = e4000_init,
.sleep = e4000_sleep,
.set_params = e4000_set_params,
 @@ -385,9 +372,12 @@ static const struct dvb_tuner_ops e4000_tuner_ops =
 {
.get_if_frequency = e4000_get_if_frequency,
   };

 -struct dvb_frontend *e4000_attach(struct dvb_frontend *fe,
 - struct i2c_adapter *i2c, const struct e4000_config *cfg)
 +static int e4000_probe(struct i2c_client *client,
 + const struct i2c_device_id *id)
   {
 + struct e4000_config *cfg = client-dev.platform_data;
 + struct dvb_frontend *fe

Re: [PATCH REVIEW] e4000: convert DVB tuner to I2C driver model

2013-10-16 Thread Michael Krufky
On Wed, Oct 16, 2013 at 1:01 PM, Michael Krufky mkru...@linuxtv.org wrote:
 On Wed, Oct 16, 2013 at 12:43 PM, Antti Palosaari cr...@iki.fi wrote:
 On 16.10.2013 18:54, Michael Krufky wrote:

 This kinda makes me a bit nervous.  The patch itself looks OK but the
 cascading effects that it will have across the DVB subsystem need to
 be discussed.


 Basically, the only effect is that you must use i2c_new_device() or
 i2c_new_probed_device() instead of old proprietary dvb_attach(). Convert old
 proprietary method with Kernel standard one.

 But thats not all. It was only first step. My final goal is to study, test
 and finally make radio tuners as a own standalone I2C drivers. This means
 that I will remove DVB frontend dependency next from the given tuner driver.
 And before you ask why: I need some more sophisticated access to tuner in
 order to meet SDR needs. Also I don't see any reason why those tuners should
 be a part of DVB API or part of V4L2 API (or even both in case of hybrid
 model). Actual reasons are likely payload from the history, but as of today
 view it is stupid design :]


 Is there a discussion about this kind of conversion on the mailing
 list somewhere that I've missed?


 There has been many times around the years. i2c_new_probed_device() function
 [1] seems to be added for somehow for out needs too...

 [1] http://lists.lm-sensors.org/pipermail/i2c/2007-March/000990.html


 regards
 Antti



 -Mike

 On Tue, Oct 15, 2013 at 7:33 PM, Mauro Carvalho Chehab
 m.che...@samsung.com wrote:

 Em Wed, 16 Oct 2013 01:31:04 +0300
 Antti Palosaari cr...@iki.fi escreveu:

 Initial driver conversion from proprietary DVB tuner model to more
 general I2C driver model.

 That commit has just basic binding stuff and driver itself still
 needs to be converted more complete later.

 Cc: Jean Delvare kh...@linux-fr.org
 Signed-off-by: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/tuners/e4000.c| 73
 ++---
   drivers/media/tuners/e4000.h|  9 +++-
   drivers/media/tuners/e4000_priv.h   |  4 +-
   drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 31 +-
   4 files changed, 78 insertions(+), 39 deletions(-)

 diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c
 index 54e2d8a..f6a5dbd 100644
 --- a/drivers/media/tuners/e4000.c
 +++ b/drivers/media/tuners/e4000.c
 @@ -27,7 +27,7 @@ static int e4000_wr_regs(struct e4000_priv *priv, u8
 reg, u8 *val, int len)
u8 buf[1 + len];
struct i2c_msg msg[1] = {
{
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
.flags = 0,
.len = sizeof(buf),
.buf = buf,
 @@ -56,12 +56,12 @@ static int e4000_rd_regs(struct e4000_priv *priv, u8
 reg, u8 *val, int len)
u8 buf[len];
struct i2c_msg msg[2] = {
{
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
.flags = 0,
.len = 1,
.buf = reg,
}, {
 - .addr = priv-cfg-i2c_addr,
 + .addr = priv-i2c_addr,
.flags = I2C_M_RD,
.len = sizeof(buf),
.buf = buf,
 @@ -233,8 +233,8 @@ static int e4000_set_params(struct dvb_frontend *fe)
 * or more.
 */
f_vco = c-frequency * e4000_pll_lut[i].mul;
 - sigma_delta = div_u64(0x1ULL * (f_vco % priv-cfg-clock),
 priv-cfg-clock);
 - buf[0] = f_vco / priv-cfg-clock;
 + sigma_delta = div_u64(0x1ULL * (f_vco % priv-clock),
 priv-clock);
 + buf[0] = f_vco / priv-clock;
buf[1] = (sigma_delta  0)  0xff;
buf[2] = (sigma_delta  8)  0xff;
buf[3] = 0x00;
 @@ -358,17 +358,6 @@ static int e4000_get_if_frequency(struct
 dvb_frontend *fe, u32 *frequency)
return 0;
   }

 -static int e4000_release(struct dvb_frontend *fe)
 -{
 - struct e4000_priv *priv = fe-tuner_priv;
 -
 - dev_dbg(priv-i2c-dev, %s:\n, __func__);
 -
 - kfree(fe-tuner_priv);
 -
 - return 0;
 -}
 -
   static const struct dvb_tuner_ops e4000_tuner_ops = {
.info = {
.name   = Elonics E4000,
 @@ -376,8 +365,6 @@ static const struct dvb_tuner_ops e4000_tuner_ops =
 {
.frequency_max  = 86200,
},

 - .release = e4000_release,
 -
.init = e4000_init,
.sleep = e4000_sleep,
.set_params = e4000_set_params,
 @@ -385,9 +372,12 @@ static const struct dvb_tuner_ops e4000_tuner_ops =
 {
.get_if_frequency = e4000_get_if_frequency,
   };

 -struct dvb_frontend *e4000_attach(struct dvb_frontend *fe,
 - struct i2c_adapter *i2c, const struct e4000_config *cfg)
 +static int e4000_probe(struct i2c_client *client,
 + const struct i2c_device_id *id)
   {
 + struct

Re: [PATCH REVIEW] e4000: convert DVB tuner to I2C driver model

2013-10-16 Thread Michael Krufky
On Wed, Oct 16, 2013 at 1:09 PM, Jean Delvare kh...@linux-fr.org wrote:
 Hi Michael,

 On Wed, 16 Oct 2013 13:04:42 -0400, Michael Krufky wrote:
 YIKES!!  i2c_new_probed_device() does indeed probe the hardware --
 this is unacceptable, as such an action can damage the ic.

 Is there some additional information that I'm missing that lets this
 perform an attach without probe?

 Oh, i2c_new_probed_device() probes the device, what a surprise! :D

 Try, I don't know, i2c_new_device() maybe if you don't want the
 probe? ;)

 --
 Jean Delvare

OK, so to confirm that I follow correctly, one can use
i2c_new_device() to attach the sub-driver without probing, and the
line that ensures that the correct sub-driver gets attached is
strlcpy(info.type, e4000, I2C_NAME_SIZE);  ??

We're matching based on a string?  I think that's kinda yucky, but if
that's what we're doing in i2c nowadays then I'm OK with it.

If not, what prevents the wrong sub-driver from attaching to a device?
 ...or conversely, how does the right sub-driver know which device to
attach to?

Again, if I'm asking stupid questions just point me to the documentation.

-Mike
--
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 REVIEW] e4000: convert DVB tuner to I2C driver model

2013-10-16 Thread Michael Krufky
On Wed, Oct 16, 2013 at 1:22 PM, Antti Palosaari cr...@iki.fi wrote:
 On 16.10.2013 20:19, Michael Krufky wrote:

 On Wed, Oct 16, 2013 at 1:09 PM, Jean Delvare kh...@linux-fr.org wrote:

 Hi Michael,

 On Wed, 16 Oct 2013 13:04:42 -0400, Michael Krufky wrote:

 YIKES!!  i2c_new_probed_device() does indeed probe the hardware --
 this is unacceptable, as such an action can damage the ic.

 Is there some additional information that I'm missing that lets this
 perform an attach without probe?


 Oh, i2c_new_probed_device() probes the device, what a surprise! :D

 Try, I don't know, i2c_new_device() maybe if you don't want the
 probe? ;)

 --
 Jean Delvare


 OK, so to confirm that I follow correctly, one can use
 i2c_new_device() to attach the sub-driver without probing, and the
 line that ensures that the correct sub-driver gets attached is
 strlcpy(info.type, e4000, I2C_NAME_SIZE);  ??

 We're matching based on a string?  I think that's kinda yucky, but if
 that's what we're doing in i2c nowadays then I'm OK with it.

 If not, what prevents the wrong sub-driver from attaching to a device?
   ...or conversely, how does the right sub-driver know which device to
 attach to?


 Yes, it is that string. Driver has that string as a ID table entry. Then you
 issue i2c_new_device() call with string and it attachs driver when strings
 match.


 Again, if I'm asking stupid questions just point me to the
 documentation.

 -Mike


 regards
 Antti


OK, I get it and it does seem OK.  I'm just curious what kind of
impact this refactoring would have over something like the
b2c2-flexcop-fe driver, who does not know which ic's to attach based
on device ids, but it does probe a few frontend combinations one after
another, in an order that the driver authors knew was safe.  I'd
imaging that we'd write some helper abstraction function to switch out
the info.type string as each driver gets probed?  I think that can get
quite ugly, but I know that the general population thinks dvb_attach()
is even uglier, so maybe this could be the right path...

Wanna take a crack at b2c2-flexcop-fe?

-Mike
--
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] cx24117: Fix/enhance set_voltage function.

2013-10-14 Thread Michael Krufky
On Sat, Oct 12, 2013 at 4:54 AM, Luis Alves lja...@gmail.com wrote:
 Hi,

 On this patch:
 Added a few defines to describe what every constant in the set_voltage 
 function.
 Added the description to the CX24117 GPIO control commands.
 Moved the GPIODIR setup to the initfe function.

Luis,

It is generally not preferred to send multiple changes in a single
patch, even if the changes themselves are small.

I know it's not such a huge patch, but, it is preferred for each patch
to contain only one single change, provided that the patch remains
atomic in nature.  I don't think it would be such a problem to merge
these changes as-is, but I do think it would be better to try to
enforce the idea of one change per atomic patch when possible.

Can you re-spin this into two (or three) smaller patches?

The first patch should handle the cosmetics, Added a few defines to
describe every constant in the set_voltage function  Added the
description to the CX24117 GPIO control commands ...  As you see,
these two bits change the code slightly but do not alter the behavior
of the driver.

The final patch should be the one that does alter the driver's
behavior, Moved the GPIODIR setup to the initfe function

Doing this can potentially help to quicken the review  merge process,
while also enhancing the readability of the change history within the
kernel.

Cheers,

Mike Krufky
--
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 05/14] cxd2820r_core: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:36 AM, Antti Palosaari cr...@iki.fi wrote:
 On 04.10.2013 17:01, Hans Verkuil wrote:

 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/dvb-frontends/cxd2820r_core.c:34:32: error: cannot size
 expression
 drivers/media/dvb-frontends/cxd2820r_core.c:68:32: error: cannot size
 expression

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



 Cc: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/dvb-frontends/cxd2820r_core.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c
 b/drivers/media/dvb-frontends/cxd2820r_core.c
 index 7ca5c69..d9eeeb1 100644
 --- a/drivers/media/dvb-frontends/cxd2820r_core.c
 +++ b/drivers/media/dvb-frontends/cxd2820r_core.c
 @@ -31,7 +31,7 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv
 *priv, u8 i2c, u8 reg,
 {
 .addr = i2c,
 .flags = 0,
 -   .len = sizeof(buf),
 +   .len = len + 1,
 .buf = buf,
 }
 };
 @@ -65,7 +65,7 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv
 *priv, u8 i2c, u8 reg,
 }, {
 .addr = i2c,
 .flags = I2C_M_RD,
 -   .len = sizeof(buf),
 +   .len = len,
 .buf = buf,
 }
 };



 --
 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

Reviewed-by: Michael Krufky mkru...@linuxtv.org
--
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 04/14] tuner-xs2028.c: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:01 AM, Hans Verkuil hverk...@xs4all.nl wrote:
 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/tuners/tuner-xc2028.c:575:24: warning: cast to restricted __le16
 drivers/media/tuners/tuner-xc2028.c:686:21: warning: cast to restricted __le16

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: Mauro Carvalho Chehab m.che...@samsung.com
 ---
  drivers/media/tuners/tuner-xc2028.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/tuners/tuner-xc2028.c 
 b/drivers/media/tuners/tuner-xc2028.c
 index 878d2c4..e287a74 100644
 --- a/drivers/media/tuners/tuner-xc2028.c
 +++ b/drivers/media/tuners/tuner-xc2028.c
 @@ -572,7 +572,7 @@ static int load_firmware(struct dvb_frontend *fe, 
 unsigned int type,
 return -EINVAL;
 }

 -   size = le16_to_cpu(*(__u16 *) p);
 +   size = le16_to_cpu(*(__le16 *) p);
 p += sizeof(size);

 if (size == 0x)
 @@ -683,7 +683,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned 
 int type,
 /* 16 SCODE entries per file; each SCODE entry is 12 bytes and
  * has a 2-byte size header in the firmware format. */
 if (priv-firm[pos].size != 14 * 16 || scode = 16 ||
 -   le16_to_cpu(*(__u16 *)(p + 14 * scode)) != 12)
 +   le16_to_cpu(*(__le16 *)(p + 14 * scode)) != 12)
 return -EINVAL;
 p += 14 * scode + 2;
 }
 --
 1.8.3.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

Reviewed-by: Michael Krufky mkru...@linuxtv.org
--
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 06/14] drxd_hard: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:44 AM, Antti Palosaari cr...@iki.fi wrote:
 On 04.10.2013 17:01, Hans Verkuil wrote:

 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/dvb-frontends/drxd_hard.c:1017:70: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxd_hard.c:1038:69: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxd_hard.c:2836:33: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxd_hard.c:2972:30: warning: Using plain
 integer as NULL pointer

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



 Cc: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/dvb-frontends/drxd_hard.c | 8 
   1 file changed, 4 insertions(+), 4 deletions(-)

 diff --git a/drivers/media/dvb-frontends/drxd_hard.c
 b/drivers/media/dvb-frontends/drxd_hard.c
 index cbd7c92..959ae36 100644
 --- a/drivers/media/dvb-frontends/drxd_hard.c
 +++ b/drivers/media/dvb-frontends/drxd_hard.c
 @@ -1014,7 +1014,7 @@ static int HI_CfgCommand(struct drxd_state *state)
 status = Write16(state, HI_RA_RAM_SRV_CMD__A,
  HI_RA_RAM_SRV_CMD_CONFIG, 0);
 else
 -   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG, 0);
 +   status = HI_Command(state, HI_RA_RAM_SRV_CMD_CONFIG,
 NULL);
 mutex_unlock(state-mutex);
 return status;
   }
 @@ -1035,7 +1035,7 @@ static int HI_ResetCommand(struct drxd_state *state)
 status = Write16(state, HI_RA_RAM_SRV_RST_KEY__A,
  HI_RA_RAM_SRV_RST_KEY_ACT, 0);
 if (status == 0)
 -   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, 0);
 +   status = HI_Command(state, HI_RA_RAM_SRV_CMD_RESET, NULL);
 mutex_unlock(state-mutex);
 msleep(1);
 return status;
 @@ -2833,7 +2833,7 @@ static int drxd_init(struct dvb_frontend *fe)
 int err = 0;

   /*if (request_firmware(state-fw, drxd.fw, state-dev)0) */
 -   return DRXD_init(state, 0, 0);
 +   return DRXD_init(state, NULL, 0);

 err = DRXD_init(state, state-fw-data, state-fw-size);
 release_firmware(state-fw);
 @@ -2969,7 +2969,7 @@ struct dvb_frontend *drxd_attach(const struct
 drxd_config *config,

 mutex_init(state-mutex);

 -   if (Read16(state, 0, 0, 0)  0)
 +   if (Read16(state, 0, NULL, 0)  0)
 goto error;

 state-frontend.ops = drxd_ops;



 --
 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

Reviewed-by: Michael Krufky mkru...@linuxtv.org
--
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 07/14] drxk_hard: fix sparse warnings

2013-10-04 Thread Michael Krufky
On Fri, Oct 4, 2013 at 10:40 AM, Antti Palosaari cr...@iki.fi wrote:
 On 04.10.2013 17:01, Hans Verkuil wrote:

 From: Hans Verkuil hans.verk...@cisco.com

 drivers/media/dvb-frontends/drxk_hard.c:1086:62: warning: Using plain
 integer as NULL pointer
 drivers/media/dvb-frontends/drxk_hard.c:2784:63: warning: Using plain
 integer as NULL pointer

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com


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



 Cc: Antti Palosaari cr...@iki.fi
 ---
   drivers/media/dvb-frontends/drxk_hard.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/dvb-frontends/drxk_hard.c
 b/drivers/media/dvb-frontends/drxk_hard.c
 index 082014d..d416c15 100644
 --- a/drivers/media/dvb-frontends/drxk_hard.c
 +++ b/drivers/media/dvb-frontends/drxk_hard.c
 @@ -1083,7 +1083,7 @@ static int hi_cfg_command(struct drxk_state *state)
  SIO_HI_RA_RAM_PAR_1_PAR1_SEC_KEY);
 if (status  0)
 goto error;
 -   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, 0);
 +   status = hi_command(state, SIO_HI_RA_RAM_CMD_CONFIG, NULL);
 if (status  0)
 goto error;

 @@ -2781,7 +2781,7 @@ static int ConfigureI2CBridge(struct drxk_state
 *state, bool b_enable_bridge)
 goto error;
 }

 -   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, 0);
 +   status = hi_command(state, SIO_HI_RA_RAM_CMD_BRDCTRL, NULL);

   error:
 if (status  0)



 --
 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

Reviewed-by: Michael Krufky mkru...@linuxtv.org
--
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


[GIT PULL BUG FIX] cx24117: prevent mutex to be stuck on locked state if FE init fails

2013-10-04 Thread Michael Krufky
The following changes since commit
d10e8280c4c2513d3e7350c27d8e6f0fa03a5f71:

  [media] cx24117: use hybrid_tuner_request/release_state to share
  state between multiple instances (2013-10-03 07:40:12 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb cx24117

for you to fetch changes up to 3f9c6e0698debcdbfc1568e16eb3cc45d320cc56:

  cx24117: prevent mutex to be stuck on locked state if FE init fails
  (2013-10-04 11:13:47 -0400)


Luis Alves (1):
  cx24117: prevent mutex to be stuck on locked state if FE init
fails

 drivers/media/dvb-frontends/cx24117.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)
--
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


[GIT PULL] dvb-usb: fix error handling in ttusb_dec_probe()

2013-10-03 Thread Michael Krufky
The following changes since commit
b4559ace2ca8c88666584279f582b998c6591fb0:

  [media] ts2020: keep 1.06 MHz as default value for frequency_div
  (2013-10-02 06:48:15 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb ttusb

for you to fetch changes up to 6f0be418ace3bf7ebb19434a8308cea2223fe6e4:

  dvb-usb: fix error handling in ttusb_dec_probe() (2013-10-02 12:00:26
  -0400)


Alexey Khoroshilov (1):
  dvb-usb: fix error handling in ttusb_dec_probe()

 drivers/media/usb/ttusb-dec/ttusb_dec.c | 152 --
 1 file changed, 82 insertions(+), 70 deletions(-)
--
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


[GIT PULL] Adding support for the cx24117 frontend with tbs6980 or tbs6981

2013-10-03 Thread Michael Krufky
The following changes since commit
ed94e614c82b4d41d92c82052e915d99614d8b5c:

  dib9000: fix typo in spelling the word empty (2013-09-30 12:24:48
  -0400)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb cx24117

for you to fetch changes up to 5dfa5d28c8e636ddb6468defc7e5e7ed07af6945:

  cx24117: use hybrid_tuner_request/release_state to share state
  between multiple instances (2013-10-03 07:39:17 -0400)


Luis Alves (3):
  dvb: add cx24117 frontend
  cx23885: add support for cx24117 with tbs6980 or tbs6981
  cx24117: use hybrid_tuner_request/release_state to share state between 
multiple instances

 drivers/media/dvb-frontends/Kconfig   |7 +
 drivers/media/dvb-frontends/Makefile  |1 +
 drivers/media/dvb-frontends/cx24117.c | 1651 

 drivers/media/dvb-frontends/cx24117.h |   47 +
 drivers/media/pci/cx23885/Kconfig |1 +
 drivers/media/pci/cx23885/cx23885-cards.c |   67 +++
 drivers/media/pci/cx23885/cx23885-dvb.c   |   24 +++
 drivers/media/pci/cx23885/cx23885-input.c |   12 ++
 drivers/media/pci/cx23885/cx23885.h   |2 + 9 files changed,
 1812 insertions(+) create mode 100644
 drivers/media/dvb-frontends/cx24117.c create mode 100644
 drivers/media/dvb-frontends/cx24117.h
--
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


[GIT PULL] git://linuxtv.org/mkrufky/dvb frontends

2013-10-02 Thread Michael Krufky
The following changes since commit
ffee921033e64edf8579a3b21c7f15d1a6c3ef71:

  Merge tag 'v3.12-rc2' into patchwork (2013-09-24 08:17:44 -0300)

are available in the git repository at:


  git://linuxtv.org/mkrufky/dvb frontends

for you to fetch changes up to ed94e614c82b4d41d92c82052e915d99614d8b5c:

  dib9000: fix typo in spelling the word empty (2013-09-30 12:24:48
  -0400)


Andreas Matthies (1):
  tda10071: change firmware download condition

Christoph Jaeger (1):
  drxd_hard: remove unused SIZEOF_ARRAY

Kees Cook (1):
  dib9000: fix potential format string leak

Michael Krufky (1):
  dib9000: fix typo in spelling the word empty

Peter Senna Tschudin (1):
  fc001[23]: Change variable type to bool

 drivers/media/dvb-frontends/dib9000.c   | 4 ++--
 drivers/media/dvb-frontends/drxd_hard.c | 4 
 drivers/media/dvb-frontends/tda10071.c  | 9 +
 drivers/media/tuners/fc0012.c   | 2 +-
 drivers/media/tuners/fc0013.c   | 2 +-
 5 files changed, 5 insertions(+), 16 deletions(-)

Cheers,

Mike
--
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] r820t: fix nint range check

2013-09-30 Thread Michael Krufky
Jiří,

Do you have any documentation that supports this value change?
Changing this value affects the algorithm, and we'd be happier making
this change if the patch included some better description and perhaps
a reference explaining why the new value is correct.

Regards,

Mike Krufky

On Sun, Sep 29, 2013 at 6:45 AM, Jiří Pinkava j...@seznam.cz wrote:


 Use full range of VCO parameters, fixes tunning for some frequencies.
 ---
  drivers/media/tuners/r820t.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
 index 1c23666..e25c720 100644
 --- a/drivers/media/tuners/r820t.c
 +++ b/drivers/media/tuners/r820t.c
 @@ -637,7 +637,7 @@ static int r820t_set_pll(struct r820t_priv *priv,
 enum v4l2_tuner_type type,
 vco_fra = pll_ref * 129 / 128;
 }

 -   if (nint  63) {
 +   if (nint  76) {
 tuner_info(No valid PLL values for %u kHz!\n, freq);
 return -EINVAL;
 }
 --
 1.8.3.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: Subject: [PATCH 2/2] [media] r820t: simplify divisor calculation

2013-09-30 Thread Michael Krufky
Jiří,

It's difficult to understand a patch like this, let alone merging it,
without any kind of explanation.  At a quick glance, the patch looks
wrong.  If you believe the patch is correct, then please resubmit with
some sort of description and explanation for the change.

Best regards,

Mike Krufky

On Sun, Sep 29, 2013 at 6:46 AM, Jiří Pinkava j...@seznam.cz wrote:

 ---
  drivers/media/tuners/r820t.c | 6 +-
  1 file changed, 1 insertion(+), 5 deletions(-)

 diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
 index e25c720..36dc63e 100644
 --- a/drivers/media/tuners/r820t.c
 +++ b/drivers/media/tuners/r820t.c
 @@ -596,13 +596,9 @@ static int r820t_set_pll(struct r820t_priv *priv,
 enum v4l2_tuner_type type,
 while (mix_div = 64) {
 if (((freq * mix_div) = vco_min) 
((freq * mix_div)  vco_max)) {
 -   div_buf = mix_div;
 -   while (div_buf  2) {
 -   div_buf = div_buf  1;
 -   div_num++;
 -   }
 break;
 }
 +   ++div_num;
 mix_div = mix_div  1;
 }

 --
 1.8.3.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] dvb: fix potential format string leak

2013-09-30 Thread Michael Krufky
On Mon, Sep 16, 2013 at 7:48 PM, Joe Perches j...@perches.com wrote:
 On Mon, 2013-09-16 at 16:37 -0700, Kees Cook wrote:
 Make sure that a format string cannot accidentally leak into the printk
 buffer.
 []
 diff --git a/drivers/media/dvb-frontends/dib9000.c 
 b/drivers/media/dvb-frontends/dib9000.c
 []
 @@ -649,7 +649,7 @@ static int dib9000_risc_debug_buf(struct dib9000_state 
 *state, u16 * data, u8 si
   b[2 * (size - 2) - 1] = '\0';   /* Bullet proof the buffer */
   if (*b == '~') {
   b++;
 - dprintk(b);
 + dprintk(%s, b);
   } else
   dprintk(RISC%d: %d.%04d %s, state-fe_id, ts / 1, ts % 
 1, *b ? b : emtpy);
   return 1;

 This looks odd.

 Perhaps this should be:

 if (*b == '~')
 b++;
 dprintk(etc...);

 It'd be nice to fix the empty typo too.

This *does* look odd, I agree.  Meanwhile, I do believe this patch
leaves things better than before.  I'm going to merge Kees' patch for
now, but it would be nice to see a better cleanup for that code block.

-Mike Krufky
--
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] r820t: fix nint range check

2013-09-30 Thread Michael Krufky
Do you have any comments on this, Mauro?

Assuming that Mauro is OK with this change, (since he is the author of
this driver) then yes - please resubmit the patch with some
explanation within comments inline or within the commit message.

Best regards,

Mike Krufky

On Mon, Sep 30, 2013 at 12:42 PM, Jiří Pinkava j...@seznam.cz wrote:
 Mike,

 unfortunately no documentation can be referenced except preliminary
 version of
 datasheet (1).This change is based on lucky guess and supported by lot of
 testing on real hardware.

 This change add support for devices with Xtal frequency bellow 28.8MHz.

 From Nint  are computed values of Ni and Si. For 28.8MHz crystal can
 reach up to 12 / 3 (Ni / Si). Tuner supports crystals with frequencies
 (1) 12, 16, 20, 20.48, 24, 27, 28.8, 32 MHz, but this kind of device is
 rare to found.
 Allowing Ni to go up to 15 instead of only 12 should be safe and for 15
 / 3 (Ni / Si)
 we can compute limit for Nint = max(Ni) * 4 + max(Si) + 13 = 76.

 If This is sufficient and acceptable explanation I can add some sort of
 documentation into patch and resend it (both patches, I can prove I'm
 right :)

 (1)
 http://rtl-sdr.com/wp-content/uploads/2013/04/R820T_datasheet-Non_R-2030_unlocked.pdf

 Jiří,

 Do you have any documentation that supports this value change?
 Changing this value affects the algorithm, and we'd be happier making
 this change if the patch included some better description and perhaps
 a reference explaining why the new value is correct.

 Regards,

 Mike Krufky

 On Sun, Sep 29, 2013 at 6:45 AM, Jiří Pinkava j...@seznam.cz wrote:

 Use full range of VCO parameters, fixes tunning for some frequencies.
 ---
  drivers/media/tuners/r820t.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
 index 1c23666..e25c720 100644
 --- a/drivers/media/tuners/r820t.c
 +++ b/drivers/media/tuners/r820t.c
 @@ -637,7 +637,7 @@ static int r820t_set_pll(struct r820t_priv *priv,
 enum v4l2_tuner_type type,
 vco_fra = pll_ref * 129 / 128;
 }

 -   if (nint  63) {
 +   if (nint  76) {
 tuner_info(No valid PLL values for %u kHz!\n, freq);
 return -EINVAL;
 }
 --
 1.8.3.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: drivers:media:tuners:fc2580c fix for Asus U3100Mini Plus error while loading driver (-19)

2013-07-01 Thread Michael Krufky
I agree with Antti  Oliver - this is not a proper fix, rather, it's
an indication of something else that's wrong.  Does it actually work
the first time?  (I'm assuming, after a cold replug?)  Is the i2c bus
not being properly reset?

Does it ever read a sane value or is it always 0xFF?

-Mike

On Mon, Jul 1, 2013 at 9:36 AM, Antti Palosaari cr...@iki.fi wrote:
 On 07/01/2013 04:26 PM, Oliver Schinagl wrote:

 On 01-07-13 15:23, Antti Palosaari wrote:

 On 07/01/2013 10:52 AM, Oliver Schinagl wrote:

 On 01-07-13 08:53, Bogdan Oprea wrote:

 this is a fix for this type of error

 [18384.579235] usb 6-5: dvb_usb_v2: 'Asus U3100Mini Plus' error while
 loading driver (-19)
 [18384.580621] usb 6-5: dvb_usb_v2: 'Asus U3100Mini Plus' successfully
 deinitialized and disconnected

 This isn't really a fix, I think i mentioned this on the ML ages ago,


 Argh, I just replied that same. Oliver, do you has that same device? Is
 it working? Could you tweak to see if I2C readings are working at all?

 I have the same device, but mine works normally (though I haven't
 checked for ages), I will try it tonight when I'm at home and don't
 forget what happens with my current kernel.


 Actually, I has RTL2832U + FC2580, and it works. It is not Asus U3100Mini
 Plus.

 Reading of that chip id must be working on the very first, is RTL2832U
 driver detects whole tuner by probing it.

 /* check FC2580 ID register; reg=01 val=56 */
 ret = rtl28xxu_ctrl_msg(d, req_fc2580);
 if (ret == 0  buf[0] == 0x56) {
 priv-tuner = TUNER_RTL2832_FC2580;
 priv-tuner_name = FC2580;
 goto found;
 }

 So I wonder if tuner I2C readings starts failing after that.


 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
--
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] dib0700: add support for PCTV 2002e PCTV 2002e SE

2013-06-30 Thread Michael Krufky
From b5a7481571163fc1c83a12987be8a6ebd88bc91a Mon Sep 17 00:00:00 2001
From: Michael Krufky mkru...@linuxtv.org
Date: Sun, 30 Jun 2013 11:43:58 -0400
Subject: [PATCH] dib0700: add support for PCTV 2002e  PCTV 2002e SE

Signed-off-by: Michael Krufky mkru...@linuxtv.org
---
 drivers/media/dvb-core/dvb-usb-ids.h|  2 ++
 drivers/media/usb/dvb-usb/dib0700_devices.c | 12 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb-usb-ids.h b/drivers/media/dvb-core/dvb-usb-ids.h
index 886da16..419a2d6 100644
--- a/drivers/media/dvb-core/dvb-usb-ids.h
+++ b/drivers/media/dvb-core/dvb-usb-ids.h
@@ -369,4 +369,6 @@
 #define USB_PID_TECHNISAT_USB2_DVB_S2			0x0500
 #define USB_PID_CPYTO_REDI_PC50A			0xa803
 #define USB_PID_CTVDIGDUAL_V20xe410
+#define USB_PID_PCTV_2002E  0x025c
+#define USB_PID_PCTV_2002E_SE   0x025d
 #endif
diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c
index f081360..829323e 100644
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
@@ -3589,6 +3589,8 @@ struct usb_device_id dib0700_usb_id_table[] = {
 	{ USB_DEVICE(USB_VID_DIBCOM,USB_PID_DIBCOM_TFE7790P) },
 	{ USB_DEVICE(USB_VID_DIBCOM,USB_PID_DIBCOM_TFE8096P) },
 /* 80 */{ USB_DEVICE(USB_VID_ELGATO,	USB_PID_ELGATO_EYETV_DTT_2) },
+	{ USB_DEVICE(USB_VID_PCTV,  USB_PID_PCTV_2002E) },
+	{ USB_DEVICE(USB_VID_PCTV,  USB_PID_PCTV_2002E_SE) },
 	{ 0 }		/* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
@@ -3993,12 +3995,20 @@ struct dvb_usb_device_properties dib0700_devices[] = {
 			}
 		},
 
-		.num_device_descs = 1,
+		.num_device_descs = 3,
 		.devices = {
 			{   Hauppauge Nova-TD Stick (52009),
 { dib0700_usb_id_table[35], NULL },
 { NULL },
 			},
+			{   PCTV 2002e,
+{ dib0700_usb_id_table[81], NULL },
+{ NULL },
+			},
+			{   PCTV 2002e SE,
+{ dib0700_usb_id_table[82], NULL },
+{ NULL },
+			},
 		},
 
 		.rc.core = {
-- 
1.8.1.2



[GIT PULL] git://linuxtv.org/mkrufky/hauppauge dib0700

2013-06-30 Thread Michael Krufky
The following changes since commit
1c26190a8d492adadac4711fe5762d46204b18b0:

  [media] exynos4-is: Correct colorspace handling at FIMC-LITE
  (2013-06-28 15:33:27 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/hauppauge dib0700

for you to fetch changes up to b5a7481571163fc1c83a12987be8a6ebd88bc91a:

  dib0700: add support for PCTV 2002e  PCTV 2002e SE (2013-06-30
  11:43:58 -0400)


Michael Krufky (1):
  dib0700: add support for PCTV 2002e  PCTV 2002e SE

 drivers/media/dvb-core/dvb-usb-ids.h|  2 ++
 drivers/media/usb/dvb-usb/dib0700_devices.c | 12 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)
--
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] mxl111sf: don't redefine pr_err/info/debug

2013-06-17 Thread Michael Krufky
eek... I'd rather merge it than ack it -- why don't I see it in patchwork?

I'll try to merge it tonight or tomorrow.

Cheers,

Mike

On Thu, Jun 13, 2013 at 2:09 AM, Hans Verkuil hverk...@xs4all.nl wrote:
 On Thu May 23 2013 08:50:43 Hans Verkuil wrote:
 Remove the silly redefines of pr_err/info/debug.

 This improves readability and it also gets rid of a bunch of warnings when
 compiling this driver for older kernels using the compatibility media_build
 system.

 Mike,

 Can you Ack this?

 Thanks,

 Hans


 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c |8 +--
  drivers/media/usb/dvb-usb-v2/mxl111sf.c   |   90 
 -
  2 files changed, 45 insertions(+), 53 deletions(-)

 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c 
 b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c
 index ef4c65f..879c529 100644
 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c
 +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c
 @@ -31,8 +31,6 @@ MODULE_PARM_DESC(debug, set debugging level (1=info 
 (or-able)).);
   if (mxl111sf_tuner_debug) \
   mxl_printk(KERN_DEBUG, fmt, ##arg)

 -#define err pr_err
 -
  /*  
 */

  struct mxl111sf_tuner_state {
 @@ -113,7 +111,7 @@ static struct mxl111sf_reg_ctrl_info 
 *mxl111sf_calc_phy_tune_regs(u32 freq,
   filt_bw = 63;
   break;
   default:
 - err(%s: invalid bandwidth setting!, __func__);
 + pr_err(%s: invalid bandwidth setting!, __func__);
   return NULL;
   }

 @@ -304,12 +302,12 @@ static int mxl111sf_tuner_set_params(struct 
 dvb_frontend *fe)
   bw = 8;
   break;
   default:
 - err(%s: bandwidth not set!, __func__);
 + pr_err(%s: bandwidth not set!, __func__);
   return -EINVAL;
   }
   break;
   default:
 - err(%s: modulation type not supported!, __func__);
 + pr_err(%s: modulation type not supported!, __func__);
   return -EINVAL;
   }
   ret = mxl1x1sf_tune_rf(fe, c-frequency, bw);
 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c 
 b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
 index efdcb15..e97964e 100644
 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
 +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
 @@ -52,12 +52,6 @@ MODULE_PARM_DESC(rfswitch, force rf switch position 
 (0=auto, 1=ext, 2=int).);

  DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);

 -#define deb_info pr_debug
 -#define deb_reg pr_debug
 -#define deb_adv pr_debug
 -#define err pr_err
 -#define info pr_info
 -
  int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
 u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
  {
 @@ -65,7 +59,7 @@ int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
   int ret;
   u8 sndbuf[1+wlen];

 - deb_adv(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen);
 + pr_debug(%s(wlen = %d, rlen = %d)\n, __func__, wlen, rlen);

   memset(sndbuf, 0, 1+wlen);

 @@ -98,12 +92,12 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 
 addr, u8 *data)
   if (buf[0] == addr)
   *data = buf[1];
   else {
 - err(invalid response reading reg: 0x%02x != 0x%02x, 0x%02x,
 + pr_err(invalid response reading reg: 0x%02x != 0x%02x, 
 0x%02x,
   addr, buf[0], buf[1]);
   ret = -EINVAL;
   }

 - deb_reg(R: (0x%02x, 0x%02x)\n, addr, *data);
 + pr_debug(R: (0x%02x, 0x%02x)\n, addr, *data);
  fail:
   return ret;
  }
 @@ -113,11 +107,11 @@ int mxl111sf_write_reg(struct mxl111sf_state *state, 
 u8 addr, u8 data)
   u8 buf[] = { addr, data };
   int ret;

 - deb_reg(W: (0x%02x, 0x%02x)\n, addr, data);
 + pr_debug(W: (0x%02x, 0x%02x)\n, addr, data);

   ret = mxl111sf_ctrl_msg(state-d, MXL_CMD_REG_WRITE, buf, 2, NULL, 0);
   if (mxl_fail(ret))
 - err(error writing reg: 0x%02x, val: 0x%02x, addr, data);
 + pr_err(error writing reg: 0x%02x, val: 0x%02x, addr, data);
   return ret;
  }

 @@ -134,7 +128,7 @@ int mxl111sf_write_reg_mask(struct mxl111sf_state *state,
  #if 1
   /* dont know why this usually errors out on the first try */
   if (mxl_fail(ret))
 - err(error writing addr: 0x%02x, mask: 0x%02x, 
 + pr_err(error writing addr: 0x%02x, mask: 0x%02x, 
   data: 0x%02x, retrying..., addr, mask, data);

   ret = mxl111sf_read_reg(state, addr, val);
 @@ -167,7 +161,7 @@ int mxl111sf_ctrl_program_regs(struct mxl111sf_state 
 *state,
 ctrl_reg_info[i].mask,
 ctrl_reg_info[i].data);
   if (mxl_fail(ret)) {
 -

[GIT PULL] git://linuxtv.org/mkrufky/tuners r820t

2013-06-17 Thread Michael Krufky
The following changes since commit
e049ca5e854263c821a15c0e25fe2ae202c365e1:

  [media] staging/media: lirc_imon: fix leaks in imon_probe()
  (2013-06-17 15:52:20 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/tuners r820t

for you to fetch changes up to a02dfce109f6dcddf1bfd973f9b3000cd74c3590:

  r820t: fix imr calibration (2013-06-17 19:32:45 -0400)


Gianluca Gennari (3):
  r820t: remove redundant initializations in r820t_attach()
  r820t: avoid potential memcpy buffer overflow in shadow_store()
  r820t: fix imr calibration

 drivers/media/tuners/r820t.c | 17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)
--
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


[GIT PULL] git://linuxtv.org/mkrufky/tuners mxl111sf

2013-06-17 Thread Michael Krufky
The following changes since commit
e049ca5e854263c821a15c0e25fe2ae202c365e1:

  [media] staging/media: lirc_imon: fix leaks in imon_probe()
  (2013-06-17 15:52:20 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/tuners mxl111sf

for you to fetch changes up to 0fca4f2af6a176bf4c980643e70c99d11d002094:

  mxl111sf: don't redefine pr_err/info/debug (2013-06-17 19:56:40 -0400)


Hans Verkuil (1):
  mxl111sf: don't redefine pr_err/info/debug

 drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c |  8 +++-
 drivers/media/usb/dvb-usb-v2/mxl111sf.c   | 90
 
++
 2 files changed, 45 insertions(+), 53 deletions(-)
--
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: [GIT PULL FOR 3.10] DiBxxxx: fixes and improvements

2013-06-02 Thread Michael Krufky
Olivier,

I have regenerated your patch against the most recent codebase, as
your patch no longer applies.  (There were changes merged on the 29th
of April that broke it.)

The new patch is attached, but I am reluctant to merge it, as I do not
have any description of the patch, and it lacks a sign-off.

Please test this patch and confirm that it produces the desired
effect, then resubmit with a short description and your sign-off.

Best regards,

Mike Krufky

On Sat, May 4, 2013 at 12:05 AM, Olivier GRENIE
olivier.gre...@parrot.com wrote:
 Hello Mauro,
 can you apply the attached patch. This patch correct the proposed patch by 
 Patrick for the dib807x. Sorry to not have seen it before.

 regards,
 Olivier

 
 From: Mauro Carvalho Chehab [mche...@redhat.com]
 Sent: Saturday, April 27, 2013 4:28 PM
 To: Patrick Boettcher
 Cc: linux-media@vger.kernel.org; Olivier GRENIE; Patrick BOETTCHER
 Subject: Re: [GIT PULL FOR 3.10] DiB: fixes and improvements

 Hi Patrick,

 Em Mon, 22 Apr 2013 10:12:34 +0200
 Patrick Boettcher pboettc...@kernellabs.com escreveu:

 Hi Mauro,

 These patches contains some fixes and changes for the DiBcom demods and
 SIPs.

 Please merge for 3.10 if possible.


 The following changes since commit 60d509fa6a9c4653a86ad830e4c4b30360b23f0e:

   Linux 3.9-rc8 (2013-04-21 14:38:45 -0700)

 are available in the git repository at:

   git://git.linuxtv.org/pb/media_tree.git/ master

 Hmm... I suspect that there's something wrong with those changes.

 Testing it with a dib8076 usb stick seems that the code is worse than
 before, as it is now harder to get a lock here.

 With the previous code:

 INFO Scanning frequency #1 725142857
 Carrier(0x03) Signal= 67.46% C/N= 0.00% UCB= 0 postBER= 0
 Viterbi(0x05) Signal= 67.08% C/N= 0.00% UCB= 0 postBER= 2097151
 Viterbi(0x07) Signal= 67.54% C/N= 0.25% UCB= 165 postBER= 0
 Sync   (0x0f) Signal= 67.06% C/N= 0.23% UCB= 151 postBER= 0
 Lock   (0x1f) Signal= 67.58% C/N= 0.24% UCB= 160 postBER= 338688
 Service #0 (60320) BAND HD channel 57.1.0
 Service #1 (60345) BAND 1SEG channel 57.1.1

 With the new code:

 INFO Scanning frequency #1 725142857
(0x00) Signal= 68.80% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.78% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.69% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.82% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.29% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.27% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.28% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.27% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.55% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.50% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.43% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.65% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.75% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.29% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.28% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.25% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.43% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.46% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.43% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.90% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.50% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.28% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.22% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.22% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.43% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.41% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.41% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 68.96% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.42% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.24% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.22% C/N= 0.00% UCB= 0 postBER= 0
 RF (0x01) Signal= 69.25% C/N= 0.00% UCB= 0 postBER= 0

 So, it seems that the changes broke something.

 Regards,
 Mauro


2013-05-04-040550.patch
Description: Binary data


[GIT PULL] git://linuxtv.org/mkrufky/dvb dib8000

2013-06-02 Thread Michael Krufky
The following changes since commit
7eac97d7e714429f7ef1ba5d35f94c07f4c34f8e:

  [media] media: pci: remove duplicate checks for EPERM (2013-05-27
  09:34:56 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb dib8000

for you to fetch changes up to 441939932b4968cd24a1dd190629600250eea992:

  dib8000: Fix dib8000_set_frontend() never setting ret (2013-06-02
  12:53:14 -0400)


Geert Uytterhoeven (1):
  dib8000: Fix dib8000_set_frontend() never setting ret

 drivers/media/dvb-frontends/dib8000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--
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


[GIT PULL] git://linuxtv.org/mkrufky/tuners r820t

2013-06-02 Thread Michael Krufky
The following changes since commit
7eac97d7e714429f7ef1ba5d35f94c07f4c34f8e:

  [media] media: pci: remove duplicate checks for EPERM (2013-05-27
  09:34:56 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/tuners r820t

for you to fetch changes up to 0fe5886ef7a961fc184ffd7f125027a99716faa1:

  r820t: avoid potential memcpy buffer overflow in shadow_store()
  (2013-06-02 13:31:19 -0400)


Gianluca Gennari (3):
  r820t: do not double-free fe-tuner_priv in r820t_release()
  r820t: remove redundant initializations in r820t_attach()
  r820t: avoid potential memcpy buffer overflow in shadow_store()

 drivers/media/tuners/r820t.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)
--
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


[GIT PULL] git://linuxtv.org/mkrufky/dvb stb0899

2013-06-02 Thread Michael Krufky
The following changes since commit
7eac97d7e714429f7ef1ba5d35f94c07f4c34f8e:

  [media] media: pci: remove duplicate checks for EPERM (2013-05-27
  09:34:56 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb stb0899

for you to fetch changes up to fda0cbcc4878079829b5e13101c1c5144c4db3d9:

  stb0899: sign of CRL_FREQ doesn't depend on inversion (2013-06-02
  14:03:13 -0400)


Reinhard Nißl (7):
  stb0899: sign extend raw CRL_FREQ value
  stb0899: enable auto inversion handling unconditionally
  stb0899: fix inversion enum values to match usage with CFR
  stb0899: store successful inversion for next run
  stb0899: store autodetected inversion while tuning in non S2 mode
  stb0899: use autodetected inversion instead of configured
inversion stb0899: sign of CRL_FREQ doesn't depend on inversion

Zoran Turalija (2):
  stb0899: allow minimum symbol rate of 100
  stb0899: allow minimum symbol rate of 200

 drivers/media/dvb-frontends/stb0899_algo.c | 105
 
++---
 drivers/media/dvb-frontends/stb0899_drv.c  |   7 +++
 drivers/media/dvb-frontends/stb0899_drv.h  |   5 ++--- 3 files
 changed, 63 insertions(+), 54 deletions(-)
--
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


[GIT PULL] git://linuxtv.org/mkrufky/dvb stb0899

2013-06-02 Thread Michael Krufky
The following changes since commit
7eac97d7e714429f7ef1ba5d35f94c07f4c34f8e:

  [media] media: pci: remove duplicate checks for EPERM (2013-05-27
  09:34:56 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb stb0899

for you to fetch changes up to fda0cbcc4878079829b5e13101c1c5144c4db3d9:

  stb0899: sign of CRL_FREQ doesn't depend on inversion (2013-06-02
  14:03:13 -0400)


Reinhard Nißl (7):
  stb0899: sign extend raw CRL_FREQ value
  stb0899: enable auto inversion handling unconditionally
  stb0899: fix inversion enum values to match usage with CFR
  stb0899: store successful inversion for next run
  stb0899: store autodetected inversion while tuning in non S2 mode
  stb0899: use autodetected inversion instead of configured
  stb0899: sign of CRL_FREQ doesn't depend on inversion

Zoran Turalija (2):
  stb0899: allow minimum symbol rate of 100
  stb0899: allow minimum symbol rate of 200

 drivers/media/dvb-frontends/stb0899_algo.c | 105 +++-
 drivers/media/dvb-frontends/stb0899_drv.c  |   7 +-
 drivers/media/dvb-frontends/stb0899_drv.h  |   5 +-
 3 files changed, 63 insertions(+), 54 deletions(-)
--
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: Patchwork and em28xx delegates

2013-04-17 Thread Michael Krufky
I see this https://patchwork.linuxtv.org/patch/17834/ is delegated to
me.  If I took ownership myself then it may have been a mistake.

Either way, the patch looks good to me and makes sense, but I am not
maintaining em28xx.  Mauro, if you want to go ahead and merge his
patch then it's fine with me.  Since this was a mistake, I don't plan
to push it from my own repository.

Reviewed-by: Michael Krufky mkru...@linuxtv.org
--
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


[GIT-PULL] lg2160: dubious one-bit signed bitfield

2013-04-17 Thread Michael Krufky
The following changes since commit
33a31edd4a4b7d26b962b32decfd8ea2377eaa0d:

  Revert [media] mfd: Add header files and Kbuild plumbing for SI476x
  MFD core (2013-04-17 06:08:00 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb demods

for you to fetch changes up to 79c9a899d199fba3505b1d76325c97a7a00b3686:

  lg2160: dubious one-bit signed bitfield (2013-04-17 07:18:40 -0400)


Dan Carpenter (1):
  lg2160: dubious one-bit signed bitfield

 drivers/media/dvb-frontends/lg2160.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--
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


[PULL] git://linuxtv.org/mkrufky/dvb demods

2013-04-07 Thread Michael Krufky
The following changes since commit
53faa685fa7df0e12751eebbda30bc7e7bb5e71a:

  [media] siano: Fix array boundary at smscore_translate_msg()
  (2013-04-04 14:35:40 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb demods

for you to fetch changes up to 15222aeea8e40ece4785cae1e82968fc906ddd78:

  cx24123: improve precision when calculating symbol rate ratio
  (2013-04-07 20:11:53 -0400)


Mauro Carvalho Chehab (6):
  mb86a20s: Use a macro for the number of layers
  mb86a20s: fix audio sub-channel check
  mb86a20s: Use 'layer' instead of 'i' on all places
  mb86a20s: Fix estimate_rate setting
  mb86a20s: better name temp vars at mb86a20s_layer_bitrate()
  cx24123: improve precision when calculating symbol rate ratio

 drivers/media/dvb-frontends/cx24123.c  |   28 +++-
 drivers/media/dvb-frontends/mb86a20s.c |  213
 
+++-
 2 files changed, 115 insertions(+), 126 deletions(-)
--
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


[PULL] Ondrej Zary's patches for AverMedia A706

2013-04-07 Thread Michael Krufky
The following changes since commit
53faa685fa7df0e12751eebbda30bc7e7bb5e71a:

  [media] siano: Fix array boundary at smscore_translate_msg()
  (2013-04-04 14:35:40 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb AverMediaA706-April

for you to fetch changes up to 84c1018a6cc3e1650dac5a881727cf4c07b7db81:

  tda8290: change magic LNA config values to enum (2013-04-06 14:07:49
  -0400)


Ondrej Zary (5):
  tda8290: Allow disabling I2C gate
  tda8290: Allow custom std_map for tda18271
  tuner-core: Change config from unsigned int to void *
  saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM
  tda8290: change magic LNA config values to enum

 drivers/media/i2c/ir-kbd-i2c.c  |   13 -
 drivers/media/pci/saa7134/saa7134-cards.c   |   94
 
++
 drivers/media/pci/saa7134/saa7134-dvb.c |   23
 +++ drivers/media/pci/saa7134/saa7134-i2c.c
 |1 + drivers/media/pci/saa7134/saa7134-input.c   |3 +++
 drivers/media/pci/saa7134/saa7134-tvaudio.c |1 +
 drivers/media/pci/saa7134/saa7134.h |4 +++-
 drivers/media/tuners/tda18271-fe.c  |9 +
 drivers/media/tuners/tda827x.c  |   10 +-
 drivers/media/tuners/tda827x.h  |3 ++-
 drivers/media/tuners/tda8290.c  |   60
 +---
 drivers/media/tuners/tda8290.h  |   12 +++-
 drivers/media/v4l2-core/tuner-core.c|   20
 +++- include/media/tuner.h   |
 2 +- 14 files changed, 185 insertions(+), 70 deletions(-)

Cheers,

Mike
--
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


[PULL] git://linuxtv.org/mkrufky/dvb demods

2013-04-07 Thread Michael Krufky
The following changes since commit
53faa685fa7df0e12751eebbda30bc7e7bb5e71a:

  [media] siano: Fix array boundary at smscore_translate_msg()
  (2013-04-04 14:35:40 -0300)

are available in the git repository at:

  git://linuxtv.org/mkrufky/dvb demods

for you to fetch changes up to bc6c1391e498c649cb22c9654a2203b328cca253:

  cxd2820r_t2: Multistream support (MultiPLP) (2013-04-07 22:56:46
  -0400)


Evgeny Plehov (1):
  cxd2820r_t2: Multistream support (MultiPLP)

Mauro Carvalho Chehab (6):
  mb86a20s: Use a macro for the number of layers
  mb86a20s: fix audio sub-channel check
  mb86a20s: Use 'layer' instead of 'i' on all places
  mb86a20s: Fix estimate_rate setting
  mb86a20s: better name temp vars at mb86a20s_layer_bitrate()
  cx24123: improve precision when calculating symbol rate ratio

 drivers/media/dvb-frontends/cx24123.c   |   28 +++-
 drivers/media/dvb-frontends/cxd2820r_core.c |3 +-
 drivers/media/dvb-frontends/cxd2820r_t2.c   |   17 +++
 drivers/media/dvb-frontends/mb86a20s.c  |  213
 
---
 4 files changed, 134 insertions(+), 127 deletions(-)
--
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: Status of the patches under review at LMML (32 patches)

2013-04-01 Thread Michael Krufky
On Sun, Mar 24, 2013 at 2:11 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:


 == Michael Krufky mkru...@linuxtv.org ==

 Michael promised to review and apply them on his tree, sending me a pull
 request, but this never happened. Mike, did you see any issues on those
 patches?


Apologies, the year 2013 has had me busier than ever.  I didn't get to
my patch queue as early as I had expected.  I'll get these reviewed,
tested  pushed to a repository and send you a merge request ASAP.

I'll try very hard to get this done in the coming week.

Best regards,

Mike
--
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] Fix undefined reference to `au8522_attach'

2013-04-01 Thread Michael Krufky
Good catch!  I don't know if this fix got merged yet or not, but it's correct.

Reviewed-by: Michael Krufky mkru...@linuxtv.org

On Tue, Mar 26, 2013 at 7:17 AM, Hans Verkuil hverk...@xs4all.nl wrote:
 au8522_attach is dependent on CONFIG_DVB_AU8522_DTV, not CONFIG_DVB_AU8522.

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com

 diff --git a/drivers/media/dvb-frontends/au8522.h 
 b/drivers/media/dvb-frontends/au8522.h
 index f2111e0..83fe9a6 100644
 --- a/drivers/media/dvb-frontends/au8522.h
 +++ b/drivers/media/dvb-frontends/au8522.h
 @@ -61,7 +61,7 @@ struct au8522_config {
 enum au8522_if_freq qam_if;
  };

 -#if IS_ENABLED(CONFIG_DVB_AU8522)
 +#if IS_ENABLED(CONFIG_DVB_AU8522_DTV)
  extern struct dvb_frontend *au8522_attach(const struct au8522_config *config,
   struct i2c_adapter *i2c);
  #else
 --
 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 4/4] [media] dvb-usb/dvb-usb-v2: use IS_ENABLED

2013-03-24 Thread Michael Krufky
Reviewed-by: Michael Krufky mkru...@linuxtv.org

On Thu, Mar 21, 2013 at 3:39 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Instead of checking everywhere there for 3 symbols, use instead
 IS_ENABLED macro.

 This replacement was done using this small perl script:

 my $data;
 $data .= $_ while ();
 if ($data =~ m/CONFIG_([A-Z\_\d]*)_MODULE/) {
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)\!]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;

 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 }
 print $data;

 Cc: Michael Krufky mkru...@linuxtv.org
 Cc: Andy Shevchenko andriy.shevche...@linux.intel.com
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h | 3 +--
  drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h | 3 +--
  drivers/media/usb/dvb-usb/dibusb-common.c | 3 +--
  3 files changed, 3 insertions(+), 6 deletions(-)

 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h 
 b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
 index 432706a..40dd409 100644
 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
 +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
 @@ -31,8 +31,7 @@ struct mxl111sf_demod_config {
 struct mxl111sf_reg_ctrl_info *ctrl_reg_info);
  };

 -#if defined(CONFIG_DVB_USB_MXL111SF) || \
 -   (defined(CONFIG_DVB_USB_MXL111SF_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
  extern
  struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
struct mxl111sf_demod_config *cfg);
 diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h 
 b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
 index ff33396..634eee3 100644
 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
 +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
 @@ -60,8 +60,7 @@ struct mxl111sf_tuner_config {

  /*  
 */

 -#if defined(CONFIG_DVB_USB_MXL111SF) || \
 -   (defined(CONFIG_DVB_USB_MXL111SF_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
  extern
  struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe,
struct mxl111sf_state *mxl_state,
 diff --git a/drivers/media/usb/dvb-usb/dibusb-common.c 
 b/drivers/media/usb/dvb-usb/dibusb-common.c
 index af0d432..ecb9360 100644
 --- a/drivers/media/usb/dvb-usb/dibusb-common.c
 +++ b/drivers/media/usb/dvb-usb/dibusb-common.c
 @@ -232,8 +232,7 @@ static struct dibx000_agc_config 
 dib3000p_panasonic_agc_config = {
 .agc2_slope2 = 0x1e,
  };

 -#if defined(CONFIG_DVB_DIB3000MC) ||   \
 -   (defined(CONFIG_DVB_DIB3000MC_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_DIB3000MC)

  static struct dib3000mc_config mod3000p_dib3000p_config = {
 dib3000p_panasonic_agc_config,
 --
 1.8.1.4

 --
 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 1/4] [media] dvb-frontends: use IS_ENABLED

2013-03-24 Thread Michael Krufky
...a long awaited cleanup ;-)

Reviewed-by: Michael Krufky mkru...@linuxtv.org

On Thu, Mar 21, 2013 at 3:39 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Instead of checking everywhere there for 3 symbols, use instead
 IS_ENABLED macro.

 This replacement was done using this small perl script:

 my $data;
 $data .= $_ while ();
 if ($data =~ m/CONFIG_([A-Z\_\d]*)_MODULE/) {
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)\!]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;

 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 }
 print $data;

 Cc: Malcolm Priestley tvbox...@gmail.com
 Cc: Michael Krufky mkru...@linuxtv.org
 Cc: Konstantin Dimitrov kosio.dimit...@gmail.com
 Cc: Igor M. Liplianin liplia...@me.by
 Cc: Thomas Mair thomas.mai...@googlemail.com
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/dvb-frontends/a8293.h| 3 +--
  drivers/media/dvb-frontends/af9013.h   | 3 +--
  drivers/media/dvb-frontends/af9033.h   | 3 +--
  drivers/media/dvb-frontends/atbm8830.h | 3 +--
  drivers/media/dvb-frontends/au8522.h   | 3 +--
  drivers/media/dvb-frontends/cx22702.h  | 3 +--
  drivers/media/dvb-frontends/cx24113.h  | 3 +--
  drivers/media/dvb-frontends/cx24116.h  | 3 +--
  drivers/media/dvb-frontends/cx24123.h  | 3 +--
  drivers/media/dvb-frontends/cxd2820r.h | 3 +--
  drivers/media/dvb-frontends/dib3000mc.h| 3 +--
  drivers/media/dvb-frontends/dib7000m.h | 3 +--
  drivers/media/dvb-frontends/dib7000p.h | 3 +--
  drivers/media/dvb-frontends/drxd.h | 3 +--
  drivers/media/dvb-frontends/drxk.h | 3 +--
  drivers/media/dvb-frontends/ds3000.h   | 3 +--
  drivers/media/dvb-frontends/dvb_dummy_fe.h | 3 +--
  drivers/media/dvb-frontends/ec100.h| 3 +--
  drivers/media/dvb-frontends/hd29l2.h   | 3 +--
  drivers/media/dvb-frontends/it913x-fe.h| 3 +--
  drivers/media/dvb-frontends/ix2505v.h  | 3 +--
  drivers/media/dvb-frontends/lg2160.h   | 3 +--
  drivers/media/dvb-frontends/lgdt3305.h | 3 +--
  drivers/media/dvb-frontends/lgs8gl5.h  | 3 +--
  drivers/media/dvb-frontends/lgs8gxx.h  | 3 +--
  drivers/media/dvb-frontends/lnbh24.h   | 3 +--
  drivers/media/dvb-frontends/lnbp21.h   | 3 +--
  drivers/media/dvb-frontends/lnbp22.h   | 3 +--
  drivers/media/dvb-frontends/m88rs2000.h| 3 +--
  drivers/media/dvb-frontends/mb86a20s.h | 3 +--
  drivers/media/dvb-frontends/rtl2830.h  | 3 +--
  drivers/media/dvb-frontends/rtl2832.h  | 3 +--
  drivers/media/dvb-frontends/s5h1409.h  | 3 +--
  drivers/media/dvb-frontends/s5h1411.h  | 3 +--
  drivers/media/dvb-frontends/s5h1432.h  | 3 +--
  drivers/media/dvb-frontends/s921.h | 3 +--
  drivers/media/dvb-frontends/si21xx.h   | 3 +--
  drivers/media/dvb-frontends/stb6000.h  | 3 +--
  drivers/media/dvb-frontends/stv0288.h  | 3 +--
  drivers/media/dvb-frontends/stv0367.h  | 3 +--
  drivers/media/dvb-frontends/stv0900.h  | 3 +--
  drivers/media/dvb-frontends/stv6110.h  | 3 +--
  drivers/media/dvb-frontends/tda10048.h | 3 +--
  drivers/media/dvb-frontends/tda10071.h | 3 +--
  drivers/media/dvb-frontends/tda18271c2dd.h | 3 +--
  drivers/media/dvb-frontends/ts2020.h   | 3 +--
  drivers/media/dvb-frontends/zl10036.h  | 3 +--
  drivers/media/dvb-frontends/zl10039.h  | 3 +--
  48 files changed, 48 insertions(+), 96 deletions(-)

 diff --git a/drivers/media/dvb-frontends/a8293.h 
 b/drivers/media/dvb-frontends/a8293.h
 index ed29e55..e6d4a83 100644
 --- a/drivers/media/dvb-frontends/a8293.h
 +++ b/drivers/media/dvb-frontends/a8293.h
 @@ -25,8 +25,7 @@ struct a8293_config {
 u8 i2c_addr;
  };

 -#if defined(CONFIG_DVB_A8293) || \
 -   (defined(CONFIG_DVB_A8293_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_DVB_A8293)
  extern struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c, const struct a8293_config *cfg);
  #else
 diff --git a/drivers/media/dvb-frontends/af9013.h 
 b/drivers/media/dvb-frontends/af9013.h
 index

Re: [PATCH 2/4] [media] tuners: use IS_ENABLED

2013-03-24 Thread Michael Krufky
Reviewed-by: Michael Krufky mkru...@linuxtv.org

On Thu, Mar 21, 2013 at 3:39 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Instead of checking everywhere there for 3 symbols, use instead
 IS_ENABLED macro.

 This replacement was done using this small perl script:

 my $data;
 $data .= $_ while ();
 if ($data =~ m/CONFIG_([A-Z\_\d]*)_MODULE/) {
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)\)[\s\|(\)\!]+defined\(CONFIG_($f)_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;

 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)[\s\|(\)]+defined\(CONFIG_($f)\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(CONFIG_MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 $data =~ 
 s,defined\(CONFIG_($f)_MODULE\)[\s\|(\)]+defined\(MODULE\)\)*,IS_ENABLED(CONFIG_$f),g;
 }
 print $data;

 Cc: Antti Palosaari cr...@iki.fi
 Cc: Michael Buesch m...@bues.ch
 Cc: Hans-Frieder Vogt hfv...@gmx.net
 Cc: Michael Krufky mkru...@kernellabs.com
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 ---
  drivers/media/tuners/e4000.h| 3 +--
  drivers/media/tuners/fc0011.h   | 3 +--
  drivers/media/tuners/fc0012.h   | 3 +--
  drivers/media/tuners/fc0013.h   | 3 +--
  drivers/media/tuners/fc2580.h   | 3 +--
  drivers/media/tuners/max2165.h  | 3 +--
  drivers/media/tuners/mc44s803.h | 3 +--
  drivers/media/tuners/mxl5005s.h | 3 +--
  drivers/media/tuners/tda18212.h | 3 +--
  drivers/media/tuners/tda18218.h | 3 +--
  drivers/media/tuners/tua9001.h  | 3 +--
  drivers/media/tuners/xc5000.h   | 3 +--
  12 files changed, 12 insertions(+), 24 deletions(-)

 diff --git a/drivers/media/tuners/e4000.h b/drivers/media/tuners/e4000.h
 index 71b1935..7801270 100644
 --- a/drivers/media/tuners/e4000.h
 +++ b/drivers/media/tuners/e4000.h
 @@ -36,8 +36,7 @@ struct e4000_config {
 u32 clock;
  };

 -#if defined(CONFIG_MEDIA_TUNER_E4000) || \
 -   (defined(CONFIG_MEDIA_TUNER_E4000_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_E4000)
  extern struct dvb_frontend *e4000_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c, const struct e4000_config *cfg);
  #else
 diff --git a/drivers/media/tuners/fc0011.h b/drivers/media/tuners/fc0011.h
 index 0ee581f..33db6e4 100644
 --- a/drivers/media/tuners/fc0011.h
 +++ b/drivers/media/tuners/fc0011.h
 @@ -22,8 +22,7 @@ enum fc0011_fe_callback_commands {
 FC0011_FE_CALLBACK_RESET,
  };

 -#if defined(CONFIG_MEDIA_TUNER_FC0011) ||\
 -defined(CONFIG_MEDIA_TUNER_FC0011_MODULE)
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_FC0011)
  struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c,
const struct fc0011_config *config);
 diff --git a/drivers/media/tuners/fc0012.h b/drivers/media/tuners/fc0012.h
 index 54508fc..668d70d 100644
 --- a/drivers/media/tuners/fc0012.h
 +++ b/drivers/media/tuners/fc0012.h
 @@ -48,8 +48,7 @@ struct fc0012_config {
 bool clock_out;
  };

 -#if defined(CONFIG_MEDIA_TUNER_FC0012) || \
 -   (defined(CONFIG_MEDIA_TUNER_FC0012_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_FC0012)
  extern struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c,
 const struct fc0012_config *cfg);
 diff --git a/drivers/media/tuners/fc0013.h b/drivers/media/tuners/fc0013.h
 index 594efd6..34aa1c3 100644
 --- a/drivers/media/tuners/fc0013.h
 +++ b/drivers/media/tuners/fc0013.h
 @@ -25,8 +25,7 @@
  #include dvb_frontend.h
  #include fc001x-common.h

 -#if defined(CONFIG_MEDIA_TUNER_FC0013) || \
 -   (defined(CONFIG_MEDIA_TUNER_FC0013_MODULE)  defined(MODULE))
 +#if IS_ENABLED(CONFIG_MEDIA_TUNER_FC0013)
  extern struct dvb_frontend *fc0013_attach(struct dvb_frontend *fe,
 struct i2c_adapter *i2c,
 u8 i2c_address, int dual_master,
 diff --git a/drivers/media/tuners/fc2580.h b/drivers/media/tuners/fc2580.h
 index 222601e..2dbf91f 100644
 --- a/drivers/media/tuners/fc2580.h
 +++ b/drivers/media/tuners/fc2580.h
 @@ -36,8 +36,7 @@ struct fc2580_config {
 u32 clock;
  };

 -#if defined(CONFIG_MEDIA_TUNER_FC2580) || \
 -   (defined(CONFIG_MEDIA_TUNER_FC2580_MODULE)  defined(MODULE))
 +#if IS_ENABLED

Re: [PATCH v2 0/4] saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM

2013-02-17 Thread Michael Krufky
On Sat, Feb 16, 2013 at 11:39 AM, Ondrej Zary
li...@rainbow-software.org wrote:
 On Friday 01 February 2013 21:21:23 Ondrej Zary wrote:
 Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.

 This requires some changes to tda8290 - disabling I2C gate control and
 passing custom std_map to tda18271.
 Also tuner-core needs to be changed because there's currently no way to
 pass any complex configuration to analog tuners.

 What's the status of this patch series?

 The two tda8290 patches are in Michael's dvb tree.
 I've sent an additional clean-up patch (on Mauro's suggestion) for the
 tuner-core change.
 I guess that the final AverMedia A706 patch would be easily merged once the
 tda8290 and tuner-core changess are done.

 Should I resend something?

I've just been a bit busier lately that I had foreseen, but no need to
resend anything - I have your patches.  You'll hear back from me
shortly.

-Mike
--
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: [git:v4l-dvb/for_v3.9] [media] [PATH, 1/2] mxl5007 move reset to attach

2013-02-08 Thread Michael Krufky
Mauro,

This isn't ready for merge yet.  Please revert it.  This needs more
work as I explained on the mailing list.

-Mike Krufky

On Fri, Feb 8, 2013 at 12:37 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 This is an automatic generated email to let you know that the following patch 
 were queued at the
 http://git.linuxtv.org/media_tree.git tree:

 Subject: [media] [PATH,1/2] mxl5007 move reset to attach
 Author:  Jose Alberto Reguero jaregu...@telefonica.net
 Date:Sun Feb 3 18:30:38 2013 -0300

 This patch move the soft reset to the attach function because with dual
 tuners, when one tuner do reset, the other one is perturbed, and the
 stream has errors.

 Signed-off-by: Jose Alberto Reguero jaregu...@telefonica.net
 Reviewed-by: Antti Palosaari cr...@iki.fi
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

  drivers/media/tuners/mxl5007t.c |   17 +
  1 files changed, 13 insertions(+), 4 deletions(-)

 ---

 http://git.linuxtv.org/media_tree.git?a=commitdiff;h=0a3237704dec476be3cdfbe8fc9df9cc65b14442

 diff --git a/drivers/media/tuners/mxl5007t.c b/drivers/media/tuners/mxl5007t.c
 index 69e453e..eb61304 100644
 --- a/drivers/media/tuners/mxl5007t.c
 +++ b/drivers/media/tuners/mxl5007t.c
 @@ -531,10 +531,6 @@ static int mxl5007t_tuner_init(struct mxl5007t_state 
 *state,
 struct reg_pair_t *init_regs;
 int ret;

 -   ret = mxl5007t_soft_reset(state);
 -   if (mxl_fail(ret))
 -   goto fail;
 -
 /* calculate initialization reg array */
 init_regs = mxl5007t_calc_init_regs(state, mode);

 @@ -900,7 +896,20 @@ struct dvb_frontend *mxl5007t_attach(struct dvb_frontend 
 *fe,
 /* existing tuner instance */
 break;
 }
 +
 +   if (fe-ops.i2c_gate_ctrl)
 +   fe-ops.i2c_gate_ctrl(fe, 1);
 +
 +   ret = mxl5007t_soft_reset(state);
 +
 +   if (fe-ops.i2c_gate_ctrl)
 +   fe-ops.i2c_gate_ctrl(fe, 0);
 +
 +   if (mxl_fail(ret))
 +   goto fail;
 +
 fe-tuner_priv = state;
 +
 mutex_unlock(mxl5007t_list_mutex);

 memcpy(fe-ops.tuner_ops, mxl5007t_tuner_ops,

 ___
 linuxtv-commits mailing list
 linuxtv-comm...@linuxtv.org
 http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
--
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: af9035 test needed!

2013-02-03 Thread Michael Krufky
On Sun, Feb 3, 2013 at 8:21 AM, Antti Palosaari cr...@iki.fi wrote:
 On 02/03/2013 02:04 PM, Jose Alberto Reguero wrote:

 On Sábado, 2 de febrero de 2013 23:00:45 Michael Krufky escribió:

 On Fri, Jan 11, 2013 at 6:45 PM, Jose Alberto Reguero

 jaregu...@telefonica.net wrote:

 On Viernes, 11 de enero de 2013 20:38:01 Antti Palosaari escribió:

 Hello Jose and Gianluca

 Could you test that (tda18218  mxl5007t):

 http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/it9135_t
 une r

 I wonder if ADC config logic still works for superheterodyne tuners
 (tuner having IF). I changed it to adc / 2 always due to IT9135 tuner.
 That makes me wonder it possible breaks tuners having IF, as ADC was
 clocked just over 20MHz and if it is half then it is 10MHz. For BB that
 is enough, but I think that having IF, which is 4MHz at least for 8MHz
 BW it is too less.

 F*ck I hate to maintain driver without a hardware! Any idea where I can
 get AF9035 device having tda18218 or mxl5007t?

 regards
 Antti


 Still pending the changes for  mxl5007t. Attached is a patch for that.

 Changes to make work Avermedia Twinstar with the af9035 driver.

 Signed-off-by: Jose Alberto Reguero jaregu...@telefonica.net

 Jose Alberto

 diff -upr linux/drivers/media/tuners/mxl5007t.c
 linux.new/drivers/media/tuners/mxl5007t.c
 --- linux/drivers/media/tuners/mxl5007t.c   2012-08-14
 05:45:22.0 +0200 +++ linux.new/drivers/media/tuners/mxl5007t.c
 2013-01-10 19:23:09.247556275 +0100
 @@ -374,7 +374,6 @@ static struct reg_pair_t *mxl5007t_calc_

  mxl5007t_set_if_freq_bits(state, cfg-if_freq_hz,
 cfg-invert_if);
  mxl5007t_set_xtal_freq_bits(state, cfg-xtal_freq_hz);

 -   set_reg_bits(state-tab_init, 0x04, 0x01,
 cfg-loop_thru_enable);

  set_reg_bits(state-tab_init, 0x03, 0x08, cfg-clk_out_enable
 
  3);
  set_reg_bits(state-tab_init, 0x03, 0x07, cfg-clk_out_amp);


 This is a configurable option - it should not be removed, just
 configure your glue code to not use that option if you dont want
 it unless there's some other reason why you're removing this?


 I just move the code to a mxl5007t_attach because with dual tuner until
 the
 code is executed, the other tuner don't work. It can be left here also.

 @@ -531,9 +530,12 @@ static int mxl5007t_tuner_init(struct mx

  struct reg_pair_t *init_regs;
  int ret;

 -   ret = mxl5007t_soft_reset(state);
 -   if (mxl_fail(ret))
 +   if (!state-config-no_reset) {
 +   ret = mxl5007t_soft_reset(state);
 +   if (mxl_fail(ret))

  goto fail;

 +   }
 +


 this seems wrong to me.  why would you want to prevent the driver from
 doing a soft reset?


 That is because with my hardware and dual tuner, when one tuner do reset,
 the
 other one is perturbed, and the stream has errors.

  /* calculate initialization reg array */
  init_regs = mxl5007t_calc_init_regs(state, mode);

 @@ -887,7 +889,12 @@ struct dvb_frontend *mxl5007t_attach(str

  if (fe-ops.i2c_gate_ctrl)

  fe-ops.i2c_gate_ctrl(fe, 1);

 -   ret = mxl5007t_get_chip_id(state);
 +   if (!state-config-no_probe)
 +   ret = mxl5007t_get_chip_id(state);
 +
 +   ret = mxl5007t_write_reg(state, 0x04,
 +   state-config-loop_thru_enable);
 +


 Can you explain why this change was made?  ^^


 mxl5007t_get_chip_id has a read, and with the hardware I have, after the
 read
 operation is made, communication with the chip don't work.

  if (fe-ops.i2c_gate_ctrl)

  fe-ops.i2c_gate_ctrl(fe, 0);

 diff -upr linux/drivers/media/tuners/mxl5007t.h
 linux.new/drivers/media/tuners/mxl5007t.h
 --- linux/drivers/media/tuners/mxl5007t.h   2012-08-14
 05:45:22.0 +0200 +++ linux.new/drivers/media/tuners/mxl5007t.h
 2013-01-10 19:19:11.204379581 +0100
 @@ -73,8 +73,10 @@ struct mxl5007t_config {

  enum mxl5007t_xtal_freq xtal_freq_hz;
  enum mxl5007t_if_freq if_freq_hz;
  unsigned int invert_if:1;

 -   unsigned int loop_thru_enable:1;
 +   unsigned int loop_thru_enable:3;


 Why widen this boolean to three bits?


 I just use the value 3 for this option(taken from windows driver) and it
 works
 well.


 Thanks for review the code.

 Jose Alberto

  unsigned int clk_out_enable:1;

 +   unsigned int no_probe:1;
 +   unsigned int no_reset:1;

   };

   #if defined(CONFIG_MEDIA_TUNER_MXL5007T) ||

 (defined(CONFIG_MEDIA_TUNER_MXL5007T_MODULE)  defined(MODULE))
 diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c
 linux.new/drivers/media/usb/dvb-usb-v2/af9035.c
 --- linux/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-07
 05:45:57.0 +0100
 +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-12
 00:30:57.557310465 +0100
 @@ -886,13 +886,17 @@ static struct mxl5007t_config

Re: af9035 test needed!

2013-02-03 Thread Michael Krufky
(history chopped cuz it got messy)

quoting Antti with my responses inline.


I agree that it should be split multiple patches.

KRUFKY:  YES.

1) soft reset should be moved to attach() (it could not be on init()
nor set_parameters() as it stops clock out and loop-through in few ms
or so causing slave tuner errors)

KRUFKY: NO.  This is not the solution.  If there is a bug in the
driver, then we fix the bug.  Moving the soft reset to a one time only
call during attach can cause worse problems.  If you feel strongly
about this, then submit it in a separate patch and we can work on that
issue separately.  The soft reset needs to be done each time the tuner
is programmed for good reason - if we are screwing up some registers,
then it means that there is a bug - lets fix the bug.

2) clock out and loop-through must be set on attach() and not touch after that

KRUFKY: NO.  attach() is called once, ever.   I admit that the current
code may be buggy but doing this would cause unpredicable behavior
after low-power states...  If this needs to be fixed then it needs to
be fixed in a thorough way, not by moving the code away into the
attach function where it will only be called once.  Clearly this issue
is directly related to issue number 1, so I understand if these two
items might be the focus of future discussion :-/

3) no_probe option should not be added unless it is really needed. If
chip ID reading fails with some I/O error then there is two
possibilities a) block reads like now b) add glue to AF9035 brain-dead
I2C adapter to handle / fake such case

KRUFKY:  I agree -- this may be required in order to work around some
questionable hardware implementations.  If the problem is really in
the i2c adapter, then the hack belongs there, not in the tuner driver.

4) loop_thru_enable to 3 bit wide should not be done unless really
needed. What happens if it is left as it is?

KRUFKY: Agreed.  We don't make a change just because you saw something
in 'the windows driver'  As per the current Linux driver, the loop
thru setting is 1 bit wide.  If this is wrong, please provide a better
explanation of those bits.

These are the four logical changes that should be sent as own patch.
Jose, we are waiting for you :)


-Mike
--
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: af9035 test needed!

2013-02-03 Thread Michael Krufky
On Sun, Feb 3, 2013 at 3:29 PM, Antti Palosaari cr...@iki.fi wrote:
 On 02/03/2013 09:53 PM, Michael Krufky wrote:

 (history chopped cuz it got messy)

 quoting Antti with my responses inline.

 
 I agree that it should be split multiple patches.

 KRUFKY:  YES.

 1) soft reset should be moved to attach() (it could not be on init()
 nor set_parameters() as it stops clock out and loop-through in few ms
 or so causing slave tuner errors)

 KRUFKY: NO.  This is not the solution.  If there is a bug in the
 driver, then we fix the bug.  Moving the soft reset to a one time only
 call during attach can cause worse problems.  If you feel strongly
 about this, then submit it in a separate patch and we can work on that
 issue separately.  The soft reset needs to be done each time the tuner
 is programmed for good reason - if we are screwing up some registers,
 then it means that there is a bug - lets fix the bug.


 You cannot do soft reset all the time. MxL5007t soft reset looks like just
 jump instruction to chip reset vector, it simply clears all the registers to
 the default state (I think just same state as power on reset).

 That means you taint clock output and loop-through every time you call that
 soft reset. Why the hell there is such outputs offered by the chip if those
 are aimed to shut off frequently by soft resetting chip? Such outputs are
 useless. Due to that analogy, there will be only one conclusion: soft reset
 is not aimed to be called for every tuning attempt.

 It is just easy way to ensure chip is known default state on attach(). For
 example you warm boot from windows to linux and wish to ensure chip is known
 state after attach(). It is driver bug if soft resetting all the registers
 to default is needed frequently in order to operate normally!



 2) clock out and loop-through must be set on attach() and not touch after
 that

 KRUFKY: NO.  attach() is called once, ever.   I admit that the current
 code may be buggy but doing this would cause unpredicable behavior
 after low-power states...  If this needs to be fixed then it needs to
 be fixed in a thorough way, not by moving the code away into the
 attach function where it will only be called once.  Clearly this issue
 is directly related to issue number 1, so I understand if these two
 items might be the focus of future discussion :-/


 Shutting down clock output when not needed surely saves few mA from the
 current drain. But currently there is no DVB framework support for it, so
 better to leave clock out enabled always. It is relative small amount of
 current you will save - there is a lot of bigger power management issues
 about all the drivers currently.



 3) no_probe option should not be added unless it is really needed. If
 chip ID reading fails with some I/O error then there is two
 possibilities a) block reads like now b) add glue to AF9035 brain-dead
 I2C adapter to handle / fake such case

 KRUFKY:  I agree -- this may be required in order to work around some
 questionable hardware implementations.  If the problem is really in
 the i2c adapter, then the hack belongs there, not in the tuner driver.


 The one thing what I think I has already mentioned for Jose - test some
 other tuner IDs. There is many tuners supported by AF9035 FW and about all
 of those uses register reads. So telling wrong tuner ID to AF9035 just
 before attach tuner could do the trick. And after successful tuner attach
 just tell AF9035 FW that MXL5007T tuner id.


 4) loop_thru_enable to 3 bit wide should not be done unless really
 needed. What happens if it is left as it is?

 KRUFKY: Agreed.  We don't make a change just because you saw something
 in 'the windows driver'  As per the current Linux driver, the loop
 thru setting is 1 bit wide.  If this is wrong, please provide a better
 explanation of those bits.

 These are the four logical changes that should be sent as own patch.
 Jose, we are waiting for you :)



 -Mike


 Antti

I was just thinking and I realize fault in my own arguments where I
said No.  ...  Coincidentally you sent this email just as I was
thinking of doing the same.

I retract my No s :-)

Let's just see a patch series and we'll evaluate each patch individually.

Cheers,

Mike
--
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: config option for building tuners

2013-02-03 Thread Michael Krufky
On Thu, Jan 24, 2013 at 5:11 PM, Simon Que s...@chromium.org wrote:
 This patch provides a Kconfig option, MEDIA_TUNER_SUPPORT, that
 determines whether media/tuners is included in the build.  This way,
 the tuners don't have to be unconditionally included in the build.

 Signed-off-by: Simon Que s...@chromium.org
 ---
  drivers/media/Kconfig  | 9 +
  drivers/media/Makefile | 3 ++-
  2 files changed, 11 insertions(+), 1 deletion(-)

 diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
 index 4ef0d80..a266da2 100644
 --- a/drivers/media/Kconfig
 +++ b/drivers/media/Kconfig
 @@ -73,6 +73,15 @@ config MEDIA_RC_SUPPORT

   Say Y when you have a TV or an IR device.

 +config MEDIA_TUNER_SUPPORT
 +   tristate
 +   help
 + This enables the tuner modules in the tuners directory.  Use this
 + option to turn on tuners.  The individual tuner modules can then be
 + turned on/off one-by-one.
 +
 + Say Y when you have a V4L/DVB tuner in your system.
 +
  #
  # Media controller
  #  Selectable only for webcam/grabbers, as other drivers don't use it
 diff --git a/drivers/media/Makefile b/drivers/media/Makefile
 index 620f275..679db94 100644
 --- a/drivers/media/Makefile
 +++ b/drivers/media/Makefile
 @@ -8,7 +8,8 @@ media-objs  := media-device.o media-devnode.o 
 media-entity.o
  # I2C drivers should come before other drivers, otherwise they'll fail
  # when compiled as builtin drivers
  #
 -obj-y += i2c/ tuners/
 +obj-y += i2c/
 +obj-$(CONFIG_MEDIA_TUNER_SUPPORT)  += tuners/
  obj-$(CONFIG_DVB_CORE)  += dvb-frontends/

  #


I don't quite see the benefit of this patch.  Could you explain to us
what the desired effect is that you're looking to achieve?  I believe
that if you have no drivers selected that need tuners, that no tuner
drivers will be built, or at least that's how it used to work.

Even if you did select a driver that uses a tuner, you can enable the
customization options and deselect all of the tuners drivers.  I don't
think this patch is needed at all, if I understand your goal
correctly.

If I'm missing something, please elaborate.

-Mike
--
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 3/4] tuner-core: Change config from unsigned int to void *

2013-02-03 Thread Michael Krufky
 sure this doesn't have any negative
effect on the tda827x driver, but it looks safe to me right now.

I'd like to hear Mauro's comments on this too, but it looks good to me.

Reviewed-by: Michael Krufky mkru...@linuxtv.org
--
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/4] tda8290: Allow disabling I2C gate

2013-02-03 Thread Michael Krufky
On Fri, Feb 1, 2013 at 3:21 PM, Ondrej Zary li...@rainbow-software.org wrote:
 Allow disabling I2C gate handling by external configuration.
 This is required by cards that have all devices on a single I2C bus,
 like AverMedia A706.

 Signed-off-by: Ondrej Zary li...@rainbow-software.org
 ---
  drivers/media/tuners/tda8290.c |   49 +++
  drivers/media/tuners/tda8290.h |1 +
  2 files changed, 30 insertions(+), 20 deletions(-)

 diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c
 index 8c48521..a2b7a9f 100644
 --- a/drivers/media/tuners/tda8290.c
 +++ b/drivers/media/tuners/tda8290.c
 @@ -233,7 +233,8 @@ static void tda8290_set_params(struct dvb_frontend *fe,
 }


 -   tda8290_i2c_bridge(fe, 1);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 1);

 if (fe-ops.tuner_ops.set_analog_params)
 fe-ops.tuner_ops.set_analog_params(fe, params);
 @@ -302,7 +303,8 @@ static void tda8290_set_params(struct dvb_frontend *fe,
 }
 }

 -   tda8290_i2c_bridge(fe, 0);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 0);
 tuner_i2c_xfer_send(priv-i2c_props, if_agc_set, 2);
  }

 @@ -424,7 +426,8 @@ static void tda8295_set_params(struct dvb_frontend *fe,
 tuner_i2c_xfer_send(priv-i2c_props, blanking_mode, 2);
 msleep(20);

 -   tda8295_i2c_bridge(fe, 1);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 1);

 if (fe-ops.tuner_ops.set_analog_params)
 fe-ops.tuner_ops.set_analog_params(fe, params);
 @@ -437,7 +440,8 @@ static void tda8295_set_params(struct dvb_frontend *fe,
 else
 tuner_dbg(tda8295 not locked, no signal?\n);

 -   tda8295_i2c_bridge(fe, 0);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 0);
  }

  /*-*/
 @@ -465,11 +469,13 @@ static void tda8290_standby(struct dvb_frontend *fe)
 unsigned char tda8290_agc_tri[] = { 0x02, 0x20 };
 struct i2c_msg msg = {.addr = priv-tda827x_addr, .flags=0, .buf=cb1, 
 .len = 2};

 -   tda8290_i2c_bridge(fe, 1);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 1);
 if (priv-ver  TDA8275A)
 cb1[1] = 0x90;
 i2c_transfer(priv-i2c_props.adap, msg, 1);
 -   tda8290_i2c_bridge(fe, 0);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 0);
 tuner_i2c_xfer_send(priv-i2c_props, tda8290_agc_tri, 2);
 tuner_i2c_xfer_send(priv-i2c_props, tda8290_standby, 2);
  }
 @@ -537,9 +543,11 @@ static void tda8290_init_tuner(struct dvb_frontend *fe)
 if (priv-ver  TDA8275A)
 msg.buf = tda8275a_init;

 -   tda8290_i2c_bridge(fe, 1);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 1);
 i2c_transfer(priv-i2c_props.adap, msg, 1);
 -   tda8290_i2c_bridge(fe, 0);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 0);
  }

  /*-*/
 @@ -565,19 +573,13 @@ static struct tda18271_config tda829x_tda18271_config = 
 {
  static int tda829x_find_tuner(struct dvb_frontend *fe)
  {
 struct tda8290_priv *priv = fe-analog_demod_priv;
 -   struct analog_demod_ops *analog_ops = fe-ops.analog_ops;
 int i, ret, tuners_found;
 u32 tuner_addrs;
 u8 data;
 struct i2c_msg msg = { .flags = I2C_M_RD, .buf = data, .len = 1 };

 -   if (!analog_ops-i2c_gate_ctrl) {
 -   printk(KERN_ERR tda8290: no gate control were provided!\n);
 -
 -   return -EINVAL;
 -   }
 -
 -   analog_ops-i2c_gate_ctrl(fe, 1);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 1);

 /* probe for tuner chip */
 tuners_found = 0;
 @@ -595,7 +597,8 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
give a response now
  */

 -   analog_ops-i2c_gate_ctrl(fe, 0);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 0);

 if (tuners_found  1)
 for (i = 0; i  tuners_found; i++) {
 @@ -618,12 +621,14 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
 priv-tda827x_addr = tuner_addrs;
 msg.addr = tuner_addrs;

 -   analog_ops-i2c_gate_ctrl(fe, 1);
 +   if (fe-ops.analog_ops.i2c_gate_ctrl)
 +   fe-ops.analog_ops.i2c_gate_ctrl(fe, 1);
 ret = i2c_transfer(priv-i2c_props.adap, msg, 1);

 if (ret != 1) {
 tuner_warn(tuner 

Re: af9035 test needed!

2013-02-02 Thread Michael Krufky
On Fri, Jan 11, 2013 at 6:45 PM, Jose Alberto Reguero
jaregu...@telefonica.net wrote:
 On Viernes, 11 de enero de 2013 20:38:01 Antti Palosaari escribió:
 Hello Jose and Gianluca

 Could you test that (tda18218  mxl5007t):
 http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/it9135_tune
 r

 I wonder if ADC config logic still works for superheterodyne tuners
 (tuner having IF). I changed it to adc / 2 always due to IT9135 tuner.
 That makes me wonder it possible breaks tuners having IF, as ADC was
 clocked just over 20MHz and if it is half then it is 10MHz. For BB that
 is enough, but I think that having IF, which is 4MHz at least for 8MHz
 BW it is too less.

 F*ck I hate to maintain driver without a hardware! Any idea where I can
 get AF9035 device having tda18218 or mxl5007t?

 regards
 Antti

 Still pending the changes for  mxl5007t. Attached is a patch for that.

 Changes to make work Avermedia Twinstar with the af9035 driver.

 Signed-off-by: Jose Alberto Reguero jaregu...@telefonica.net

 Jose Alberto

 diff -upr linux/drivers/media/tuners/mxl5007t.c
 linux.new/drivers/media/tuners/mxl5007t.c
 --- linux/drivers/media/tuners/mxl5007t.c   2012-08-14 05:45:22.0 
 +0200
 +++ linux.new/drivers/media/tuners/mxl5007t.c   2013-01-10 19:23:09.247556275
 +0100
 @@ -374,7 +374,6 @@ static struct reg_pair_t *mxl5007t_calc_
 mxl5007t_set_if_freq_bits(state, cfg-if_freq_hz, cfg-invert_if);
 mxl5007t_set_xtal_freq_bits(state, cfg-xtal_freq_hz);

 -   set_reg_bits(state-tab_init, 0x04, 0x01, cfg-loop_thru_enable);
 set_reg_bits(state-tab_init, 0x03, 0x08, cfg-clk_out_enable  3);
 set_reg_bits(state-tab_init, 0x03, 0x07, cfg-clk_out_amp);


This is a configurable option - it should not be removed, just
configure your glue code to not use that option if you dont want
it unless there's some other reason why you're removing this?

 @@ -531,9 +530,12 @@ static int mxl5007t_tuner_init(struct mx
 struct reg_pair_t *init_regs;
 int ret;

 -   ret = mxl5007t_soft_reset(state);
 -   if (mxl_fail(ret))
 +   if (!state-config-no_reset) {
 +   ret = mxl5007t_soft_reset(state);
 +   if (mxl_fail(ret))
 goto fail;
 +   }
 +

this seems wrong to me.  why would you want to prevent the driver from
doing a soft reset?


 /* calculate initialization reg array */
 init_regs = mxl5007t_calc_init_regs(state, mode);
 @@ -887,7 +889,12 @@ struct dvb_frontend *mxl5007t_attach(str
 if (fe-ops.i2c_gate_ctrl)
 fe-ops.i2c_gate_ctrl(fe, 1);

 -   ret = mxl5007t_get_chip_id(state);
 +   if (!state-config-no_probe)
 +   ret = mxl5007t_get_chip_id(state);
 +
 +   ret = mxl5007t_write_reg(state, 0x04,
 +   state-config-loop_thru_enable);
 +


Can you explain why this change was made?  ^^

 if (fe-ops.i2c_gate_ctrl)
 fe-ops.i2c_gate_ctrl(fe, 0);
 diff -upr linux/drivers/media/tuners/mxl5007t.h
 linux.new/drivers/media/tuners/mxl5007t.h
 --- linux/drivers/media/tuners/mxl5007t.h   2012-08-14 05:45:22.0 
 +0200
 +++ linux.new/drivers/media/tuners/mxl5007t.h   2013-01-10 19:19:11.204379581
 +0100
 @@ -73,8 +73,10 @@ struct mxl5007t_config {
 enum mxl5007t_xtal_freq xtal_freq_hz;
 enum mxl5007t_if_freq if_freq_hz;
 unsigned int invert_if:1;
 -   unsigned int loop_thru_enable:1;
 +   unsigned int loop_thru_enable:3;

Why widen this boolean to three bits?

 unsigned int clk_out_enable:1;
 +   unsigned int no_probe:1;
 +   unsigned int no_reset:1;
  };

  #if defined(CONFIG_MEDIA_TUNER_MXL5007T) ||
 (defined(CONFIG_MEDIA_TUNER_MXL5007T_MODULE)  defined(MODULE))
 diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c
 linux.new/drivers/media/usb/dvb-usb-v2/af9035.c
 --- linux/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-07 05:45:57.0
 +0100
 +++ linux.new/drivers/media/usb/dvb-usb-v2/af9035.c 2013-01-12
 00:30:57.557310465 +0100
 @@ -886,13 +886,17 @@ static struct mxl5007t_config af9035_mxl
 .loop_thru_enable = 0,
 .clk_out_enable = 0,
 .clk_out_amp = MxL_CLKOUT_AMP_0_94V,
 +   .no_probe = 1,
 +   .no_reset = 1,
 }, {
 .xtal_freq_hz = MxL_XTAL_24_MHZ,
 .if_freq_hz = MxL_IF_4_57_MHZ,
 .invert_if = 0,
 -   .loop_thru_enable = 1,
 +   .loop_thru_enable = 3,
 .clk_out_enable = 1,
 .clk_out_amp = MxL_CLKOUT_AMP_0_94V,
 +   .no_probe = 1,
 +   .no_reset = 1,
 }
  };




This patch cannot be merged as-is.  I'm sorry.  If you could explain
why each change was made, then perhaps I would be able to advise
better how to make this work on your device without breaking others.

-Mike 

Re: af9035 test needed!

2013-01-31 Thread Michael Krufky
Hey guys... somehow this email slipped through my filters :-(  I see
it now, and I'll give a look over the patch this weekend.

-Mike

On Thu, Jan 31, 2013 at 8:04 AM, Andre Heider a.hei...@gmail.com wrote:
 Hi,

 On Fri, Jan 11, 2013 at 7:38 PM, Antti Palosaari cr...@iki.fi wrote:
 Could you test that (tda18218  mxl5007t):
 http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/it9135_tuner

 I got a 'TerraTec Cinergy T Stick Dual RC (rev. 2)', which is fixed by
 this series.
 Any chance to get this into 3.9 (I guess its too late for the USB
 VID/PID 'fix' for 3.8)?

 Regards,
 Andre
 --
 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: [RFC] Initial scan files troubles and brainstorming

2013-01-10 Thread Michael Krufky
On Thu, Jan 10, 2013 at 1:46 PM, Manu Abraham abraham.m...@gmail.com wrote:
 On 1/11/13, Jiri Slaby jirisl...@gmail.com wrote:
 On 01/10/2013 06:40 PM, Manu Abraham wrote:
 On 1/9/13, Mauro Carvalho Chehab mche...@redhat.com wrote:
 Em Wed, 9 Jan 2013 06:08:44 -0500
 Michael Krufky mkru...@linuxtv.org escreveu:

 On Wed, Jan 9, 2013 at 5:41 AM, Mauro Carvalho Chehab
 mche...@redhat.com wrote:
 Em Wed, 09 Jan 2013 10:43:23 +0100
 Oliver Schinagl oliver+l...@schinagl.nl escreveu:

 On 08-01-13 21:01, Johannes Stezenbach wrote:
 On Mon, Jan 07, 2013 at 01:48:29PM +0100, Oliver Schinagl wrote:
 On 07-01-13 11:46, Jiri Slaby wrote:
 On 12/18/2012 11:01 PM, Oliver Schinagl wrote:
 Unfortunatly, I have had zero replies.
 Hmm, it's sad there is a silence in this thread from linux-media
 guys :/.
 In their defense, they are very very busy people ;) chatter on this
 thread does bring it up however.
 This is such a nice thing to say :-)
 But it might be that Mauro thinks the dvb-apps maintainer should
 respond, but apparently there is no dvb-apps maintainer...
 Maybe you should ask Mauro directly to create an account for you
 to implement what you proposed.
 Mauro is CC'ed and I'd ask of course for this (I kinda did) but who
 decides what I suggested is a good idea? I personally obviously think
 it
 is ;) and even more so if dvb-apps are unmaintained.

 I guess the question now becomes 'who okay's this change? Who says
 'okay, lets do it this way. Once that is answered we can go from
 there
 ;)

 If I understood it right, you want to split the scan files into a
 separate
 git tree and maintain it, right?

 I'm ok with that.

 Regards,
 Mauro

 As a DVB maintainer, I am OK with this as well - It does indeed make
 sense to separate the c code sources from the regional frequency
 tables, and I'm sure we'll see much benefit from this change.

 Done. I created a tree for Oliver to maintain it and an account for him.
 I also created a new tree with just the DVB table commits to:
 http://git.linuxtv.org/dtv-scan-tables.git

 I kept there both szap and scan files, although maybe it makes sense to
 drop the szap table (channels-conf dir). It also makes sense to drop the
 tables from the dvb-apps tree, to avoid duplicated stuff, and to avoid

 Being one of the maintainers:

 I will keep the tables in the dvb-apps tree for the time being.

 That does not make sense at all -- why? Duplicated stuff always hurts.


 The scan files and config files are very specific to dvb-apps, some
 applications
 do rely on these config files. It doesn't really make sense to have
 split out config
 files for these  small applications.



 Will decide to
 drop the config files as needed from dvb-apps. It is necessary to keep a
 copy of the config files for development purposes, rather than pulling
 from
 different trees.

 What development purposes, could you be more specific? You can still use
 git submodules if really needed. But as it stands I do not see a reason
 for that at all...


 Did you think that the dvb-apps just came out of thin air ?

 development of dvb-applications, implies eventually config files also
 will be updated as necessary. Having them in separate repositories
 makes such work harder for working.
 while working with dvb-apps, it would make things saner if it is the
 same SCM, rather
 than having different SCM's. So according to you, you want to make it
 still harder for someone to work with dvb-apps.


 Manu

Manu,

I see great value in separating the history of the data files from the
code files.  If you really think this is such a terrible task for a
developer to have to pull from a second repository to fetch these data
files, then I find no reason why we couldn't script it such that
building the dvb-apps package would trigger the pull from the
additional repository.

I think that's a fair compromise.

Meanwhile, your argument is for developers.  Developers can handle
pulling from a separated tree for data files who shouldn't be clouding
the history of source code development, anyway.  Developers are indeed
used to dealing with multiple repositories, and if any developer
isn't, then now is the time to get with the program!

I think this change is a great idea, and I would hope that we'd all
agree on this, at least.

Best Regards,

Mike Krufky
--
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: [RFC] Initial scan files troubles and brainstorming

2013-01-09 Thread Michael Krufky
On Wed, Jan 9, 2013 at 5:41 AM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Em Wed, 09 Jan 2013 10:43:23 +0100
 Oliver Schinagl oliver+l...@schinagl.nl escreveu:

 On 08-01-13 21:01, Johannes Stezenbach wrote:
  On Mon, Jan 07, 2013 at 01:48:29PM +0100, Oliver Schinagl wrote:
  On 07-01-13 11:46, Jiri Slaby wrote:
  On 12/18/2012 11:01 PM, Oliver Schinagl wrote:
  Unfortunatly, I have had zero replies.
  Hmm, it's sad there is a silence in this thread from linux-media guys :/.
  In their defense, they are very very busy people ;) chatter on this
  thread does bring it up however.
  This is such a nice thing to say :-)
  But it might be that Mauro thinks the dvb-apps maintainer should
  respond, but apparently there is no dvb-apps maintainer...
  Maybe you should ask Mauro directly to create an account for you
  to implement what you proposed.
 Mauro is CC'ed and I'd ask of course for this (I kinda did) but who
 decides what I suggested is a good idea? I personally obviously think it
 is ;) and even more so if dvb-apps are unmaintained.

 I guess the question now becomes 'who okay's this change? Who says
 'okay, lets do it this way. Once that is answered we can go from there ;)

 If I understood it right, you want to split the scan files into a separate
 git tree and maintain it, right?

 I'm ok with that.

 Regards,
 Mauro

As a DVB maintainer, I am OK with this as well - It does indeed make
sense to separate the c code sources from the regional frequency
tables, and I'm sure we'll see much benefit from this change.

Regards,

Mike Krufky
--
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] tda10071: make sure both tuner and demod i2c addresses are specified

2013-01-04 Thread Michael Krufky
On Tue, Jan 1, 2013 at 10:39 AM, Antti Palosaari cr...@iki.fi wrote:
 On 12/17/2012 03:12 AM, Michael Krufky wrote:

 display an error message if either tuner_i2c_addr or demod_i2c_addr
 are not specified in the tda10071_config structure


 Nack.

 I don't see it necessary at all to check correctness of driver configuration
 values explicitly like that. Those are values which user cannot never change
 and when driver developer pass wrong values he will find it out very soon as
 hardware is not working.

 Adding comments to configuration struct which says possible values is
 advisable and enough IMHO.

 Maybe you should open own topic for discussion if you really would like to
 add this kind of checks. It is not tda10071 driver specific change, it
 affects about all drivers.


Antti,

I don't believe that your NACK has any technical merit- we are trying
to enforce good programming practice here, and when we find that a
piece of silicon has a configurable option, we like to expose that
option.  We try not to make default values unless its necessary, but
when there are differing i2c addresses, it is always best to have that
listed explicitly in the configuration structures.  It's called
self-documenting code- It's the way we try to write code in the Linux
kernel.

In this case, there was one previous user of the tda10071 driver and
it was a small change to add both tuner and demod i2c addresses to the
configuration structure.

We did speak about this on IRC on the sixteenth of December, and you
seemed OK with the idea:

[18:21] mkrufky dunno if you saw i asked earlier, but if you
want to review the patches, i can include your credentials on the pull
request
[18:21] mkrufky tda10071 patch:
http://git.linuxtv.org/mkrufky/hauppauge.git/commitdiff/4244d8155324263df37a8b2e067e7b9b81faec29
[18:22] mkrufky cx23885 patch:
http://git.linuxtv.org/mkrufky/hauppauge.git/commitdiff/eb658993b7a834911a3e8aabc7729b2505eef7d0
[18:22] mkrufky and i'll add another patch error out if the
tuner_i2c_addr is not specified, as devin recommended
[18:22] mkrufky (and also change the other tda10071 user to specify
0x14 for tuner_i2c_addr)
[18:23] crope Acked-by: Antti Palosaari cr...@iki.fi
[18:23] crope Reviewed-by: Antti Palosaari cr...@iki.fi
[18:23] mkrufky cool, thanks :-)
[18:24] crope I think 14 is the default, it is hard to understand
why ever one wants to use some other address in case of it is
controlled by demod :] but feel free to do that
[18:24] mkrufky ok
[18:25] mkrufky thats why i'll do it in a separate patch -- no need
to confuse a board addition with other cleanups
[18:25] crope eg cx24116/cx24118 does not specify tuner address at
all (as far as I see) = I think it is hard coded even to firmware
[18:26] mkrufky yea ur right

...the tuner and demod addresses can be changed, so we represent that
in the configuration structure.  I see no reason why you should have
any complaints about this patch.

Best regards,

Mike


 regards
 Antti




 Signed-off-by: Michael Krufky mkru...@linuxtv.org
 ---
   drivers/media/dvb-frontends/tda10071.c  |   18 +++---
   drivers/media/dvb-frontends/tda10071.h  |4 ++--
   drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
   drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
   4 files changed, 20 insertions(+), 7 deletions(-)

 diff --git a/drivers/media/dvb-frontends/tda10071.c
 b/drivers/media/dvb-frontends/tda10071.c
 index 7103629..02f9234 100644
 --- a/drivers/media/dvb-frontends/tda10071.c
 +++ b/drivers/media/dvb-frontends/tda10071.c
 @@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv,
 u8 reg, u8 *val,
 u8 buf[len+1];
 struct i2c_msg msg[1] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = sizeof(buf),
 .buf = buf,
 @@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv
 *priv, u8 reg, u8 *val,
 u8 buf[len];
 struct i2c_msg msg[2] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = 1,
 .buf = reg,
 }, {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = I2C_M_RD,
 .len = sizeof(buf),
 .buf = buf,
 @@ -1202,6 +1202,18 @@ struct dvb_frontend *tda10071_attach(const struct
 tda10071_config *config,
 goto error;
 }

 +   /* make sure demod i2c address is specified */
 +   if (!config-demod_i2c_addr) {
 +   dev_dbg(i2c-dev, %s: invalid demod i2c address!\n,
 __func__);
 +   goto error;
 +   }
 +
 +   /* make sure tuner i2c address

Re: RFC run time configuration parameter checks in subdriver

2013-01-04 Thread Michael Krufky
On Fri, Jan 4, 2013 at 9:02 AM, Antti Palosaari cr...@iki.fi wrote:
 I would like to discuss if there is idea to validate subdriver parameters
 explicitly at run-time when subdriver module is load.

 There is configuration parameters for about every driver like:
 * I2C address
 * clock frequency

 Nowadays, when main driver loads subdriver, it passes those static
 compile-time parameters to the subdriver, those parameters are not mainly
 validated at all. That could lead situation device is not working, instead
 it is will fail with some error, like I/O as I2C address is wrong.

 As these parameters are set compile time, this situation affects only
 developers which are adding support for new hardware.

 regards
 Antti

As Linux itself appeals most to developers, or at least we as
developers want to encourage Linux users to be involved in their
operating system, I believe it is indeed best to provide checking and
error reporting for the sake of development (especially by newcomer
programmers) during driver bring-up *and* for the use case of users
themselves.

I understand that you are very concerned with bloat of what you
consider to be potentially unnecessary checks, but I do believe that
this is better for the grand scheme of things.  If you have concerns
about bloat then I would indeed find it friendly to make these such
checks conditional to be included in debug mode, only.  (or if the
kernel is compiled with the media subsystem's advanced debug flag
enabled)

Is that a fair compromise?

Cheers,

Mike Krufky
--
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


[PULL] dvb: push down ioctl lock in dvb_usercopy / fix ioctls failing if frontend open/closed too fast

2012-12-26 Thread Michael Krufky
Mauro,

The following two patches have been on the mailing lists for a while
with no complaints.  I have been testing them for the past few days
and all seems well.  I haven't been able to test the AV7110 driver
myself, but the patch is sane and should not cause any regressions.  I
believe these are fine for the 3.9 branch - let's merge this into our
devel branch asap to get some wider testing.

Please apply the following to update status in patchwork along with
the following merge request...

pwclient update -s 'accepted' 12989
pwclient update -s 'superseded' 14665


The following changes since commit 8b2aea7878f64814544d0527c659011949d52358:

  [media] em28xx: prefer bulk mode on webcams (2012-12-23 17:24:30 -0200)

are available in the git repository at:

  git://git.linuxtv.org/mkrufky/dvb core

for you to fetch changes up to 93851d93d1b2eb8d678cc46a3e29c4945001a761:

  dvb: push down ioctl lock in dvb_usercopy (2012-12-23 17:21:01 -0500)


Juergen Lock (1):
  dvb_frontend: fix ioctls failing if frontend open/closed too fast

Nikolaus Schulz (1):
  dvb: push down ioctl lock in dvb_usercopy

 drivers/media/dvb-core/dvb_ca_en50221.c |9 +
 drivers/media/dvb-core/dvb_frontend.c   |   19 ++-
 drivers/media/dvb-core/dvb_net.c|   71
---
 drivers/media/dvb-core/dvb_net.h|1 +
 drivers/media/dvb-core/dvbdev.c |2 --
 drivers/media/pci/ttpci/av7110.c|2 ++
 drivers/media/pci/ttpci/av7110.h|2 ++
 drivers/media/pci/ttpci/av7110_av.c |8 
 drivers/media/pci/ttpci/av7110_ca.c |   24 +---
 9 files changed, 101 insertions(+), 37 deletions(-)

Cheers,

Mike
--
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: [PULL] dvb-frontends: use %*ph[N] to dump small buffers

2012-12-21 Thread Michael Krufky
Mauro,

updated pwclient script and pull request follows:

pwclient update -s 'superseded' 15687
pwclient update -s 'superseded' 15688
pwclient update -s 'superseded' 15933

The following changes since commit 5b7d8de7d2328f7b25fe4645eafee7e48f9b7df3:

  [media] au0828: break au0828_card_setup() down into smaller
functions (2012-12-17 14:34:27 -0200)

are available in the git repository at:

  git://git.linuxtv.org/mkrufky/tuners frontends

for you to fetch changes up to cf866aea2dd6730b20be9ad69f8829675b0e6234:

  or51211: apply pr_fmt and use pr_* macros instead of printk
(2012-12-18 08:20:28 -0500)


Andy Shevchenko (3):
  or51211: use %*ph[N] to dump small buffers
  ix2505v: use %*ph[N] to dump small buffers
  or51211: apply pr_fmt and use pr_* macros instead of printk

 drivers/media/dvb-frontends/ix2505v.c |2 +-
 drivers/media/dvb-frontends/or51211.c |   99
---
 2 files changed, 45 insertions(+), 56 deletions(-)

Cheers,

Mike

On Mon, Dec 17, 2012 at 9:16 PM, Michael Krufky mkru...@linuxtv.org wrote:
 Mauro,

 Please apply the following to update status in patchwork along with
 the following merge request...

 pwclient update -s 'superseded' 15687
 pwclient update -s 'changes requested' 15688

 I am marking 15687 as superseded because I broke the patch into two
 separate patches.  (see merge request below)
 15688 causes new build warnings, so I've asked Andy to resubmit.

 Please merge:

 The following changes since commit 5b7d8de7d2328f7b25fe4645eafee7e48f9b7df3:

   [media] au0828: break au0828_card_setup() down into smaller
 functions (2012-12-17 14:34:27 -0200)

 are available in the git repository at:

   git://git.linuxtv.org/mkrufky/tuners frontends

 for you to fetch changes up to 34c87fa2214d134c0028c97d7aab3dd769bb3bf0:

   ix2505v: use %*ph[N] to dump small buffers (2012-12-17 20:12:29 -0500)

 
 Andy Shevchenko (2):
   or51211: use %*ph[N] to dump small buffers
   ix2505v: use %*ph[N] to dump small buffers

  drivers/media/dvb-frontends/ix2505v.c |2 +-
  drivers/media/dvb-frontends/or51211.c |5 +
  2 files changed, 2 insertions(+), 5 deletions(-)

 Cheers,

 Mike
--
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: [PULL] dvb-frontends: use %*ph[N] to dump small buffers

2012-12-21 Thread Michael Krufky
rebased against today's tip, as per your request :-)

pwclient update -s 'superseded' 15687
pwclient update -s 'superseded' 15688
pwclient update -s 'superseded' 15933
pwclient update -s 'accepted' 15938
pwclient update -s 'superseded' 15970


The following changes since commit 1b5901331ff3af4bdc1b998a056a248c9924e2d1:

  [media] exynos-gsc: modify number of output/capture buffers
(2012-12-21 10:26:44 -0200)

are available in the git repository at:

  git://git.linuxtv.org/mkrufky/tuners frontends-andy

for you to fetch changes up to d81eae5f62d705b786e8e1ad13eac78ffa95cf18:

  or51211: apply pr_fmt and use pr_* macros instead of printk
(2012-12-21 08:25:09 -0500)


Andy Shevchenko (3):
  or51211: use %*ph[N] to dump small buffers
  ix2505v: use %*ph[N] to dump small buffers
  or51211: apply pr_fmt and use pr_* macros instead of printk

 drivers/media/dvb-frontends/ix2505v.c |2 +-
 drivers/media/dvb-frontends/or51211.c |   99
---
 2 files changed, 45 insertions(+), 56 deletions(-)


On Fri, Dec 21, 2012 at 8:12 AM, Michael Krufky mkru...@linuxtv.org wrote:
 Argh!  I forgot one pwclient command:

 pwclient update -s 'accepted' 15938

 Thanks again,

 Mike

 On Fri, Dec 21, 2012 at 8:10 AM, Michael Krufky mkru...@linuxtv.org wrote:
 Mauro,

 updated pwclient script and pull request follows:

 pwclient update -s 'superseded' 15687
 pwclient update -s 'superseded' 15688
 pwclient update -s 'superseded' 15933

 The following changes since commit 5b7d8de7d2328f7b25fe4645eafee7e48f9b7df3:

   [media] au0828: break au0828_card_setup() down into smaller
 functions (2012-12-17 14:34:27 -0200)

 are available in the git repository at:

   git://git.linuxtv.org/mkrufky/tuners frontends

 for you to fetch changes up to cf866aea2dd6730b20be9ad69f8829675b0e6234:

   or51211: apply pr_fmt and use pr_* macros instead of printk
 (2012-12-18 08:20:28 -0500)

 
 Andy Shevchenko (3):
   or51211: use %*ph[N] to dump small buffers
   ix2505v: use %*ph[N] to dump small buffers
   or51211: apply pr_fmt and use pr_* macros instead of printk

  drivers/media/dvb-frontends/ix2505v.c |2 +-
  drivers/media/dvb-frontends/or51211.c |   99
 ---
  2 files changed, 45 insertions(+), 56 deletions(-)

 Cheers,

 Mike

 On Mon, Dec 17, 2012 at 9:16 PM, Michael Krufky mkru...@linuxtv.org wrote:
 Mauro,

 Please apply the following to update status in patchwork along with
 the following merge request...

 pwclient update -s 'superseded' 15687
 pwclient update -s 'changes requested' 15688

 I am marking 15687 as superseded because I broke the patch into two
 separate patches.  (see merge request below)
 15688 causes new build warnings, so I've asked Andy to resubmit.

 Please merge:

 The following changes since commit 5b7d8de7d2328f7b25fe4645eafee7e48f9b7df3:

   [media] au0828: break au0828_card_setup() down into smaller
 functions (2012-12-17 14:34:27 -0200)

 are available in the git repository at:

   git://git.linuxtv.org/mkrufky/tuners frontends

 for you to fetch changes up to 34c87fa2214d134c0028c97d7aab3dd769bb3bf0:

   ix2505v: use %*ph[N] to dump small buffers (2012-12-17 20:12:29 -0500)

 
 Andy Shevchenko (2):
   or51211: use %*ph[N] to dump small buffers
   ix2505v: use %*ph[N] to dump small buffers

  drivers/media/dvb-frontends/ix2505v.c |2 +-
  drivers/media/dvb-frontends/or51211.c |5 +
  2 files changed, 2 insertions(+), 5 deletions(-)

 Cheers,

 Mike
--
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] tda10071: make sure both tuner and demod i2c addresses are specified

2012-12-21 Thread Michael Krufky
rebased against today's tip, as per your request :-)


pwclient update -s 'superseded' 15923
pwclient update -s 'superseded' 15930


The following changes since commit 1b5901331ff3af4bdc1b998a056a248c9924e2d1:

  [media] exynos-gsc: modify number of output/capture buffers
(2012-12-21 10:26:44 -0200)

are available in the git repository at:

  git://git.linuxtv.org/mkrufky/tuners tda10071

for you to fetch changes up to d562d77132333f0a7b1d704edc992a092d6d6bbe:

  tda10071: make sure both tuner and demod i2c addresses are specified
(2012-12-21 08:29:49 -0500)

Cheers,

Mike

On Fri, Dec 21, 2012 at 8:32 AM, Michael Krufky mkru...@kernellabs.com wrote:
 rebased against today's tip, as per your request :-)


 pwclient update -s 'superseded' 15923
 pwclient update -s 'superseded' 15930


 The following changes since commit 1b5901331ff3af4bdc1b998a056a248c9924e2d1:

   [media] exynos-gsc: modify number of output/capture buffers
 (2012-12-21 10:26:44 -0200)

 are available in the git repository at:

   git://git.linuxtv.org/mkrufky/tuners tda10071

 for you to fetch changes up to d562d77132333f0a7b1d704edc992a092d6d6bbe:

   tda10071: make sure both tuner and demod i2c addresses are specified
 (2012-12-21 08:29:49 -0500)

 
 Michael Krufky (1):
   tda10071: make sure both tuner and demod i2c addresses are specified

  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 Cheers,

 Mike

 On Mon, Dec 17, 2012 at 10:10 AM, Michael Krufky mkru...@linuxtv.org wrote:
 As discussed on irc, the following pwclient commands should update the
 status of the patches in patchwork to correspond with this merge
 request:

 pwclient update -s 'superseded' 15923
 pwclient update -s 'accepted' 15930


 Cheers,

 Mike

 On Mon, Dec 17, 2012 at 10:09 AM, Michael Krufky mkru...@linuxtv.org wrote:
 Mauro,

 Please merge:

 The following changes since commit 4c8e64232d4a71e68d68b9093506966c0244a526:

   cx23885: add basic DVB-S2 support for Hauppauge HVR-4400 (2012-12-16
 12:27:25 -0500)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/tuners tda10071

 for you to fetch changes up to 326e65af0104faf8a243e534eb8bfdb35b73f4ed:

   tda10071: make sure both tuner and demod i2c addresses are specified
 (2012-12-16 18:05:02 -0500)

 
 Michael Krufky (1):
   tda10071: make sure both tuner and demod i2c addresses are specified

  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 Cheers,

 Mike

 On Sun, Dec 16, 2012 at 8:12 PM, Michael Krufky mkru...@linuxtv.org wrote:
 display an error message if either tuner_i2c_addr or demod_i2c_addr
 are not specified in the tda10071_config structure

 Signed-off-by: Michael Krufky mkru...@linuxtv.org
 ---
  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 diff --git a/drivers/media/dvb-frontends/tda10071.c 
 b/drivers/media/dvb-frontends/tda10071.c
 index 7103629..02f9234 100644
 --- a/drivers/media/dvb-frontends/tda10071.c
 +++ b/drivers/media/dvb-frontends/tda10071.c
 @@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv, 
 u8 reg, u8 *val,
 u8 buf[len+1];
 struct i2c_msg msg[1] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = sizeof(buf),
 .buf = buf,
 @@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv 
 *priv, u8 reg, u8 *val,
 u8 buf[len];
 struct i2c_msg msg[2] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = 1,
 .buf = reg,
 }, {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = I2C_M_RD,
 .len = sizeof(buf),
 .buf = buf,
 @@ -1202,6 +1202,18 @@ struct dvb_frontend *tda10071_attach(const struct 
 tda10071_config *config,
 goto error;
 }

 +   /* make sure demod

Re: [PATCH] tda10071: make sure both tuner and demod i2c addresses are specified

2012-12-21 Thread Michael Krufky
rebased against today's tip, as per your request :-)


pwclient update -s 'superseded' 15923
pwclient update -s 'superseded' 15930


The following changes since commit 1b5901331ff3af4bdc1b998a056a248c9924e2d1:

  [media] exynos-gsc: modify number of output/capture buffers
(2012-12-21 10:26:44 -0200)

are available in the git repository at:

  git://git.linuxtv.org/mkrufky/tuners tda10071

for you to fetch changes up to d562d77132333f0a7b1d704edc992a092d6d6bbe:

  tda10071: make sure both tuner and demod i2c addresses are specified
(2012-12-21 08:29:49 -0500)


Michael Krufky (1):
  tda10071: make sure both tuner and demod i2c addresses are specified

 drivers/media/dvb-frontends/tda10071.c  |   18 +++---
 drivers/media/dvb-frontends/tda10071.h  |4 ++--
 drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
 drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
 4 files changed, 20 insertions(+), 7 deletions(-)

Cheers,

Mike

On Mon, Dec 17, 2012 at 10:10 AM, Michael Krufky mkru...@linuxtv.org wrote:
 As discussed on irc, the following pwclient commands should update the
 status of the patches in patchwork to correspond with this merge
 request:

 pwclient update -s 'superseded' 15923
 pwclient update -s 'accepted' 15930


 Cheers,

 Mike

 On Mon, Dec 17, 2012 at 10:09 AM, Michael Krufky mkru...@linuxtv.org wrote:
 Mauro,

 Please merge:

 The following changes since commit 4c8e64232d4a71e68d68b9093506966c0244a526:

   cx23885: add basic DVB-S2 support for Hauppauge HVR-4400 (2012-12-16
 12:27:25 -0500)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/tuners tda10071

 for you to fetch changes up to 326e65af0104faf8a243e534eb8bfdb35b73f4ed:

   tda10071: make sure both tuner and demod i2c addresses are specified
 (2012-12-16 18:05:02 -0500)

 
 Michael Krufky (1):
   tda10071: make sure both tuner and demod i2c addresses are specified

  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 Cheers,

 Mike

 On Sun, Dec 16, 2012 at 8:12 PM, Michael Krufky mkru...@linuxtv.org wrote:
 display an error message if either tuner_i2c_addr or demod_i2c_addr
 are not specified in the tda10071_config structure

 Signed-off-by: Michael Krufky mkru...@linuxtv.org
 ---
  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 diff --git a/drivers/media/dvb-frontends/tda10071.c 
 b/drivers/media/dvb-frontends/tda10071.c
 index 7103629..02f9234 100644
 --- a/drivers/media/dvb-frontends/tda10071.c
 +++ b/drivers/media/dvb-frontends/tda10071.c
 @@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv, 
 u8 reg, u8 *val,
 u8 buf[len+1];
 struct i2c_msg msg[1] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = sizeof(buf),
 .buf = buf,
 @@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv *priv, 
 u8 reg, u8 *val,
 u8 buf[len];
 struct i2c_msg msg[2] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = 1,
 .buf = reg,
 }, {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = I2C_M_RD,
 .len = sizeof(buf),
 .buf = buf,
 @@ -1202,6 +1202,18 @@ struct dvb_frontend *tda10071_attach(const struct 
 tda10071_config *config,
 goto error;
 }

 +   /* make sure demod i2c address is specified */
 +   if (!config-demod_i2c_addr) {
 +   dev_dbg(i2c-dev, %s: invalid demod i2c address!\n, 
 __func__);
 +   goto error;
 +   }
 +
 +   /* make sure tuner i2c address is specified */
 +   if (!config-tuner_i2c_addr) {
 +   dev_dbg(i2c-dev, %s: invalid tuner i2c address!\n, 
 __func__);
 +   goto error;
 +   }
 +
 /* setup the priv */
 priv-i2c = i2c;
 memcpy(priv-cfg, config, sizeof(struct tda10071_config));
 diff --git a/drivers/media/dvb-frontends/tda10071.h 
 b/drivers/media/dvb-frontends/tda10071.h
 index a20d5c4..bff1c38 100644
 --- a/drivers/media

Re: [PULL] add basic DVB-S2 support for Hauppauge HVR-4400

2012-12-17 Thread Michael Krufky
As discussed on irc, the following pwclient commands should update the
status of the patches in patchwork to correspond with this merge
request:

pwclient update -s 'superseded' 15920
pwclient update -s 'superseded' 15921
pwclient update -s 'accepted' 15922

Cheers,

Mike

On Sun, Dec 16, 2012 at 8:09 PM, Michael Krufky mkru...@linuxtv.org wrote:
 Mauro,

 Please merge:

 git request-pull 49cc629df16f2a15917800a8579bd9c25c41b634
 git://linuxtv.org/mkrufky/hauppauge hvr4400
 The following changes since commit 49cc629df16f2a15917800a8579bd9c25c41b634:

   [media] MAINTAINERS: add si470x-usb+common and si470x-i2c entries
 (2012-12-11 18:16:13 -0200)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/hauppauge hvr4400

 for you to fetch changes up to 4c8e64232d4a71e68d68b9093506966c0244a526:

   cx23885: add basic DVB-S2 support for Hauppauge HVR-4400 (2012-12-16
 12:27:25 -0500)

 
 Michael Krufky (2):
   tda10071: add tuner_i2c_addr to struct tda10071_config
   cx23885: add basic DVB-S2 support for Hauppauge HVR-4400

  drivers/media/dvb-frontends/tda10071.c|2 +-
  drivers/media/dvb-frontends/tda10071.h|6 ++
  drivers/media/pci/cx23885/Kconfig |2 ++
  drivers/media/pci/cx23885/cx23885-cards.c |   38
 +-
  drivers/media/pci/cx23885/cx23885-dvb.c   |   27 +++
  drivers/media/pci/cx23885/cx23885.h   |1 +
  6 files changed, 74 insertions(+), 2 deletions(-)

 Cheers,

 Mike
--
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: [PULL] tda18271: add missing entries for qam_7 to tda18271_update_std_map() and tda18271_dump_std_map()

2012-12-17 Thread Michael Krufky
As discussed on irc, the following pwclient commands should update the
status of the patches in patchwork to correspond with this merge
request:

pwclient update -s 'superseded' 15772
pwclient update -s 'superseded' 15924
pwclient update -s 'superseded' 15925
pwclient update -s 'accepted' 15926


Cheers,

Mike

On Sun, Dec 16, 2012 at 8:21 PM, Michael Krufky mkru...@linuxtv.org wrote:
 Please pardon the previous email...

 Mauro,

 Please merge:

 The following changes since commit c6c22955f80f2db9614b01fe5a3d1cfcd8b3d848:

   [media] dma-mapping: fix dma_common_get_sgtable() conditional
 compilation (2012-11-27 09:42:31 -0200)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/tuners tda18271-qam7

 for you to fetch changes up to 6554906af8c145b4fa8d4ea1b9c98c20322dd132:

   tda18271: add missing entries for qam_7 to tda18271_update_std_map()
 and tda18271_dump_std_map() (2012-12-04 14:14:26 -0500)

 
 Frank Sch�fer (1):
   tda18271: add missing entries for qam_7 to
 tda18271_update_std_map() and tda18271_dump_std_map()

  drivers/media/tuners/tda18271-fe.c |2 ++
  1 file changed, 2 insertions(+)

 Cheers,

 Mike
--
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] tda10071: make sure both tuner and demod i2c addresses are specified

2012-12-17 Thread Michael Krufky
Mauro,

Please merge:

The following changes since commit 4c8e64232d4a71e68d68b9093506966c0244a526:

  cx23885: add basic DVB-S2 support for Hauppauge HVR-4400 (2012-12-16
12:27:25 -0500)

are available in the git repository at:

  git://linuxtv.org/mkrufky/tuners tda10071

for you to fetch changes up to 326e65af0104faf8a243e534eb8bfdb35b73f4ed:

  tda10071: make sure both tuner and demod i2c addresses are specified
(2012-12-16 18:05:02 -0500)


Michael Krufky (1):
  tda10071: make sure both tuner and demod i2c addresses are specified

 drivers/media/dvb-frontends/tda10071.c  |   18 +++---
 drivers/media/dvb-frontends/tda10071.h  |4 ++--
 drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
 drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
 4 files changed, 20 insertions(+), 7 deletions(-)

Cheers,

Mike

On Sun, Dec 16, 2012 at 8:12 PM, Michael Krufky mkru...@linuxtv.org wrote:
 display an error message if either tuner_i2c_addr or demod_i2c_addr
 are not specified in the tda10071_config structure

 Signed-off-by: Michael Krufky mkru...@linuxtv.org
 ---
  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 diff --git a/drivers/media/dvb-frontends/tda10071.c 
 b/drivers/media/dvb-frontends/tda10071.c
 index 7103629..02f9234 100644
 --- a/drivers/media/dvb-frontends/tda10071.c
 +++ b/drivers/media/dvb-frontends/tda10071.c
 @@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv, u8 
 reg, u8 *val,
 u8 buf[len+1];
 struct i2c_msg msg[1] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = sizeof(buf),
 .buf = buf,
 @@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv *priv, 
 u8 reg, u8 *val,
 u8 buf[len];
 struct i2c_msg msg[2] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = 1,
 .buf = reg,
 }, {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = I2C_M_RD,
 .len = sizeof(buf),
 .buf = buf,
 @@ -1202,6 +1202,18 @@ struct dvb_frontend *tda10071_attach(const struct 
 tda10071_config *config,
 goto error;
 }

 +   /* make sure demod i2c address is specified */
 +   if (!config-demod_i2c_addr) {
 +   dev_dbg(i2c-dev, %s: invalid demod i2c address!\n, 
 __func__);
 +   goto error;
 +   }
 +
 +   /* make sure tuner i2c address is specified */
 +   if (!config-tuner_i2c_addr) {
 +   dev_dbg(i2c-dev, %s: invalid tuner i2c address!\n, 
 __func__);
 +   goto error;
 +   }
 +
 /* setup the priv */
 priv-i2c = i2c;
 memcpy(priv-cfg, config, sizeof(struct tda10071_config));
 diff --git a/drivers/media/dvb-frontends/tda10071.h 
 b/drivers/media/dvb-frontends/tda10071.h
 index a20d5c4..bff1c38 100644
 --- a/drivers/media/dvb-frontends/tda10071.h
 +++ b/drivers/media/dvb-frontends/tda10071.h
 @@ -28,10 +28,10 @@ struct tda10071_config {
  * Default: none, must set
  * Values: 0x55,
  */
 -   u8 i2c_address;
 +   u8 demod_i2c_addr;

 /* Tuner I2C address.
 -* Default: 0x14
 +* Default: none, must set
  * Values: 0x14, 0x54, ...
  */
 u8 tuner_i2c_addr;
 diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
 b/drivers/media/pci/cx23885/cx23885-dvb.c
 index cf84c53..a1aae56 100644
 --- a/drivers/media/pci/cx23885/cx23885-dvb.c
 +++ b/drivers/media/pci/cx23885/cx23885-dvb.c
 @@ -662,7 +662,7 @@ static struct mt2063_config terratec_mt2063_config[] = {
  };

  static const struct tda10071_config hauppauge_tda10071_config = {
 -   .i2c_address = 0x05,
 +   .demod_i2c_addr = 0x05,
 .tuner_i2c_addr = 0x54,
 .i2c_wr_max = 64,
 .ts_mode = TDA10071_TS_SERIAL,
 diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c 
 b/drivers/media/usb/em28xx/em28xx-dvb.c
 index 63f2e70..e800881 100644
 --- a/drivers/media/usb/em28xx/em28xx-dvb.c
 +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
 @@ -714,7 +714,8 @@ static struct tda18271_config 
 em28xx_cxd2820r_tda18271_config = {
  };

  static const struct tda10071_config em28xx_tda10071_config = {
 -   .i2c_address = 0x55, /* (0xaa  1) */
 +   .demod_i2c_addr = 0x55, /* (0xaa  1

Re: [PATCH] tda10071: make sure both tuner and demod i2c addresses are specified

2012-12-17 Thread Michael Krufky
As discussed on irc, the following pwclient commands should update the
status of the patches in patchwork to correspond with this merge
request:

pwclient update -s 'superseded' 15923
pwclient update -s 'accepted' 15930


Cheers,

Mike

On Mon, Dec 17, 2012 at 10:09 AM, Michael Krufky mkru...@linuxtv.org wrote:
 Mauro,

 Please merge:

 The following changes since commit 4c8e64232d4a71e68d68b9093506966c0244a526:

   cx23885: add basic DVB-S2 support for Hauppauge HVR-4400 (2012-12-16
 12:27:25 -0500)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/tuners tda10071

 for you to fetch changes up to 326e65af0104faf8a243e534eb8bfdb35b73f4ed:

   tda10071: make sure both tuner and demod i2c addresses are specified
 (2012-12-16 18:05:02 -0500)

 
 Michael Krufky (1):
   tda10071: make sure both tuner and demod i2c addresses are specified

  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 Cheers,

 Mike

 On Sun, Dec 16, 2012 at 8:12 PM, Michael Krufky mkru...@linuxtv.org wrote:
 display an error message if either tuner_i2c_addr or demod_i2c_addr
 are not specified in the tda10071_config structure

 Signed-off-by: Michael Krufky mkru...@linuxtv.org
 ---
  drivers/media/dvb-frontends/tda10071.c  |   18 +++---
  drivers/media/dvb-frontends/tda10071.h  |4 ++--
  drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
  drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
  4 files changed, 20 insertions(+), 7 deletions(-)

 diff --git a/drivers/media/dvb-frontends/tda10071.c 
 b/drivers/media/dvb-frontends/tda10071.c
 index 7103629..02f9234 100644
 --- a/drivers/media/dvb-frontends/tda10071.c
 +++ b/drivers/media/dvb-frontends/tda10071.c
 @@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv, u8 
 reg, u8 *val,
 u8 buf[len+1];
 struct i2c_msg msg[1] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = sizeof(buf),
 .buf = buf,
 @@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv *priv, 
 u8 reg, u8 *val,
 u8 buf[len];
 struct i2c_msg msg[2] = {
 {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = 0,
 .len = 1,
 .buf = reg,
 }, {
 -   .addr = priv-cfg.i2c_address,
 +   .addr = priv-cfg.demod_i2c_addr,
 .flags = I2C_M_RD,
 .len = sizeof(buf),
 .buf = buf,
 @@ -1202,6 +1202,18 @@ struct dvb_frontend *tda10071_attach(const struct 
 tda10071_config *config,
 goto error;
 }

 +   /* make sure demod i2c address is specified */
 +   if (!config-demod_i2c_addr) {
 +   dev_dbg(i2c-dev, %s: invalid demod i2c address!\n, 
 __func__);
 +   goto error;
 +   }
 +
 +   /* make sure tuner i2c address is specified */
 +   if (!config-tuner_i2c_addr) {
 +   dev_dbg(i2c-dev, %s: invalid tuner i2c address!\n, 
 __func__);
 +   goto error;
 +   }
 +
 /* setup the priv */
 priv-i2c = i2c;
 memcpy(priv-cfg, config, sizeof(struct tda10071_config));
 diff --git a/drivers/media/dvb-frontends/tda10071.h 
 b/drivers/media/dvb-frontends/tda10071.h
 index a20d5c4..bff1c38 100644
 --- a/drivers/media/dvb-frontends/tda10071.h
 +++ b/drivers/media/dvb-frontends/tda10071.h
 @@ -28,10 +28,10 @@ struct tda10071_config {
  * Default: none, must set
  * Values: 0x55,
  */
 -   u8 i2c_address;
 +   u8 demod_i2c_addr;

 /* Tuner I2C address.
 -* Default: 0x14
 +* Default: none, must set
  * Values: 0x14, 0x54, ...
  */
 u8 tuner_i2c_addr;
 diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
 b/drivers/media/pci/cx23885/cx23885-dvb.c
 index cf84c53..a1aae56 100644
 --- a/drivers/media/pci/cx23885/cx23885-dvb.c
 +++ b/drivers/media/pci/cx23885/cx23885-dvb.c
 @@ -662,7 +662,7 @@ static struct mt2063_config terratec_mt2063_config[] = {
  };

  static const struct tda10071_config hauppauge_tda10071_config = {
 -   .i2c_address = 0x05,
 +   .demod_i2c_addr = 0x05,
 .tuner_i2c_addr = 0x54,
 .i2c_wr_max = 64,
 .ts_mode = TDA10071_TS_SERIAL,
 diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c 
 b/drivers/media/usb/em28xx/em28xx-dvb.c
 index 63f2e70..e800881 100644
 --- a/drivers/media/usb

Re: [PULL] au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2 | git://linuxtv.org/mkrufky/hauppauge voyager-digital

2012-12-17 Thread Michael Krufky
As discussed on irc, the following pwclient commands should update the
status of the patches in patchwork to correspond with this merge
request:

pwclient update -s 'superseded' 15779
pwclient update -s 'superseded' 15780
pwclient update -s 'accepted' 15782


Cheers,

Mike

On Tue, Dec 4, 2012 at 12:09 PM, Michael Krufky mkru...@linuxtv.org wrote:
 On Tue, Dec 4, 2012 at 11:29 AM, Devin Heitmueller
 dheitmuel...@kernellabs.com wrote:
 On Tue, Dec 4, 2012 at 11:25 AM, Michael Krufky mkru...@linuxtv.org wrote:
 Do you have any issues with these two patches as-is?  Any suggestions?
  If not, is it OK with you if I request that Mauro merge this for v3.9
 ?

 I have no specific issues with the patch as-is.

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

 --
 Devin J. Heitmueller - Kernel Labs
 http://www.kernellabs.com

 Thank you, Devin.

 Mauro, please merge:

 The following changes since commit 72567f3cfafe31c1612efe52e2893e960cc8dd00:

   au0828: update model matrix entries for 72261, 72271  72281
 (2012-11-28 09:46:24 -0500)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/hauppauge voyager-digital

 for you to fetch changes up to c67f6580bfa7922572a883437413f6480db05ef2:

   au0828: break au0828_card_setup() down into smaller functions
 (2012-12-04 10:46:38 -0500)

 
 Michael Krufky (2):
   au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2
   au0828: break au0828_card_setup() down into smaller functions

  drivers/media/usb/Kconfig   |2 +-
  drivers/media/usb/au0828/Kconfig|   17 ++---
  drivers/media/usb/au0828/Makefile   |6 +-
  drivers/media/usb/au0828/au0828-cards.c |   16 +---
  drivers/media/usb/au0828/au0828-core.c  |   13 -
  drivers/media/usb/au0828/au0828-i2c.c   |4 
  drivers/media/usb/au0828/au0828.h   |2 ++
  7 files changed, 51 insertions(+), 9 deletions(-)

 Cheers,

 Mike Krufky
--
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: [PULL] au0828: update model matrix | git://linuxtv.org/mkrufky/hauppauge voyager-72281

2012-12-17 Thread Michael Krufky
As discussed on irc, the following pwclient commands should update the
status of the patches in patchwork to correspond with this merge
request:

pwclient update -s 'superseded' 15708
pwclient update -s 'superseded' 15709
pwclient update -s 'superseded' 15710
pwclient update -s 'superseded' 15711
pwclient update -s 'accepted' 15707


Cheers,

Mike

On Wed, Nov 28, 2012 at 10:23 AM, Michael Krufky mkru...@linuxtv.org wrote:
 The following changes since commit c6c22955f80f2db9614b01fe5a3d1cfcd8b3d848:

   [media] dma-mapping: fix dma_common_get_sgtable() conditional
 compilation (2012-11-27 09:42:31 -0200)

 are available in the git repository at:

   git://linuxtv.org/mkrufky/hauppauge voyager-72281

 for you to fetch changes up to 72567f3cfafe31c1612efe52e2893e960cc8dd00:

   au0828: update model matrix entries for 72261, 72271  72281
 (2012-11-28 09:46:24 -0500)

 
 Michael Krufky (2):
   au0828: add missing model 72281, usb id 2040:7270 to the model matrix
   au0828: update model matrix entries for 72261, 72271  72281

  drivers/media/usb/au0828/au0828-cards.c |6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)
--
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


[PULL] dvb-frontends: use %*ph[N] to dump small buffers

2012-12-17 Thread Michael Krufky
Mauro,

Please apply the following to update status in patchwork along with
the following merge request...

pwclient update -s 'superseded' 15687
pwclient update -s 'changes requested' 15688

I am marking 15687 as superseded because I broke the patch into two
separate patches.  (see merge request below)
15688 causes new build warnings, so I've asked Andy to resubmit.

Please merge:

The following changes since commit 5b7d8de7d2328f7b25fe4645eafee7e48f9b7df3:

  [media] au0828: break au0828_card_setup() down into smaller
functions (2012-12-17 14:34:27 -0200)

are available in the git repository at:

  git://git.linuxtv.org/mkrufky/tuners frontends

for you to fetch changes up to 34c87fa2214d134c0028c97d7aab3dd769bb3bf0:

  ix2505v: use %*ph[N] to dump small buffers (2012-12-17 20:12:29 -0500)


Andy Shevchenko (2):
  or51211: use %*ph[N] to dump small buffers
  ix2505v: use %*ph[N] to dump small buffers

 drivers/media/dvb-frontends/ix2505v.c |2 +-
 drivers/media/dvb-frontends/or51211.c |5 +
 2 files changed, 2 insertions(+), 5 deletions(-)

Cheers,

Mike
--
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


dvb: or51211: apply pr_fmt and use pr_* macros instead of printk

2012-12-17 Thread Michael Krufky
Andy,

Your patch from Nov 28 entitled, dvb: or51211: apply pr_fmt and use
pr_* macros instead of printk located in patchwork at the URL:

http://patchwork.linuxtv.org/patch/15688/

...creates the following build warning:

  CC [M]  drivers/media/dvb-frontends/or51211.o
drivers/media/dvb-frontends/or51211.c:45:0: warning: pr_fmt
redefined [enabled by default]
In file included from include/linux/kernel.h:13:0,
 from drivers/media/dvb-frontends/or51211.c:33:
include/linux/printk.h:180:0: note: this is the location of the
previous definition
drivers/media/dvb-frontends/or51211.c:45:0: warning: pr_fmt
redefined [enabled by default]
In file included from include/linux/kernel.h:13:0,
 from drivers/media/dvb-frontends/or51211.c:33:
include/linux/printk.h:180:0: note: this is the location of the
previous definition

Please take a look at your patch and send a revised version if you
think it's appropriate.

I will have the other use %*ph[N] to dump small buffers patches
merged -- thanks for your contribution!

Regards,

Mike Krufky
--
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] tda10071: add tuner_i2c_addr to struct tda10071_config

2012-12-16 Thread Michael Krufky
The default i2c address for the tuner is 0x14,
allow this to be overridden with a configuration parameter

Signed-off-by: Michael Krufky mkru...@linuxtv.org
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/tda10071.c |2 +-
 drivers/media/dvb-frontends/tda10071.h |6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/media/dvb-frontends/tda10071.c 
b/drivers/media/dvb-frontends/tda10071.c
index 16a4bc5..7103629 100644
--- a/drivers/media/dvb-frontends/tda10071.c
+++ b/drivers/media/dvb-frontends/tda10071.c
@@ -1064,7 +1064,7 @@ static int tda10071_init(struct dvb_frontend *fe)
cmd.args[2] = 0x00;
cmd.args[3] = 0x00;
cmd.args[4] = 0x00;
-   cmd.args[5] = 0x14;
+   cmd.args[5] = (priv-cfg.tuner_i2c_addr) ? 
priv-cfg.tuner_i2c_addr : 0x14;
cmd.args[6] = 0x00;
cmd.args[7] = 0x03;
cmd.args[8] = 0x02;
diff --git a/drivers/media/dvb-frontends/tda10071.h 
b/drivers/media/dvb-frontends/tda10071.h
index 21163c4..a20d5c4 100644
--- a/drivers/media/dvb-frontends/tda10071.h
+++ b/drivers/media/dvb-frontends/tda10071.h
@@ -30,6 +30,12 @@ struct tda10071_config {
 */
u8 i2c_address;
 
+   /* Tuner I2C address.
+* Default: 0x14
+* Values: 0x14, 0x54, ...
+*/
+   u8 tuner_i2c_addr;
+
/* Max bytes I2C provider can write at once.
 * Note: Buffer is taken from the stack currently!
 * Default: none, must set
-- 
1.7.10.4

--
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] cx23885: add basic DVB-S2 support for Hauppauge HVR-4400

2012-12-16 Thread Michael Krufky
Add basic DVB-S2 support for the Hauppauge HVR-4400 PCIe board.

Thanks to Antti Palosaari and Devin Heitmueller for their
suggestions and testing.

Signed-off-by: Michael Krufky mkru...@linuxtv.org
Reviewed-by: Devin Heitmueller dheitmuel...@kernellabs.com
Reviewed-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/pci/cx23885/Kconfig |2 ++
 drivers/media/pci/cx23885/cx23885-cards.c |   38 -
 drivers/media/pci/cx23885/cx23885-dvb.c   |   27 
 drivers/media/pci/cx23885/cx23885.h   |1 +
 4 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/drivers/media/pci/cx23885/Kconfig 
b/drivers/media/pci/cx23885/Kconfig
index eafa114..733d6c8 100644
--- a/drivers/media/pci/cx23885/Kconfig
+++ b/drivers/media/pci/cx23885/Kconfig
@@ -26,6 +26,8 @@ config VIDEO_CX23885
select DVB_STV0900 if MEDIA_SUBDRV_AUTOSELECT
select DVB_DS3000 if MEDIA_SUBDRV_AUTOSELECT
select DVB_STV0367 if MEDIA_SUBDRV_AUTOSELECT
+   select DVB_TDA10071 if MEDIA_SUBDRV_AUTOSELECT
+   select DVB_A8293 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_MT2063 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_MT2131 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_XC2028 if MEDIA_SUBDRV_AUTOSELECT
diff --git a/drivers/media/pci/cx23885/cx23885-cards.c 
b/drivers/media/pci/cx23885/cx23885-cards.c
index 6277e145..7a79a17 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -572,7 +572,11 @@ struct cx23885_board cx23885_boards[] = {
[CX23885_BOARD_PROF_8000] = {
.name   = Prof Revolution DVB-S2 8000,
.portb  = CX23885_MPEG_DVB,
-   }
+   },
+   [CX23885_BOARD_HAUPPAUGE_HVR4400] = {
+   .name   = Hauppauge WinTV-HVR4400,
+   .portb  = CX23885_MPEG_DVB,
+   },
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -788,6 +792,22 @@ struct cx23885_subid cx23885_subids[] = {
.subvendor = 0x8000,
.subdevice = 0x3034,
.card  = CX23885_BOARD_PROF_8000,
+   }, {
+   .subvendor = 0x0070,
+   .subdevice = 0xc108,
+   .card  = CX23885_BOARD_HAUPPAUGE_HVR4400,
+   }, {
+   .subvendor = 0x0070,
+   .subdevice = 0xc138,
+   .card  = CX23885_BOARD_HAUPPAUGE_HVR4400,
+   }, {
+   .subvendor = 0x0070,
+   .subdevice = 0xc12a,
+   .card  = CX23885_BOARD_HAUPPAUGE_HVR4400,
+   }, {
+   .subvendor = 0x0070,
+   .subdevice = 0xc1f8,
+   .card  = CX23885_BOARD_HAUPPAUGE_HVR4400,
},
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -1301,6 +1321,16 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
/* enable irq */
cx_write(GPIO_ISM, 0x);/* INTERRUPTS active low*/
break;
+   case CX23885_BOARD_HAUPPAUGE_HVR4400:
+   /* GPIO-8 tda10071 demod reset */
+
+   /* Put the parts into reset and back */
+   cx23885_gpio_enable(dev, GPIO_8, 1);
+   cx23885_gpio_clear(dev, GPIO_8);
+   mdelay(100);
+   cx23885_gpio_set(dev, GPIO_8);
+   mdelay(100);
+   break;
}
 }
 
@@ -1509,6 +1539,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_HAUPPAUGE_HVR1210:
case CX23885_BOARD_HAUPPAUGE_HVR1850:
case CX23885_BOARD_HAUPPAUGE_HVR1290:
+   case CX23885_BOARD_HAUPPAUGE_HVR4400:
if (dev-i2c_bus[0].i2c_rc == 0)
hauppauge_eeprom(dev, eeprom+0xc0);
break;
@@ -1581,6 +1612,11 @@ void cx23885_card_setup(struct cx23885_dev *dev)
ts2-ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts2-src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
break;
+   case CX23885_BOARD_HAUPPAUGE_HVR4400:
+   ts1-gen_ctrl_val  = 0xc; /* Serial bus + punctured clock */
+   ts1-ts_clk_en_val = 0x1; /* Enable TS_CLK */
+   ts1-src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+   break;
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1500:
case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index 2f5b902..cf84c53 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -66,6 +66,8 @@
 #include stv090x.h
 #include stb6100.h
 #include stb6100_cfg.h
+#include tda10071.h
+#include a8293.h
 
 static unsigned int debug;
 
@@ -659,6 +661,20 @@ static struct mt2063_config terratec_mt2063_config[] = {
},
 };
 
+static const struct

[PULL] add basic DVB-S2 support for Hauppauge HVR-4400

2012-12-16 Thread Michael Krufky
Mauro,

Please merge:

git request-pull 49cc629df16f2a15917800a8579bd9c25c41b634
git://linuxtv.org/mkrufky/hauppauge hvr4400
The following changes since commit 49cc629df16f2a15917800a8579bd9c25c41b634:

  [media] MAINTAINERS: add si470x-usb+common and si470x-i2c entries
(2012-12-11 18:16:13 -0200)

are available in the git repository at:

  git://linuxtv.org/mkrufky/hauppauge hvr4400

for you to fetch changes up to 4c8e64232d4a71e68d68b9093506966c0244a526:

  cx23885: add basic DVB-S2 support for Hauppauge HVR-4400 (2012-12-16
12:27:25 -0500)


Michael Krufky (2):
  tda10071: add tuner_i2c_addr to struct tda10071_config
  cx23885: add basic DVB-S2 support for Hauppauge HVR-4400

 drivers/media/dvb-frontends/tda10071.c|2 +-
 drivers/media/dvb-frontends/tda10071.h|6 ++
 drivers/media/pci/cx23885/Kconfig |2 ++
 drivers/media/pci/cx23885/cx23885-cards.c |   38
+-
 drivers/media/pci/cx23885/cx23885-dvb.c   |   27 +++
 drivers/media/pci/cx23885/cx23885.h   |1 +
 6 files changed, 74 insertions(+), 2 deletions(-)

Cheers,

Mike
--
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] tda10071: make sure both tuner and demod i2c addresses are specified

2012-12-16 Thread Michael Krufky
display an error message if either tuner_i2c_addr or demod_i2c_addr
are not specified in the tda10071_config structure

Signed-off-by: Michael Krufky mkru...@linuxtv.org
---
 drivers/media/dvb-frontends/tda10071.c  |   18 +++---
 drivers/media/dvb-frontends/tda10071.h  |4 ++--
 drivers/media/pci/cx23885/cx23885-dvb.c |2 +-
 drivers/media/usb/em28xx/em28xx-dvb.c   |3 ++-
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/media/dvb-frontends/tda10071.c 
b/drivers/media/dvb-frontends/tda10071.c
index 7103629..02f9234 100644
--- a/drivers/media/dvb-frontends/tda10071.c
+++ b/drivers/media/dvb-frontends/tda10071.c
@@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv, u8 
reg, u8 *val,
u8 buf[len+1];
struct i2c_msg msg[1] = {
{
-   .addr = priv-cfg.i2c_address,
+   .addr = priv-cfg.demod_i2c_addr,
.flags = 0,
.len = sizeof(buf),
.buf = buf,
@@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv *priv, u8 
reg, u8 *val,
u8 buf[len];
struct i2c_msg msg[2] = {
{
-   .addr = priv-cfg.i2c_address,
+   .addr = priv-cfg.demod_i2c_addr,
.flags = 0,
.len = 1,
.buf = reg,
}, {
-   .addr = priv-cfg.i2c_address,
+   .addr = priv-cfg.demod_i2c_addr,
.flags = I2C_M_RD,
.len = sizeof(buf),
.buf = buf,
@@ -1202,6 +1202,18 @@ struct dvb_frontend *tda10071_attach(const struct 
tda10071_config *config,
goto error;
}
 
+   /* make sure demod i2c address is specified */
+   if (!config-demod_i2c_addr) {
+   dev_dbg(i2c-dev, %s: invalid demod i2c address!\n, 
__func__);
+   goto error;
+   }
+
+   /* make sure tuner i2c address is specified */
+   if (!config-tuner_i2c_addr) {
+   dev_dbg(i2c-dev, %s: invalid tuner i2c address!\n, 
__func__);
+   goto error;
+   }
+
/* setup the priv */
priv-i2c = i2c;
memcpy(priv-cfg, config, sizeof(struct tda10071_config));
diff --git a/drivers/media/dvb-frontends/tda10071.h 
b/drivers/media/dvb-frontends/tda10071.h
index a20d5c4..bff1c38 100644
--- a/drivers/media/dvb-frontends/tda10071.h
+++ b/drivers/media/dvb-frontends/tda10071.h
@@ -28,10 +28,10 @@ struct tda10071_config {
 * Default: none, must set
 * Values: 0x55,
 */
-   u8 i2c_address;
+   u8 demod_i2c_addr;
 
/* Tuner I2C address.
-* Default: 0x14
+* Default: none, must set
 * Values: 0x14, 0x54, ...
 */
u8 tuner_i2c_addr;
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index cf84c53..a1aae56 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -662,7 +662,7 @@ static struct mt2063_config terratec_mt2063_config[] = {
 };
 
 static const struct tda10071_config hauppauge_tda10071_config = {
-   .i2c_address = 0x05,
+   .demod_i2c_addr = 0x05,
.tuner_i2c_addr = 0x54,
.i2c_wr_max = 64,
.ts_mode = TDA10071_TS_SERIAL,
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c 
b/drivers/media/usb/em28xx/em28xx-dvb.c
index 63f2e70..e800881 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -714,7 +714,8 @@ static struct tda18271_config 
em28xx_cxd2820r_tda18271_config = {
 };
 
 static const struct tda10071_config em28xx_tda10071_config = {
-   .i2c_address = 0x55, /* (0xaa  1) */
+   .demod_i2c_addr = 0x55, /* (0xaa  1) */
+   .tuner_i2c_addr = 0x14,
.i2c_wr_max = 64,
.ts_mode = TDA10071_TS_SERIAL,
.spec_inv = 0,
-- 
1.7.10.4

--
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] tda18271: add missing entries for qam_7 to tda18271_update_std_map() and tda18271_dump_std_map()

2012-12-16 Thread Michael Krufky
From: Frank Sch�fer fschaefer@googlemail.com

Signed-off-by: Frank Sch�fer fschaefer@googlemail.com
Signed-off-by: Michael Krufky mkru...@linuxtv.org
---
 drivers/media/tuners/tda18271-fe.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/tuners/tda18271-fe.c 
b/drivers/media/tuners/tda18271-fe.c
index 72c26fd..e778686 100644
--- a/drivers/media/tuners/tda18271-fe.c
+++ b/drivers/media/tuners/tda18271-fe.c
@@ -1122,6 +1122,7 @@ static int tda18271_dump_std_map(struct dvb_frontend *fe)
tda18271_dump_std_item(dvbt_7, dvbt 7);
tda18271_dump_std_item(dvbt_8, dvbt 8);
tda18271_dump_std_item(qam_6,  qam 6 );
+   tda18271_dump_std_item(qam_7,  qam 7 );
tda18271_dump_std_item(qam_8,  qam 8 );
 
return 0;
@@ -1149,6 +1150,7 @@ static int tda18271_update_std_map(struct dvb_frontend 
*fe,
tda18271_update_std(dvbt_7, dvbt 7);
tda18271_update_std(dvbt_8, dvbt 8);
tda18271_update_std(qam_6,  qam 6);
+   tda18271_update_std(qam_7,  qam 7);
tda18271_update_std(qam_8,  qam 8);
 
return 0;
-- 
1.7.10.4

--
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] tda18271: add missing entries for qam_7 to tda18271_update_std_map() and tda18271_dump_std_map()

2012-12-16 Thread Michael Krufky
Mauro,

Please merge:

git request-pull c6c22955f80f2db9614b01fe5a3d1cfcd8b3d848
git://linuxtv.org/mkrufky/tuners tda18271-qam7
The following changes since commit c6c22955f80f2db9614b01fe5a3d1cfcd8b3d848:

  [media] dma-mapping: fix dma_common_get_sgtable() conditional
compilation (2012-11-27 09:42:31 -0200)

are available in the git repository at:

  git://linuxtv.org/mkrufky/tuners tda18271-qam7

for you to fetch changes up to 6554906af8c145b4fa8d4ea1b9c98c20322dd132:

  tda18271: add missing entries for qam_7 to tda18271_update_std_map()
and tda18271_dump_std_map() (2012-12-04 14:14:26 -0500)


Frank Sch�fer (1):
  tda18271: add missing entries for qam_7 to
tda18271_update_std_map() and tda18271_dump_std_map()

 drivers/media/tuners/tda18271-fe.c |2 ++
 1 file changed, 2 insertions(+)

Regards,

Mike

On Sun, Dec 16, 2012 at 8:17 PM, Michael Krufky mkru...@linuxtv.org wrote:
 From: Frank Schäfer fschaefer@googlemail.com

 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 Signed-off-by: Michael Krufky mkru...@linuxtv.org
 ---
  drivers/media/tuners/tda18271-fe.c |2 ++
  1 file changed, 2 insertions(+)

 diff --git a/drivers/media/tuners/tda18271-fe.c 
 b/drivers/media/tuners/tda18271-fe.c
 index 72c26fd..e778686 100644
 --- a/drivers/media/tuners/tda18271-fe.c
 +++ b/drivers/media/tuners/tda18271-fe.c
 @@ -1122,6 +1122,7 @@ static int tda18271_dump_std_map(struct dvb_frontend 
 *fe)
 tda18271_dump_std_item(dvbt_7, dvbt 7);
 tda18271_dump_std_item(dvbt_8, dvbt 8);
 tda18271_dump_std_item(qam_6,  qam 6 );
 +   tda18271_dump_std_item(qam_7,  qam 7 );
 tda18271_dump_std_item(qam_8,  qam 8 );

 return 0;
 @@ -1149,6 +1150,7 @@ static int tda18271_update_std_map(struct dvb_frontend 
 *fe,
 tda18271_update_std(dvbt_7, dvbt 7);
 tda18271_update_std(dvbt_8, dvbt 8);
 tda18271_update_std(qam_6,  qam 6);
 +   tda18271_update_std(qam_7,  qam 7);
 tda18271_update_std(qam_8,  qam 8);

 return 0;
 --
 1.7.10.4

--
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


[PULL] tda18271: add missing entries for qam_7 to tda18271_update_std_map() and tda18271_dump_std_map()

2012-12-16 Thread Michael Krufky
Please pardon the previous email...

Mauro,

Please merge:

The following changes since commit c6c22955f80f2db9614b01fe5a3d1cfcd8b3d848:

  [media] dma-mapping: fix dma_common_get_sgtable() conditional
compilation (2012-11-27 09:42:31 -0200)

are available in the git repository at:

  git://linuxtv.org/mkrufky/tuners tda18271-qam7

for you to fetch changes up to 6554906af8c145b4fa8d4ea1b9c98c20322dd132:

  tda18271: add missing entries for qam_7 to tda18271_update_std_map()
and tda18271_dump_std_map() (2012-12-04 14:14:26 -0500)


Frank Sch�fer (1):
  tda18271: add missing entries for qam_7 to
tda18271_update_std_map() and tda18271_dump_std_map()

 drivers/media/tuners/tda18271-fe.c |2 ++
 1 file changed, 2 insertions(+)

Cheers,

Mike
--
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] au0828: break au0828_card_setup() down into smaller functions

2012-12-04 Thread Michael Krufky
Pull the analog frontend setup code out of au0828_card_setup into its
own seperate function, au0828_card_analog_fe_setup().

Signed-off-by: Michael Krufky mkru...@linuxtv.org
---
 drivers/media/usb/au0828/au0828-cards.c |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/au0828/au0828-cards.c 
b/drivers/media/usb/au0828/au0828-cards.c
index 7b5b742..88e35df 100644
--- a/drivers/media/usb/au0828/au0828-cards.c
+++ b/drivers/media/usb/au0828/au0828-cards.c
@@ -185,14 +185,11 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 
*eeprom_data)
   __func__, tv.model);
 }
 
+void au0828_card_analog_fe_setup(struct au0828_dev *dev);
+
 void au0828_card_setup(struct au0828_dev *dev)
 {
static u8 eeprom[256];
-#ifdef CONFIG_VIDEO_AU0828_V4L2
-   struct tuner_setup tun_setup;
-   struct v4l2_subdev *sd;
-   unsigned int mode_mask = T_ANALOG_TV;
-#endif
 
dprintk(1, %s()\n, __func__);
 
@@ -213,7 +210,16 @@ void au0828_card_setup(struct au0828_dev *dev)
break;
}
 
+   au0828_card_analog_fe_setup(dev);
+}
+
+void au0828_card_analog_fe_setup(struct au0828_dev *dev)
+{
 #ifdef CONFIG_VIDEO_AU0828_V4L2
+   struct tuner_setup tun_setup;
+   struct v4l2_subdev *sd;
+   unsigned int mode_mask = T_ANALOG_TV;
+
if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) {
/* Load the analog demodulator driver (note this would need to
   be abstracted out if we ever need to support a different
-- 
1.7.10.4

--
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] au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2

2012-12-04 Thread Michael Krufky
This patch removes the dependendency of VIDEO_AU0828 on VIDEO_V4L2 by
creating a new Kconfig option, VIDEO_AU0828_V4L2, which enables analog
video capture support and depends on VIDEO_V4L2 itself.

With VIDEO_AU0828_V4L2 disabled, the driver will only support digital
television and will not depend on the v4l2-core. With VIDEO_AU0828_V4L2
enabled, the driver will be built with the analog v4l2 support included.

By default, the VIDEO_AU0828_V4L2 option will be set to Y, so as to
preserve the original behavior.

Signed-off-by: Michael Krufky mkru...@linuxtv.org
---
 drivers/media/usb/Kconfig   |2 +-
 drivers/media/usb/au0828/Kconfig|   17 ++---
 drivers/media/usb/au0828/Makefile   |6 +-
 drivers/media/usb/au0828/au0828-cards.c |4 
 drivers/media/usb/au0828/au0828-core.c  |   13 -
 drivers/media/usb/au0828/au0828-i2c.c   |4 
 drivers/media/usb/au0828/au0828.h   |2 ++
 7 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/Kconfig b/drivers/media/usb/Kconfig
index 6746994..0a7d520 100644
--- a/drivers/media/usb/Kconfig
+++ b/drivers/media/usb/Kconfig
@@ -21,7 +21,6 @@ endif
 
 if MEDIA_ANALOG_TV_SUPPORT
comment Analog TV USB devices
-source drivers/media/usb/au0828/Kconfig
 source drivers/media/usb/pvrusb2/Kconfig
 source drivers/media/usb/hdpvr/Kconfig
 source drivers/media/usb/tlg2300/Kconfig
@@ -31,6 +30,7 @@ endif
 
 if (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT)
comment Analog/digital TV USB devices
+source drivers/media/usb/au0828/Kconfig
 source drivers/media/usb/cx231xx/Kconfig
 source drivers/media/usb/tm6000/Kconfig
 endif
diff --git a/drivers/media/usb/au0828/Kconfig b/drivers/media/usb/au0828/Kconfig
index 1766c0c..953a37c 100644
--- a/drivers/media/usb/au0828/Kconfig
+++ b/drivers/media/usb/au0828/Kconfig
@@ -1,17 +1,28 @@
 
 config VIDEO_AU0828
tristate Auvitek AU0828 support
-   depends on I2C  INPUT  DVB_CORE  USB  VIDEO_V4L2
+   depends on I2C  INPUT  DVB_CORE  USB
select I2C_ALGOBIT
select VIDEO_TVEEPROM
select VIDEOBUF_VMALLOC
select DVB_AU8522_DTV if MEDIA_SUBDRV_AUTOSELECT
-   select DVB_AU8522_V4L if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_MXL5007T if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT
---help---
- This is a video4linux driver for Auvitek's USB device.
+ This is a hybrid analog/digital tv capture driver for
+ Auvitek's AU0828 USB device.
 
  To compile this driver as a module, choose M here: the
  module will be called au0828
+
+config VIDEO_AU0828_V4L2
+   bool Auvitek AU0828 v4l2 analog video support
+   depends on VIDEO_AU0828  VIDEO_V4L2
+   select DVB_AU8522_V4L if MEDIA_SUBDRV_AUTOSELECT
+   default y
+   ---help---
+ This is a video4linux driver for Auvitek's USB device.
+
+ Choose Y here to include support for v4l2 analog video
+ capture within the au0828 driver.
diff --git a/drivers/media/usb/au0828/Makefile 
b/drivers/media/usb/au0828/Makefile
index 98cc20c..be3bdf6 100644
--- a/drivers/media/usb/au0828/Makefile
+++ b/drivers/media/usb/au0828/Makefile
@@ -1,4 +1,8 @@
-au0828-objs:= au0828-core.o au0828-i2c.o au0828-cards.o au0828-dvb.o 
au0828-video.o au0828-vbi.o
+au0828-objs:= au0828-core.o au0828-i2c.o au0828-cards.o au0828-dvb.o
+
+ifeq ($(CONFIG_VIDEO_AU0828_V4L2),y)
+  au0828-objs   += au0828-video.o au0828-vbi.o
+endif
 
 obj-$(CONFIG_VIDEO_AU0828) += au0828.o
 
diff --git a/drivers/media/usb/au0828/au0828-cards.c 
b/drivers/media/usb/au0828/au0828-cards.c
index cf309d8..7b5b742 100644
--- a/drivers/media/usb/au0828/au0828-cards.c
+++ b/drivers/media/usb/au0828/au0828-cards.c
@@ -188,9 +188,11 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 
*eeprom_data)
 void au0828_card_setup(struct au0828_dev *dev)
 {
static u8 eeprom[256];
+#ifdef CONFIG_VIDEO_AU0828_V4L2
struct tuner_setup tun_setup;
struct v4l2_subdev *sd;
unsigned int mode_mask = T_ANALOG_TV;
+#endif
 
dprintk(1, %s()\n, __func__);
 
@@ -211,6 +213,7 @@ void au0828_card_setup(struct au0828_dev *dev)
break;
}
 
+#ifdef CONFIG_VIDEO_AU0828_V4L2
if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) {
/* Load the analog demodulator driver (note this would need to
   be abstracted out if we ever need to support a different
@@ -236,6 +239,7 @@ void au0828_card_setup(struct au0828_dev *dev)
v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_type_addr,
 tun_setup);
}
+#endif
 }
 
 /*
diff --git a/drivers/media/usb/au0828/au0828-core.c 
b/drivers/media/usb/au0828/au0828-core.c
index 745a80a..1e6f40e 100644
--- a/drivers/media/usb/au0828/au0828-core.c

Re: [PATCH 1/2] au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2

2012-12-04 Thread Michael Krufky
On Tue, Dec 4, 2012 at 11:17 AM, Devin Heitmueller
dheitmuel...@kernellabs.com wrote:
 On Tue, Dec 4, 2012 at 11:07 AM, Michael Krufky mkru...@linuxtv.org wrote:
 This patch removes the dependendency of VIDEO_AU0828 on VIDEO_V4L2 by
 creating a new Kconfig option, VIDEO_AU0828_V4L2, which enables analog
 video capture support and depends on VIDEO_V4L2 itself.

 With VIDEO_AU0828_V4L2 disabled, the driver will only support digital
 television and will not depend on the v4l2-core. With VIDEO_AU0828_V4L2
 enabled, the driver will be built with the analog v4l2 support included.

 Hi Mike,

 This is generally good stuff.  A couple of thoughts.

 It seems that this driver effectively takes the approach which is the
 exact reverse of all the other hybrid drivers - it mandates DVB with
 V4L as optional, whereas most of the other drivers mandate V4L with
 DVB is optional.  Now I recognize that in this case it was done
 because of some specific business need -- however I have to wonder if
 the moving around of all the code to no longer be video vs. dvb
 specific could be leveraged to allow users to select either condition
 - to select DVB, V4L, or both.

 This seems like the direction things are going in -- we've
 restructured the tree based on bus interface type (pci/usb/etc) rather
 than v4l versus dvb.  This might be an opportunity to define the model
 for how other hybrid devices could also be refactored to not have V4L
 or DVB if not needed.

Thanks for your comments, Devin.  I agree with you that it would be
nice to be able to choose to disable DVB just like how we can disable
V4L, but the reason why I did this to V4L first was not simply due to
the business need -- I did this because of how easy it was to do.  The
driver was originally developed as a DVB-only driver, and later analog
support was added to it (by you ;-) ).  As a result, conditionalizing
the analog support was rather easy.  Doing the same for DVB would
probably not be very difficult either, but I also believe in small
patches and gradual changes.

These patches allow us to build the au0828 driver (and its
dependencies) without the need for the v4l-core.  This is especially
helpful when backporting digital support to older kernels without the
need to muck through the v4l2 api changes.

Do you have any issues with these two patches as-is?  Any suggestions?
 If not, is it OK with you if I request that Mauro merge this for v3.9
?

Cheers,

Mike Krufky
--
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


[PULL] au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2 | git://linuxtv.org/mkrufky/hauppauge voyager-digital

2012-12-04 Thread Michael Krufky
On Tue, Dec 4, 2012 at 11:29 AM, Devin Heitmueller
dheitmuel...@kernellabs.com wrote:
 On Tue, Dec 4, 2012 at 11:25 AM, Michael Krufky mkru...@linuxtv.org wrote:
 Do you have any issues with these two patches as-is?  Any suggestions?
  If not, is it OK with you if I request that Mauro merge this for v3.9
 ?

 I have no specific issues with the patch as-is.

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

 --
 Devin J. Heitmueller - Kernel Labs
 http://www.kernellabs.com

Thank you, Devin.

Mauro, please merge:

The following changes since commit 72567f3cfafe31c1612efe52e2893e960cc8dd00:

  au0828: update model matrix entries for 72261, 72271  72281
(2012-11-28 09:46:24 -0500)

are available in the git repository at:

  git://linuxtv.org/mkrufky/hauppauge voyager-digital

for you to fetch changes up to c67f6580bfa7922572a883437413f6480db05ef2:

  au0828: break au0828_card_setup() down into smaller functions
(2012-12-04 10:46:38 -0500)


Michael Krufky (2):
  au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2
  au0828: break au0828_card_setup() down into smaller functions

 drivers/media/usb/Kconfig   |2 +-
 drivers/media/usb/au0828/Kconfig|   17 ++---
 drivers/media/usb/au0828/Makefile   |6 +-
 drivers/media/usb/au0828/au0828-cards.c |   16 +---
 drivers/media/usb/au0828/au0828-core.c  |   13 -
 drivers/media/usb/au0828/au0828-i2c.c   |4 
 drivers/media/usb/au0828/au0828.h   |2 ++
 7 files changed, 51 insertions(+), 9 deletions(-)

Cheers,

Mike Krufky
--
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] tda18271: add missing entries for qam_7 to tda18271_update_std_map() and tda18271_dump_std_map()

2012-12-03 Thread Michael Krufky
Frank,

Thank you for your patch -- I'll merge it to my tree later on today.

Best regards,

Mike Krufky

2012/12/3 Frank Schäfer fschaefer@googlemail.com:
 Signed-off-by: Frank Schäfer fschaefer@googlemail.com
 ---
  drivers/media/tuners/tda18271-fe.c |2 ++
  1 Datei geändert, 2 Zeilen hinzugefügt(+)

 diff --git a/drivers/media/tuners/tda18271-fe.c 
 b/drivers/media/tuners/tda18271-fe.c
 index 72c26fd..e778686 100644
 --- a/drivers/media/tuners/tda18271-fe.c
 +++ b/drivers/media/tuners/tda18271-fe.c
 @@ -1122,6 +1122,7 @@ static int tda18271_dump_std_map(struct dvb_frontend 
 *fe)
 tda18271_dump_std_item(dvbt_7, dvbt 7);
 tda18271_dump_std_item(dvbt_8, dvbt 8);
 tda18271_dump_std_item(qam_6,  qam 6 );
 +   tda18271_dump_std_item(qam_7,  qam 7 );
 tda18271_dump_std_item(qam_8,  qam 8 );

 return 0;
 @@ -1149,6 +1150,7 @@ static int tda18271_update_std_map(struct dvb_frontend 
 *fe,
 tda18271_update_std(dvbt_7, dvbt 7);
 tda18271_update_std(dvbt_8, dvbt 8);
 tda18271_update_std(qam_6,  qam 6);
 +   tda18271_update_std(qam_7,  qam 7);
 tda18271_update_std(qam_8,  qam 8);

 return 0;
 --
 1.7.10.4

--
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


[PULL] au0828: update model matrix | git://linuxtv.org/mkrufky/hauppauge voyager-72281

2012-11-28 Thread Michael Krufky
The following changes since commit c6c22955f80f2db9614b01fe5a3d1cfcd8b3d848:

  [media] dma-mapping: fix dma_common_get_sgtable() conditional
compilation (2012-11-27 09:42:31 -0200)

are available in the git repository at:

  git://linuxtv.org/mkrufky/hauppauge voyager-72281

for you to fetch changes up to 72567f3cfafe31c1612efe52e2893e960cc8dd00:

  au0828: update model matrix entries for 72261, 72271  72281
(2012-11-28 09:46:24 -0500)


Michael Krufky (2):
  au0828: add missing model 72281, usb id 2040:7270 to the model matrix
  au0828: update model matrix entries for 72261, 72271  72281

 drivers/media/usb/au0828/au0828-cards.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--
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] au0828: update model matrix entries for 72261, 72271 72281

2012-11-28 Thread Michael Krufky
Signed-off-by: Michael Krufky mkru...@linuxtv.org
---
 drivers/media/usb/au0828/au0828-cards.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/au0828/au0828-cards.c 
b/drivers/media/usb/au0828/au0828-cards.c
index d12bdd3..cf309d8 100644
--- a/drivers/media/usb/au0828/au0828-cards.c
+++ b/drivers/media/usb/au0828/au0828-cards.c
@@ -169,8 +169,9 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 
*eeprom_data)
case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
-   case 72261: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
-   case 72281: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */
+   case 72261: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
+   case 72271: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
+   case 72281: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and analog video */
case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */
break;
-- 
1.7.10.4

--
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


  1   2   3   4   5   >