Re: [PATCH 03/15]drivers:staging:rtl8187se:r8180_hw.h Typo change diable to disable.

2011-01-01 Thread Dan Carpenter
On Fri, Dec 31, 2010 at 11:43:30PM -0800, Justin P. Mattock wrote:
 On 12/31/2010 10:48 PM, Finn Thain wrote:
 -/*  BIT[8-9] is for SW Antenna Diversity. Only the value 
 EEPROM_SW_AD_ENABLE means enable, other values are diable.  
   */
 +/*  BIT[8-9] is for SW Antenna Diversity. Only the value 
 EEPROM_SW_AD_ENABLE means enable, other values are disabled.
   */
 
 I think, other values disable was what you meant?
 
 Finn
 
   #define EEPROM_SW_AD_MASK 0x0300
   #define EEPROM_SW_AD_ENABLE   0x0100
 
 
 
 
 no! I changed it to disabled to make it proper..

Finn is obviously right, but maybe a compromise would be:

Only the value EEPROM_SW_AD_ENABLE means enable, other values mean
disable.

regards,
dan carpenter
--
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 01/18] Altera FPGA firmware download module.

2011-01-01 Thread Igor M. Liplianin
В сообщении от 31 декабря 2010 12:53:16 автор Mauro Carvalho Chehab написал:
 Em 31-12-2010 03:26, Igor M. Liplianin escreveu:
  It uses STAPL files and programs Altera FPGA through JTAG.
  Interface to JTAG must be provided from main device module,
  for example through cx23885 GPIO.
  
  Signed-off-by: Igor M. Liplianin liplia...@netup.ru
 
 There's something wrong with the way you sent your patches: They
 were sent with some random dates (most patches are from Aug), so
 they went out-of-order in patchwork and at the default email display
 order.
 
 Also, patch 4/18 seems missed.
 
 Cheers,
 Mauro
Sorry, I'm experimenting with automating to send patches and have such result...
Gmail account blocked for a day :(

«5.4.5 Daily sending quota exceeded. b52sm12000609eei.19»
I will resend with new dates. In addition I will make some fixes Randy Dunlap 
write about.
 
-- 
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
--
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 02/18] Altera FPGA based CI driver module.

2011-01-01 Thread Igor M. Liplianin
An Altera FPGA CI module for NetUP Dual DVB-T/C RF CI card.

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx23885/Kconfig |9 +
 drivers/media/video/cx23885/Makefile|1 +
 drivers/media/video/cx23885/altera-ci.c |  837 +++
 drivers/media/video/cx23885/altera-ci.h |  102 
 4 files changed, 949 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/cx23885/altera-ci.c
 create mode 100644 drivers/media/video/cx23885/altera-ci.h

diff --git a/drivers/media/video/cx23885/Kconfig 
b/drivers/media/video/cx23885/Kconfig
index 6b4a516..5e5faad 100644
--- a/drivers/media/video/cx23885/Kconfig
+++ b/drivers/media/video/cx23885/Kconfig
@@ -33,3 +33,12 @@ config VIDEO_CX23885
  To compile this driver as a module, choose M here: the
  module will be called cx23885
 
+config MEDIA_ALTERA_CI
+   tristate Altera FPGA based CI module
+   depends on VIDEO_CX23885  DVB_CORE
+   select STAPL_ALTERA
+   ---help---
+ An Altera FPGA CI module for NetUP Dual DVB-T/C RF CI card.
+
+ To compile this driver as a module, choose M here: the
+ module will be called altera-ci
diff --git a/drivers/media/video/cx23885/Makefile 
b/drivers/media/video/cx23885/Makefile
index e2ee95f..23293c7 100644
--- a/drivers/media/video/cx23885/Makefile
+++ b/drivers/media/video/cx23885/Makefile
@@ -5,6 +5,7 @@ cx23885-objs:= cx23885-cards.o cx23885-video.o 
cx23885-vbi.o \
cx23885-f300.o
 
 obj-$(CONFIG_VIDEO_CX23885) += cx23885.o
+obj-$(CONFIG_MEDIA_ALTERA_CI) += altera-ci.o
 
 EXTRA_CFLAGS += -Idrivers/media/video
 EXTRA_CFLAGS += -Idrivers/media/common/tuners
diff --git a/drivers/media/video/cx23885/altera-ci.c 
b/drivers/media/video/cx23885/altera-ci.c
new file mode 100644
index 000..019797b
--- /dev/null
+++ b/drivers/media/video/cx23885/altera-ci.c
@@ -0,0 +1,837 @@
+/*
+ * altera-ci.c
+ *
+ *  CI driver in conjunction with NetUp Dual DVB-T/C RF CI card
+ *
+ * Copyright (C) 2010 NetUP Inc.
+ * Copyright (C) 2010 Igor M. Liplianin liplia...@netup.ru
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * currently cx23885 GPIO's used.
+ * GPIO-0 ~INT in
+ * GPIO-1 TMS out
+ * GPIO-2 ~reset chips out
+ * GPIO-3 to GPIO-10 data/addr for CA in/out
+ * GPIO-11 ~CS out
+ * GPIO-12 AD_RG out
+ * GPIO-13 ~WR out
+ * GPIO-14 ~RD out
+ * GPIO-15 ~RDY in
+ * GPIO-16 TCK out
+ * GPIO-17 TDO in
+ * GPIO-18 TDI out
+ */
+/*
+ *  Bit definitions for MC417_RWD and MC417_OEN registers
+ * bits 31-16
+ * +---+
+ * | Reserved  |
+ * +---+
+ *   bit 15  bit 14  bit 13 bit 12  bit 11  bit 10  bit 9   bit 8
+ * +---+---+---+---+---+---+---+---+
+ * |  TDI  |  TDO  |  TCK  |  RDY# |  #RD  |  #WR  | AD_RG |  #CS  |
+ * +---+---+---+---+---+---+---+---+
+ *  bit 7   bit 6   bit 5   bit 4   bit 3   bit 2   bit 1   bit 0
+ * +---+---+---+---+---+---+---+---+
+ * |  DATA7|  DATA6|  DATA5|  DATA4|  DATA3|  DATA2|  DATA1|  DATA0|
+ * +---+---+---+---+---+---+---+---+
+ */
+#include linux/version.h
+#include media/videobuf-dma-sg.h
+#include media/videobuf-dvb.h
+#include altera-ci.h
+#include dvb_ca_en50221.h
+
+/* FPGA regs */
+#define NETUP_CI_INT_CTRL  0x00
+#define NETUP_CI_BUSCTRL2  0x01
+#define NETUP_CI_ADDR0 0x04
+#define NETUP_CI_ADDR1 0x05
+#define NETUP_CI_DATA  0x06
+#define NETUP_CI_BUSCTRL   0x07
+#define NETUP_CI_PID_ADDR0 0x08
+#define NETUP_CI_PID_ADDR1 0x09
+#define NETUP_CI_PID_DATA  0x0a
+#define NETUP_CI_TSA_DIV   0x0c
+#define NETUP_CI_TSB_DIV   0x0d
+#define NETUP_CI_REVISION  0x0f
+
+/* const for ci op */
+#define NETUP_CI_FLG_CTL   1
+#define NETUP_CI_FLG_RD1
+#define NETUP_CI_FLG_AD1
+
+static unsigned int ci_dbg;
+module_param(ci_dbg, int, 0644);
+MODULE_PARM_DESC(ci_dbg, Enable CI debugging);
+
+static unsigned int pid_dbg;
+module_param(pid_dbg, int, 0644);
+MODULE_PARM_DESC(pid_dbg, Enable PID filtering debugging);
+
+MODULE_DESCRIPTION(altera FPGA CI module);
+MODULE_AUTHOR(Igor M. Liplianin  liplia...@netup.ru);
+MODULE_LICENSE(GPL);
+
+#define ci_dbg_print(args...) \
+   

[PATCH 04/18] xc5000: add support for DVB-C tuning.

2011-01-01 Thread Igor M. Liplianin
Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/common/tuners/xc5000.c |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/media/common/tuners/xc5000.c 
b/drivers/media/common/tuners/xc5000.c
index 76ac5cd..e3218c9 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -683,6 +683,24 @@ static int xc5000_set_params(struct dvb_frontend *fe,
return -EINVAL;
}
priv-rf_mode = XC_RF_MODE_AIR;
+   } else if (fe-ops.info.type == FE_QAM) {
+   dprintk(1, %s() QAM\n, __func__);
+   switch (params-u.qam.modulation) {
+   case QAM_16:
+   case QAM_32:
+   case QAM_64:
+   case QAM_128:
+   case QAM_256:
+   case QAM_AUTO:
+   dprintk(1, %s() QAM modulation\n, __func__);
+   priv-bandwidth = BANDWIDTH_8_MHZ;
+   priv-video_standard = DTV7_8;
+   priv-freq_hz = params-frequency - 275;
+   priv-rf_mode = XC_RF_MODE_CABLE;
+   break;
+   default:
+   return -EINVAL;
+   }
} else {
printk(KERN_ERR xc5000 modulation type not supported!\n);
return -EINVAL;
-- 
1.7.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 05/18] Initial commit to support NetUP Dual DVB-T/C CI RF card.

2011-01-01 Thread Igor M. Liplianin
The card based on cx23885 PCI-e brige. Altera FPGA for CI,
multistandard demods stv0367 from STM for QAM  OFDM,  Xcieve xc5000 tuners
and additional cx25840 for second analog input.

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx23885/Kconfig |3 +-
 drivers/media/video/cx23885/cx23885-cards.c |  103 -
 drivers/media/video/cx23885/cx23885-core.c  |   24 +++--
 drivers/media/video/cx23885/cx23885-dvb.c   |  172 +-
 drivers/media/video/cx23885/cx23885.h   |4 +-
 5 files changed, 288 insertions(+), 18 deletions(-)

diff --git a/drivers/media/video/cx23885/Kconfig 
b/drivers/media/video/cx23885/Kconfig
index 5e5faad..3b6e7f2 100644
--- a/drivers/media/video/cx23885/Kconfig
+++ b/drivers/media/video/cx23885/Kconfig
@@ -1,6 +1,7 @@
 config VIDEO_CX23885
tristate Conexant cx23885 (2388x successor) support
-   depends on DVB_CORE  VIDEO_DEV  PCI  I2C  INPUT
+   depends on DVB_CORE  VIDEO_DEV  PCI  I2C  INPUT  SND
+   select SND_PCM
select I2C_ALGOBIT
select VIDEO_BTCX
select VIDEO_TUNER
diff --git a/drivers/media/video/cx23885/cx23885-cards.c 
b/drivers/media/video/cx23885/cx23885-cards.c
index b298b73..1ef4f7b 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -24,10 +24,14 @@
 #include linux/pci.h
 #include linux/delay.h
 #include media/cx25840.h
+#include linux/firmware.h
+#include misc/altera.h
 
 #include cx23885.h
 #include tuner-xc2028.h
 #include netup-init.h
+#include altera-ci.h
+#include xc5000.h
 #include cx23888-ir.h
 
 static unsigned int enable_885_ir;
@@ -187,7 +191,7 @@ struct cx23885_board cx23885_boards[] = {
.portb  = CX23885_MPEG_DVB,
},
[CX23885_BOARD_NETUP_DUAL_DVBS2_CI] = {
-   .cimax  = 1,
+   .ci_type= 1,
.name   = NetUP Dual DVB-S2 CI,
.portb  = CX23885_MPEG_DVB,
.portc  = CX23885_MPEG_DVB,
@@ -329,6 +333,19 @@ struct cx23885_board cx23885_boards[] = {
  CX25840_SVIDEO_CHROMA4,
} },
},
+   [CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF] = {
+   .ci_type= 2,
+   .name   = NetUP Dual DVB-T/C-CI RF,
+   .porta  = CX23885_ANALOG_VIDEO,
+   .portb  = CX23885_MPEG_DVB,
+   .portc  = CX23885_MPEG_DVB,
+   .tuner_type = TUNER_XC5000,
+   .tuner_addr = 0x64,
+   .input  = { {
+   .type   = CX23885_VMUX_TELEVISION,
+   .vmux   = CX25840_COMPOSITE1,
+   } },
+   },
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -520,6 +537,10 @@ struct cx23885_subid cx23885_subids[] = {
.subvendor = 0x5654,
.subdevice = 0x2390,
.card  = CX23885_BOARD_GOTVIEW_X5_3D_HYBRID,
+   }, {
+   .subvendor = 0x1b55,
+   .subdevice = 0xe2e4,
+   .card  = CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF,
},
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -740,6 +761,9 @@ int cx23885_tuner_callback(void *priv, int component, int 
command, int arg)
/* Tuner Reset Command */
bitmask = 0x02;
break;
+   case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF:
+   altera_ci_tuner_reset(dev, port-nr);
+   break;
}
 
if (bitmask) {
@@ -998,6 +1022,33 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID:
cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */
break;
+   case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF:
+   /* GPIO-0 ~INT in
+  GPIO-1 TMS out
+  GPIO-2 ~reset chips out
+  GPIO-3 to GPIO-10 data/addr for CA in/out
+  GPIO-11 ~CS out
+  GPIO-12 ADDR out
+  GPIO-13 ~WR out
+  GPIO-14 ~RD out
+  GPIO-15 ~RDY in
+  GPIO-16 TCK out
+  GPIO-17 TDO in
+  GPIO-18 TDI out
+*/
+   cx_set(GP0_IO, 0x0006); /* GPIO-1,2 as out */
+   /* GPIO-0 as INT, reset  TMS low */
+   cx_clear(GP0_IO, 0x00010006);
+   mdelay(100);/* reset delay */
+   cx_set(GP0_IO, 0x0004); /* reset high */
+   cx_write(MC417_CTL, 0x0037);/* enable GPIO-3..18 pins */
+   /* GPIO-17 is TDO in, GPIO-15 is ~RDY in, rest is out */
+   cx_write(MC417_OEN, 0x5000);
+   /* ~RD, ~WR high; ADDR low; ~CS high */
+   

[PATCH 06/18] cx23885: implement tuner_bus parameter for cx23885_board structure.

2011-01-01 Thread Igor M. Liplianin
There is two external I2C buses in cx23885 chip.
Currently, analog tuners supported for second I2C bus only
In NetUP Dual DVB-T/C CI RF card tuners connected to first bus
So, in order to support analog tuners sitting on first bus
we need modifications.

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx23885/cx23885-cards.c |5 +
 drivers/media/video/cx23885/cx23885-core.c  |5 +++--
 drivers/media/video/cx23885/cx23885-video.c |7 ---
 drivers/media/video/cx23885/cx23885.h   |2 ++
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-cards.c 
b/drivers/media/video/cx23885/cx23885-cards.c
index 1ef4f7b..7de6379 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -94,6 +94,7 @@ struct cx23885_board cx23885_boards[] = {
.portc  = CX23885_MPEG_DVB,
.tuner_type = TUNER_PHILIPS_TDA8290,
.tuner_addr = 0x42, /* 0x84  1 */
+   .tuner_bus  = 1,
.input  = {{
.type   = CX23885_VMUX_TELEVISION,
.vmux   =   CX25840_VIN7_CH3 |
@@ -216,6 +217,7 @@ struct cx23885_board cx23885_boards[] = {
.name   = Mygica X8506 DMB-TH,
.tuner_type = TUNER_XC5000,
.tuner_addr = 0x61,
+   .tuner_bus  = 1,
.porta  = CX23885_ANALOG_VIDEO,
.portb  = CX23885_MPEG_DVB,
.input  = {
@@ -245,6 +247,7 @@ struct cx23885_board cx23885_boards[] = {
.name   = Magic-Pro ProHDTV Extreme 2,
.tuner_type = TUNER_XC5000,
.tuner_addr = 0x61,
+   .tuner_bus  = 1,
.porta  = CX23885_ANALOG_VIDEO,
.portb  = CX23885_MPEG_DVB,
.input  = {
@@ -293,6 +296,7 @@ struct cx23885_board cx23885_boards[] = {
.porta  = CX23885_ANALOG_VIDEO,
.tuner_type = TUNER_XC2028,
.tuner_addr = 0x61,
+   .tuner_bus  = 1,
.input  = {{
.type   = CX23885_VMUX_TELEVISION,
.vmux   = CX25840_VIN2_CH1 |
@@ -317,6 +321,7 @@ struct cx23885_board cx23885_boards[] = {
.name   = GoTView X5 3D Hybrid,
.tuner_type = TUNER_XC5000,
.tuner_addr = 0x64,
+   .tuner_bus  = 1,
.porta  = CX23885_ANALOG_VIDEO,
.portb  = CX23885_MPEG_DVB,
.input  = {{
diff --git a/drivers/media/video/cx23885/cx23885-core.c 
b/drivers/media/video/cx23885/cx23885-core.c
index 7c6f08e..a5998dd 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -976,11 +976,12 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
/* Assume some sensible defaults */
dev-tuner_type = cx23885_boards[dev-board].tuner_type;
dev-tuner_addr = cx23885_boards[dev-board].tuner_addr;
+   dev-tuner_bus = cx23885_boards[dev-board].tuner_bus;
dev-radio_type = cx23885_boards[dev-board].radio_type;
dev-radio_addr = cx23885_boards[dev-board].radio_addr;
 
-   dprintk(1, %s() tuner_type = 0x%x tuner_addr = 0x%x\n,
-   __func__, dev-tuner_type, dev-tuner_addr);
+   dprintk(1, %s() tuner_type = 0x%x tuner_addr = 0x%x tuner_bus = 
0x%x\n,
+   __func__, dev-tuner_type, dev-tuner_addr, dev-tuner_bus);
dprintk(1, %s() radio_type = 0x%x radio_addr = 0x%x\n,
__func__, dev-radio_type, dev-radio_addr);
 
diff --git a/drivers/media/video/cx23885/cx23885-video.c 
b/drivers/media/video/cx23885/cx23885-video.c
index 644fcb8..ee57f6b 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -1468,16 +1468,17 @@ int cx23885_video_register(struct cx23885_dev *dev)
 
cx23885_irq_add_enable(dev, 0x01);
 
-   if (TUNER_ABSENT != dev-tuner_type) {
+   if ((TUNER_ABSENT != dev-tuner_type) 
+   ((dev-tuner_bus == 0) || (dev-tuner_bus == 1))) {
struct v4l2_subdev *sd = NULL;
 
if (dev-tuner_addr)
sd = v4l2_i2c_new_subdev(dev-v4l2_dev,
-   dev-i2c_bus[1].i2c_adap,
+   dev-i2c_bus[dev-tuner_bus].i2c_adap,
tuner, dev-tuner_addr, NULL);
else
sd = v4l2_i2c_new_subdev(dev-v4l2_dev,
-   dev-i2c_bus[1].i2c_adap,
+   dev-i2c_bus[dev-tuner_bus].i2c_adap,
tuner, 0, v4l2_i2c_tuner_addrs(ADDRS_TV));
   

[PATCH 07/18] cx23885: implement num_fds_portb, num_fds_portc parameters for cx23885_board structure.

2011-01-01 Thread Igor M. Liplianin
This is needed for multifrontend support.
NetUP Dual DVB-T/C CI RF card has frontends connected to port B  C
Each frontend has two switchable cores - DVB-T  DVB-C

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx23885/cx23885-cards.c |2 ++
 drivers/media/video/cx23885/cx23885-core.c  |4 
 drivers/media/video/cx23885/cx23885.h   |1 +
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-cards.c 
b/drivers/media/video/cx23885/cx23885-cards.c
index 7de6379..461413a 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -344,6 +344,8 @@ struct cx23885_board cx23885_boards[] = {
.porta  = CX23885_ANALOG_VIDEO,
.portb  = CX23885_MPEG_DVB,
.portc  = CX23885_MPEG_DVB,
+   .num_fds_portb  = 2,
+   .num_fds_portc  = 2,
.tuner_type = TUNER_XC5000,
.tuner_addr = 0x64,
.input  = { {
diff --git a/drivers/media/video/cx23885/cx23885-core.c 
b/drivers/media/video/cx23885/cx23885-core.c
index a5998dd..307eaf4 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -1011,6 +1011,8 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
}
 
if (cx23885_boards[dev-board].portb == CX23885_MPEG_DVB) {
+   if (cx23885_boards[dev-board].num_fds_portb)
+   dev-ts1.num_frontends = 
cx23885_boards[dev-board].num_fds_portb;
if (cx23885_dvb_register(dev-ts1)  0) {
printk(KERN_ERR %s() Failed to register dvb adapters 
on VID_B\n,
   __func__);
@@ -1025,6 +1027,8 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
}
 
if (cx23885_boards[dev-board].portc == CX23885_MPEG_DVB) {
+   if (cx23885_boards[dev-board].num_fds_portc)
+   dev-ts2.num_frontends = 
cx23885_boards[dev-board].num_fds_portc;
if (cx23885_dvb_register(dev-ts2)  0) {
printk(KERN_ERR
%s() Failed to register dvb on VID_C\n,
diff --git a/drivers/media/video/cx23885/cx23885.h 
b/drivers/media/video/cx23885/cx23885.h
index d43f80b..e678667 100644
--- a/drivers/media/video/cx23885/cx23885.h
+++ b/drivers/media/video/cx23885/cx23885.h
@@ -205,6 +205,7 @@ typedef enum {
 struct cx23885_board {
char*name;
port_t  porta, portb, portc;
+   int num_fds_portb, num_fds_portc;
unsigned inttuner_type;
unsigned intradio_type;
unsigned char   tuner_addr;
-- 
1.7.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 09/18] stv0367: Fix potential divide error

2011-01-01 Thread Igor M. Liplianin
Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/dvb/frontends/stv0367.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/stv0367.c 
b/drivers/media/dvb/frontends/stv0367.c
index 0575741..e6bee7f 100644
--- a/drivers/media/dvb/frontends/stv0367.c
+++ b/drivers/media/dvb/frontends/stv0367.c
@@ -3275,12 +3275,14 @@ static int stv0367cab_read_snr(struct dvb_frontend *fe, 
u16 *snr)
power = 1;
break;
}
+
for (i = 0; i  10; i++) {
regval += (stv0367_readbits(state, F367CAB_SNR_LO)
+ 256 * stv0367_readbits(state, F367CAB_SNR_HI));
}
+
+   regval /= 10; /*for average over 10 times in for loop above*/
if (regval != 0) {
-   regval /= 10; /*for average over 10 times in for loop above*/
temp = power
* (1  (3 + stv0367_readbits(state, F367CAB_SNR_PER)));
temp /= regval;
-- 
1.7.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 12/18] stv0367: implement uncorrected blocks counter.

2011-01-01 Thread Abylay Ospan
Signed-off-by: Abylay Ospan aos...@netup.ru
---
 drivers/media/dvb/frontends/stv0367.c |   20 +++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/frontends/stv0367.c 
b/drivers/media/dvb/frontends/stv0367.c
index 9439388..aaa2b44 100644
--- a/drivers/media/dvb/frontends/stv0367.c
+++ b/drivers/media/dvb/frontends/stv0367.c
@@ -3327,6 +3327,24 @@ static int stv0367cab_read_snr(struct dvb_frontend *fe, 
u16 *snr)
return 0;
 }
 
+static int stv0367cab_read_ucblcks(struct dvb_frontend *fe, u32 *ucblocks)
+{
+   struct stv0367_state *state = fe-demodulator_priv;
+   int corrected, tscount;
+
+   *ucblocks = (stv0367_readreg(state, R367CAB_RS_COUNTER_5)  8)
+   | stv0367_readreg(state, R367CAB_RS_COUNTER_4);
+   corrected = (stv0367_readreg(state, R367CAB_RS_COUNTER_3)  8)
+   | stv0367_readreg(state, R367CAB_RS_COUNTER_2);
+   tscount = (stv0367_readreg(state, R367CAB_RS_COUNTER_2)  8)
+   | stv0367_readreg(state, R367CAB_RS_COUNTER_1);
+
+   dprintk(%s: uncorrected blocks=%d corrected blocks=%d tscount=%d\n,
+   __func__, *ucblocks, corrected, tscount);
+
+   return 0;
+};
+
 static struct dvb_frontend_ops stv0367cab_ops = {
.info = {
.name = ST STV0367 DVB-C,
@@ -3351,7 +3369,7 @@ static struct dvb_frontend_ops stv0367cab_ops = {
 /* .read_ber   = stv0367cab_read_ber,*/
.read_signal_strength   = stv0367cab_read_strength,
.read_snr   = stv0367cab_read_snr,
-/* .read_ucblocks  = stv0367cab_read_ucblcks,*/
+   .read_ucblocks  = stv0367cab_read_ucblcks,
.get_tune_settings  = stv0367_get_tune_settings,
 };
 
-- 
1.7.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 13/18] stv0367: coding style corrections

2011-01-01 Thread Igor M. Liplianin
---
 drivers/media/dvb/frontends/stv0367.c |   68 
 1 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/media/dvb/frontends/stv0367.c 
b/drivers/media/dvb/frontends/stv0367.c
index aaa2b44..67301a3 100644
--- a/drivers/media/dvb/frontends/stv0367.c
+++ b/drivers/media/dvb/frontends/stv0367.c
@@ -784,7 +784,7 @@ int stv0367_writeregs (struct stv0367_state *state, u16 
reg, u8 *data, int len)
 
ret = i2c_transfer (state-i2c, msg, 1);
if (ret != 1)
-   printk(%s: i2c write error! \n, __func__);
+   printk(%s: i2c write error!\n, __func__);
 
return (ret != 1) ? -EREMOTEIO : 0;
 }
@@ -818,7 +818,7 @@ static u8 stv0367_readreg (struct stv0367_state *state, u16 
reg)
 
ret = i2c_transfer(state-i2c, msg, 2);
if (ret != 2)
-   printk(%s: i2c read error \n, __func__);
+   printk(%s: i2c read error\n, __func__);
 
if (i2cdebug) printk(%s: %02x: %02x\n, __func__, reg, b1[0]);
 
@@ -1032,12 +1032,12 @@ static u32 stv0367ter_get_mclk(struct stv0367_state 
*state, u32 ExtClk_Hz)
 
mclk_Hz = ((ExtClk_Hz / 2) * n) / (m * (1  p));
 
-   printk(N=%d M=%d P=%d mclk_Hz=%d ExtClk_Hz=%d \n,
+   printk(N=%d M=%d P=%d mclk_Hz=%d ExtClk_Hz=%d\n,
n, m, p, mclk_Hz, ExtClk_Hz);
} else
mclk_Hz = ExtClk_Hz;
 
-   printk(%s: mclk_Hz=%d \n, __func__, mclk_Hz);
+   printk(%s: mclk_Hz=%d\n, __func__, mclk_Hz);
 
return mclk_Hz;
 }
@@ -1205,7 +1205,7 @@ fe_stv0367_ter_signal_type_t stv0367ter_check_syr(struct 
stv0367_state *state)
else
SYRStatus =  FE_TER_SYMBOLOK;
 
-   dprintk(stv0367ter_check_syr SYRStatus %s \n,
+   dprintk(stv0367ter_check_syr SYRStatus %s\n,
SYR_var == 0 ? No Symbol : OK);
 
return SYRStatus;
@@ -1239,7 +1239,7 @@ fe_stv0367_ter_signal_type_t 
stv0367ter_check_cpamp(struct stv0367_state *state,
break;
}
 
-   dprintk(%s: CPAMPMin=%d wd=%d \n, __func__, CPAMPMin, wd);
+   dprintk(%s: CPAMPMin=%d wd=%d\n, __func__, CPAMPMin, wd);
 
CPAMPvalue = stv0367_readbits(state, F367TER_PPM_CPAMP_DIRECT);
while ((CPAMPvalue  CPAMPMin)  (wd  0)) {
@@ -1308,8 +1308,8 @@ fe_stv0367_ter_signal_type_t stv0367ter_lock_algo(struct 
stv0367_state *state)
 
tmp  = stv0367_readreg(state, R367TER_SYR_STAT);
tmp2 = stv0367_readreg(state, R367TER_STATUS);
-   printk(state=0x%x \n, (int)state);
-   printk(LOCK OK! mode=%d SYR_STAT=0x%x R367TER_STATUS=0x%x \n,
+   printk(state=0x%x\n, (int)state);
+   printk(LOCK OK! mode=%d SYR_STAT=0x%x R367TER_STATUS=0x%x\n,
mode, tmp, tmp2);
 
tmp  = stv0367_readreg(state, R367TER_PRVIT);
@@ -1317,7 +1317,7 @@ fe_stv0367_ter_signal_type_t stv0367ter_lock_algo(struct 
stv0367_state *state)
printk(PRVIT=0x%x I2CRPT=0x%x\n, tmp, tmp2);
 
tmp  = stv0367_readreg(state, R367TER_GAIN_SRC1);
-   printk(GAIN_SRC1=0x%x \n, tmp);
+   printk(GAIN_SRC1=0x%x\n, tmp);
 
if ((mode != 0)  (mode != 1)  (mode != 2)) {
return FE_TER_SWNOK;
@@ -1436,7 +1436,7 @@ fe_stv0367_ter_signal_type_t stv0367ter_lock_algo(struct 
stv0367_state *state)
 
stv0367_writebits(state, F367TER_SYR_TR_DIS, 1);
 
-   printk(FE_TER_LOCKOK !!! \n);
+   printk(FE_TER_LOCKOK !!!\n);
 
return  FE_TER_LOCKOK;
 
@@ -1545,7 +1545,7 @@ int stv0367ter_init(struct dvb_frontend *fe)
break;
default:
case 2700:
-   printk(FE_STV0367TER_SetCLKgen for 27Mhz \n);
+   printk(FE_STV0367TER_SetCLKgen for 27Mhz\n);
stv0367_writereg(state, R367TER_PLLMDIV, 0x1);
stv0367_writereg(state, R367TER_PLLNDIV, 0x8);
stv0367_writereg(state, R367TER_PLLSETUP, 0x18);
@@ -1583,7 +1583,7 @@ static int stv0367ter_algo(struct dvb_frontend *fe,
s32 timing_offset = 0;
u32 trl_nomrate = 0, InternalFreq = 0, temp = 0;
 
-   dprintk(%s: \n, __func__);
+   dprintk(%s:\n, __func__);
 
ter_state-frequency = param-frequency;
ter_state-force = FE_TER_FORCENONE
@@ -1591,24 +1591,24 @@ static int stv0367ter_algo(struct dvb_frontend *fe,
ter_state-if_iq_mode = state-config-if_iq_mode;
switch (state-config-if_iq_mode) {
case FE_TER_NORMAL_IF_TUNER:  /* Normal IF mode */
-   printk(ALGO: FE_TER_NORMAL_IF_TUNER selected \n);
+   printk(ALGO: FE_TER_NORMAL_IF_TUNER selected\n);
stv0367_writebits(state, F367TER_TUNER_BB, 0);
stv0367_writebits(state, F367TER_LONGPATH_IF, 0);
stv0367_writebits(state, F367TER_DEMUX_SWAP, 0);
break;
case FE_TER_LONGPATH_IF_TUNER:  /* Long IF mode */
-   

[PATCH 14/18] cx25840: Fix subdev registration in cx25840-core.c

2011-01-01 Thread Igor M. Liplianin
On my system, cx23885 based card reports default volume value above 7.
So, register cx25840 subdev fails. Although, the card don't have a/v inputs
it needs a/v firmware to be loaded.

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx25840/cx25840-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx25840/cx25840-core.c 
b/drivers/media/video/cx25840/cx25840-core.c
index dfb198d..dc0cec7 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1991,6 +1991,8 @@ static int cx25840_probe(struct i2c_client *client,
if (!is_cx2583x(state)) {
default_volume = 228 - cx25840_read(client, 0x8d4);
default_volume = ((default_volume / 2) + 23)  9;
+   if (default_volume  65535)
+   default_volume = 65535;
 
state-volume = v4l2_ctrl_new_std(state-hdl,
cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME,
-- 
1.7.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 14/18] cx25840: Fix subdev registration in cx25840-core.c

2011-01-01 Thread Igor M. Liplianin
On my system, cx23885 based card reports default volume value above 7.
So, register cx25840 subdev fails. Although, the card don't have a/v inputs
it needs a/v firmware to be loaded.

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx25840/cx25840-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx25840/cx25840-core.c 
b/drivers/media/video/cx25840/cx25840-core.c
index dfb198d..dc0cec7 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1991,6 +1991,8 @@ static int cx25840_probe(struct i2c_client *client,
if (!is_cx2583x(state)) {
default_volume = 228 - cx25840_read(client, 0x8d4);
default_volume = ((default_volume / 2) + 23)  9;
+   if (default_volume  65535)
+   default_volume = 65535;
 
state-volume = v4l2_ctrl_new_std(state-hdl,
cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME,
-- 
1.7.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


dvb_usb_dib0700 driver woes with Pinnacle 72e stick

2011-01-01 Thread Alfredo Braunstein
Hi  happy new year,

I recently bought a Pinnacle 72e USB stick, (lsusb says: Bus 002
Device 011: ID 2304:0236 Pinnacle Systems, Inc. [hex]. The stick says
pinnacle on front
and 72e and  1100 on the back) which seemed to be supported by the
dvb_usb_dib0700 driver. Indeed, the module seems to load correctly,
e.g.  this is the output of dmesg after sticking it in:

[10729.192683] usb 2-3: new high speed USB device using ehci_hcd and address 11
[10729.341288] usb 2-3: configuration #1 chosen from 1 choice
[10729.341674] dvb-usb: found a 'Pinnacle PCTV 72e' in cold state,
will try to load a firmware
[10729.341685] usb 2-3: firmware: requesting dvb-usb-dib0700-1.20.fw
[10729.355056] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw'
[10729.588139] dib0700: firmware started successfully.
[10730.090185] dvb-usb: found a 'Pinnacle PCTV 72e' in warm state.
[10730.090245] dvb-usb: will pass the complete MPEG2 transport stream
to the software demuxer.
[10730.090711] DVB: registering new adapter (Pinnacle PCTV 72e)
[10730.340445] DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
[10730.577782] DiB0070: successfully identified
[10730.577989] input: IR-receiver inside an USB DVB receiver as
/devices/pci:00/:00:1d.7/usb2/2-3/input/input28
[10730.578146] dvb-usb: schedule remote query interval to 50 msecs.
[10730.578156] dvb-usb: Pinnacle PCTV 72e successfully initialized and
connected.

However, scanning channels only finds a small subset of them (Always
the same set. I didn't find an identifying characteristic of this set,
I could look again with some pointers) and it is not possible to tune
to the others (tuning parameters obtained with another card)

If I install the provided driver in windows under virtualbox, the
stick works fine. Moreover, after exiting virtualbox (virtualbox
removes the dvb_usb_dib0700 module on start and reloads on exit) the
cards works fine under linux also!

This is both with shipped kernel/v4l from ubuntu lucid
(2.6.32-27-generic) and latest v4l hg.

Any clues on how can this be debugged / investigated? I can of course
look at usb trafic during the correct initialization.

Please ask me if you need further info or I forgot something (likely).

Thanks!

A/
--
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/18] xc5000: add support for DVB-C tuning.

2011-01-01 Thread Benny Amorsen
It is always good to see more DVB-C devices supported... Do you happen
to know some devices which have DVB-C support and use this chip?


/Benny

--
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 14/18] cx25840: Fix subdev registration in cx25840-core.c

2011-01-01 Thread Andy Walls
Igor,

The proper fix is here:

https://patchwork.kernel.org/patch/376612/

So, NAK on your particular patch.

Mauro,

I do not see the above patch at linux next.  And I couldn't find it in your 
kernel.org tree.  What is its status?

This fixes a regression that is known to break cx23885 hardware initialization 
and can break ivtv hardware initialization.

Regards,
Andy

Igor M. Liplianin liplia...@me.by wrote:

On my system, cx23885 based card reports default volume value above 7.
So, register cx25840 subdev fails. Although, the card don't have a/v inputs
it needs a/v firmware to be loaded.

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx25840/cx25840-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx25840/cx25840-core.c 
b/drivers/media/video/cx25840/cx25840-core.c
index dfb198d..dc0cec7 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1991,6 +1991,8 @@ static int cx25840_probe(struct i2c_client *client,
   if (!is_cx2583x(state)) {
   default_volume = 228 - cx25840_read(client, 0x8d4);
   default_volume = ((default_volume / 2) + 23)  9;
+  if (default_volume  65535)
+  default_volume = 65535;
 
   state-volume = v4l2_ctrl_new_std(state-hdl,
   cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME,
-- 
1.7.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
N�r��yb�X��ǧv�^�)޺{.n�+{���bj)w*jg����ݢj/���z�ޖ��2�ޙ�)ߡ�a�����G���h��j:+v���w��٥

[PATCH 15/18] cx23885: disable MSI for NetUP cards, otherwise CI is not working

2011-01-01 Thread Igor M. Liplianin
Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx23885/cx23885-core.c |4 
 drivers/media/video/cx23885/cx23885-reg.h  |1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-core.c 
b/drivers/media/video/cx23885/cx23885-
core.c
index 3a09dd2..e6d7232 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -1039,6 +1039,10 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
 
cx23885_dev_checkrevision(dev);
 
+   /* disable MSI for NetUP cards, otherwise CI is not working */
+   if (cx23885_boards[dev-board].ci_type  0)
+   cx_clear(RDR_RDRCTL1, 1  8);
+
return 0;
 }
 
diff --git a/drivers/media/video/cx23885/cx23885-reg.h 
b/drivers/media/video/cx23885/cx23885-reg.h
index a28772d..c87ac68 100644
--- a/drivers/media/video/cx23885/cx23885-reg.h
+++ b/drivers/media/video/cx23885/cx23885-reg.h
@@ -292,6 +292,7 @@ Channel manager Data Structure entry = 20 DWORD
 #define RDR_CFG0   0x0005
 #define RDR_CFG1   0x00050004
 #define RDR_CFG2   0x00050008
+#define RDR_RDRCTL10x0005030c
 #define RDR_TLCTL0 0x00050318
 
 /* APB DMAC Current Buffer Pointer */
-- 
1.7.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 16/18] Fix CI code for NetUP Dual DVB-T/C CI RF card

2011-01-01 Thread Abylay Ospan
CI reset takes several seconds on some CAM,
so there is no need to lock mutex all that time.
Also we need not to preserve CI's reset bits in
CIBUSCTRL register, they are handled automatically by FPGA.
Set it to 0 explicitly in order to not reset wrong CAM.

Signed-off-by: Abylay Ospan aos...@netup.ru
---
 drivers/media/video/cx23885/altera-ci.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/cx23885/altera-ci.c 
b/drivers/media/video/cx23885/altera-ci.c
index 019797b..90147d6 100644
--- a/drivers/media/video/cx23885/altera-ci.c
+++ b/drivers/media/video/cx23885/altera-ci.c
@@ -283,7 +283,7 @@ int netup_ci_op_cam(struct dvb_ca_en50221 *en50221, int 
slot,
netup_fpga_op_rw(inter, NETUP_CI_ADDR1, ((addr  7)  0x7f), 0);
store = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, 0, NETUP_CI_FLG_RD);
 
-   store = 0x3f;
+   store = 0x0f;
store |= ((state-nr  7) | (flag  6));
 
netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, store, 0);
@@ -340,19 +340,25 @@ int netup_ci_slot_reset(struct dvb_ca_en50221 *en50221, 
int slot)
 
ret = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, 0, NETUP_CI_FLG_RD);
netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL,
-   ret | (1  (5 - state-nr)), 0);
+   (ret  0xcf) | (1  (5 - state-nr)), 0);
+
+   mutex_unlock(inter-fpga_mutex);
 
for (;;) {
mdelay(50);
+
+   mutex_lock(inter-fpga_mutex);
+
ret = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL,
0, NETUP_CI_FLG_RD);
+   mutex_unlock(inter-fpga_mutex);
+
if ((ret  (1  (5 - state-nr))) == 0)
break;
if (time_after(jiffies, t_out))
break;
}
 
-   mutex_unlock(inter-fpga_mutex);
 
printk(%s: %d msecs\n, __func__,
jiffies_to_msecs(jiffies + msecs_to_jiffies() - t_out));
@@ -381,7 +387,7 @@ int netup_ci_slot_ts_ctl(struct dvb_ca_en50221 *en50221, 
int slot)
 
ret = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, 0, NETUP_CI_FLG_RD);
netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL,
-   ret | (1  (3 - state-nr)), 0);
+   (ret  0x0f) | (1  (3 - state-nr)), 0);
 
mutex_unlock(inter-fpga_mutex);
 
-- 
1.7.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 17/18] Force xc5000 firmware loading for NetUP Dual DVB-T/C CI RF card

2011-01-01 Thread Abylay Ospan
Two xc5000 tuners connected to same i2c bus.
Experiments shows that situation when one tuner is not initialized
while other is tuned to channel causes TS errors.

Signed-off-by: Abylay Ospan aos...@netup.ru
---
 drivers/media/video/cx23885/cx23885-dvb.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-dvb.c 
b/drivers/media/video/cx23885/cx23885-dvb.c
index 53c2b6d..e17be5a 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -1071,12 +1071,15 @@ static int dvb_register(struct cx23885_tsport *port)
fe0-dvb.frontend = dvb_attach(stv0367ter_attach,
netup_stv0367_config[port-nr -1],
i2c_bus-i2c_adap);
-   if (fe0-dvb.frontend != NULL)
+   if (fe0-dvb.frontend != NULL) {
if (NULL == dvb_attach(xc5000_attach,
fe0-dvb.frontend,
i2c_bus-i2c_adap,
netup_xc5000_tunerconfig[port-nr - 
1]))
goto frontend_detach;
+   /* load xc5000 firmware */
+   
fe0-dvb.frontend-ops.tuner_ops.init(fe0-dvb.frontend);
+   }
/* MFE frontend 2 */
fe1 = videobuf_dvb_get_frontend(port-frontends, 2);
if (fe1 == NULL)
-- 
1.7.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 18/18] cx23885, altera-ci: enable all PID's less than 0x20 in hardware PID filter.

2011-01-01 Thread Igor M. Liplianin
It takes too long time to scan due to low symbol rate PID's
like PAT, PMT, CAT, NIT.
For that matter we enabled permanently all PID's
less 0x20 in hardware PID filter for NetUP Dual DVB-T/C CI RF card
to combine rates.

Signed-off-by: Igor M. Liplianin liplia...@netup.ru
---
 drivers/media/video/cx23885/altera-ci.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/cx23885/altera-ci.c 
b/drivers/media/video/cx23885/altera-ci.c
index 90147d6..aa67a33 100644
--- a/drivers/media/video/cx23885/altera-ci.c
+++ b/drivers/media/video/cx23885/altera-ci.c
@@ -652,8 +652,9 @@ static void altera_toggle_fullts_streaming(struct 
netup_hw_pid_filter 
*pid_filt,
 
netup_fpga_op_rw(inter, NETUP_CI_PID_ADDR1,
((i  8)  0x03) | (pid_filt-nr  2), 0);
-
-   netup_fpga_op_rw(inter, NETUP_CI_PID_DATA, store, 0);
+   /* pid 0-0x1f always enabled */
+   netup_fpga_op_rw(inter, NETUP_CI_PID_DATA,
+   (i  3 ? store : 0), 0);
}
 
mutex_unlock(inter-fpga_mutex);
@@ -730,8 +731,8 @@ static void altera_pid_control(struct netup_hw_pid_filter 
*pid_filt,
 {
struct fpga_internal *inter = pid_filt-internal;
u8 store = 0;
-
-   if (pid == 0x2000)
+   /* pid 0-0x1f always enabled, don't touch them */
+   if ((pid == 0x2000) || (pid  0x20))
return;
 
mutex_lock(inter-fpga_mutex);
-- 
1.7.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 03/15]drivers:staging:rtl8187se:r8180_hw.h Typo change diable to disable.

2011-01-01 Thread Justin P. Mattock

On 01/01/2011 01:09 AM, Dan Carpenter wrote:

On Fri, Dec 31, 2010 at 11:43:30PM -0800, Justin P. Mattock wrote:

On 12/31/2010 10:48 PM, Finn Thain wrote:

-/*  BIT[8-9] is for SW Antenna Diversity. Only the value EEPROM_SW_AD_ENABLE 
means enable, other values are diable.*/
+/*  BIT[8-9] is for SW Antenna Diversity. Only the value EEPROM_SW_AD_ENABLE 
means enable, other values are disabled.  */


I think, other values disable was what you meant?

Finn


  #define EEPROM_SW_AD_MASK 0x0300
  #define EEPROM_SW_AD_ENABLE   0x0100






no! I changed it to disabled to make it proper..


Finn is obviously right, but maybe a compromise would be:

Only the value EEPROM_SW_AD_ENABLE means enable, other values mean
disable.

regards,
dan carpenter



ahh.. I see what you your saying now.. alright let me send this out that 
way..


Justin P. Mattock
--
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


Blackgold BGT3620 DVB-T2 Dual Tuner PCI-E Card...development?

2011-01-01 Thread Another Sillyname
Hi Guys

Blackgold have just started shipping the BGT3620 Dual Tuner PCI-E
DVB-T2 card, as far as I know this is the first DVB-T2 card actually
shipping.

The link to the page is here.

http://shop.blackgold.tv/BGT3620

Is there any chance of getting some development of a Linux driver underway?

I'd be willing to organise a bounty payment to kick start things if it
would help.

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


[cron job] v4l-dvb daily build: WARNINGS

2011-01-01 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Sat Jan  1 19:00:13 CET 2011
git master:   59365d136d205cc20fe666ca7f89b1c5001b0d5a
git media-master: gcc version:  i686-linux-gcc (GCC) 4.5.1
host hardware:x86_64
host os:  2.6.32.5

linux-git-armv5: WARNINGS
linux-git-armv5-davinci: WARNINGS
linux-git-armv5-ixp: WARNINGS
linux-git-armv5-omap2: WARNINGS
linux-git-i686: WARNINGS
linux-git-m32r: WARNINGS
linux-git-mips: WARNINGS
linux-git-powerpc64: WARNINGS
linux-git-x86_64: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The V4L-DVB specification from this daily build is here:

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


RFC: Move the deprecated et61x251 and sn9c102 to staging

2011-01-01 Thread Hans Verkuil
The subject says it all:

If there are no objections, then I propose that the deprecated et61x251 and
sn9c102 are moved to staging for 2.6.38 and marked for removal in 2.6.39.

If there are no objections, then I'll make a patch for this.

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by Cisco
--
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


S2API documentation

2011-01-01 Thread Mark Zimmerman
Greetings:

Is there any sort of documentation yet for S2API? The wiki still
references DVB API 3.2.

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


V4L2 spec behavior for G_TUNER and T_STANDBY

2011-01-01 Thread Devin Heitmueller
I have been doing some application conformance for VLC, and I noticed
something interesting with regards to the G_TUNER call.

If you have a tuner which supports sleeping, making a G_TUNER call
essentially returns garbage.
===
r...@devin-laptop2:~# v4l2-ctl -d /dev/video1 --get-tuner
Tuner:
Name : Auvitek tuner
Capabilities : 62.5 kHz stereo lang1 lang2
Frequency range  : 0.0 MHz - 0.0 MHz
Signal strength/AFC  : 0%/0
Current audio mode   : stereo
Available subchannels: mono
===
Note that the frequency range is zero (the capabilities and name are
populated by the bridge or video decoder).  Some digging into the
tuner_g_tuner() function in tuner core shows that the check_mode()
call fails because the device's mode is T_STANDBY.  However, it does
this despite the fact that none of values required actually interact
with the tuner.  The capabilities and frequency ranges should be able
to be populated regardless of whether the device is in standby.

This is particularly bad because devices normally come out of standby
when a s_freq call occurs, but some applications (such as VLC) will
call g_tuner first to validate the target frequency is inside the
valid frequency range.  So you have a chicken/egg problem:  The
g_tuner won't return a valid frequency range until you do a tuning
request to wake up the tuner, but apps like VLC won't do a tuning
request unless it has validated the frequency range.

Further, look at the following block:

if (t-mode != V4L2_TUNER_RADIO) {
vt-rangelow = tv_range[0] * 16;
vt-rangehigh = tv_range[1] * 16;
return 0;
}

This basically means that a video tuner will bail out, which sounds
good because the rest of the function supposedly assumes a radio
device.  However, as a result the has_signal() call (which returns
signal strength) will never be executed for video tuners.  You
wouldn't notice this if a video decoder subdev is responsible for
showing signal strength, but if you're expecting the tuner to provide
the info, the call will never happen.

Are these known issues?  Am I misreading the specified behavior?  I
don't see anything in the spec that suggests that this call should
return invalid data if the tuner happens to be powered down.

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


Re: V4L2 spec behavior for G_TUNER and T_STANDBY

2011-01-01 Thread Devin Heitmueller
Hi Hans,

Thanks for the feedback.

On Sat, Jan 1, 2011 at 4:18 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 This basically means that a video tuner will bail out, which sounds
 good because the rest of the function supposedly assumes a radio
 device.  However, as a result the has_signal() call (which returns
 signal strength) will never be executed for video tuners.  You
 wouldn't notice this if a video decoder subdev is responsible for
 showing signal strength, but if you're expecting the tuner to provide
 the info, the call will never happen.

 I am not aware of any tuner that does that. I think that for video this
 is always done by a video decoder. That said, it isn't pretty, but a lot
 of this is legacy code and I wouldn't want to change it.

The Xceive tuners have their analog demodulator onboard, so they make
available a 0-100% signal strength.

 After digging some more I think that check_mode is a poor function. There are
 two things that check_mode does: checking if the tuner support radio and/or tv
 mode (that's fine), and if it is in standby: not so fine. That should be a
 separate function since filling in frequency ranges can be done regardless of
 the standby state.

Yeah, I didn't realize myself that is what check_mode was doing until
I had this problem.

I'll see if I can cook up a patch which returns the appropriate data
even when in standby, while trying to minimize the risk of introducing
a regression.

Thanks,

Devin

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


Re: V4L2 spec behavior for G_TUNER and T_STANDBY

2011-01-01 Thread Hans Verkuil
On Saturday, January 01, 2011 22:25:04 Devin Heitmueller wrote:
 Hi Hans,
 
 Thanks for the feedback.
 
 On Sat, Jan 1, 2011 at 4:18 PM, Hans Verkuil hverk...@xs4all.nl wrote:
  This basically means that a video tuner will bail out, which sounds
  good because the rest of the function supposedly assumes a radio
  device.  However, as a result the has_signal() call (which returns
  signal strength) will never be executed for video tuners.  You
  wouldn't notice this if a video decoder subdev is responsible for
  showing signal strength, but if you're expecting the tuner to provide
  the info, the call will never happen.
 
  I am not aware of any tuner that does that. I think that for video this
  is always done by a video decoder. That said, it isn't pretty, but a lot
  of this is legacy code and I wouldn't want to change it.
 
 The Xceive tuners have their analog demodulator onboard, so they make
 available a 0-100% signal strength.
 
  After digging some more I think that check_mode is a poor function. There 
  are
  two things that check_mode does: checking if the tuner support radio and/or 
  tv
  mode (that's fine), and if it is in standby: not so fine. That should be a
  separate function since filling in frequency ranges can be done regardless 
  of
  the standby state.
 
 Yeah, I didn't realize myself that is what check_mode was doing until
 I had this problem.
 
 I'll see if I can cook up a patch which returns the appropriate data
 even when in standby, while trying to minimize the risk of introducing
 a regression.

Since you are working with tuner-core and xceive I wonder if you could also
make a patch to remove T_DIGITAL_TV in enum tuner_mode. T_DIGITAL_TV (and it's
public API counterpart V4L2_TUNER_DIGITAL_TV) are not used (and never were used
since digital tuning is handled through dvb).

We can't remove V4L2_TUNER_DIGITAL_TV (although we can mark it as deprecated in
videodev2.h), but T_DIGITAL_TV should definitely be removed.

The only tuner driver that uses T_DIGITAL_TV is tuner-xc2028.c, but on closer
analysis it turns out that it uses enum tuner_mode as an internal mode. So this
mode is never set outside the driver. Instead it should have used an internal
xceive_mode enum.

Everywhere else T_DIGITAL_TV can be removed.

For some reason I'm in an early spring-cleaning mode (winter-cleaning mode?)
these days :-) Getting rid of old obsolete stuff is always nice.

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by Cisco
--
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


Silver Crest VG2000 USB 2.0 Video Grabber, USB-Id: eb1a:2863 - does not work

2011-01-01 Thread Martin Seekatz
Hello,

in December 2009, I bought an USB Stick as Video-Grabber in order to convert my 
old VCR video tapes to digital files.

The Grabber means that this is only converting analog video and audio signals 
to digital streams - without any TV or Radio receiver.

After installing the actual v4l-dvb tree the device is known from the kernel 
and modules are installed as reported below. 

The Problem is that no Video aplications is working with the unit. I have 
testet MoTV, Kaffeine/Xine and VLC.

With MoTV tool i got the following informations:
v4l-conf: using X11 display :0.0
dga: version 2.0
WARNING: No DGA direct video mode for this display.
mode: 1920x1200, depth=24, bpp=32, bpl=7680, base=unknown
/dev/video0 [v4l2]: no overlay support

The device was sold from the Lidl discounter in Germany for 27.99 E
UR

 I successfully instaled the Drivers acording to
http://www.linuxtv.org/wiki/index.php/Em28xx_devices
The only differnce was the make install needs to be done as root or with 
sudo. No error messages ocured during the compilation 
and installation.


- Package Informations --
Item: USB-Video-Grabber
EAN: 4250133701701
SN: L7088988
Trade Mark: SILVER CREST (or SilverCrest)
Trade Mark Owner: Lidl Stiftung  Co. KG, 74172 Neckarsulm, DE
Distributor: Targa GmbH, Lange Wende 41, D-59494 Soest
Model: Silvercrest VG 2000
TARGA-Nr. 1479836

Technical datas
Interface: USB 2.0
Video-Inputs: Composite and S-Video
Audio-Inputs: 2 x Cinch (stereo)
Video-Resolution: PAL/SECAM: 720 x 576 @ 25 FPS; NTSC: 720 x 480 @ 30 FPS


- Linux Informations --
Distribution: OpenSuse 11.3

System:
Linux trixi 2.6.34.7-0.5-desktop #1 SMP PREEMPT 2010-10-25 08:40:12 +0200 
x86_64 x86_64 x86_64 GNU/Linux


USB Infos:
Bus 002 Device 006: ID eb1a:2863 eMPIA Technology, Inc. 

Kernel informations from /var/log/messages:
Dec 31 16:40:56 trixi kernel: [ 3004.742788] usb 2-5: new high speed USB device 
using ehci_hcd and address 5
Dec 31 16:40:56 trixi kernel: [ 3004.857132] usb 2-5: New USB device found, 
idVendor=eb1a, idProduct=2863
Dec 31 16:40:56 trixi kernel: [ 3004.857136] usb 2-5: New USB device strings: 
Mfr=0, Product=0, SerialNumber=0
Dec 31 16:40:56 trixi kernel: [ 3004.857593] em28xx: New device @ 480 Mbps 
(eb1a:2863, interface 0, class 0)
Dec 31 16:40:56 trixi kernel: [ 3004.857886] em28xx #0: chip ID is em2860
Dec 31 16:40:56 trixi kernel: [ 3004.927236] em28xx #0: board has no eeprom
Dec 31 16:40:56 trixi kernel: [ 3004.928382] em28xx #0: Identified as 
EM2860/SAA711X Reference Design (card=19)
Dec 31 16:40:56 trixi kernel: [ 3004.928385] em28xx #0: Registering snapshot 
button...
Dec 31 16:40:56 trixi kernel: [ 3004.928439] input: em28xx snapshot button as 
/devices/pci:00/:00:1d.7/usb2/2-5/input/input9
Dec 31 16:40:56 trixi kernel: [ 3004.928439] input: em28xx snapshot button as 
/devices/pci:00/:00:1d.7/usb2/2-5/input/input9
Dec 31 16:40:56 trixi kernel: [ 3004.931863] em28xx #0: Config register raw 
data: 0x10
Dec 31 16:40:56 trixi kernel: [ 3004.945893] em28xx #0: AC97 vendor ID = 
0x83847650
Dec 31 16:40:56 trixi kernel: [ 3004.952882] em28xx #0: AC97 features = 0x6a90
Dec 31 16:40:56 trixi kernel: [ 3004.952885] em28xx #0: Sigmatel audio 
processor detected(stac 9750)
Dec 31 16:40:56 trixi kernel: [ 3005.161760] em28xx #0: v4l2 driver version 
0.1.2
Dec 31 16:40:57 trixi kernel: [ 3005.628853] em28xx #0: V4L2 video device 
registered as video0
Dec 31 16:40:57 trixi kernel: [ 3005.628856] em28xx #0: V4L2 VBI device 
registered as vbi0
Dec 31 16:40:57 trixi kernel: [ 3005.628856] em28xx #0: V4L2 VBI device 
registered as vbi0
Dec 31 16:40:57 trixi kernel: [ 3005.628859] em28xx-audio.c: probing for em28x1 
non standard usbaudio
Dec 31 16:40:57 trixi kernel: [ 3005.628861] em28xx-audio.c: Copyright (C) 2006 
Markus Rechberger

Device files (/dev/dvb* is not existing):
 l -R /dev/dvb* /dev/vb* /dev//video* /dev/v4l
ls: Zugriff auf /dev/dvb* nicht möglich: Datei oder Verzeichnis nicht gefunden
crw-rw+ 1 root video 81, 1  1. Jan 21:01 /dev/vbi0
crw-rw+ 1 root video 81, 0  1. Jan 21:01 /dev//video0

/dev/v4l:
insgesamt 0
drwxr-xr-x  4 root root   80  1. Jan 21:01 ./
drwxr-xr-x 18 root root 4940  1. Jan 21:02 ../
drwxr-xr-x  2 root root   60  1. Jan 21:01 by-id/
drwxr-xr-x  2 root root   80  1. Jan 21:01 by-path/

/dev/v4l/by-id:
insgesamt 0
drwxr-xr-x 2 root root 60  1. Jan 21:01 ./
drwxr-xr-x 4 root root 80  1. Jan 21:01 ../
lrwxrwxrwx 1 root root 12  1. Jan 21:01 usb-eb1a_2863-video-index0 - 
../../video0

/dev/v4l/by-path:
insgesamt 0
drwxr-xr-x 2 root root 80  1. Jan 21:01 ./
drwxr-xr-x 4 root root 80  1. Jan 21:01 ../
lrwxrwxrwx 1 root root 12  1. Jan 21:01 
pci-:00:1d.7-usb-0:6:1.0-video-index0 - ../../video0   
  
lrwxrwxrwx 1 root root 10  1. Jan 21:01 
pci-:00:1d.7-usb-0:6:1.0-video-index1 - ../../vbi0

Modules 

Support for TV Tuner Prolink PixelView PlayTV 400 USB

2011-01-01 Thread Lucian Iuga-Popescu

Hi!

More than 4 years ago (long time, eh? :)  ), there was a discussion 
thread on the linuxtv mailing list about supporting the tuner PixelView 
PlayTV 400 USB.


It was here: 
http://www.linuxtv.org/pipermail/linux-dvb/2006-November/thread.html#14322


I was involved in that thread, but had to drop it because of shifting 
priorities. But now, I would like to give it a try again.


A lot of things have changed in the meantime. Now, there is a m920x 
module in the main kernel, but the tuner I have is not supported. Also, 
nvidia added the M9207 to their homepage: 
http://www.nvidia.com/page/uli_m9207.html


Is anyone willing to give it a try? I will help with anything that I 
can. I already have some USB sniffs from Windows which I can provide; 
and I can make more. Also, I made new pictures of the PCB (I lost the 
old ones). I even gave a try at modifying the module source myself, but 
it is way beyond my current knowledge.


Can anyone help?

Regards,
Lucian

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