Re: How I must report that a driver has been broken?

2012-05-12 Thread Hans de Goede

Hi

On 05/12/2012 06:26 AM, Alfredo Jesús Delaiti wrote:

Hi

New features of the driver has left a card does not work.
How I must report that a driver has been broken?


Well this list would be a good place for starters, please
send a *detailed* bug report to this list, including
things like what is the last (kernel) version it worked
with, what is the first version it is broken.

What did it do before breaking what know now longer works,
etc.

Regards,

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


[PATCH] fc0013 ver. 0.2: introduction of get_rf_strength function

2012-05-12 Thread Hans-Frieder Vogt
Changes compared to version 0.1 of driver (sent 6 May):
- Initial implementation of get_rf_strength function.
- Introduction of a warning message

Signed-off-by: Hans-Frieder Vogt hfv...@gmx.net

 fc0013.c |   74 ++-
 1 file changed, 73 insertions(+), 1 deletion(-)

diff -up --new-file --recursive a/drivers/media/common/tuners/fc0013.c 
b/drivers/media/common/tuners/fc0013.c
--- a/drivers/media/common/tuners/fc0013.c  2012-05-12 10:54:01.093352494 
+0200
+++ b/drivers/media/common/tuners/fc0013.c  2012-05-12 11:00:29.940455095 
+0200
@@ -484,6 +484,8 @@ static int fc0013_set_params(struct dvb_
 exit:
if (fe-ops.i2c_gate_ctrl)
fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
+   if (ret)
+   warn(%s: failed: %d, __func__, ret);
return ret;
 }
 
@@ -508,6 +510,74 @@ static int fc0013_get_bandwidth(struct d
return 0;
 }
 
+#define INPUT_ADC_LEVEL-8
+
+static int fc0013_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
+{
+   struct fc0013_priv *priv = fe-tuner_priv;
+   int ret;
+   unsigned char tmp;
+   int int_temp, lna_gain, int_lna, tot_agc_gain, power;
+   const int fc0013_lna_gain_table[] = {
+   /* low gain */
+   -63, -58, -99, -73,
+   -63, -65, -54, -60,
+   /* middle gain */
+71,  70,  68,  67,
+65,  63,  61,  58,
+   /* high gain */
+   197, 191, 188, 186,
+   184, 182, 181, 179,
+   };
+
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */
+
+   ret = fc0013_writereg(priv, 0x13, 0x00);
+   if (ret)
+   goto err;
+
+   ret = fc0013_readreg(priv, 0x13, tmp);
+   if (ret)
+   goto err;
+   int_temp = tmp;
+
+   ret = fc0013_readreg(priv, 0x14, tmp);
+   if (ret)
+   goto err;
+   lna_gain = tmp  0x1f;
+
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
+
+   if (lna_gain  ARRAY_SIZE(fc0013_lna_gain_table)) {
+   int_lna = fc0013_lna_gain_table[lna_gain];
+   tot_agc_gain = (abs((int_temp  5) - 7) - 2 +
+   (int_temp  0x1f)) * 2;
+   power = INPUT_ADC_LEVEL - tot_agc_gain - int_lna / 10;
+
+   if (power = 45)
+   *strength = 255;/* 100% */
+   else if (power  -95)
+   *strength = 0;
+   else
+   *strength = (power + 95) * 255 / 140;
+
+   *strength |= *strength  8;
+   } else {
+   ret = -1;
+   }
+
+   goto exit;
+
+err:
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
+exit:
+   if (ret)
+   warn(%s: failed: %d, __func__, ret);
+   return ret;
+}
 
 static const struct dvb_tuner_ops fc0013_tuner_ops = {
.info = {
@@ -528,6 +598,8 @@ static const struct dvb_tuner_ops fc0013
.get_frequency  = fc0013_get_frequency,
.get_if_frequency = fc0013_get_if_frequency,
.get_bandwidth  = fc0013_get_bandwidth,
+
+   .get_rf_strength = fc0013_get_rf_strength,
 };
 
 struct dvb_frontend *fc0013_attach(struct dvb_frontend *fe,
@@ -559,4 +631,4 @@ EXPORT_SYMBOL(fc0013_attach);
 MODULE_DESCRIPTION(Fitipower FC0013 silicon tuner driver);
 MODULE_AUTHOR(Hans-Frieder Vogt hfv...@gmx.net);
 MODULE_LICENSE(GPL);
-MODULE_VERSION(0.1);
+MODULE_VERSION(0.2);

Hans-Frieder Vogt   e-mail: hfvogt at gmx .dot. net
--
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] fc0012 ver. 0.6: introduction of get_rf_strength function

2012-05-12 Thread Thomas Mair
On 12.05.2012 11:11, Hans-Frieder Vogt wrote:
 Changes compared to version 0.5 of driver (sent 6 May):
 - Initial implementation of get_rf_strength function.
 
 Signed-off-by: Hans-Frieder Vogt hfv...@gmx.net
 
  fc0012.c |   72 
 ++-
  1 file changed, 71 insertions(+), 1 deletion(-)
 
 diff -up --new-file --recursive a/drivers/media/common/tuners/fc0012.c 
 b/drivers/media/common/tuners/fc0012.c
 --- a/drivers/media/common/tuners/fc0012.c2012-05-12 10:53:55.330058209 
 +0200
 +++ b/drivers/media/common/tuners/fc0012.c2012-05-09 23:27:37.781193720 
 +0200
 @@ -343,6 +343,74 @@ static int fc0012_get_bandwidth(struct d
   return 0;
  }
  
 +#define INPUT_ADC_LEVEL  -8
 +
 +static int fc0012_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
 +{
 + struct fc0012_priv *priv = fe-tuner_priv;
 + int ret;
 + unsigned char tmp;
 + int int_temp, lna_gain, int_lna, tot_agc_gain, power;
 + const int fc0012_lna_gain_table[] = {
 + /* low gain */
 + -63, -58, -99, -73,
 + -63, -65, -54, -60,
 + /* middle gain */
 +  71,  70,  68,  67,
 +  65,  63,  61,  58,
 + /* high gain */
 + 197, 191, 188, 186,
 + 184, 182, 181, 179,
 + };
 +
 + if (fe-ops.i2c_gate_ctrl)
 + fe-ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */
 +
 + ret = fc0012_writereg(priv, 0x12, 0x00);
 + if (ret)
 + goto err;
 +
 + ret = fc0012_readreg(priv, 0x12, tmp);
 + if (ret)
 + goto err;
 + int_temp = tmp;
 +
 + ret = fc0012_readreg(priv, 0x13, tmp);
 + if (ret)
 + goto err;
 + lna_gain = tmp  0x1f;
 +
 + if (fe-ops.i2c_gate_ctrl)
 + fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
 +
 + if (lna_gain  ARRAY_SIZE(fc0012_lna_gain_table)) {
 + int_lna = fc0012_lna_gain_table[lna_gain];
 + tot_agc_gain = (abs((int_temp  5) - 7) - 2 +
 + (int_temp  0x1f)) * 2;
 + power = INPUT_ADC_LEVEL - tot_agc_gain - int_lna / 10;
 +
 + if (power = 45)
 + *strength = 255;/* 100% */
 + else if (power  -95)
 + *strength = 0;
 + else
 + *strength = (power + 95) * 255 / 140;
 +
 + *strength |= *strength  8;
 + } else {
 + ret = -1;
 + }
 +
 + goto exit;
 +
 +err:
 + if (fe-ops.i2c_gate_ctrl)
 + fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
 +exit:
 + if (ret)
 + warn(%s: failed: %d, __func__, ret);
 + return ret;
 +}
  
  static const struct dvb_tuner_ops fc0012_tuner_ops = {
   .info = {
 @@ -363,6 +431,8 @@ static const struct dvb_tuner_ops fc0012
   .get_frequency  = fc0012_get_frequency,
   .get_if_frequency = fc0012_get_if_frequency,
   .get_bandwidth  = fc0012_get_bandwidth,
 +
 + .get_rf_strength = fc0012_get_rf_strength,
  };
  
  struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
 @@ -394,4 +464,4 @@ EXPORT_SYMBOL(fc0012_attach);
  MODULE_DESCRIPTION(Fitipower FC0012 silicon tuner driver);
  MODULE_AUTHOR(Hans-Frieder Vogt hfv...@gmx.net);
  MODULE_LICENSE(GPL);
 -MODULE_VERSION(0.5);
 +MODULE_VERSION(0.6);
 
 Hans-Frieder Vogt   e-mail: hfvogt at gmx .dot. net

Thanks!
I was just doing the same to get it to work with the rtl2832 demod. I will
test the fc0012 driver with the rtl2832 driver today.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] au0828: Move under dvb

2012-05-12 Thread Devin Heitmueller
On Fri, May 11, 2012 at 11:08 PM, Ismael Luceno ismael.luc...@gmail.com wrote:
 On Fri, 11 May 2012 08:04:59 -0400
 Devin Heitmueller dheitmuel...@kernellabs.com wrote:
 ...
 What is the motivation for moving these files?

 Well, the device was on the wrong Kconfig section, and while thinking
 about changing that, I just thought to move it under DVB.

 The au0828 is a hybrid bridge, and every other hybrid bridge is
 under video?

 Sorry, the devices I got don't support analog, so I didn't thought
 about it that much...

 I guess it's arbitrary... isn't it? wouldn't it be better to have an
 hybrid section? (just thinking out loud)

Yeah, in this case it's largely historical (a product from before the
V4L and DVB subsystems were merged).  At this point I don't see any
real advantage to arbitrarily moving the stuff around.  And in fact in
some areas it's even more ambiguous because some drivers are hybrid
drivers but support both hybrid chips as well as analog-only (the
em28xx driver is one such example).

Anyway, Mauro is welcome to offer his opinion if it differs, but as
far as I'm concerned this patch shouldn't get applied.

Cheers,

Devin

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


[PATCH 0/5] support rtl2832 demodulator

2012-05-12 Thread Thomas Mair
This series of patches contains the rtl2832 demodulator driver.
In order to work the fc0012 and fc0013 driver from Hans-Frieder Vogt
have to be applied first.
The current version includes all the comments on the previous patches.
I currently only own a Cinergy Terratec T Stick Black (rev 1) device,
that is why i could only test it with that device. Feel free to 
comment on the patch and report issues you are having with it.

Thanks again for all the comments, especially to Antti.

Regards
Thomas

Thomas Mair (5):
  rtl2832 ver 0.3: suport for RTL2832 demodulator revised version
  rtl28xxu: support for the rtl2832 demod driver
  rtl28xxu: renamed rtl2831_rd/rtl2831_wr to rtl28xx_rd/rtl28xx_wr
  rtl28xxu: support G-Tek Electronics Group Lifeview LV5TDLX DVB-T
  rtl28xxu: support Terratec Noxon DAB/DAB+ stick

 drivers/media/dvb/dvb-usb/Kconfig  |3 +
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h|3 +
 drivers/media/dvb/dvb-usb/rtl28xxu.c   |  513 +--
 drivers/media/dvb/frontends/Kconfig|7 +
 drivers/media/dvb/frontends/Makefile   |1 +
 drivers/media/dvb/frontends/rtl2832.c  | 1009 
 drivers/media/dvb/frontends/rtl2832.h  |   81 +++
 drivers/media/dvb/frontends/rtl2832_priv.h |  260 +++
 8 files changed, 1829 insertions(+), 48 deletions(-)
 create mode 100644 drivers/media/dvb/frontends/rtl2832.c
 create mode 100644 drivers/media/dvb/frontends/rtl2832.h
 create mode 100644 drivers/media/dvb/frontends/rtl2832_priv.h

-- 
1.7.7.6

--
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/5] rtl2832 ver 0.3: suport for RTL2832 demodulator revised version

2012-05-12 Thread Thomas Mair
Changes compared to version 0.2:
- removed reading of signal strength for tuners FC0012,FC0013 (is now supported 
by fc0012,fc0013 driver)
- moved definition of register names to rtl2832_priv.h
- cleaned up demod private structure
- replaced rtl2832_log2 function with intlog2 from dvb_math

Signed-off-by: Thomas Mair thomas.mai...@googlemail.com
---
 drivers/media/dvb/frontends/Kconfig|7 +
 drivers/media/dvb/frontends/Makefile   |1 +
 drivers/media/dvb/frontends/rtl2832.c  | 1009 
 drivers/media/dvb/frontends/rtl2832.h  |   81 +++
 drivers/media/dvb/frontends/rtl2832_priv.h |  260 +++
 5 files changed, 1358 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/dvb/frontends/rtl2832.c
 create mode 100644 drivers/media/dvb/frontends/rtl2832.h
 create mode 100644 drivers/media/dvb/frontends/rtl2832_priv.h

diff --git a/drivers/media/dvb/frontends/Kconfig 
b/drivers/media/dvb/frontends/Kconfig
index f479834..f7d67d7 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -432,6 +432,13 @@ config DVB_RTL2830
help
  Say Y when you want to support this frontend.
 
+config DVB_RTL2832
+   tristate Realtek RTL2832 DVB-T
+   depends on DVB_CORE  I2C
+   default m if DVB_FE_CUSTOMISE
+   help
+ Say Y when you want to support this frontend.
+
 comment DVB-C (cable) frontends
depends on DVB_CORE
 
diff --git a/drivers/media/dvb/frontends/Makefile 
b/drivers/media/dvb/frontends/Makefile
index b0381dc..9731192 100644
--- a/drivers/media/dvb/frontends/Makefile
+++ b/drivers/media/dvb/frontends/Makefile
@@ -98,6 +98,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o
 obj-$(CONFIG_DVB_A8293) += a8293.o
 obj-$(CONFIG_DVB_TDA10071) += tda10071.o
 obj-$(CONFIG_DVB_RTL2830) += rtl2830.o
+obj-$(CONFIG_DVB_RTL2832) = rtl2832.o
 obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o
 obj-$(CONFIG_DVB_AF9033) += af9033.o
 
diff --git a/drivers/media/dvb/frontends/rtl2832.c 
b/drivers/media/dvb/frontends/rtl2832.c
new file mode 100644
index 000..1936c50
--- /dev/null
+++ b/drivers/media/dvb/frontends/rtl2832.c
@@ -0,0 +1,1009 @@
+/*
+ * Realtek RTL2832 DVB-T demodulator driver
+ *
+ * Copyright (C) 2012 Thomas Mair thomas.mai...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include rtl2832_priv.h
+#include dvb_math.h
+
+
+int rtl2832_debug;
+module_param_named(debug, rtl2832_debug, int, 0644);
+MODULE_PARM_DESC(debug, Turn on/off frontend debugging (default:off).);
+
+
+static int reg_mask[32] = {
+   0x0001,
+   0x0003,
+   0x0007,
+   0x000f,
+   0x001f,
+   0x003f,
+   0x007f,
+   0x00ff,
+   0x01ff,
+   0x03ff,
+   0x07ff,
+   0x0fff,
+   0x1fff,
+   0x3fff,
+   0x7fff,
+   0x,
+   0x0001,
+   0x0003,
+   0x0007,
+   0x000f,
+   0x001f,
+   0x003f,
+   0x007f,
+   0x00ff,
+   0x01ff,
+   0x03ff,
+   0x07ff,
+   0x0fff,
+   0x1fff,
+   0x3fff,
+   0x7fff,
+   0x
+};
+
+static const rtl2832_reg_entry registers[] = {
+   [DVBT_SOFT_RST] = {0x1, 0x1, 2, 2},
+   [DVBT_IIC_REPEAT] = {0x1,  0x1,   3,  3},
+   [DVBT_TR_WAIT_MIN_8K]   = {0x1,  0x88,   11,  2},
+   [DVBT_RSD_BER_FAIL_VAL] = {0x1,  0x8f,   15,  0},
+   [DVBT_EN_BK_TRK]= {0x1,  0xa6,   7,  7},
+   [DVBT_AD_EN_REG]= {0x0,  0x8,   7,  7},
+   [DVBT_AD_EN_REG1]  = {0x0,  0x8,   6,  6},
+   [DVBT_EN_BBIN]= {0x1,  0xb1,   0,  0},
+   [DVBT_MGD_THD0]  = {0x1,  0x95,   7,  0},
+   [DVBT_MGD_THD1]  = {0x1,  0x96,   7,  0},
+   [DVBT_MGD_THD2]  = {0x1,  0x97,   7,  0},
+   [DVBT_MGD_THD3]  = {0x1,  0x98,   7,  0},
+   [DVBT_MGD_THD4]  = {0x1,  0x99,   7,  0},
+   [DVBT_MGD_THD5]  = {0x1,  0x9a,   7,  0},
+   [DVBT_MGD_THD6]  = {0x1,  0x9b,   7,  0},
+   [DVBT_MGD_THD7]  = {0x1,  0x9c,   7,  0},
+   [DVBT_EN_CACQ_NOTCH]= {0x1,  0x61,   4,  4},
+   

[PATCH 2/5] rtl28xxu: support for the rtl2832 demod driver

2012-05-12 Thread Thomas Mair
This only adds support for the Terratec Cinergy T Stick Black device.

Signed-off-by: Thomas Mair thomas.mai...@googlemail.com
---
 drivers/media/dvb/dvb-usb/Kconfig   |3 +
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h |1 +
 drivers/media/dvb/dvb-usb/rtl28xxu.c|  431 +--
 3 files changed, 411 insertions(+), 24 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/Kconfig 
b/drivers/media/dvb/dvb-usb/Kconfig
index be1db75..98dd0d8 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -417,9 +417,12 @@ config DVB_USB_RTL28XXU
tristate Realtek RTL28xxU DVB USB support
depends on DVB_USB  EXPERIMENTAL
select DVB_RTL2830
+   select DVB_RTL2832
select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMISE
+   select MEDIA_TUNER_FC0012 if !MEDIA_TUNER_CUSTOMISE
+   select MEDIA_TUNER_FC0013 if !MEDIA_TUNER_CUSTOMISE
help
  Say Y here to support the Realtek RTL28xxU DVB USB receiver.
 
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 
b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 2418e41..fd37be0 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -157,6 +157,7 @@
 #define USB_PID_TERRATEC_CINERGY_T_STICK   0x0093
 #define USB_PID_TERRATEC_CINERGY_T_STICK_RC0x0097
 #define USB_PID_TERRATEC_CINERGY_T_STICK_DUAL_RC   0x0099
+#define USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1 0x00a9
 #define USB_PID_TWINHAN_VP7041_COLD0x3201
 #define USB_PID_TWINHAN_VP7041_WARM0x3202
 #define USB_PID_TWINHAN_VP7020_COLD0x3203
diff --git a/drivers/media/dvb/dvb-usb/rtl28xxu.c 
b/drivers/media/dvb/dvb-usb/rtl28xxu.c
index 8f4736a..a2b3d73 100644
--- a/drivers/media/dvb/dvb-usb/rtl28xxu.c
+++ b/drivers/media/dvb/dvb-usb/rtl28xxu.c
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2009 Antti Palosaari cr...@iki.fi
  * Copyright (C) 2011 Antti Palosaari cr...@iki.fi
+ * Copyright (C) 2012 Thomas Mair thomas.mai...@googlemail.com
  *
  *This program is free software; you can redistribute it and/or modify
  *it under the terms of the GNU General Public License as published by
@@ -22,10 +23,12 @@
 #include rtl28xxu.h
 
 #include rtl2830.h
+#include rtl2832.h
 
 #include qt1010.h
 #include mt2060.h
 #include mxl5005s.h
+#include fc0012.h
 
 /* debug */
 static int dvb_usb_rtl28xxu_debug;
@@ -378,34 +381,153 @@ err:
return ret;
 }
 
+static struct rtl2832_config rtl28xxu_rtl2832_fc0012_config = {
+   .i2c_addr = 0x10, /* 0x20 */
+   .xtal = 2880,
+   .if_dvbt = 0,
+   .tuner = TUNER_RTL2832_FC0012
+};
+
+
+static int rtl2832u_fc0012_tuner_callback(struct dvb_usb_device *d,
+   int cmd, int arg)
+{
+   int ret;
+   u8 val;
+
+   deb_info(%s cmd=%d arg=%d\n, __func__, cmd, arg);
+   switch (cmd) {
+   case FC_FE_CALLBACK_VHF_ENABLE:
+   /* set output values */
+   ret = rtl2831_rd_reg(d, SYS_GPIO_OUT_VAL, val);
+   if (ret)
+   goto err;
+
+   if (arg)
+   val = 0xbf; /* set GPIO6 low */
+   else
+   val |= 0x40; /* set GPIO6 high */
+
+
+   ret = rtl2831_wr_reg(d, SYS_GPIO_OUT_VAL, val);
+   if (ret)
+   goto err;
+   break;
+   default:
+   ret = -EINVAL;
+   goto err;
+   }
+   return 0;
+
+err:
+   err(%s: failed=%d\n, __func__, ret);
+
+   return ret;
+}
+
+
+static int rtl2832u_fc0013_tuner_callback(struct dvb_usb_device *d,
+   int cmd, int arg)
+{
+   /* TODO implement*/
+   return 0;
+}
+
+static int rtl2832u_tuner_callback(struct dvb_usb_device *d, int cmd, int arg)
+{
+   struct rtl28xxu_priv *priv = d-priv;
+
+   switch (priv-tuner) {
+   case TUNER_RTL2832_FC0012:
+   return rtl2832u_fc0012_tuner_callback(d, cmd, arg);
+
+   case TUNER_RTL2832_FC0013:
+   return rtl2832u_fc0013_tuner_callback(d, cmd, arg);
+   default:
+   break;
+   }
+
+   return -ENODEV;
+}
+
+static int rtl2832u_frontend_callback(void *adapter_priv, int component,
+   int cmd, int arg)
+{
+   struct i2c_adapter *adap = adapter_priv;
+   struct dvb_usb_device *d = i2c_get_adapdata(adap);
+
+   switch (component) {
+   case DVB_FRONTEND_COMPONENT_TUNER:
+   return rtl2832u_tuner_callback(d, cmd, arg);
+   default:
+   break;
+   }
+
+   return -EINVAL;
+}
+
+
+
+
 static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
 {
int ret;
struct rtl28xxu_priv *priv = adap-dev-priv;
-   u8 buf[1];
+   struct 

[PATCH 3/5] rtl28xxu: renamed rtl2831_rd/rtl2831_wr to rtl28xx_rd/rtl28xx_wr

2012-05-12 Thread Thomas Mair
Signed-off-by: Thomas Mair thomas.mai...@googlemail.com
---
 drivers/media/dvb/dvb-usb/rtl28xxu.c |  102 +-
 1 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/rtl28xxu.c 
b/drivers/media/dvb/dvb-usb/rtl28xxu.c
index a2b3d73..86304c6 100644
--- a/drivers/media/dvb/dvb-usb/rtl28xxu.c
+++ b/drivers/media/dvb/dvb-usb/rtl28xxu.c
@@ -83,7 +83,7 @@ err:
return ret;
 }
 
-static int rtl2831_wr_regs(struct dvb_usb_device *d, u16 reg, u8 *val, int len)
+static int rtl28xx_wr_regs(struct dvb_usb_device *d, u16 reg, u8 *val, int len)
 {
struct rtl28xxu_req req;
 
@@ -119,12 +119,12 @@ static int rtl2831_rd_regs(struct dvb_usb_device *d, u16 
reg, u8 *val, int len)
return rtl28xxu_ctrl_msg(d, req);
 }
 
-static int rtl2831_wr_reg(struct dvb_usb_device *d, u16 reg, u8 val)
+static int rtl28xx_wr_reg(struct dvb_usb_device *d, u16 reg, u8 val)
 {
-   return rtl2831_wr_regs(d, reg, val, 1);
+   return rtl28xx_wr_regs(d, reg, val, 1);
 }
 
-static int rtl2831_rd_reg(struct dvb_usb_device *d, u16 reg, u8 *val)
+static int rtl28xx_rd_reg(struct dvb_usb_device *d, u16 reg, u8 *val)
 {
return rtl2831_rd_regs(d, reg, val, 1);
 }
@@ -311,12 +311,12 @@ static int rtl2831u_frontend_attach(struct 
dvb_usb_adapter *adap)
 */
 
/* GPIO direction */
-   ret = rtl2831_wr_reg(adap-dev, SYS_GPIO_DIR, 0x0a);
+   ret = rtl28xx_wr_reg(adap-dev, SYS_GPIO_DIR, 0x0a);
if (ret)
goto err;
 
/* enable as output GPIO0, GPIO2, GPIO4 */
-   ret = rtl2831_wr_reg(adap-dev, SYS_GPIO_OUT_EN, 0x15);
+   ret = rtl28xx_wr_reg(adap-dev, SYS_GPIO_OUT_EN, 0x15);
if (ret)
goto err;
 
@@ -399,7 +399,7 @@ static int rtl2832u_fc0012_tuner_callback(struct 
dvb_usb_device *d,
switch (cmd) {
case FC_FE_CALLBACK_VHF_ENABLE:
/* set output values */
-   ret = rtl2831_rd_reg(d, SYS_GPIO_OUT_VAL, val);
+   ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_VAL, val);
if (ret)
goto err;
 
@@ -409,7 +409,7 @@ static int rtl2832u_fc0012_tuner_callback(struct 
dvb_usb_device *d,
val |= 0x40; /* set GPIO6 high */
 
 
-   ret = rtl2831_wr_reg(d, SYS_GPIO_OUT_VAL, val);
+   ret = rtl28xx_wr_reg(d, SYS_GPIO_OUT_VAL, val);
if (ret)
goto err;
break;
@@ -504,25 +504,25 @@ static int rtl2832u_frontend_attach(struct 
dvb_usb_adapter *adap)
deb_info(%s:\n, __func__);
 
 
-   ret = rtl2831_rd_reg(adap-dev, SYS_GPIO_DIR, val);
+   ret = rtl28xx_rd_reg(adap-dev, SYS_GPIO_DIR, val);
if (ret)
goto err;
 
val = 0xbf;
 
-   ret = rtl2831_wr_reg(adap-dev, SYS_GPIO_DIR, val);
+   ret = rtl28xx_wr_reg(adap-dev, SYS_GPIO_DIR, val);
if (ret)
goto err;
 
 
/* enable as output GPIO3 and GPIO6*/
-   ret = rtl2831_rd_reg(adap-dev, SYS_GPIO_OUT_EN, val);
+   ret = rtl28xx_rd_reg(adap-dev, SYS_GPIO_OUT_EN, val);
if (ret)
goto err;
 
val |= 0x48;
 
-   ret = rtl2831_wr_reg(adap-dev, SYS_GPIO_OUT_EN, val);
+   ret = rtl28xx_wr_reg(adap-dev, SYS_GPIO_OUT_EN, val);
if (ret)
goto err;
 
@@ -773,7 +773,7 @@ static int rtl2831u_streaming_ctrl(struct dvb_usb_adapter 
*adap , int onoff)
 
deb_info(%s: onoff=%d\n, __func__, onoff);
 
-   ret = rtl2831_rd_reg(adap-dev, SYS_GPIO_OUT_VAL, gpio);
+   ret = rtl28xx_rd_reg(adap-dev, SYS_GPIO_OUT_VAL, gpio);
if (ret)
goto err;
 
@@ -787,11 +787,11 @@ static int rtl2831u_streaming_ctrl(struct dvb_usb_adapter 
*adap , int onoff)
gpio = (~0x04); /* LED off */
}
 
-   ret = rtl2831_wr_reg(adap-dev, SYS_GPIO_OUT_VAL, gpio);
+   ret = rtl28xx_wr_reg(adap-dev, SYS_GPIO_OUT_VAL, gpio);
if (ret)
goto err;
 
-   ret = rtl2831_wr_regs(adap-dev, USB_EPA_CTL, buf, 2);
+   ret = rtl28xx_wr_regs(adap-dev, USB_EPA_CTL, buf, 2);
if (ret)
goto err;
 
@@ -817,7 +817,7 @@ static int rtl2832u_streaming_ctrl(struct dvb_usb_adapter 
*adap , int onoff)
buf[1] = 0x02; /* reset EPA */
}
 
-   ret = rtl2831_wr_regs(adap-dev, USB_EPA_CTL, buf, 2);
+   ret = rtl28xx_wr_regs(adap-dev, USB_EPA_CTL, buf, 2);
if (ret)
goto err;
 
@@ -835,12 +835,12 @@ static int rtl2831u_power_ctrl(struct dvb_usb_device *d, 
int onoff)
deb_info(%s: onoff=%d\n, __func__, onoff);
 
/* demod adc */
-   ret = rtl2831_rd_reg(d, SYS_SYS0, sys0);
+   ret = rtl28xx_rd_reg(d, SYS_SYS0, sys0);
if (ret)
goto err;
 
/* tuner power, read GPIOs */
-   ret = rtl2831_rd_reg(d, SYS_GPIO_OUT_VAL, gpio);
+   ret = rtl28xx_rd_reg(d, SYS_GPIO_OUT_VAL, gpio);
 

[PATCH 4/5] rtl28xxu: support G-Tek Electronics Group Lifeview LV5TDLX DVB-T

2012-05-12 Thread Thomas Mair
Signed-off-by: Thomas Mair thomas.mai...@googlemail.com
---
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h |1 +
 drivers/media/dvb/dvb-usb/rtl28xxu.c|   11 ++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 
b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index fd37be0..b0a86e9 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -135,6 +135,7 @@
 #define USB_PID_GENIUS_TVGO_DVB_T030x4012
 #define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0
 #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1
+#define USB_PID_GTEK   0xb803
 #define USB_PID_INTEL_CE9500   0x9500
 #define USB_PID_ITETECH_IT9135 0x9135
 #define USB_PID_ITETECH_IT9135_90050x9005
diff --git a/drivers/media/dvb/dvb-usb/rtl28xxu.c 
b/drivers/media/dvb/dvb-usb/rtl28xxu.c
index 86304c6..699da68 100644
--- a/drivers/media/dvb/dvb-usb/rtl28xxu.c
+++ b/drivers/media/dvb/dvb-usb/rtl28xxu.c
@@ -1135,6 +1135,7 @@ enum rtl28xxu_usb_table_entry {
RTL2831U_14AA_0160,
RTL2831U_14AA_0161,
RTL2832U_0CCD_00A9,
+   RTL2832U_1F4D_B803,
 };
 
 static struct usb_device_id rtl28xxu_table[] = {
@@ -1149,6 +1150,8 @@ static struct usb_device_id rtl28xxu_table[] = {
/* RTL2832U */
[RTL2832U_0CCD_00A9] = {
USB_DEVICE(USB_VID_TERRATEC, 
USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1)},
+   [RTL2832U_1F4D_B803] = {
+   USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK)},
{} /* terminating entry */
 };
 
@@ -1262,7 +1265,7 @@ static struct dvb_usb_device_properties 
rtl28xxu_properties[] = {
 
.i2c_algo = rtl28xxu_i2c_algo,
 
-   .num_device_descs = 1,
+   .num_device_descs = 2,
.devices = {
{
.name = Terratec Cinergy T Stick Black,
@@ -1270,6 +1273,12 @@ static struct dvb_usb_device_properties 
rtl28xxu_properties[] = {
rtl28xxu_table[RTL2832U_0CCD_00A9],
},
},
+   {
+   .name = G-Tek Electronics Group Lifeview 
LV5TDLX DVB-T [RTL2832U],
+   .warm_ids = {
+   rtl28xxu_table[RTL2832U_1F4D_B803],
+   },
+   },
}
},
 
-- 
1.7.7.6

--
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 5/5] rtl28xxu: support Terratec Noxon DAB/DAB+ stick

2012-05-12 Thread Thomas Mair
Signed-off-by: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Thomas Mair thomas.mai...@googlemail.com
---
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h |1 +
 drivers/media/dvb/dvb-usb/rtl28xxu.c|   27 ++-
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 
b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index b0a86e9..95c9c14 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -244,6 +244,7 @@
 #define USB_PID_TERRATEC_H7_2  0x10a3
 #define USB_PID_TERRATEC_T30x10a0
 #define USB_PID_TERRATEC_T50x10a1
+#define USB_PID_NOXON_DAB_STICK0x00b3
 #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e
 #define USB_PID_PINNACLE_PCTV2000E 0x022c
 #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH  0x0228
diff --git a/drivers/media/dvb/dvb-usb/rtl28xxu.c 
b/drivers/media/dvb/dvb-usb/rtl28xxu.c
index 699da68..bacc783 100644
--- a/drivers/media/dvb/dvb-usb/rtl28xxu.c
+++ b/drivers/media/dvb/dvb-usb/rtl28xxu.c
@@ -29,6 +29,7 @@
 #include mt2060.h
 #include mxl5005s.h
 #include fc0012.h
+#include fc0013.h
 
 /* debug */
 static int dvb_usb_rtl28xxu_debug;
@@ -388,6 +389,12 @@ static struct rtl2832_config 
rtl28xxu_rtl2832_fc0012_config = {
.tuner = TUNER_RTL2832_FC0012
 };
 
+static struct rtl2832_config rtl28xxu_rtl2832_fc0013_config = {
+   .i2c_addr = 0x10, /* 0x20 */
+   .xtal = 2880,
+   .if_dvbt = 0,
+   .tuner = TUNER_RTL2832_FC0013
+};
 
 static int rtl2832u_fc0012_tuner_callback(struct dvb_usb_device *d,
int cmd, int arg)
@@ -553,6 +560,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter 
*adap)
ret = rtl28xxu_ctrl_msg(adap-dev, req_fc0013);
if (ret == 0  buf[0] == 0xa3) {
priv-tuner = TUNER_RTL2832_FC0013;
+   rtl2832_config = rtl28xxu_rtl2832_fc0013_config;
info(%s: FC0013 tuner found\n, __func__);
goto found;
}
@@ -750,6 +758,14 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter 
*adap)
fe-ops.tuner_ops.get_rf_strength;
return 0;
break;
+   case TUNER_RTL2832_FC0013:
+   fe = dvb_attach(fc0013_attach, adap-fe_adap[0].fe,
+   adap-dev-i2c_adap, 0xc61, 0, FC_XTAL_28_8_MHZ);
+
+   /* fc0013 also supports signal strength reading */
+   adap-fe_adap[0].fe-ops.read_signal_strength = adap-fe_adap[0]
+   .fe-ops.tuner_ops.get_rf_strength;
+   return 0;
default:
fe = NULL;
err(unknown tuner=%d, priv-tuner);
@@ -1136,6 +1152,7 @@ enum rtl28xxu_usb_table_entry {
RTL2831U_14AA_0161,
RTL2832U_0CCD_00A9,
RTL2832U_1F4D_B803,
+   RTL2832U_0CCD_00B3,
 };
 
 static struct usb_device_id rtl28xxu_table[] = {
@@ -1152,6 +1169,8 @@ static struct usb_device_id rtl28xxu_table[] = {
USB_DEVICE(USB_VID_TERRATEC, 
USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1)},
[RTL2832U_1F4D_B803] = {
USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK)},
+   [RTL2832U_0CCD_00B3] = {
+   USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK)},
{} /* terminating entry */
 };
 
@@ -1265,7 +1284,7 @@ static struct dvb_usb_device_properties 
rtl28xxu_properties[] = {
 
.i2c_algo = rtl28xxu_i2c_algo,
 
-   .num_device_descs = 2,
+   .num_device_descs = 3,
.devices = {
{
.name = Terratec Cinergy T Stick Black,
@@ -1279,6 +1298,12 @@ static struct dvb_usb_device_properties 
rtl28xxu_properties[] = {
rtl28xxu_table[RTL2832U_1F4D_B803],
},
},
+   {
+   .name = NOXON DAB/DAB+ USB dongle,
+   .warm_ids = {
+   rtl28xxu_table[RTL2832U_0CCD_00B3],
+   },
+   },
}
},
 
-- 
1.7.7.6

--
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: marvell-ccic: lacks of some features

2012-05-12 Thread Guennadi Liakhovetski
Hi Albert

On Fri, 11 May 2012, Albert Wang wrote:

 Hi, Jonathan
 
 Nice to meet you!
 
 We must clarify that it's not our target to replace your marvell-ccic by 
 our mv_camera in the tree
 
 We just hope you can help to review our mv_camera patches and discuss if 
 can put it in tree, because it may support more and better for Marvell 
 Soc chips.
 There is no conflict between your marvell-ccic which support OLPC and 
 our mv_camera which support most Marvell platforms.
 Actually we are willing to add support on OLPC. :)

Thanks for continuing your work on the mv_camera driver and for your 
effort to integrate it into the mainline! We certainly want to support new 
hardware types and features. So, we're certainly glad to hear, that your 
driver supports features, not presently available in the mainline.

As you certainly understand, we also want to reuse kernel code as much as 
possible. Drivers for the same IP block in different packaging, with 
different interfaces even with slight differences in functionality is one 
such example. Therefore, we certainly would _very much_ prefer having your 
driver and marvell-ccic share as much code as possible.

It would be interesting to know: have you actually tried to build your 
driver around the marvell-ccic code-base? If yes - how did it go? What 
difficulties did you encounter? If no - have you considered doing so? If 
yes - why have you decided against it? Have you considered a possibility 
of building your driver as an soc-camera driver, while still reusing the 
core functionality from marvell-ccic?

Thanks
Guennadi

 OK, we will provide the patches for discussing.
 Thank you very much!
 
 
 Thanks
 Albert Wang
 -Original Message-
 From: Jonathan Corbet [mailto:cor...@lwn.net] 
 Sent: Saturday, 12 May, 2012 00:28
 To: Albert Wang
 Cc: 'Guennadi Liakhovetski'; Linux Media Mailing List; Mauro Carvalho Chehab; 
 Chao Xie; Angela Wan; Kassey Lee; Albert
 Subject: Re: marvell-ccic: lacks of some features
 
 On Fri, 11 May 2012 09:02:26 -0700
 Albert Wang twan...@marvell.com wrote:
 
  Hi, Jonathan  Guennadi
  
  We used the marvell-ccic code and found it lacks of some features, but 
  our Marvell Camera driver (mv_camera.c) which based on soc_camera can 
  support all these features:
 
 The marvell-ccic driver has the features that were needed by the people doing 
 the work and that I had the documentation and hardware to support.
 Of course it's incomplete.
 
 I'll go through your list, but, first: is the purpose of your message to 
 argue for a replacement of the marvell-ccic driver by your mv_camera driver?  
 I am not necessarily opposed to that idea if mv_camera can support deployed 
 systems back to the OLPC XO 1.0 and if it seems clear that a replacement 
 makes more sense than adding features to the in-tree driver.  
 
  1. marvell-ccic only support MMP2 (PXA688), it can’t support other 
  Marvell SOC chips Our mv_camera can support such as MMP3 (PXA2128), TD 
  (PXA910/920) and so on besides MMP2
 
 Which is cool.  It is nice that Marvell is finally providing Linux support 
 for its camera controllers after all these years.  For the last several 
 years, I've necessarily been limited in the controllers I could support.
 Is it Marvell's intention to provide upstream maintenance and support going 
 forward? 
 
  2. marvell-ccic only support parallel (DVP) mode, can’t support MIPI 
  mode Our mv_camera can support both DVP mode and MIPI mode, MIPI 
  interface is the trend of current camera sensors with high resolution
 
 Adding MIPI doesn't look that hard, I've just never had a reason (or
 hardware) to do it.
 
  
  3. marvell-ccic only support ccic1 controller, can’t support ccic2 or 
  dual ccic controllers As you known, both MMP2 and MMP3 have 2 ccic 
  controllers, ccic2 is different with ccic1 Sometimes we need use both 
  2 ccic controllers for connecting 2 camera sensors Actually, we have 
  used 2 ccic controllers' cases in our platforms Our mv_camera can 
  support these cases: only use ccic1, only use ccic2 and use ccic1 + 
  ccic2
 
 It doesn't support two because nobody has asked for it, but the driver was 
 written with that in mind.  I don't see supporting the second controller as a 
 big job.
 
  4. marvell-ccic only support camera sensor OV7670 It's an old and low 
  resolution parallel sensor, and sensor info also is hard code But it 
  loooks we should better separate controller and sensor in driver, 
  controller doesn't care sensor type which will communicate with Our 
  mv_camera can support any camera sensor which based on subdev 
  structure
 
 That is a well-known limitation, which, again, isn't that hard to fix.  The 
 main problem is fixing it without breaking existing users.
 
  5. marvell-ccic only support YUYV format which is packed format 
  besides
  RGB444 and RGB565, it can’t support planar formats Our mv_camera can 
  support both packed format and planar formats such as
  YUV420 and YUV422P
 
 Again, not a 

Re: How I must report that a driver has been broken?

2012-05-12 Thread Alfredo Jesús Delaiti

Hi

Thanks for your response Hans and Patrick

Maybe I doing wrong this, because it reports twice:

http://www.mail-archive.com/linux-media@vger.kernel.org/msg45199.html
http://www.mail-archive.com/linux-media@vger.kernel.org/msg44846.html

and I have not had any response.


Thanks again,

Alfredo





El 12/05/12 05:17, Hans de Goede escribió:

Hi

On 05/12/2012 06:26 AM, Alfredo Jesús Delaiti wrote:

Hi

New features of the driver has left a card does not work.
How I must report that a driver has been broken?


Well this list would be a good place for starters, please
send a *detailed* bug report to this list, including
things like what is the last (kernel) version it worked
with, what is the first version it is broken.

What did it do before breaking what know now longer works,
etc.

Regards,

Hans



--
Dona tu voz
http://www.voxforge.org/es

--
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 5/5] rtl28xxu: support Terratec Noxon DAB/DAB+ stick

2012-05-12 Thread Thomas Mair
The patch contains two small errors that prevent its application. This is the 
fixed version.

Signed-off-by: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Thomas Mair thomas.mai...@googlemail.com
---
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h |1 +
 drivers/media/dvb/dvb-usb/rtl28xxu.c|   27 ++-
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 
b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index b0a86e9..95c9c14 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -244,6 +244,7 @@
 #define USB_PID_TERRATEC_H7_2  0x10a3
 #define USB_PID_TERRATEC_T30x10a0
 #define USB_PID_TERRATEC_T50x10a1
+#define USB_PID_NOXON_DAB_STICK0x00b3
 #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e
 #define USB_PID_PINNACLE_PCTV2000E 0x022c
 #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH  0x0228
diff --git a/drivers/media/dvb/dvb-usb/rtl28xxu.c 
b/drivers/media/dvb/dvb-usb/rtl28xxu.c
index 699da68..bacc783 100644
--- a/drivers/media/dvb/dvb-usb/rtl28xxu.c
+++ b/drivers/media/dvb/dvb-usb/rtl28xxu.c
@@ -29,6 +29,7 @@
 #include mt2060.h
 #include mxl5005s.h
 #include fc0012.h
+#include fc0013.h
 
 /* debug */
 static int dvb_usb_rtl28xxu_debug;
@@ -388,6 +389,12 @@ static struct rtl2832_config 
rtl28xxu_rtl2832_fc0012_config = {
.tuner = TUNER_RTL2832_FC0012
 };
 
+static struct rtl2832_config rtl28xxu_rtl2832_fc0013_config = {
+   .i2c_addr = 0x10, /* 0x20 */
+   .xtal = 2880,
+   .if_dvbt = 0,
+   .tuner = TUNER_RTL2832_FC0013
+};
 
 static int rtl2832u_fc0012_tuner_callback(struct dvb_usb_device *d,
int cmd, int arg)
@@ -553,6 +560,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter 
*adap)
ret = rtl28xxu_ctrl_msg(adap-dev, req_fc0013);
if (ret == 0  buf[0] == 0xa3) {
priv-tuner = TUNER_RTL2832_FC0013;
+   rtl2832_config = rtl28xxu_rtl2832_fc0013_config;
info(%s: FC0013 tuner found\n, __func__);
goto found;
}
@@ -750,6 +758,14 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter 
*adap)
fe-ops.tuner_ops.get_rf_strength;
return 0;
break;
+   case TUNER_RTL2832_FC0013:
+   fe = dvb_attach(fc0013_attach, adap-fe_adap[0].fe,
+   adap-dev-i2c_adap, 0xc61, 0, FC_XTAL_28_8_MHZ);
+
+   /* fc0013 also supports signal strength reading */
+   adap-fe_adap[0].fe-ops.read_signal_strength = adap-fe_adap[0]
+   .fe-ops.tuner_ops.get_rf_strength;
+   return 0;
default:
fe = NULL;
err(unknown tuner=%d, priv-tuner);
@@ -1136,6 +1152,7 @@ enum rtl28xxu_usb_table_entry {
RTL2831U_14AA_0161,
RTL2832U_0CCD_00A9,
RTL2832U_1F4D_B803,
+   RTL2832U_0CCD_00B3,
 };
 
 static struct usb_device_id rtl28xxu_table[] = {
@@ -1152,6 +1169,8 @@ static struct usb_device_id rtl28xxu_table[] = {
USB_DEVICE(USB_VID_TERRATEC, 
USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1)},
[RTL2832U_1F4D_B803] = {
USB_DEVICE(USB_VID_GTEK, USB_PID_GTEK)},
+   [RTL2832U_0CCD_00B3] = {
+   USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK)},
{} /* terminating entry */
 };
 
@@ -1265,7 +1284,7 @@ static struct dvb_usb_device_properties 
rtl28xxu_properties[] = {
 
.i2c_algo = rtl28xxu_i2c_algo,
 
-   .num_device_descs = 2,
+   .num_device_descs = 3,
.devices = {
{
.name = Terratec Cinergy T Stick Black,
@@ -1279,6 +1298,12 @@ static struct dvb_usb_device_properties 
rtl28xxu_properties[] = {
rtl28xxu_table[RTL2832U_1F4D_B803],
},
},
+   {
+   .name = NOXON DAB/DAB+ USB dongle,
+   .warm_ids = {
+   rtl28xxu_table[RTL2832U_0CCD_00B3],
+   },
+   },
}
},
 
-- 
1.7.7.6

--
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/5] rtl2832 ver 0.3: suport for RTL2832 demodulator revised version

2012-05-12 Thread poma
On 05/12/2012 08:08 PM, Thomas Mair wrote:
 Changes compared to version 0.2:
 - removed reading of signal strength for tuners FC0012,FC0013 (is now 
 supported by fc0012,fc0013 driver)
 - moved definition of register names to rtl2832_priv.h
 - cleaned up demod private structure
 - replaced rtl2832_log2 function with intlog2 from dvb_math
 
 Signed-off-by: Thomas Mair thomas.mai...@googlemail.com
 ---
  drivers/media/dvb/frontends/Kconfig|7 +
  drivers/media/dvb/frontends/Makefile   |1 +
  drivers/media/dvb/frontends/rtl2832.c  | 1009 
 
  drivers/media/dvb/frontends/rtl2832.h  |   81 +++
  drivers/media/dvb/frontends/rtl2832_priv.h |  260 +++
  5 files changed, 1358 insertions(+), 0 deletions(-)
  create mode 100644 drivers/media/dvb/frontends/rtl2832.c
  create mode 100644 drivers/media/dvb/frontends/rtl2832.h
  create mode 100644 drivers/media/dvb/frontends/rtl2832_priv.h
 
 diff --git a/drivers/media/dvb/frontends/Kconfig 
 b/drivers/media/dvb/frontends/Kconfig
 index f479834..f7d67d7 100644
 --- a/drivers/media/dvb/frontends/Kconfig
 +++ b/drivers/media/dvb/frontends/Kconfig
 @@ -432,6 +432,13 @@ config DVB_RTL2830
   help
 Say Y when you want to support this frontend.
  
 +config DVB_RTL2832
 + tristate Realtek RTL2832 DVB-T
 + depends on DVB_CORE  I2C
 + default m if DVB_FE_CUSTOMISE
 + help
 +   Say Y when you want to support this frontend.
 +
  comment DVB-C (cable) frontends
   depends on DVB_CORE
  
 diff --git a/drivers/media/dvb/frontends/Makefile 
 b/drivers/media/dvb/frontends/Makefile
 index b0381dc..9731192 100644
 --- a/drivers/media/dvb/frontends/Makefile
 +++ b/drivers/media/dvb/frontends/Makefile
 @@ -98,6 +98,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o
  obj-$(CONFIG_DVB_A8293) += a8293.o
  obj-$(CONFIG_DVB_TDA10071) += tda10071.o
  obj-$(CONFIG_DVB_RTL2830) += rtl2830.o
 +obj-$(CONFIG_DVB_RTL2832) = rtl2832.o
  obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o
  obj-$(CONFIG_DVB_AF9033) += af9033.o
  
 diff --git a/drivers/media/dvb/frontends/rtl2832.c 
 b/drivers/media/dvb/frontends/rtl2832.c
 new file mode 100644
 index 000..1936c50
 --- /dev/null
 +++ b/drivers/media/dvb/frontends/rtl2832.c
 @@ -0,0 +1,1009 @@
 +/*
 + * Realtek RTL2832 DVB-T demodulator driver
 + *
 + * Copyright (C) 2012 Thomas Mair thomas.mai...@gmail.com
 + *
 + *   This program is free software; you can redistribute it and/or modify
 + *   it under the terms of the GNU General Public License as published by
 + *   the Free Software Foundation; either version 2 of the License, or
 + *   (at your option) any later version.
 + *
 + *   This program is distributed in the hope that it will be useful,
 + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + *   GNU General Public License for more details.
 + *
 + *   You should have received a copy of the GNU General Public License along
 + *   with this program; if not, write to the Free Software Foundation, Inc.,
 + *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 + */
 +
 +#include rtl2832_priv.h
 +#include dvb_math.h
 +
 +
 +int rtl2832_debug;
 +module_param_named(debug, rtl2832_debug, int, 0644);
 +MODULE_PARM_DESC(debug, Turn on/off frontend debugging (default:off).);
 +
 +
 +static int reg_mask[32] = {
 + 0x0001,
 + 0x0003,
 + 0x0007,
 + 0x000f,
 + 0x001f,
 + 0x003f,
 + 0x007f,
 + 0x00ff,
 + 0x01ff,
 + 0x03ff,
 + 0x07ff,
 + 0x0fff,
 + 0x1fff,
 + 0x3fff,
 + 0x7fff,
 + 0x,
 + 0x0001,
 + 0x0003,
 + 0x0007,
 + 0x000f,
 + 0x001f,
 + 0x003f,
 + 0x007f,
 + 0x00ff,
 + 0x01ff,
 + 0x03ff,
 + 0x07ff,
 + 0x0fff,
 + 0x1fff,
 + 0x3fff,
 + 0x7fff,
 + 0x
 +};
 +
 +static const rtl2832_reg_entry registers[] = {
 + [DVBT_SOFT_RST] = {0x1, 0x1, 2, 2},
 + [DVBT_IIC_REPEAT] = {0x1,  0x1,   3,  3},
 + [DVBT_TR_WAIT_MIN_8K]   = {0x1,  0x88,   11,  2},
 + [DVBT_RSD_BER_FAIL_VAL] = {0x1,  0x8f,   15,  0},
 + [DVBT_EN_BK_TRK]= {0x1,  0xa6,   7,  7},
 + [DVBT_AD_EN_REG]= {0x0,  0x8,   7,  7},
 + [DVBT_AD_EN_REG1]  = {0x0,  0x8,   6,  6},
 + [DVBT_EN_BBIN]= {0x1,  0xb1,   0,  0},
 + [DVBT_MGD_THD0]  = {0x1,  0x95,   7,  0},
 + [DVBT_MGD_THD1]  = {0x1,  0x96,   7,  0},
 + [DVBT_MGD_THD2]  = {0x1,  0x97,   7,  0},
 + [DVBT_MGD_THD3]  = {0x1,  0x98,   7,  0},
 + [DVBT_MGD_THD4]  = {0x1,  0x99,   7,  0},
 + [DVBT_MGD_THD5]  = {0x1,  0x9a,   7,  0},
 + [DVBT_MGD_THD6]  = {0x1,  0x9b,   7,  0},
 + [DVBT_MGD_THD7]  = {0x1,  0x9c,   7,  0},
 + 

atsc_epg 64-bit bug / fault tolerance

2012-05-12 Thread Mike Slegeir
I was looking at using the dvb-apps when I had a hangup with atsc_epg.  
This issue had been previously reported from what I found at 
http://www.mail-archive.com/linux-media@vger.kernel.org/msg44661.html 
but had not been resolved from what I could tell.
Below I'm including a patch to fix the segfault on 64-bit builds and 
also to improve tolerance of the fault I found when a segment was read 
with a mode of '?' (don't ask me why, but I could try to give more 
information if desired).
The first three changes in the patch are about using an appropriately 
sized type rather than casting a pointer to a larger type; this fixes 
the segfault.  The last change involves nulling the title text when it 
fails to parse rather than failing altogether.


Thanks,
Mike Slegeir

diff -r 4030c51d6e7b util/atsc_epg/atsc_epg.c
--- a/util/atsc_epg/atsc_epg.cTue Apr 10 16:44:06 2012 +0200
+++ b/util/atsc_epg/atsc_epg.cSat May 12 18:15:04 2012 -0500
@@ -60,8 +60,8 @@
 void (*old_handler)(int);

 struct atsc_string_buffer {
-int buf_len;
-int buf_pos;
+size_t buf_len;
+size_t buf_pos;
 char *string;
 };

@@ -507,8 +507,8 @@
 event-msg_pos = channel-msg_buf.buf_pos;
 if(0  atsc_text_segment_decode(seg,
 (uint8_t **)channel-msg_buf.string,
-(size_t *)channel-msg_buf.buf_len,
-(size_t *)channel-msg_buf.buf_pos)) {
+ channel-msg_buf.buf_len,
+ channel-msg_buf.buf_pos)) {
 fprintf(stderr, %s(): error calling 
 atsc_text_segment_decode()\n,
 __FUNCTION__);
@@ -653,15 +653,18 @@
 e_info-title_pos = curr_info-title_buf.buf_pos;
 if(0  atsc_text_segment_decode(seg,
 (uint8_t **)curr_info-title_buf.string,
-(size_t *)curr_info-title_buf.buf_len,
-(size_t *)curr_info-title_buf.buf_pos)) {
+ curr_info-title_buf.buf_len,
+ curr_info-title_buf.buf_pos)) {
 fprintf(stderr, %s(): error calling 
 atsc_text_segment_decode()\n,
 __FUNCTION__);
-return -1;
+e_info-title_len = 0;
 }
-e_info-title_len = curr_info-title_buf.buf_pos -
-e_info-title_pos + 1;
+else
+{
+e_info-title_len = curr_info-title_buf.buf_pos -
+e_info-title_pos + 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


Re: [PATCH/RFC v4 10/12] V4L: Add auto focus targets to the selections API

2012-05-12 Thread Sakari Ailus
Hi Sylwester,

On Tue, May 08, 2012 at 12:46:15PM +0200, Sylwester Nawrocki wrote:
 Hi Sakari!
 
 On 05/06/2012 08:22 PM, Sakari Ailus wrote:
  Hi Sylwester,
  
  Thanks for the patch.
  
  Sylwester Nawrocki wrote:
  The camera automatic focus algorithms may require setting up
  a spot or rectangle coordinates or multiple such parameters.
 
  The automatic focus selection targets are introduced in order
  to allow applications to query and set such coordinates. Those
  selections are intended to be used together with the automatic
  focus controls available in the camera control class.
  
  Have you thought about multiple autofocus windows, and how could they be
  implemented on top of this patch?
  
  I'm not saying that we should implement them now, but at least we should
  think how we _would_ implement them when needed. They aren't that exotic
  functionality these days after all.
  
  I'd guess this would involve an additional bitmask control and defining
  a set of new targets. A comment in the source might help here ---
  perhaps a good rule is to start new ranges at 0x1000 as you're doing
  already.
 
 There was also an idea to convert part of the reserved[] field to a window
 index IIRC. Not sure which approach is better. I didn't want to make any
 assumptions about features I don't have exact knowledge about, neither that
 I currently need. The large offset in the auto focus target is to better
 indicate they are really different than current selection targets we have,
 I also had in mind reserving a target pool for AF targets as you are
 pointing out.
 That said I'm not really sure right now what additional exact comments
 would need to be added.

I was thinking about reserving a bunch of targets for just AF windows, but
the idea of adding a window ID is interesting. Then there's only need for a
single target which does sound a lot cleaner.

This would be a quite nice way to implement passing the face detection info
to user space, too: face detection target and object identifier. The target
field would map nicely to id in events, too.

It might make sense to implement a new IOCTL for passing multiple events but
that's fine optimisation.

 Hopefully there isn't anything blocking further expansion in this patches.
 
 I didn't decided yet if I want to send this selection/auto focus patches
 out for v3.5. I'm also considering dropping just the V4L2_AUTO_FOCUS_AREA
 control from 12/12 V4L: Add camera auto focus controls patch this time.
 
 The bitmask control for multiple windows selection makes a lot of sense
 to me. I suppose it would be better to use an additional 'index' field
 in the selection data structures for AF window selection.

I agree.

I'd like to get a conclusion to whether or not to drop ACTUAL / ACTIVE
before I give my ack to this patch.

Kind regards,

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi jabber/XMPP/Gmail: sai...@retiisi.org.uk
--
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: How I must report that a driver has been broken?

2012-05-12 Thread Patrick Dickey
I'm not an expert (or anywhere near one), but I'm guessing that the
reason you didn't get a response to your two previous (actually three or
four previous) emails is because you submitted a patch that was
already in the kernel.

You were intending to show that the patch breaks something, yet instead
of submitting the fix for the problem, you resubmitted the patch that
was already applied.  Either that, or for some other reason, the patch
that you submitted was rejected.

My suggestion is to take what you've submitted (if it was the fix for
the problem) and resubmit it. If you were just pointing out the broken
code, then submit your fix for the issue (by creating a patch that fixes
or removes the broken code).

Also one other thing I found is that you submitted the original patches
for the card.  Or at least you submitted some patches for it around
November of last year. So my question is, do the patches that you
submitted back then work, or are they the broken code now?

Have a great day:)
Patrick.

P.S. Again, I'm not an expert here, nor do I claim to be. So if someone
else gives you an answer, I'd put more weight on theirs--as they
probably have more experience than I do.


On Sat, 2012-05-12 at 16:26 -0300, Alfredo Jesús Delaiti wrote: 
 Hi
 
 Thanks for your response Hans and Patrick
 
 Maybe I doing wrong this, because it reports twice:
 
 http://www.mail-archive.com/linux-media@vger.kernel.org/msg45199.html
 http://www.mail-archive.com/linux-media@vger.kernel.org/msg44846.html
 
 and I have not had any response.
 
 
 Thanks again,
 
 Alfredo
 
 
 
 
 
 El 12/05/12 05:17, Hans de Goede escribió:
  Hi
 
  On 05/12/2012 06:26 AM, Alfredo Jesús Delaiti wrote:
  Hi
 
  New features of the driver has left a card does not work.
  How I must report that a driver has been broken?
 
  Well this list would be a good place for starters, please
  send a *detailed* bug report to this list, including
  things like what is the last (kernel) version it worked
  with, what is the first version it is broken.
 
  What did it do before breaking what know now longer works,
  etc.
 
  Regards,
 
  Hans
 
 

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


Re: How I must report that a driver has been broken?

2012-05-12 Thread Hans de Goede

Hi,

On 05/12/2012 09:26 PM, Alfredo Jesús Delaiti wrote:

Hi

Thanks for your response Hans and Patrick

Maybe I doing wrong this, because it reports twice:

http://www.mail-archive.com/linux-media@vger.kernel.org/msg45199.html
http://www.mail-archive.com/linux-media@vger.kernel.org/msg44846.html


In your last message you indicate that you've found the patch causing it,
and that you were looking into figuring which bit of the patch actually
breaks things, so I guess people reading the thread were / are
waiting for you to follow up on it with the results of your attempts
to further isolate the cause.

What I were do if I were you is send a mail directly to the author
of the patch causing the problems, with what you've discovered
about the problem sofar in there, and put the list in the CC.

Regards,

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