dtv-scan-tables dvbv5 tables

2014-08-18 Thread Stefan Ringel

Hi,

i have problems dtv-scan-tables dvbv5 part.

1. better a new subdirectory to equalant to dvb (i.e. dvbv5)
2. the block names must add a index number (format BerlinX - X is a 
number, i.e. first block: Berlin1, second block: Berlin2 etc. not first 
block: Berlin, second block: Berlin), because software can have problems 
by reading edge block (seeing only the first block or using setting from 
the next block), all setting must add to edge block (incl. auto-setting 
parameters)

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


[no subject]

2014-03-04 Thread Stefan Ringel


From a5cfa1881de152a887d195e8c880dcca3e6b766e Mon Sep 17 00:00:00 2001
From: Stefan Ringel linu...@stefanringel.de
Date: Tue, 4 Mar 2014 20:50:32 +0100
Subject: [PATCH] v4l-utils: bugfix memory chunk

Bug 1070855 - [abrt] v4l-utils: parse_string(): dvbv5-scan killed by SIGABRT
https://bugzilla.redhat.com/show_bug.cgi?id=1070855

Signed-off-by: Stefan Ringel linu...@stefanringel.de
---
 lib/libdvbv5/descriptors/desc_frequency_list.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libdvbv5/descriptors/desc_frequency_list.c b/lib/libdvbv5/descriptors/desc_frequency_list.c
index de6f9fd..0a06a4a 100644
--- a/lib/libdvbv5/descriptors/desc_frequency_list.c
+++ b/lib/libdvbv5/descriptors/desc_frequency_list.c
@@ -36,10 +36,10 @@ void dvb_desc_frequency_list_init(struct dvb_v5_fe_parms *parms, const uint8_t *
 
 	d-frequencies = (d-length - len) / sizeof(d-frequency[0]);
 
-	d-frequency = calloc(1, sizeof(d-frequency));
+	d-frequency = calloc(d-frequencies, sizeof(d-frequency));
 
 	for (i = 0; i  d-frequencies; i++) {
-		d-frequency[i] = ((uint32_t *) buf)[i];
+		d-frequency[i] = ((uint32_t *) p)[i];
 		bswap32(d-frequency[i]);
 		switch (d-freq_type) {
 			case 1: /* satellite - to get kHz */
-- 
1.9.0



[no subject]

2014-03-04 Thread Stefan Ringel


From a5cfa1881de152a887d195e8c880dcca3e6b766e Mon Sep 17 00:00:00 2001
From: Stefan Ringel linu...@stefanringel.de
Date: Tue, 4 Mar 2014 20:50:32 +0100
Subject: [PATCH] v4l-utils: bugfix memory chunk

Bug 1070855 - [abrt] v4l-utils: parse_string(): dvbv5-scan killed by SIGABRT
https://bugzilla.redhat.com/show_bug.cgi?id=1070855

Signed-off-by: Stefan Ringel linu...@stefanringel.de
---
 lib/libdvbv5/descriptors/desc_frequency_list.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libdvbv5/descriptors/desc_frequency_list.c b/lib/libdvbv5/descriptors/desc_frequency_list.c
index de6f9fd..0a06a4a 100644
--- a/lib/libdvbv5/descriptors/desc_frequency_list.c
+++ b/lib/libdvbv5/descriptors/desc_frequency_list.c
@@ -36,10 +36,10 @@ void dvb_desc_frequency_list_init(struct dvb_v5_fe_parms *parms, const uint8_t *
 
 	d-frequencies = (d-length - len) / sizeof(d-frequency[0]);
 
-	d-frequency = calloc(1, sizeof(d-frequency));
+	d-frequency = calloc(d-frequencies, sizeof(d-frequency));
 
 	for (i = 0; i  d-frequencies; i++) {
-		d-frequency[i] = ((uint32_t *) buf)[i];
+		d-frequency[i] = ((uint32_t *) p)[i];
 		bswap32(d-frequency[i]);
 		switch (d-freq_type) {
 			case 1: /* satellite - to get kHz */
-- 
1.9.0



[PATCH] v4l-utils: bugfix memory chunk

2014-03-04 Thread Stefan Ringel


From a5cfa1881de152a887d195e8c880dcca3e6b766e Mon Sep 17 00:00:00 2001
From: Stefan Ringel linu...@stefanringel.de
Date: Tue, 4 Mar 2014 20:50:32 +0100
Subject: [PATCH] v4l-utils: bugfix memory chunk

Bug 1070855 - [abrt] v4l-utils: parse_string(): dvbv5-scan killed by SIGABRT
https://bugzilla.redhat.com/show_bug.cgi?id=1070855

Signed-off-by: Stefan Ringel linu...@stefanringel.de
---
 lib/libdvbv5/descriptors/desc_frequency_list.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libdvbv5/descriptors/desc_frequency_list.c b/lib/libdvbv5/descriptors/desc_frequency_list.c
index de6f9fd..0a06a4a 100644
--- a/lib/libdvbv5/descriptors/desc_frequency_list.c
+++ b/lib/libdvbv5/descriptors/desc_frequency_list.c
@@ -36,10 +36,10 @@ void dvb_desc_frequency_list_init(struct dvb_v5_fe_parms *parms, const uint8_t *
 
 	d-frequencies = (d-length - len) / sizeof(d-frequency[0]);
 
-	d-frequency = calloc(1, sizeof(d-frequency));
+	d-frequency = calloc(d-frequencies, sizeof(d-frequency));
 
 	for (i = 0; i  d-frequencies; i++) {
-		d-frequency[i] = ((uint32_t *) buf)[i];
+		d-frequency[i] = ((uint32_t *) p)[i];
 		bswap32(d-frequency[i]);
 		switch (d-freq_type) {
 			case 1: /* satellite - to get kHz */
-- 
1.9.0



Re: [PATCH 2/3] drxk: correction frontend attatching

2011-12-17 Thread Stefan Ringel

Am 18.12.2011 00:39, schrieb Oliver Endriss:

On Saturday 17 December 2011 21:57:16linu...@stefanringel.de  wrote:

From: Stefan Ringellinu...@stefanringel.de

all drxk have dvb-t, but not dvb-c.

Signed-off-by: Stefan Ringellinu...@stefanringel.de
---
  drivers/media/dvb/frontends/drxk_hard.c |6 --
  1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb/frontends/drxk_hard.c 
b/drivers/media/dvb/frontends/drxk_hard.c
index 038e470..8a59801 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -6460,9 +6460,11 @@ struct dvb_frontend *drxk_attach(const struct 
drxk_config *config,
init_state(state);
if (init_drxk(state)  0)
goto error;
-   *fe_t =state-t_frontend;

 ^^^


-   returnstate-c_frontend;

 ^^

+   if (state-m_hasDVBC)
+   *fe_t =state-c_frontend;

 ^^^

+
+   returnstate-t_frontend;

^^^


  error:
printk(KERN_ERR drxk: not found\n);

NAK, this changes the behaviour for existing drivers.

What is the point to swap DVB-T and DVB-C frontends?
broking by attaching or deattaching the frontend driver, if no dvb-c 
frontend drxk can use(i.e. drx-3916k). Do you add a frontend which is 
not physically present? Look to my 3rd patch. I tested many ways to 
attach that.


Stefan

If you really need this, please add an option to the config struct
with default that does not change anything for existing drivers.

CU
Oliver




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


Re: [PATCH 2/3] drxk: correction frontend attatching

2011-12-17 Thread Stefan Ringel

Am 18.12.2011 00:47, schrieb Oliver Endriss:

On Sunday 18 December 2011 00:39:49 Oliver Endriss wrote:

On Saturday 17 December 2011 21:57:16 linu...@stefanringel.de wrote:

From: Stefan Ringellinu...@stefanringel.de

all drxk have dvb-t, but not dvb-c.

Signed-off-by: Stefan Ringellinu...@stefanringel.de
---
  drivers/media/dvb/frontends/drxk_hard.c |6 --
  1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb/frontends/drxk_hard.c 
b/drivers/media/dvb/frontends/drxk_hard.c
index 038e470..8a59801 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -6460,9 +6460,11 @@ struct dvb_frontend *drxk_attach(const struct 
drxk_config *config,
init_state(state);
if (init_drxk(state)  0)
goto error;
-   *fe_t =state-t_frontend;

 ^^^


-   returnstate-c_frontend;

 ^^

+   if (state-m_hasDVBC)
+   *fe_t =state-c_frontend;

 ^^^

+
+   returnstate-t_frontend;

^^^


  error:
printk(KERN_ERR drxk: not found\n);

NAK, this changes the behaviour for existing drivers.

What is the point to swap DVB-T and DVB-C frontends?
If you really need this, please add an option to the config struct
with default that does not change anything for existing drivers.

Correction:
Better do something like this (untested):

if (state-m_hasDVBC) {
*fe_t =state-t_frontend;
return state-c_frontend;
} else
returnstate-t_frontend;

CU
Oliver


What shall be that, explain? For me not practicable.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/5] tm6000: bugfix interrupt reset

2011-12-05 Thread Stefan Ringel

Am 05.12.2011 19:21, schrieb Mauro Carvalho Chehab:

On 05-12-2011 13:38, Thierry Reding wrote:

* Mauro Carvalho Chehab wrote:

On 05-12-2011 05:21, Thierry Reding wrote:

* linu...@stefanringel.de wrote:

From: Stefan Ringellinu...@stefanringel.de

Signed-off-by: Stefan Ringellinu...@stefanringel.de


Your commit message needs more details. Why do you think this is a 
bugfix?
Also this commit seems to effectively revert (and then partially 
reimplement)

a patch that I posted some months ago.


Thierry,

I noticed this. I tested tm6000 with those changes with both the 
first gen
tm5600 devices I have and HVR900H and I didn't notice any bad thing 
with this

approach, and changing from one standard to another is now faster.

So, I decided to apply it (with the remaining patches I've made to
fix audio for PAL/M and NTSC/M).

I also noticed that TM6000_QUIRK_NO_USB_DELAY is not needed anymore
(still, Stefan's patches didn't remove it completely).

Could you please test if the problems you've solved with your approach
are still occurring?


Unfortunately I don't have any hardware available anymore. I will see 
if I
can get my hands on some of the devices, but that may take a while. I 
guess

you'll just have to apply without me testing them first.


Ok.


My comments should be addressed anyway, though.


Sure.

Stefan,

Could you better explain a little more about this change?




After add Thierry's patch the interrupt endpoint don't send data anymore.
I tested different ways to bring the interrupt endpoint in working. 
First in the function tm6000_uninit_isoc() - nothing, but if I remove 
the function tm6000_reset(), then works.
The next what I tested are directly in the function tm6000_reset(), but 
it froze in.
Now I am adding this lines in function tm600_relese() in position it 
call tm6000() (after videobuf_mmap_free() and it froze in, but before 
videobuf_mmap_free() it don't froze in and I have now data over the 
interrupt endpoint, and IR works.



better now?

Stefan
Also, if this is not required anymore, please send us a patch removing 
the

TM6000_QUIRK_NO_USB_DELAY quirk.


In a few days, if I have tested my next patch (signal detection)

Regards,
Mauro.


Thierry


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


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


[PATCH v2] tm6000: fix uninitialized field, change prink to dprintk

2011-05-21 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

fix uninitialized field, change prink to dprintk


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-usb-isoc.h |2 +-
 drivers/staging/tm6000/tm6000-video.c|5 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
b/drivers/staging/tm6000/tm6000-usb-isoc.h
index a9e61d9..084c2a8 100644
--- a/drivers/staging/tm6000/tm6000-usb-isoc.h
+++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
@@ -39,7 +39,7 @@ struct usb_isoc_ctl {
int pos, size, pktsize;
 
/* Last field: ODD or EVEN? */
-   int vfield;
+   int vfield, field;
 
/* Stores incomplete commands */
u32 tmp_buf;
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 4802396..4264064 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -334,6 +334,7 @@ static int copy_streams(u8 *data, unsigned long len,
size = dev-isoc_ctl.size;
pos = dev-isoc_ctl.pos;
pktsize = dev-isoc_ctl.pktsize;
+   field = dev-isoc_ctl.field;
}
cpysize = (endp - ptr  size) ? size : endp - ptr;
if (cpysize) {
@@ -359,7 +360,8 @@ static int copy_streams(u8 *data, unsigned long len,
/* Need some code to copy pts */
u32 pts;
pts = *(u32 *)ptr;
-   printk(KERN_INFO %s: field %d, PTS %x, 
dev-name, field, pts);
+   dprintk(dev, V4L2_DEBUG_ISOC, field %d, PTS 
%x,
+   field, pts);
break;
}
}
@@ -371,6 +373,7 @@ static int copy_streams(u8 *data, unsigned long len,
dev-isoc_ctl.pos = pos + cpysize;
dev-isoc_ctl.size = size - cpysize;
dev-isoc_ctl.cmd = cmd;
+   dev-isoc_ctl.field = field;
dev-isoc_ctl.pktsize = pktsize - (endp - ptr);
ptr += endp - ptr;
} else {
-- 
1.7.4.2

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


[PATCH] tm6000: fix uninitialized field, change prink to dprintk

2011-05-20 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

fix uninitialized field, change prink to dprintk


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-video.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 4802396..3baee84 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -228,7 +228,7 @@ static int copy_streams(u8 *data, unsigned long len,
u8 *ptr = data, *endp = data+len, c;
unsigned long header = 0;
int rc = 0;
-   unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
+   unsigned int cmd, cpysize, pktsize, size, field = 0, block, line, pos = 
0;
struct tm6000_buffer *vbuf = NULL;
char *voutp = NULL;
unsigned int linewidth;
@@ -359,7 +359,8 @@ static int copy_streams(u8 *data, unsigned long len,
/* Need some code to copy pts */
u32 pts;
pts = *(u32 *)ptr;
-   printk(KERN_INFO %s: field %d, PTS %x, 
dev-name, field, pts);
+   dprintk(dev, V4L2_DEBUG_ISOC, field %d, PTS 
%x,
+   field, pts);
break;
}
}
-- 
1.7.4.2

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


[PATCH 01/16] tm6000: add radio capabilities

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add radio capabilities


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |4 +++
 drivers/staging/tm6000/tm6000-video.c |   34 +---
 drivers/staging/tm6000/tm6000.h   |1 +
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 6e51486..31ccd2f 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -254,6 +254,7 @@ struct tm6000_board tm6000_boards[] = {
.has_zl10353= 1,
.has_eeprom = 1,
.has_remote = 1,
+   .has_radio  = 1.
.has_input_comp = 1,
.has_input_svid = 1,
},
@@ -276,6 +277,7 @@ struct tm6000_board tm6000_boards[] = {
.has_zl10353= 0,
.has_eeprom = 1,
.has_remote = 1,
+   .has_radio  = 1,
.has_input_comp = 1,
.has_input_svid = 1,
},
@@ -350,6 +352,7 @@ struct tm6000_board tm6000_boards[] = {
.has_zl10353= 1,
.has_eeprom = 1,
.has_remote = 0,
+   .has_radio  = 1,
.has_input_comp = 0,
.has_input_svid = 0,
},
@@ -372,6 +375,7 @@ struct tm6000_board tm6000_boards[] = {
.has_zl10353= 0,
.has_eeprom = 1,
.has_remote = 0,
+   .has_radio  = 1,
.has_input_comp = 0,
.has_input_svid = 0,
},
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index f82edfa..a434a32 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1730,24 +1730,26 @@ int tm6000_v4l2_register(struct tm6000_core *dev)
printk(KERN_INFO %s: registered device %s\n,
   dev-name, video_device_node_name(dev-vfd));
 
-   dev-radio_dev = vdev_init(dev, tm6000_radio_template,
-  radio);
-   if (!dev-radio_dev) {
-   printk(KERN_INFO %s: can't register radio device\n,
-  dev-name);
-   return ret; /* FIXME release resource */
-   }
+   if (dev-caps.has_radio) {
+   dev-radio_dev = vdev_init(dev, tm6000_radio_template,
+  radio);
+   if (!dev-radio_dev) {
+   printk(KERN_INFO %s: can't register radio device\n,
+  dev-name);
+   return ret; /* FIXME release resource */
+   }
 
-   ret = video_register_device(dev-radio_dev, VFL_TYPE_RADIO,
-   radio_nr);
-   if (ret  0) {
-   printk(KERN_INFO %s: can't register radio device\n,
-  dev-name);
-   return ret; /* FIXME release resource */
-   }
+   ret = video_register_device(dev-radio_dev, VFL_TYPE_RADIO,
+   radio_nr);
+   if (ret  0) {
+   printk(KERN_INFO %s: can't register radio device\n,
+  dev-name);
+   return ret; /* FIXME release resource */
+   }
 
-   printk(KERN_INFO %s: registered device %s\n,
-  dev-name, video_device_node_name(dev-radio_dev));
+   printk(KERN_INFO %s: registered device %s\n,
+  dev-name, video_device_node_name(dev-radio_dev));
+   }
 
printk(KERN_INFO Trident TVMaster TM5600/TM6000/TM6010 USB2 board 
(Load status: %d)\n, ret);
return ret;
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index fdd6d30..8cdc992 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -129,6 +129,7 @@ struct tm6000_capabilities {
unsigned inthas_zl10353:1;
unsigned inthas_eeprom:1;
unsigned inthas_remote:1;
+   unsigned inthas_radio:1;
unsigned inthas_input_comp:1;
unsigned inthas_input_svid:1;
 };
-- 
1.7.4.2

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


[PATCH 02/16] tm6000: add tm6010 audio mode setup

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add tm6010 audio mode setup


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-stds.c  |  149 ++---
 drivers/staging/tm6000/tm6000-video.c |   35 +---
 drivers/staging/tm6000/tm6000.h   |1 +
 3 files changed, 107 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-stds.c 
b/drivers/staging/tm6000/tm6000-stds.c
index da3e51b..588b1fc 100644
--- a/drivers/staging/tm6000/tm6000-stds.c
+++ b/drivers/staging/tm6000/tm6000-stds.c
@@ -22,6 +22,9 @@
 #include tm6000.h
 #include tm6000-regs.h
 
+static unsigned int tm6010_a_mode = 0;
+module_param(tm6010_a_mode, int, 0644);
+MODULE_PARM_DESC(tm6010_a_mode, set tm6010 sif audio mode);
 struct tm6000_reg_settings {
unsigned char req;
unsigned char reg;
@@ -947,9 +950,8 @@ static int tm6000_set_audio_std(struct tm6000_core *dev,
enum tm6000_audio_std std)
 {
uint8_t areg_02 = 0x04; /* GC1 Fixed gain 0dB */
-   uint8_t areg_05 = 0x09; /* Auto 4.5 = M Japan, Auto 6.5 = DK */
+   uint8_t areg_05 = 0x01; /* Auto 4.5 = M Japan, Auto 6.5 = DK */
uint8_t areg_06 = 0x02; /* Auto de-emphasis, mannual channel mode */
-   uint8_t mono_flag = 0;  /* No mono */
uint8_t nicam_flag = 0; /* No NICAM */
 
if (dev-radio) {
@@ -958,81 +960,99 @@ static int tm6000_set_audio_std(struct tm6000_core *dev,
tm6000_set_reg(dev, TM6010_REQ08_R03_A_AUTO_GAIN_CTRL, 0x00);
tm6000_set_reg(dev, TM6010_REQ08_R04_A_SIF_AMP_CTRL, 0x80);
tm6000_set_reg(dev, TM6010_REQ08_R05_A_STANDARD_MOD, 0x0c);
-   tm6000_set_reg(dev, TM6010_REQ08_R06_A_SOUND_MOD, 0x00);
+   /* set mono or stereo */
+   if (dev-amode == V4L2_TUNER_MODE_MONO)
+   tm6000_set_reg(dev, TM6010_REQ08_R06_A_SOUND_MOD, 0x00);
+   else if (dev-amode == V4L2_TUNER_MODE_STEREO)
+   tm6000_set_reg(dev, TM6010_REQ08_R06_A_SOUND_MOD, 0x02);
tm6000_set_reg(dev, TM6010_REQ08_R09_A_MAIN_VOL, 0x18);
tm6000_set_reg(dev, TM6010_REQ08_R0C_A_ASD_THRES2, 0x0a);
tm6000_set_reg(dev, TM6010_REQ08_R0D_A_AMD_THRES, 0x40);
-   tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfc);
+   tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfe);
tm6000_set_reg(dev, TM6010_REQ08_R1E_A_GAIN_DEEMPH_OUT, 0x13);
tm6000_set_reg(dev, TM6010_REQ08_R01_A_INIT, 0x80);
return 0;
}
 
-   switch (std) {
-#if 0
-   case DK_MONO:
-   mono_flag = 1;
-   break;
-   case DK_A2_1:
-   break;
-   case DK_A2_3:
-   areg_05 = 0x0b;
-   break;
-   case BG_MONO:
-   mono_flag = 1;
-   areg_05 = 0x05;
-   break;
-#endif
-   case BG_NICAM:
-   areg_05 = 0x07;
-   nicam_flag = 1;
-   break;
-   case BTSC:
-   areg_05 = 0x02;
-   break;
-   case BG_A2:
-   areg_05 = 0x05;
-   break;
-   case DK_NICAM:
-   areg_05 = 0x06;
-   nicam_flag = 1;
-   break;
-   case EIAJ:
-   areg_05 = 0x02;
-   break;
-   case I_NICAM:
-   areg_05 = 0x08;
-   nicam_flag = 1;
+   switch (tm6010_a_mode) {
+   /* auto */
+   case 0:
+   switch (dev-norm) {
+   case V4L2_STD_NTSC_M_KR:
+   areg_05 |= 0x00;
+   break;
+   case V4L2_STD_NTSC_M_JP:
+   areg_05 |= 0x40;
+   break;
+   case V4L2_STD_NTSC_M:
+   case V4L2_STD_PAL_M:
+   case V4L2_STD_PAL_N:
+   areg_05 |= 0x20;
+   break;
+   case V4L2_STD_PAL_Nc:
+   areg_05 |= 0x60;
+   break;
+   case V4L2_STD_SECAM_L:
+   areg_05 |= 0x00;
+   break;
+   case V4L2_STD_DK:
+   areg_05 |= 0x10;
+   break;
+   }
break;
-   case KOREA_A2:
-   areg_05 = 0x04;
+   /* A2 */
+   case 1:
+   switch (dev-norm) {
+   case V4L2_STD_B:
+   case V4L2_STD_GH:
+   areg_05 = 0x05;
+   break;
+   case V4L2_STD_DK:
+   areg_05 = 0x09;
+   break;
+   }
break;
-   case L_NICAM:
-   areg_02 = 0x02; /* GC1 Fixed gain +12dB */
-   areg_05 = 0x0a;
+   /* NICAM */
+   case 2:
+   switch (dev

[PATCH 07/16] tm6000: remove unused capabilities

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

remove unused capabilities



Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |8 
 drivers/staging/tm6000/tm6000.h   |2 --
 2 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 199cc86..19120ed 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -396,8 +396,6 @@ struct tm6000_board tm6000_boards[] = {
.has_eeprom = 1,
.has_remote = 1,
.has_radio  = 1.
-   .has_input_comp = 1,
-   .has_input_svid = 1,
},
.gpio = {
.tuner_reset= TM6010_GPIO_0,
@@ -435,8 +433,6 @@ struct tm6000_board tm6000_boards[] = {
.has_eeprom = 1,
.has_remote = 1,
.has_radio  = 1,
-   .has_input_comp = 1,
-   .has_input_svid = 1,
},
.gpio = {
.tuner_reset= TM6010_GPIO_0,
@@ -568,8 +564,6 @@ struct tm6000_board tm6000_boards[] = {
.has_eeprom = 1,
.has_remote = 0,
.has_radio  = 1,
-   .has_input_comp = 0,
-   .has_input_svid = 0,
},
.gpio = {
.tuner_reset= TM6010_GPIO_0,
@@ -599,8 +593,6 @@ struct tm6000_board tm6000_boards[] = {
.has_eeprom = 1,
.has_remote = 0,
.has_radio  = 1,
-   .has_input_comp = 0,
-   .has_input_svid = 0,
},
.gpio = {
.tuner_reset= TM6010_GPIO_0,
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index e4ca896..ae6369b 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -143,8 +143,6 @@ struct tm6000_capabilities {
unsigned inthas_eeprom:1;
unsigned inthas_remote:1;
unsigned inthas_radio:1;
-   unsigned inthas_input_comp:1;
-   unsigned inthas_input_svid:1;
 };
 
 struct tm6000_dvb {
-- 
1.7.4.2

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


[PATCH 09/16] tm6000: remove dopple init

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

remove dopple init


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 8ca8727..a69c82e 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -998,9 +998,6 @@ static int fill_board_specific_data(struct tm6000_core *dev)
if (rc  0)
return rc;
 
-   /* initialize hardware */
-   rc = tm6000_init(dev);
-
return rc;
 }
 
-- 
1.7.4.2

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


[PATCH 08/16] tm6000: remove old tuner params

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

remove old tuner params


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 19120ed..8ca8727 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -922,12 +922,8 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
memset(xc2028_cfg, 0, sizeof(xc2028_cfg));
memset(ctl, 0, sizeof(ctl));
 
-   ctl.input1 = 1;
-   ctl.read_not_reliable = 0;
-   ctl.msleep = 10;
ctl.demod = XC3028_FE_ZARLINK456;
-   ctl.vhfbw7 = 1;
-   ctl.uhfbw8 = 1;
+
xc2028_cfg.tuner = TUNER_XC2028;
xc2028_cfg.priv  = ctl;
 
-- 
1.7.4.2

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


[PATCH 12/16] tm6000: all audio packets must swab

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

all audio packets must swab


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-video.c |   13 +
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index a9a5919..ea5ad6c 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -344,17 +344,14 @@ static int copy_streams(u8 *data, unsigned long len,
if (vbuf)
memcpy(voutp[pos], ptr, cpysize);
break;
-   case TM6000_URB_MSG_AUDIO:
-   /* Need some code to copy audio buffer */
-   if (dev-fourcc == V4L2_PIX_FMT_YUYV) {
-   /* Swap word bytes */
-   int i;
+   case TM6000_URB_MSG_AUDIO: {
+   int i;
+   for (i = 0; i  cpysize; i += 2)
+   swab16s((u16 *)(ptr + i));
 
-   for (i = 0; i  cpysize; i += 2)
-   swab16s((u16 *)(ptr + i));
-   }
tm6000_call_fillbuf(dev, TM6000_AUDIO, ptr, 
cpysize);
break;
+   }
case TM6000_URB_MSG_VBI:
/* Need some code to copy vbi buffer */
break;
-- 
1.7.4.2

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


[PATCH 16/16] tm6000: remove tm6010 sif audio start and stop

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

remove tm6010 sif audio start and stop


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-alsa.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
b/drivers/staging/tm6000/tm6000-alsa.c
index acb0317..2b96047 100644
--- a/drivers/staging/tm6000/tm6000-alsa.c
+++ b/drivers/staging/tm6000/tm6000-alsa.c
@@ -84,7 +84,6 @@ static int _tm6000_start_audio_dma(struct snd_tm6000_card 
*chip)
 
tm6000_set_audio_bitrate(core, 48000);
 
-   tm6000_set_reg(core, TM6010_REQ08_R01_A_INIT, 0x80);
 
return 0;
 }
@@ -101,8 +100,6 @@ static int _tm6000_stop_audio_dma(struct snd_tm6000_card 
*chip)
/* Disables audio */
tm6000_set_reg_mask(core, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0x00, 0x40);
 
-   tm6000_set_reg(core, TM6010_REQ08_R01_A_INIT, 0);
-
return 0;
 }
 
-- 
1.7.4.2

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


[PATCH 14/16] tm6000: add pts logging

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add pts logging


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-video.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 2d83204..4802396 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -355,10 +355,14 @@ static int copy_streams(u8 *data, unsigned long len,
case TM6000_URB_MSG_VBI:
/* Need some code to copy vbi buffer */
break;
-   case TM6000_URB_MSG_PTS:
+   case TM6000_URB_MSG_PTS: {
/* Need some code to copy pts */
+   u32 pts;
+   pts = *(u32 *)ptr;
+   printk(KERN_INFO %s: field %d, PTS %x, 
dev-name, field, pts);
break;
}
+   }
}
if (ptr + pktsize  endp) {
/* End of URB packet, but cmd processing is not
-- 
1.7.4.2

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


[PATCH 15/16] tm6000: remove unsued exports

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

remove unsued exports


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-core.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 57fd874..d7eb2e2 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -686,7 +686,6 @@ int tm6000_set_audio_rinput(struct tm6000_core *dev)
}
return 0;
 }
-EXPORT_SYMBOL_GPL(tm6000_set_audio_input);
 
 void tm6010_set_mute_sif(struct tm6000_core *dev, u8 mute)
 {
@@ -749,7 +748,6 @@ int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 
mute)
}
return 0;
 }
-EXPORT_SYMBOL_GPL(tm6000_tvaudio_set_mute);
 
 void tm6010_set_volume_sif(struct tm6000_core *dev, int vol)
 {
@@ -807,7 +805,6 @@ void tm6000_set_volume(struct tm6000_core *dev, int vol)
break;
}
 }
-EXPORT_SYMBOL_GPL(tm6000_set_volume);
 
 static LIST_HEAD(tm6000_devlist);
 static DEFINE_MUTEX(tm6000_devlist_mutex);
-- 
1.7.4.2

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


[PATCH 11/16] tm6000: remove input select

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

remove input select


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-core.c |8 
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 1ac8409..57fd874 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -299,14 +299,6 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
 
/* Disables soft reset */
tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x00);
-
-   /* E3: Select input 0 - TV tuner */
-   tm6000_set_reg(dev, TM6000_REQ07_RE3_VADC_INP_LPF_SEL1, 0x00);
-   tm6000_set_reg(dev, TM6000_REQ07_REB_VADC_AADC_MODE, 0x60);
-
-   /* This controls input */
-   tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_2, 0x0);
-   tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_3, 
0x01);
}
msleep(20);
 
-- 
1.7.4.2

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


[PATCH 13/16] tm6000: change from ioctl to unlocked_ioctl

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

change from ioctl to unlocked_ioctl


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-video.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index ea5ad6c..2d83204 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1666,10 +1666,10 @@ static struct video_device tm6000_template = {
 };
 
 static const struct v4l2_file_operations radio_fops = {
-   .owner= THIS_MODULE,
-   .open = tm6000_open,
-   .release  = tm6000_release,
-   .ioctl= video_ioctl2,
+   .owner  = THIS_MODULE,
+   .open   = tm6000_open,
+   .release= tm6000_release,
+   .unlocked_ioctl = video_ioctl2,
 };
 
 static const struct v4l2_ioctl_ops radio_ioctl_ops = {
-- 
1.7.4.2

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


[PATCH 10/16] tm6000: move from tm6000_set_reg to tm6000_set_reg_mask

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

move from tm6000_set_reg to tm6000_set_reg_mask



Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-core.c |   26 ++
 1 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 259cf80..1ac8409 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -268,19 +268,18 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
struct v4l2_frequency f;
 
if (dev-dev_type == TM6010) {
-   /* Enable video */
-
+   /* Enable video and audio */
tm6000_set_reg_mask(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF,
0x60, 0x60);
+   /* Disable TS input */
tm6000_set_reg_mask(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE,
0x00, 0x40);
-   tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfc);
-
} else {
/* Enables soft reset */
tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x01);
 
if (dev-scaler)
+   /* Disable Hfilter and Enable TS Drop err */
tm6000_set_reg(dev, 
TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x20);
else/* Enable Hfilter and disable TS Drop err */
tm6000_set_reg(dev, 
TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x80);
@@ -343,21 +342,16 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
 int tm6000_init_digital_mode(struct tm6000_core *dev)
 {
if (dev-dev_type == TM6010) {
-   int val;
-   u8 buf[2];
-
-   /* digital init */
-   val = tm6000_get_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0);
-   val = ~0x60;
-   tm6000_set_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val);
-   val = tm6000_get_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 
0);
-   val |= 0x40;
-   tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, val);
+   /* Disable video and audio */
+   tm6000_set_reg_mask(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF,
+   0x00, 0x60);
+   /* Enable TS input */
+   tm6000_set_reg_mask(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE,
+   0x40, 0x40);
+   /* all power down, but not the digital data port */
tm6000_set_reg(dev, TM6010_REQ07_RFE_POWER_DOWN, 0x28);
tm6000_set_reg(dev, TM6010_REQ08_RE2_POWER_DOWN_CTRL1, 0xfc);
tm6000_set_reg(dev, TM6010_REQ08_RE6_POWER_DOWN_CTRL2, 0xff);
-   tm6000_read_write_usb(dev, 0xc0, 0x0e, 0x00c2, 0x0008, buf, 2);
-   printk(KERN_INFObuf %#x %#x\n, buf[0], buf[1]);
} else  {
tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x08);
tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x00);
-- 
1.7.4.2

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


[PATCH 06/16] tm6000: add eeprom

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add eeprom


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 9f4daac..199cc86 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -84,6 +84,7 @@ struct tm6000_board {
 
struct tm6000_input vinput[3];
struct tm6000_input rinput;
+
char*ir_codes;
 };
 
@@ -91,7 +92,8 @@ struct tm6000_board tm6000_boards[] = {
[TM6000_BOARD_UNKNOWN] = {
.name = Unknown tm6000 video grabber,
.caps = {
-   .has_tuner= 1,
+   .has_tuner  = 1,
+   .has_eeprom = 1,
},
.gpio = {
.tuner_reset= TM6000_GPIO_1,
@@ -118,6 +120,7 @@ struct tm6000_board tm6000_boards[] = {
.tuner_addr   = 0xc2  1,
.caps = {
.has_tuner  = 1,
+   .has_eeprom = 1,
},
.gpio = {
.tuner_reset= TM6000_GPIO_1,
@@ -143,7 +146,7 @@ struct tm6000_board tm6000_boards[] = {
.tuner_addr   = 0xc2  1,
.caps = {
.has_tuner  = 1,
-   .has_dvb= 1,
+   .has_eeprom = 1,
},
.gpio = {
.tuner_reset= TM6000_GPIO_1,
-- 
1.7.4.2

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


[PATCH 05/16] tm6000: change input control

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

change input control


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-core.c  |   12 +-
 drivers/staging/tm6000/tm6000-stds.c  |  774 ++---
 drivers/staging/tm6000/tm6000-video.c |9 +-
 drivers/staging/tm6000/tm6000.h   |4 +-
 4 files changed, 130 insertions(+), 669 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index f4b9fcd..259cf80 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -327,7 +327,7 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
 
msleep(100);
-   tm6000_set_standard(dev, dev-norm);
+   tm6000_set_standard(dev);
tm6000_set_vbi(dev);
tm6000_set_audio_bitrate(dev, 48000);
 
@@ -489,14 +489,6 @@ struct reg_init tm6010_init_tab[] = {
{ TM6010_REQ08_REB_SIF_GAIN_CTRL, 0xf0 },
{ TM6010_REQ08_REC_REVERSE_YC_CTRL, 0xc2 },
{ TM6010_REQ08_RF0_DAUDIO_INPUT_CONFIG, 0x60 },
-   { TM6010_REQ08_R03_A_AUTO_GAIN_CTRL, 0x00},
-   { TM6010_REQ08_R04_A_SIF_AMP_CTRL, 0x80},
-   { TM6010_REQ08_R0C_A_ASD_THRES2, 0x0a},
-   { TM6010_REQ08_R0D_A_AMD_THRES, 0x40},
-   { TM6010_REQ08_R1A_A_NICAM_SER_MAX, 0x64},
-   { TM6010_REQ08_R1B_A_NICAM_SER_MIN, 0x20},
-   { TM6010_REQ08_R16_A_AGC_GAIN_MAX, 0xfe},
-   { TM6010_REQ08_R17_A_AGC_GAIN_MIN, 0x01},
{ TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfc },
 
{ TM6010_REQ07_R3F_RESET, 0x01 },
@@ -657,7 +649,7 @@ int tm6000_set_audio_bitrate(struct tm6000_core *dev, int 
bitrate)
 }
 EXPORT_SYMBOL_GPL(tm6000_set_audio_bitrate);
 
-int tm6000_set_audio_input(struct tm6000_core *dev, enum tm6000_inaudio ainp)
+int tm6000_set_audio_rinput(struct tm6000_core *dev)
 {
if (dev-dev_type == TM6010) {
/* Audio crossbar setting, default SIF1 */
diff --git a/drivers/staging/tm6000/tm6000-stds.c 
b/drivers/staging/tm6000/tm6000-stds.c
index 588b1fc..8b29d73 100644
--- a/drivers/staging/tm6000/tm6000-stds.c
+++ b/drivers/staging/tm6000/tm6000-stds.c
@@ -25,422 +25,23 @@
 static unsigned int tm6010_a_mode = 0;
 module_param(tm6010_a_mode, int, 0644);
 MODULE_PARM_DESC(tm6010_a_mode, set tm6010 sif audio mode);
+
 struct tm6000_reg_settings {
unsigned char req;
unsigned char reg;
unsigned char value;
 };
 
-enum tm6000_audio_std {
-   BG_NICAM,
-   BTSC,
-   BG_A2,
-   DK_NICAM,
-   EIAJ,
-   FM_RADIO,
-   I_NICAM,
-   KOREA_A2,
-   L_NICAM,
-};
-
-struct tm6000_std_tv_settings {
-   v4l2_std_id id;
-   enum tm6000_audio_std audio_default_std;
-
-   struct tm6000_reg_settings sif[12];
-   struct tm6000_reg_settings nosif[12];
-   struct tm6000_reg_settings common[26];
-};
 
 struct tm6000_std_settings {
v4l2_std_id id;
-   enum tm6000_audio_std audio_default_std;
-   struct tm6000_reg_settings common[37];
-};
-
-static struct tm6000_std_tv_settings tv_stds[] = {
-   {
-   .id = V4L2_STD_PAL_M,
-   .audio_default_std = BTSC,
-   .sif = {
-   {TM6010_REQ08_RE2_POWER_DOWN_CTRL1, 0xf2},
-   {TM6010_REQ08_RE3_ADC_IN1_SEL, 0xf8},
-   {TM6010_REQ08_RE4_ADC_IN2_SEL, 0xf3},
-   {TM6010_REQ08_RE6_POWER_DOWN_CTRL2, 0x08},
-   {TM6010_REQ08_REA_BUFF_DRV_CTRL, 0xf1},
-   {TM6010_REQ08_REB_SIF_GAIN_CTRL, 0xe0},
-   {TM6010_REQ08_REC_REVERSE_YC_CTRL, 0xc2},
-   {TM6010_REQ08_RED_GAIN_SEL, 0xe8},
-   {TM6010_REQ08_RF0_DAUDIO_INPUT_CONFIG, 0x62},
-   {TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfe},
-   {TM6010_REQ07_RFE_POWER_DOWN, 0xcb},
-   {0, 0, 0},
-   },
-   .nosif = {
-   {TM6010_REQ08_RE2_POWER_DOWN_CTRL1, 0xf0},
-   {TM6010_REQ08_RE3_ADC_IN1_SEL, 0xf8},
-   {TM6010_REQ08_RE4_ADC_IN2_SEL, 0xf3},
-   {TM6010_REQ08_RE6_POWER_DOWN_CTRL2, 0x0f},
-   {TM6010_REQ08_REA_BUFF_DRV_CTRL, 0xf1},
-   {TM6010_REQ08_REB_SIF_GAIN_CTRL, 0xe0},
-   {TM6010_REQ08_REC_REVERSE_YC_CTRL, 0xc2},
-   {TM6010_REQ08_RED_GAIN_SEL, 0xe8},
-   {TM6010_REQ08_RF0_DAUDIO_INPUT_CONFIG, 0x60},
-   {TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfc},
-   {TM6010_REQ07_RFE_POWER_DOWN, 0x8b},
-   {0, 0, 0},
-   },
-   .common = {
-   {TM6010_REQ07_R3F_RESET, 0x01},
-   {TM6010_REQ07_R00_VIDEO_CONTROL0, 0x04

[PATCH 04/16] tm6000: vitual input enums

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

vitual input enums


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-video.c |  100 +++--
 1 files changed, 57 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index e1a7eb2..8b3bf7e 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1083,35 +1083,37 @@ static int vidioc_s_std (struct file *file, void *priv, 
v4l2_std_id *norm)
return 0;
 }
 
+static const char *iname [] = {
+   [TM6000_INPUT_TV] = Television,
+   [TM6000_INPUT_COMPOSITE1] = Composite 1,
+   [TM6000_INPUT_COMPOSITE2] = Composite 2,
+   [TM6000_INPUT_SVIDEO] = S-Video,
+};
+
 static int vidioc_enum_input(struct file *file, void *priv,
-   struct v4l2_input *inp)
+   struct v4l2_input *i)
 {
struct tm6000_fh   *fh = priv;
struct tm6000_core *dev = fh-dev;
+   unsigned int n;
 
-   switch (inp-index) {
-   case TM6000_INPUT_TV:
-   inp-type = V4L2_INPUT_TYPE_TUNER;
-   strcpy(inp-name, Television);
-   break;
-   case TM6000_INPUT_COMPOSITE:
-   if (dev-caps.has_input_comp) {
-   inp-type = V4L2_INPUT_TYPE_CAMERA;
-   strcpy(inp-name, Composite);
-   } else
-   return -EINVAL;
-   break;
-   case TM6000_INPUT_SVIDEO:
-   if (dev-caps.has_input_svid) {
-   inp-type = V4L2_INPUT_TYPE_CAMERA;
-   strcpy(inp-name, S-Video);
-   } else
-   return -EINVAL;
-   break;
-   default:
+   n = i-index;
+   if (n = 3)
return -EINVAL;
-   }
-   inp-std = TM6000_STD;
+
+   if (!dev-vinput[n].type)
+   return -EINVAL;
+
+   i-index = n;
+
+   if (dev-vinput[n].type == TM6000_INPUT_TV)
+   i-type = V4L2_INPUT_TYPE_TUNER;
+   else
+   i-type = V4L2_INPUT_TYPE_CAMERA;
+
+   strcpy(i-name, iname[dev-vinput[n].type]);
+
+   i-std = TM6000_STD;
 
return 0;
 }
@@ -1125,33 +1127,21 @@ static int vidioc_g_input(struct file *file, void 
*priv, unsigned int *i)
 
return 0;
 }
+
 static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
 {
struct tm6000_fh   *fh = priv;
struct tm6000_core *dev = fh-dev;
int rc = 0;
-   char buf[1];
 
-   switch (i) {
-   case TM6000_INPUT_TV:
-   dev-input = i;
-   *buf = 0;
-   break;
-   case TM6000_INPUT_COMPOSITE:
-   case TM6000_INPUT_SVIDEO:
-   dev-input = i;
-   *buf = 1;
-   break;
-   default:
+   if (i = 3)
+   return -EINVAL;
+   if (!dev-vinput[i].type)
return -EINVAL;
-   }
-   rc = tm6000_read_write_usb(dev, USB_DIR_OUT | USB_TYPE_VENDOR,
-  REQ_03_SET_GET_MCU_PIN, 0x03, 1, buf, 1);
 
-   if (!rc) {
-   dev-input = i;
-   rc = vidioc_s_std(file, priv, dev-vfd-current_norm);
-   }
+   dev-input = i;
+
+   rc = vidioc_s_std(file, priv, dev-vfd-current_norm);
 
return rc;
 }
@@ -1379,9 +1369,15 @@ static int radio_s_tuner(struct file *file, void *priv,
 static int radio_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
 {
+   struct tm6000_fh *fh = priv;
+   struct tm6000_core *dev = fh-dev;
+
if (i-index != 0)
return -EINVAL;
 
+   if (!dev-rinput.type)
+   return -EINVAL;
+
strcpy(i-name, Radio);
i-type = V4L2_INPUT_TYPE_TUNER;
 
@@ -1390,7 +1386,14 @@ static int radio_enum_input(struct file *file, void 
*priv,
 
 static int radio_g_input(struct file *filp, void *priv, unsigned int *i)
 {
-   *i = 0;
+   struct tm6000_fh *fh = priv;
+   struct tm6000_core *dev = fh-dev;
+
+   if (dev-input !=5)
+   return -EINVAL;
+
+   *i = dev-input -5;
+
return 0;
 }
 
@@ -1410,6 +1413,17 @@ static int radio_s_audio(struct file *file, void *priv,
 
 static int radio_s_input(struct file *filp, void *priv, unsigned int i)
 {
+   struct tm6000_fh *fh = priv;
+   struct tm6000_core *dev = fh-dev;
+
+   if (i)
+   return -EINVAL;
+
+   if (!dev-rinput.type)
+   return -EINVAL;
+
+   dev-input = i + 5;
+
return 0;
 }
 
-- 
1.7.4.2

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


[PATCH 03/16] tm6000: change to virtual inputs

2011-05-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

change to virtual inputs


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |  257 +++--
 drivers/staging/tm6000/tm6000-core.c  |   60 +
 drivers/staging/tm6000/tm6000.h   |   36 --
 3 files changed, 303 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 31ccd2f..9f4daac 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -74,8 +74,6 @@ struct tm6000_board {
unsignedeename_pos; /* Position where it appears at 
ROM */
 
struct tm6000_capabilities caps;
-   enumtm6000_inaudio aradio;
-   enumtm6000_inaudio avideo;
 
enumtm6000_devtype type;/* variant of the chipset */
int tuner_type; /* type of the tuner */
@@ -84,6 +82,8 @@ struct tm6000_board {
 
struct tm6000_gpio gpio;
 
+   struct tm6000_input vinput[3];
+   struct tm6000_input rinput;
char*ir_codes;
 };
 
@@ -96,6 +96,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = {
.tuner_reset= TM6000_GPIO_1,
},
+   .vinput = { {
+   .type   = TM6000_INPUT_TV,
+   .vmux   = TM6000_VMUX_VIDEO_B,
+   .amux   = TM6000_AMUX_ADC1,
+   }, {
+   .type   = TM6000_INPUT_COMPOSITE1,
+   .vmux   = TM6000_VMUX_VIDEO_A,
+   .amux   = TM6000_AMUX_ADC2,
+   }, {
+   .type   = TM6000_INPUT_SVIDEO,
+   .vmux   = TM6000_VMUX_VIDEO_AB,
+   .amux   = TM6000_AMUX_ADC2,
+   },
+   },
},
[TM5600_BOARD_GENERIC] = {
.name = Generic tm5600 board,
@@ -108,6 +122,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = {
.tuner_reset= TM6000_GPIO_1,
},
+   .vinput = { {
+   .type   = TM6000_INPUT_TV,
+   .vmux   = TM6000_VMUX_VIDEO_B,
+   .amux   = TM6000_AMUX_ADC1,
+   }, {
+   .type   = TM6000_INPUT_COMPOSITE1,
+   .vmux   = TM6000_VMUX_VIDEO_A,
+   .amux   = TM6000_AMUX_ADC2,
+   }, {
+   .type   = TM6000_INPUT_SVIDEO,
+   .vmux   = TM6000_VMUX_VIDEO_AB,
+   .amux   = TM6000_AMUX_ADC2,
+   },
+   },
},
[TM6000_BOARD_GENERIC] = {
.name = Generic tm6000 board,
@@ -120,6 +148,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = {
.tuner_reset= TM6000_GPIO_1,
},
+   .vinput = { {
+   .type   = TM6000_INPUT_TV,
+   .vmux   = TM6000_VMUX_VIDEO_B,
+   .amux   = TM6000_AMUX_ADC1,
+   }, {
+   .type   = TM6000_INPUT_COMPOSITE1,
+   .vmux   = TM6000_VMUX_VIDEO_A,
+   .amux   = TM6000_AMUX_ADC2,
+   }, {
+   .type   = TM6000_INPUT_SVIDEO,
+   .vmux   = TM6000_VMUX_VIDEO_AB,
+   .amux   = TM6000_AMUX_ADC2,
+   },
+   },
},
[TM6010_BOARD_GENERIC] = {
.name = Generic tm6010 board,
@@ -143,6 +185,20 @@ struct tm6000_board tm6000_boards[] = {
.dvb_led= TM6010_GPIO_5,
.ir = TM6010_GPIO_0,
},
+   .vinput = { {
+   .type   = TM6000_INPUT_TV,
+   .vmux   = TM6000_VMUX_VIDEO_B,
+   .amux   = TM6000_AMUX_SIF1,
+   }, {
+   .type   = TM6000_INPUT_COMPOSITE1,
+   .vmux   = TM6000_VMUX_VIDEO_A,
+   .amux   = TM6000_AMUX_ADC2,
+   }, {
+   .type   = TM6000_INPUT_SVIDEO,
+   .vmux   = TM6000_VMUX_VIDEO_AB,
+   .amux   = TM6000_AMUX_ADC2,
+   },
+   },
},
[TM5600_BOARD_10MOONS_UT821] = {
.name = 10Moons UT 821,
@@ -159,6 +215,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = {
.tuner_reset= TM6000_GPIO_1,
},
+   .vinput = { {
+   .type   = TM6000_INPUT_TV

tm6000: video buffer

2011-05-08 Thread Stefan Ringel

Hi Mauro,

I have a few little problems.

1. How I can set up buffer field?
 - Alternate
 - Top
 - Bottom
etc.

2. How I can add time code to buffer?
PTS packet send an 32 bit long frame number, that count edge half frame.

3. How I can set up aspect ratio?
 - 4:3
- 16:9
incl. after a vbi packet with radio info (WSS)

a few variables which help us:

in structure tm6000_core :
aspect
framecount

Stefan Ringel

--
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 v1] tm6000: rework standards

2011-05-04 Thread Stefan Ringel

Dmitri,

I have tested your patch, but is doesn't work (big crash - long, long, 
long beep).

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


Re: [PATCH 3/5] tm6000: add audio mode parameter

2011-05-03 Thread Stefan Ringel arcor
Am 03.05.2011 12:07, schrieb Mauro Carvalho Chehab:
 Em 20-04-2011 05:36, Stefan Ringel escreveu:
 Am 19.04.2011 23:26, schrieb Mauro Carvalho Chehab:
 Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:
 From: Stefan Ringelstefan.rin...@arcor.de

 add audio mode parameter
 Why we need a parameter for it? It should be determined based on
 the standard.

 tm6010 has a sif decoder, and I think if auto detect doesn't work, use can 
 set the audio standard, which it has in your region. Or it's better if users 
 can see image but can hear audio?
 I did some tests with SIF and MTS here. None of them were capable of working 
 with BTSC signals with
 my devices. Adding a parameter won't help it at all. What we need to do is to 
 fix the audio
 decoding.

In the next patch I will send it. A preview I have send to be test (
https://patchwork.kernel.org/patch/722021/ ).
 Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
 ---
   drivers/staging/tm6000/tm6000-stds.c |5 +
   1 files changed, 5 insertions(+), 0 deletions(-)

 diff --git a/drivers/staging/tm6000/tm6000-stds.c 
 b/drivers/staging/tm6000/tm6000-stds.c
 index da3e51b..a9e1921 100644
 --- a/drivers/staging/tm6000/tm6000-stds.c
 +++ b/drivers/staging/tm6000/tm6000-stds.c
 @@ -22,12 +22,17 @@
   #include tm6000.h
   #include tm6000-regs.h

 +static unsigned int tm6010_a_mode;
 +module_param(tm6010_a_mode, int, 0644);
 +MODULE_PARM_DESC(tm6010_a_mode, set sif audio mode (tm6010 only));
 +
   struct tm6000_reg_settings {
   unsigned char req;
   unsigned char reg;
   unsigned char value;
   };

 +/* must be updated */
   enum tm6000_audio_std {
   BG_NICAM,
   BTSC,
 -- 
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

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


Re: [PATCH 3/5] tm6000: add audio mode parameter

2011-05-03 Thread Stefan Ringel

Am 03.05.2011 16:42, schrieb Mauro Carvalho Chehab:

Em 03-05-2011 11:25, Stefan Ringel arcor escreveu:

Am 03.05.2011 12:07, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 05:36, Stefan Ringel escreveu:

Am 19.04.2011 23:26, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add audio mode parameter

Why we need a parameter for it? It should be determined based on
the standard.


tm6010 has a sif decoder, and I think if auto detect doesn't work, use can set 
the audio standard, which it has in your region. Or it's better if users can 
see image but can hear audio?

I did some tests with SIF and MTS here. None of them were capable of working 
with BTSC signals with
my devices. Adding a parameter won't help it at all. What we need to do is to 
fix the audio
decoding.


In the next patch I will send it. A preview I have send to be test (
https://patchwork.kernel.org/patch/722021/ ).

I tested your preview. Didn't make any difference.
Has you test with all setting variants? (BG_A2 works auto and A2 audio 
mode).

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
   drivers/staging/tm6000/tm6000-stds.c |5 +
   1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-stds.c 
b/drivers/staging/tm6000/tm6000-stds.c
index da3e51b..a9e1921 100644
--- a/drivers/staging/tm6000/tm6000-stds.c
+++ b/drivers/staging/tm6000/tm6000-stds.c
@@ -22,12 +22,17 @@
   #include tm6000.h
   #include tm6000-regs.h

+static unsigned int tm6010_a_mode;
+module_param(tm6010_a_mode, int, 0644);
+MODULE_PARM_DESC(tm6010_a_mode, set sif audio mode (tm6010 only));
+
   struct tm6000_reg_settings {
   unsigned char req;
   unsigned char reg;
   unsigned char value;
   };

+/* must be updated */
   enum tm6000_audio_std {
   BG_NICAM,
   BTSC,

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

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


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


Re: [PATCH 3/5] tm6000: add audio mode parameter

2011-05-03 Thread Stefan Ringel

Am 03.05.2011 16:52, schrieb Stefan Ringel:

Am 03.05.2011 16:42, schrieb Mauro Carvalho Chehab:

Em 03-05-2011 11:25, Stefan Ringel arcor escreveu:

Am 03.05.2011 12:07, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 05:36, Stefan Ringel escreveu:

Am 19.04.2011 23:26, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add audio mode parameter

Why we need a parameter for it? It should be determined based on
the standard.

tm6010 has a sif decoder, and I think if auto detect doesn't work, 
use can set the audio standard, which it has in your region. Or 
it's better if users can see image but can hear audio?
I did some tests with SIF and MTS here. None of them were capable 
of working with BTSC signals with
my devices. Adding a parameter won't help it at all. What we need 
to do is to fix the audio

decoding.


In the next patch I will send it. A preview I have send to be test (
https://patchwork.kernel.org/patch/722021/ ).

I tested your preview. Didn't make any difference.
Has you test with all setting variants? (BG_A2 works auto and A2 audio 
mode).
I use mplayer, and have in the first use the wrong parameter. Now I know 
the right parameter for mplayer:


mplayer -vc rawyuy2 -ac pcm -ao alsa:device=hw=0.0 -tv 
driver=v4l2:device=/dev/video2:input=0:outfmt=yv12:freq=210.25:normid=3:alsa:adevice=hw.2,0:amode=1:immediatemode=0 
-fs tv://

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
   drivers/staging/tm6000/tm6000-stds.c |5 +
   1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-stds.c 
b/drivers/staging/tm6000/tm6000-stds.c

index da3e51b..a9e1921 100644
--- a/drivers/staging/tm6000/tm6000-stds.c
+++ b/drivers/staging/tm6000/tm6000-stds.c
@@ -22,12 +22,17 @@
   #include tm6000.h
   #include tm6000-regs.h

+static unsigned int tm6010_a_mode;
+module_param(tm6010_a_mode, int, 0644);
+MODULE_PARM_DESC(tm6010_a_mode, set sif audio mode (tm6010 
only));

+
   struct tm6000_reg_settings {
   unsigned char req;
   unsigned char reg;
   unsigned char value;
   };

+/* must be updated */
   enum tm6000_audio_std {
   BG_NICAM,
   BTSC,

--
To unsubscribe from this list: send the line unsubscribe 
linux-media in

the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe 
linux-media in

the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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


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


Re: [PATCH 2/5] tm6000: add dtv78 parameter

2011-05-03 Thread Stefan Ringel

Am 03.05.2011 12:04, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 11:30, Stefan Ringel escreveu:

Am 20.04.2011 14:38, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 05:19, Stefan Ringel escreveu:

Am 19.04.2011 23:22, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add dtv78 parameter

The dtv78 entry is a hack meant for card usage in Australia, that
speeds up channel detection there. Again, it should be specified
only when needed, and at per-board basis.

I have test and auto detect doesn't work right. That is also region
specific staff and it's better to set outside. In other words in Germany
it must set this param and in other country, which use only 7MHz or 8MHz it 
doesn't set (i.e. Australia).

xc3028 has a logic to detect and work on both Australia and Europe.
If that logic is broken, we should fix it, not adding a manual
parameter for it.


It positively a bug. When I use lower band (7MHz, load DTV7 SCODE) it doesn't 
work, then I go in the high band (8MHz, load DTV78, DTV8 SCODE) and have 
channels and can watch TV. If I go now in the lower band (7MHz, don't reload 
SCODE) it works. This effect is for me a bug.

The fix for it should be at xc3028. Please propose a patch for it. Maybe we 
should add there
a parameter for auto-detection, or to force it to use dtv78, if bandwith is  
6MHz.


The last I have scanned and used in auto mode was last year. And now 
work fine :-) . When have you change the code?

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
drivers/staging/tm6000/tm6000-cards.c |   11 +--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index eef58da..cf2e76c 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -65,6 +65,9 @@ static unsigned int xc2028_mts;
module_param(xc2028_mts, int, 0644);
MODULE_PARM_DESC(xc2028_mts, enable mts firmware (xc2028/3028 only));

+static unsigned int xc2028_dtv78;
+module_param(xc2028_dtv78, int, 0644);
+MODULE_PARM_DESC(xc2028_dtv78, enable dualband config (xc2028/3028 only));

struct tm6000_board {
char*name;
@@ -687,8 +690,12 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
ctl.read_not_reliable = 0;
ctl.msleep = 10;
ctl.demod = XC3028_FE_ZARLINK456;
-ctl.vhfbw7 = 1;
-ctl.uhfbw8 = 1;
+
+if (xc2028_dtv78) {
+ctl.vhfbw7 = 1;
+ctl.uhfbw8 = 1;
+}
+
if (xc2028_mts)
ctl.mts = 1;


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

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

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


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


Re: [PATCH 1/5] tm6000: add mts parameter

2011-04-20 Thread Stefan Ringel

Am 19.04.2011 23:21, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add mts parameter

Stefan,

The MTS config depends on the specific board design (generally present on
mono NTSC cards). So, it should be inside the cards struct, and not
provided as an userspace parameter.

Mauro.
No. It wrong. I think edge board must work under all region and TV 
standards and if I set MTS, it doesn't work in Germany (PAL_BG and 
DVB-T). The best is to set outside region specific params.

.

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
  drivers/staging/tm6000/tm6000-cards.c |7 +++
  1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 146c7e8..eef58da 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -61,6 +61,10 @@ module_param_array(card,  int, NULL, 0444);

  static unsigned long tm6000_devused;

+static unsigned int xc2028_mts;
+module_param(xc2028_mts, int, 0644);
+MODULE_PARM_DESC(xc2028_mts, enable mts firmware (xc2028/3028 only));
+

  struct tm6000_board {
char*name;
@@ -685,6 +689,9 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
ctl.demod = XC3028_FE_ZARLINK456;
ctl.vhfbw7 = 1;
ctl.uhfbw8 = 1;
+   if (xc2028_mts)
+   ctl.mts = 1;
+
xc2028_cfg.tuner = TUNER_XC2028;
xc2028_cfg.priv  =ctl;


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


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


Re: [PATCH 3/5] tm6000: add audio mode parameter

2011-04-20 Thread Stefan Ringel

Am 19.04.2011 23:26, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add audio mode parameter

Why we need a parameter for it? It should be determined based on
the standard.

tm6010 has a sif decoder, and I think if auto detect doesn't work, use 
can set the audio standard, which it has in your region. Or it's better 
if users can see image but can hear audio?

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
  drivers/staging/tm6000/tm6000-stds.c |5 +
  1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-stds.c 
b/drivers/staging/tm6000/tm6000-stds.c
index da3e51b..a9e1921 100644
--- a/drivers/staging/tm6000/tm6000-stds.c
+++ b/drivers/staging/tm6000/tm6000-stds.c
@@ -22,12 +22,17 @@
  #include tm6000.h
  #include tm6000-regs.h

+static unsigned int tm6010_a_mode;
+module_param(tm6010_a_mode, int, 0644);
+MODULE_PARM_DESC(tm6010_a_mode, set sif audio mode (tm6010 only));
+
  struct tm6000_reg_settings {
unsigned char req;
unsigned char reg;
unsigned char value;
  };

+/* must be updated */
  enum tm6000_audio_std {
BG_NICAM,
BTSC,


--
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/5] tm6000: add dtv78 parameter

2011-04-20 Thread Stefan Ringel

Am 19.04.2011 23:22, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add dtv78 parameter

The dtv78 entry is a hack meant for card usage in Australia, that
speeds up channel detection there. Again, it should be specified
only when needed, and at per-board basis.
I have test and auto detect doesn't work right. That is also region 
specific staff and it's better to set outside. In other words in Germany 
it must set this param and in other country, which use only 7MHz or 8MHz 
it doesn't set (i.e. Australia).


Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
  drivers/staging/tm6000/tm6000-cards.c |   11 +--
  1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index eef58da..cf2e76c 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -65,6 +65,9 @@ static unsigned int xc2028_mts;
  module_param(xc2028_mts, int, 0644);
  MODULE_PARM_DESC(xc2028_mts, enable mts firmware (xc2028/3028 only));

+static unsigned int xc2028_dtv78;
+module_param(xc2028_dtv78, int, 0644);
+MODULE_PARM_DESC(xc2028_dtv78, enable dualband config (xc2028/3028 only));

  struct tm6000_board {
char*name;
@@ -687,8 +690,12 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
ctl.read_not_reliable = 0;
ctl.msleep = 10;
ctl.demod = XC3028_FE_ZARLINK456;
-   ctl.vhfbw7 = 1;
-   ctl.uhfbw8 = 1;
+
+   if (xc2028_dtv78) {
+   ctl.vhfbw7 = 1;
+   ctl.uhfbw8 = 1;
+   }
+
if (xc2028_mts)
ctl.mts = 1;


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


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


Re: [PATCH 1/5] tm6000: add mts parameter

2011-04-20 Thread Stefan Ringel

Am 20.04.2011 14:37, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 05:14, Stefan Ringel escreveu:

Am 19.04.2011 23:21, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add mts parameter

Stefan,

The MTS config depends on the specific board design (generally present on
mono NTSC cards). So, it should be inside the cards struct, and not
provided as an userspace parameter.

Mauro.

No. It wrong. I think edge board must work under all region and TV standards 
and if I set MTS, it doesn't work in Germany (PAL_BG and DVB-T). The best is to 
set outside region specific params.

Stefan,

Not all boards have MTS wired.

standard option that param is not auto.
MTS = 0 or not set means load firmware without MTS.
MTS = 1 means load firmware with MTS.
That means, if you MTS then add a param MTS=1.
Have you other method to detect norm BTSC and EIAJ and set it? I have 
not that.

Also, MTS works only for BTSC and EIAJ,
e. g. STD M/N. The SIF output works for all standards, depending of the audio
decoder capabilities, and if the SIF is properly wired. AFAIK, 
tm5600/6000/tm6010
is a worldwide decoder, so if SIF is wired, it should be capable of also 
decoding
BTSC, EIAJ and the other sound standards found elsewhere.

In other words, boards shipped outside NTSC or PAL-M Countries use SIF and 
supports
worldwide standards. however, most boards shipped in US with xc3028 have only
MTS wired and won't work outside NTSC/PAL-M/PAL-N area (America, Japan and a few
other places).


Which board is only MTS?

Which board is only no MTS?

Which board will both?

.

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
   drivers/staging/tm6000/tm6000-cards.c |7 +++
   1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 146c7e8..eef58da 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -61,6 +61,10 @@ module_param_array(card,  int, NULL, 0444);

   static unsigned long tm6000_devused;

+static unsigned int xc2028_mts;
+module_param(xc2028_mts, int, 0644);
+MODULE_PARM_DESC(xc2028_mts, enable mts firmware (xc2028/3028 only));
+

   struct tm6000_board {
   char*name;
@@ -685,6 +689,9 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
   ctl.demod = XC3028_FE_ZARLINK456;
   ctl.vhfbw7 = 1;
   ctl.uhfbw8 = 1;
+if (xc2028_mts)
+ctl.mts = 1;
+
   xc2028_cfg.tuner = TUNER_XC2028;
   xc2028_cfg.priv  =ctl;


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


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


Re: [PATCH 2/5] tm6000: add dtv78 parameter

2011-04-20 Thread Stefan Ringel

Am 20.04.2011 14:38, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 05:19, Stefan Ringel escreveu:

Am 19.04.2011 23:22, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add dtv78 parameter

The dtv78 entry is a hack meant for card usage in Australia, that
speeds up channel detection there. Again, it should be specified
only when needed, and at per-board basis.

I have test and auto detect doesn't work right. That is also region
specific staff and it's better to set outside. In other words in Germany
it must set this param and in other country, which use only 7MHz or 8MHz it 
doesn't set (i.e. Australia).

xc3028 has a logic to detect and work on both Australia and Europe.
If that logic is broken, we should fix it, not adding a manual
parameter for it.

It positively a bug. When I use lower band (7MHz, load DTV7 SCODE) it 
doesn't work, then I go in the high band (8MHz, load DTV78, DTV8 SCODE) 
and have channels and can watch TV. If I go now in the lower band (7MHz, 
don't reload SCODE) it works. This effect is for me a bug.

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
---
   drivers/staging/tm6000/tm6000-cards.c |   11 +--
   1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index eef58da..cf2e76c 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -65,6 +65,9 @@ static unsigned int xc2028_mts;
   module_param(xc2028_mts, int, 0644);
   MODULE_PARM_DESC(xc2028_mts, enable mts firmware (xc2028/3028 only));

+static unsigned int xc2028_dtv78;
+module_param(xc2028_dtv78, int, 0644);
+MODULE_PARM_DESC(xc2028_dtv78, enable dualband config (xc2028/3028 only));

   struct tm6000_board {
   char*name;
@@ -687,8 +690,12 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
   ctl.read_not_reliable = 0;
   ctl.msleep = 10;
   ctl.demod = XC3028_FE_ZARLINK456;
-ctl.vhfbw7 = 1;
-ctl.uhfbw8 = 1;
+
+if (xc2028_dtv78) {
+ctl.vhfbw7 = 1;
+ctl.uhfbw8 = 1;
+}
+
   if (xc2028_mts)
   ctl.mts = 1;


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


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


Re: [PATCH 1/5] tm6000: add mts parameter

2011-04-20 Thread Stefan Ringel

Am 20.04.2011 17:17, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 11:19, Stefan Ringel escreveu:

Am 20.04.2011 14:37, schrieb Mauro Carvalho Chehab:

Em 20-04-2011 05:14, Stefan Ringel escreveu:

Am 19.04.2011 23:21, schrieb Mauro Carvalho Chehab:

Em 04-04-2011 17:18, stefan.rin...@arcor.de escreveu:

From: Stefan Ringelstefan.rin...@arcor.de

add mts parameter

Stefan,

The MTS config depends on the specific board design (generally present on
mono NTSC cards). So, it should be inside the cards struct, and not
provided as an userspace parameter.

Mauro.

No. It wrong. I think edge board must work under all region and TV standards 
and if I set MTS, it doesn't work in Germany (PAL_BG and DVB-T). The best is to 
set outside region specific params.

Stefan,

Not all boards have MTS wired.

standard option that param is not auto.
MTS = 0 or not set means load firmware without MTS.
MTS = 1 means load firmware with MTS.
That means, if you MTS then add a param MTS=1.
Have you other method to detect norm BTSC and EIAJ and set it? I have not that.

Yes. Audio standard is related to video standard. So, it is easy to map on what
standards you have BTSC or EIAJ.

You could find that info listed on some places, like:
http://www.videouniversity.com/articles/world-wide-tv-standards
http://en.wikipedia.org/wiki/BTSC
and on good analog TV books.

Basically, BTSC/EIAJ applies only to PAL/M, PAL/N and NTSC/M. So, if the 
standard is
not PAL/MN, mts should always be equal to 0. We may have a patch at 
tuner-xc2028 for that.

If standard is V4L_STD_MN, we have:

For NTSC standards:
if standard == V4L2_STD_NTSC_M_KR, audio is A2 (Korea) and mts should 
be 0.
if standard == V4L2_STD_NTSC_M_JP, audio is EIAJ (Japan).
All the rest use BTSC (or are mono, but the BTSC decoder is designed to 
be
backward compatible with NTSC mono FM transmission).

For PAL:
V4L2_STD_PAL_M - always BTSC
V4L2_STD_PAL_Nc (only Argentina) - always BTSC
V4L2_STD_PAL_N  (Paraguay/Uruguay) - they also use FM for audio. I 
think it is also BTSC.

So, basically, assuming that some device could potentiallt have both SIF and 
MTS baseband
wired and that the audio decoder is not capable of decoding EIAJ/BTSC, it makes 
sense to
add something like this at tuner-xc2028:

/* MTS is only valid for M/N standars, except in Korea */
if (!(std  V4L2_STD_MN) || (std == V4L2_STD_NTSC_M_KR))
mts = 0;

and, for such device, specify xc2028 with mts = 1.

For devices that support only mts, it makes sense to change the supported 
standards to
just V4L2_STD_MN.

However, we cannot assume that (std  V4L2_STD_MN)  (std != 
V4L2_STD_NTSC_M_KR) is always
mts, as it will depend on how xc2028/xc3028 is wired to the bridge/audio demod.


Is that better to use no mts parameter and always mts = 0?

Also, MTS works only for BTSC and EIAJ,
e. g. STD M/N. The SIF output works for all standards, depending of the audio
decoder capabilities, and if the SIF is properly wired. AFAIK, 
tm5600/6000/tm6010
is a worldwide decoder, so if SIF is wired, it should be capable of also 
decoding
BTSC, EIAJ and the other sound standards found elsewhere.

In other words, boards shipped outside NTSC or PAL-M Countries use SIF and 
supports
worldwide standards. however, most boards shipped in US with xc3028 have only
MTS wired and won't work outside NTSC/PAL-M/PAL-N area (America, Japan and a few
other places).


Which board is only MTS?

Developers need to test, but, based on my experience with other xc3028/2028 
devices,
in general, the ones sold in US are only MTS.


Which board is only no MTS?
Which board will both?

Except if the tm5600/tm6000 SIF decoder for BTSC/EIAJ is broken, we don't
need to map the differences between only SIF and SIF + MTS.

All boards sold in Europe should support SIF, so mts should be 0 for them.

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


--
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] tm6000: add mts parameter

2011-04-04 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add mts parameter


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 146c7e8..eef58da 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -61,6 +61,10 @@ module_param_array(card,  int, NULL, 0444);
 
 static unsigned long tm6000_devused;
 
+static unsigned int xc2028_mts;
+module_param(xc2028_mts, int, 0644);
+MODULE_PARM_DESC(xc2028_mts, enable mts firmware (xc2028/3028 only));
+
 
 struct tm6000_board {
char*name;
@@ -685,6 +689,9 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
ctl.demod = XC3028_FE_ZARLINK456;
ctl.vhfbw7 = 1;
ctl.uhfbw8 = 1;
+   if (xc2028_mts)
+   ctl.mts = 1;
+
xc2028_cfg.tuner = TUNER_XC2028;
xc2028_cfg.priv  = ctl;
 
-- 
1.7.3.4

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


[PATCH 3/5] tm6000: add audio mode parameter

2011-04-04 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add audio mode parameter


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-stds.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-stds.c 
b/drivers/staging/tm6000/tm6000-stds.c
index da3e51b..a9e1921 100644
--- a/drivers/staging/tm6000/tm6000-stds.c
+++ b/drivers/staging/tm6000/tm6000-stds.c
@@ -22,12 +22,17 @@
 #include tm6000.h
 #include tm6000-regs.h
 
+static unsigned int tm6010_a_mode;
+module_param(tm6010_a_mode, int, 0644);
+MODULE_PARM_DESC(tm6010_a_mode, set sif audio mode (tm6010 only));
+
 struct tm6000_reg_settings {
unsigned char req;
unsigned char reg;
unsigned char value;
 };
 
+/* must be updated */
 enum tm6000_audio_std {
BG_NICAM,
BTSC,
-- 
1.7.3.4

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


[PATCH 2/5] tm6000: add dtv78 parameter

2011-04-04 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add dtv78 parameter


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index eef58da..cf2e76c 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -65,6 +65,9 @@ static unsigned int xc2028_mts;
 module_param(xc2028_mts, int, 0644);
 MODULE_PARM_DESC(xc2028_mts, enable mts firmware (xc2028/3028 only));
 
+static unsigned int xc2028_dtv78;
+module_param(xc2028_dtv78, int, 0644);
+MODULE_PARM_DESC(xc2028_dtv78, enable dualband config (xc2028/3028 only));
 
 struct tm6000_board {
char*name;
@@ -687,8 +690,12 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
ctl.read_not_reliable = 0;
ctl.msleep = 10;
ctl.demod = XC3028_FE_ZARLINK456;
-   ctl.vhfbw7 = 1;
-   ctl.uhfbw8 = 1;
+
+   if (xc2028_dtv78) {
+   ctl.vhfbw7 = 1;
+   ctl.uhfbw8 = 1;
+   }
+
if (xc2028_mts)
ctl.mts = 1;
 
-- 
1.7.3.4

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


[PATCH 5/5] tm6000: add CARDLIST

2011-04-04 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add CARDLIST


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/CARDLIST |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/tm6000/CARDLIST

diff --git a/drivers/staging/tm6000/CARDLIST b/drivers/staging/tm6000/CARDLIST
new file mode 100644
index 000..b5edce4
--- /dev/null
+++ b/drivers/staging/tm6000/CARDLIST
@@ -0,0 +1,16 @@
+  1 - Generic tm5600 board   (tm5600)  [6000:0001]
+  2 - Generic tm6000 board   (tm6000)  [6000:0001]
+  3 - Generic tm6010 board   (tm6010)  [6000:0002]
+  4 - 10Moons UT821  (tm5600)  [6000:0001]
+  5 - 10Moons UT330  (tm5600)
+  6 - ADSTech Dual TV(tm6000)  [06e1:f332]
+  7 - FreeCom and similar(tm6000)  [14aa:0620]
+  8 - ADSTech Mini Dual TV   (tm6000)  [06e1:b339]
+  9 - Hauppauge WinTV HVR-900H/USB2 Stick(tm6010)  
[2040:6600,2040:6601,2040:6610,2040:6611]
+ 10 - Beholder Wander(tm6010)  [6000:dec0]
+ 11 - Beholder Voyager   (tm6010)  [6000:dec1]
+ 12 - TerraTec Cinergy Hybrid XE/Cinergy Hybrid Stick (tm6010) 
[0ccd:0086,0ccd:00a5]
+ 13 - TwinHan TU501  (tm6010)  
[13d3:3240,13d3:3241,13d3:3243,13d3:3264]
+ 14 - Beholder Wander Lite   (tm6010)  [6000:dec2]
+ 15 - Beholder Voyager Lite  (tm6010)  [6000:dec3]
+
-- 
1.7.3.4

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


[PATCH 4/5] tm6000: add kernel module desciption

2011-04-04 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

add kernel module desciption


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/README |   40 
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/README b/drivers/staging/tm6000/README
index c340ebc..48e8d9b 100644
--- a/drivers/staging/tm6000/README
+++ b/drivers/staging/tm6000/README
@@ -1,3 +1,43 @@
+tm6000
+==
+
+You will only use analogue tv, you must additionally load tm6000_alsa. 
+You will only use digital tv, you must additionally load tm6000_dvb.
+For both must load tm6000, tm6000_alsa and tm6000_dvb.
+
+Kernel module parameter:
+
+tm6000
+--
+debug:
+i2c_debug:
+ir_debug:
+card : see CARDLIST
+enable_ir: enable infrared
+0 - disable
+1 - enable (default)
+tm6010_a_mode: set audio mode (tm6010 only)
+0 - auto
+1 - A2
+2 - NICAM
+3 - BTSC
+etc.
+xc2028_mts: enable mts firmware (xc2028/3028 only)
+0 - disable (default)
+1 - enable mts firmware
+xc2028_dtv78: set dualband (xc2028/3028 only)
+0 - singleband/auto (default) i.e. dtv7 only
+1 - dualband
+
+tm6000_alsa
+---
+debug: enable debug information
+
+tm6000_dvb
+--
+debug: enable debug information
+
+
 Todo:
- Fix the loss of some blocks when receiving the video URB's
- Add a lock at tm6000_read_write_usb() to prevent two simultaneous 
access to the
-- 
1.7.3.4

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


Re: [PATCH] tm6000: fix s-video input

2011-03-19 Thread Stefan Ringel

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Am 18.03.2011 01:08, schrieb Dmitri Belimov:
 Hi

 Add compatibility for composite and s-video inputs. Some TV cards
hasn't it.
 Fix S-Video input, the s-video cable has only video signals no audio.
Call the function of audio configure kill chroma in signal. only b/w video.

 Known bugs:
 after s-video the audio for radio didn't work, TV crashed hardly
 after composite TV crashed hardly too.

 P.S. After this patch I'll want to rework the procedure of configure
video. Now it has a lot of junk and dubles.


Why you use caps to define video input and audio with avideo and/or
aradio as flags? Better is , I think,  we use a struct for edge
virtual input (Video type (s-vhs, composite, tuner), video input pin
(video port a, video port b or both), video mode gpio, audio type ,
audio input pin (adc 1, adc 2 or sif)). If we are called
vidioc_s_input or radio_g_input setting input number. In tm6000_std.c
we can use this input number and the input struct with the same number
and can use all setting from here to set it.

Stefan Ringel


 diff --git a/drivers/staging/tm6000/tm6000-cards.c
b/drivers/staging/tm6000/tm6000-cards.c
 index 88144a1..146c7e8 100644
 --- a/drivers/staging/tm6000/tm6000-cards.c
 +++ b/drivers/staging/tm6000/tm6000-cards.c
 @@ -235,11 +235,13 @@ struct tm6000_board tm6000_boards[] = {
 .avideo = TM6000_AIP_SIF1,
 .aradio = TM6000_AIP_LINE1,
 .caps = {
 - .has_tuner = 1,
 - .has_dvb = 1,
 - .has_zl10353 = 1,
 - .has_eeprom = 1,
 - .has_remote = 1,
 + .has_tuner = 1,
 + .has_dvb = 1,
 + .has_zl10353 = 1,
 + .has_eeprom = 1,
 + .has_remote = 1,
 + .has_input_comp = 1,
 + .has_input_svid = 1,
 },
 .gpio = {
 .tuner_reset = TM6010_GPIO_0,
 @@ -255,11 +257,13 @@ struct tm6000_board tm6000_boards[] = {
 .avideo = TM6000_AIP_SIF1,
 .aradio = TM6000_AIP_LINE1,
 .caps = {
 - .has_tuner = 1,
 - .has_dvb = 0,
 - .has_zl10353 = 0,
 - .has_eeprom = 1,
 - .has_remote = 1,
 + .has_tuner = 1,
 + .has_dvb = 0,
 + .has_zl10353 = 0,
 + .has_eeprom = 1,
 + .has_remote = 1,
 + .has_input_comp = 1,
 + .has_input_svid = 1,
 },
 .gpio = {
 .tuner_reset = TM6010_GPIO_0,
 @@ -327,10 +331,13 @@ struct tm6000_board tm6000_boards[] = {
 .avideo = TM6000_AIP_SIF1,
 .aradio = TM6000_AIP_LINE1,
 .caps = {
 - .has_tuner = 1,
 - .has_dvb = 1,
 - .has_zl10353 = 1,
 - .has_eeprom = 1,
 + .has_tuner = 1,
 + .has_dvb = 1,
 + .has_zl10353 = 1,
 + .has_eeprom = 1,
 + .has_remote = 0,
 + .has_input_comp = 0,
 + .has_input_svid = 0,
 },
 .gpio = {
 .tuner_reset = TM6010_GPIO_0,
 @@ -346,10 +353,13 @@ struct tm6000_board tm6000_boards[] = {
 .avideo = TM6000_AIP_SIF1,
 .aradio = TM6000_AIP_LINE1,
 .caps = {
 - .has_tuner = 1,
 - .has_dvb = 0,
 - .has_zl10353 = 0,
 - .has_eeprom = 1,
 + .has_tuner = 1,
 + .has_dvb = 0,
 + .has_zl10353 = 0,
 + .has_eeprom = 1,
 + .has_remote = 0,
 + .has_input_comp = 0,
 + .has_input_svid = 0,
 },
 .gpio = {
 .tuner_reset = TM6010_GPIO_0,
 diff --git a/drivers/staging/tm6000/tm6000-stds.c
b/drivers/staging/tm6000/tm6000-stds.c
 index a4c07e5..da3e51b 100644
 --- a/drivers/staging/tm6000/tm6000-stds.c
 +++ b/drivers/staging/tm6000/tm6000-stds.c
 @@ -1161,8 +1161,6 @@ int tm6000_set_standard(struct tm6000_core *dev,
v4l2_std_id * norm)
 rc = tm6000_load_std(dev, svideo_stds[i].common,
 sizeof(svideo_stds[i].
 common));
 - tm6000_set_audio_std(dev, svideo_stds[i].audio_default_std);
 -
 goto ret;
 }
 }
 diff --git a/drivers/staging/tm6000/tm6000-video.c
b/drivers/staging/tm6000/tm6000-video.c
 index b550340..c80a316 100644
 --- a/drivers/staging/tm6000/tm6000-video.c
 +++ b/drivers/staging/tm6000/tm6000-video.c
 @@ -1080,18 +1080,27 @@ static int vidioc_s_std (struct file *file,
void *priv, v4l2_std_id *norm)
 static int vidioc_enum_input(struct file *file, void *priv,
 struct v4l2_input *inp)
 {
 + struct tm6000_fh *fh = priv;
 + struct tm6000_core *dev = fh-dev;
 +
 switch (inp-index) {
 case TM6000_INPUT_TV:
 inp-type = V4L2_INPUT_TYPE_TUNER;
 strcpy(inp-name, Television);
 break;
 case TM6000_INPUT_COMPOSITE:
 - inp-type = V4L2_INPUT_TYPE_CAMERA;
 - strcpy(inp-name, Composite);
 + if (dev-caps.has_input_comp) {
 + inp-type = V4L2_INPUT_TYPE_CAMERA;
 + strcpy(inp-name, Composite);
 + } else
 + return -EINVAL;
 break;
 case TM6000_INPUT_SVIDEO:
 - inp-type = V4L2_INPUT_TYPE_CAMERA;
 - strcpy(inp-name, S-Video);
 + if (dev-caps.has_input_svid) {
 + inp-type = V4L2_INPUT_TYPE_CAMERA;
 + strcpy(inp-name, S-Video);
 + } else
 + return -EINVAL;
 break;
 default:
 return -EINVAL;
 diff --git a/drivers/staging/tm6000/tm6000.h
b/drivers/staging/tm6000/tm6000.h
 index ccd120f..99ae50e 100644
 --- a/drivers/staging/tm6000/tm6000.h
 +++ b/drivers/staging/tm6000/tm6000.h
 @@ -129,6 +129,8 @@ struct tm6000_capabilities {
 unsigned int has_zl10353:1;
 unsigned int has_eeprom:1;
 unsigned int has_remote:1;
 + unsigned int has_input_comp:1;
 + unsigned int has_input_svid:1;
 };

 struct tm6000_dvb {

 Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov d.beli...@gmail.com

[PATCH] tm6000: relabeling any registers

2011-01-25 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

relabeling any registers


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-core.c |   64 -
 1 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 96aed4a..5162cd4 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -268,11 +268,11 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
tm6000_set_reg(dev, 
TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x80);
 
tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x88);
-   tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0x23);
+   tm6000_set_reg(dev, TM6000_REQ07_RDA_CLK_SEL, 0x23);
tm6000_set_reg(dev, TM6010_REQ07_RD1_ADDR_FOR_REQ1, 0xc0);
tm6000_set_reg(dev, TM6010_REQ07_RD2_ADDR_FOR_REQ2, 0xd8);
tm6000_set_reg(dev, TM6010_REQ07_RD6_ENDP_REQ1_REQ2, 0x06);
-   tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_PULSE_CNT0, 0x1f);
+   tm6000_set_reg(dev, TM6000_REQ07_RDF_PWDOWN_ACLK, 0x1f);
 
/* AP Software reset */
tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x08);
@@ -284,8 +284,8 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x00);
 
/* E3: Select input 0 - TV tuner */
-   tm6000_set_reg(dev, TM6010_REQ07_RE3_OUT_SEL1, 0x00);
-   tm6000_set_reg(dev, REQ_07_SET_GET_AVREG, 0xeb, 0x60);
+   tm6000_set_reg(dev, TM6000_REQ07_RE3_VADC_INP_LPF_SEL1, 0x00);
+   tm6000_set_reg(dev, TM6000_REQ07_REB_VADC_AADC_MODE, 0x60);
 
/* This controls input */
tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_2, 0x0);
@@ -344,21 +344,21 @@ int tm6000_init_digital_mode(struct tm6000_core *dev)
tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x08);
tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x00);
tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x01);
-   tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_PULSE_CNT0, 0x08);
-   tm6000_set_reg(dev, TM6010_REQ07_RE2_OUT_SEL2, 0x0c);
-   tm6000_set_reg(dev, TM6010_REQ07_RE8_TYPESEL_MOS_I2S, 0xff);
-   tm6000_set_reg(dev, REQ_07_SET_GET_AVREG, 0x00eb, 0xd8);
+   tm6000_set_reg(dev, TM6000_REQ07_RDF_PWDOWN_ACLK, 0x08);
+   tm6000_set_reg(dev, TM6000_REQ07_RE2_VADC_STATUS_CTL, 0x0c);
+   tm6000_set_reg(dev, TM6000_REQ07_RE8_VADC_PWDOWN_CTL, 0xff);
+   tm6000_set_reg(dev, TM6000_REQ07_REB_VADC_AADC_MODE, 0xd8);
tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x40);
tm6000_set_reg(dev, TM6010_REQ07_RC1_TRESHOLD, 0xd0);
tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x09);
-   tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0x37);
+   tm6000_set_reg(dev, TM6000_REQ07_RDA_CLK_SEL, 0x37);
tm6000_set_reg(dev, TM6010_REQ07_RD1_ADDR_FOR_REQ1, 0xd8);
tm6000_set_reg(dev, TM6010_REQ07_RD2_ADDR_FOR_REQ2, 0xc0);
tm6000_set_reg(dev, TM6010_REQ07_RD6_ENDP_REQ1_REQ2, 0x60);
 
-   tm6000_set_reg(dev, TM6010_REQ07_RE2_OUT_SEL2, 0x0c);
-   tm6000_set_reg(dev, TM6010_REQ07_RE8_TYPESEL_MOS_I2S, 0xff);
-   tm6000_set_reg(dev, REQ_07_SET_GET_AVREG, 0x00eb, 0x08);
+   tm6000_set_reg(dev, TM6000_REQ07_RE2_VADC_STATUS_CTL, 0x0c);
+   tm6000_set_reg(dev, TM6000_REQ07_RE8_VADC_PWDOWN_CTL, 0xff);
+   tm6000_set_reg(dev, TM6000_REQ07_REB_VADC_AADC_MODE, 0x08);
msleep(50);
 
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00);
@@ -388,18 +388,19 @@ struct reg_init {
 /* The meaning of those initializations are unknown */
 struct reg_init tm6000_init_tab[] = {
/* REG  VALUE */
-   { TM6010_REQ07_RD8_IR_PULSE_CNT0, 0x1f },
+   { TM6000_REQ07_RDF_PWDOWN_ACLK, 0x1f },
{ TM6010_REQ07_RFF_SOFT_RESET, 0x08 },
{ TM6010_REQ07_RFF_SOFT_RESET, 0x00 },
{ TM6010_REQ07_RD5_POWERSAVE, 0x4f },
-   { TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0x23 },
-   { TM6010_REQ07_RD8_IR_WAKEUP_ADD, 0x08 },
-   { TM6010_REQ07_RE2_OUT_SEL2, 0x00 },
-   { TM6010_REQ07_RE3_OUT_SEL1, 0x10 },
-   { TM6010_REQ07_RE5_REMOTE_WAKEUP, 0x00 },
-   { TM6010_REQ07_RE8_TYPESEL_MOS_I2S, 0x00 },
-   { REQ_07_SET_GET_AVREG,  0xeb, 0x64 },  /* 48000 bits/sample, 
external input */
-   { REQ_07_SET_GET_AVREG,  0xee, 0xc2 },
+   { TM6000_REQ07_RDA_CLK_SEL, 0x23 },
+   { TM6000_REQ07_RDB_OUT_SEL, 0x08 },
+   { TM6000_REQ07_RE2_VADC_STATUS_CTL, 0x00

Re: [PATCH] tm6000: add/rework reg.defines

2011-01-20 Thread Stefan Ringel
 TM6010_REQ08_R02_A_FIX_GAIN_CTRL 0x08, 0x02
 @@ -518,7 +575,7 @@ enum {
 #define TM6010_REQ08_R27_A_NOISE_AMP 0x08, 0x27
 #define TM6010_REQ08_R28_A_AUDIO_MODE_RES 0x08, 0x28

 -/* Define TM6000/TM6010 Video ADC registers */
 +/* Define TM6010 Video ADC registers */
 #define TM6010_REQ08_RE0_ADC_REF 0x08, 0xe0
 #define TM6010_REQ08_RE1_DAC_CLMP 0x08, 0xe1
 #define TM6010_REQ08_RE2_POWER_DOWN_CTRL1 0x08, 0xe2
 @@ -534,7 +591,7 @@ enum {
 #define TM6010_REQ08_REC_REVERSE_YC_CTRL 0x08, 0xec
 #define TM6010_REQ08_RED_GAIN_SEL 0x08, 0xed

 -/* Define TM6000/TM6010 Audio ADC registers */
 +/* Define TM6010 Audio ADC registers */
 #define TM6010_REQ08_RF0_DAUDIO_INPUT_CONFIG 0x08, 0xf0
 #define TM6010_REQ08_RF1_AADC_POWER_DOWN 0x08, 0xf1
 #define TM6010_REQ08_RF2_LEFT_CHANNEL_VOL 0x08, 0xf2

 Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov d.beli...@gmail.com


 With my best regards, Dmitry.
Dmitry, that are good news! And that anwers my questions. Now I think
we must separate the both chipsets in any points:

*  audio standards
*  video standards
* in tm6000-alsa the functions  _tm6000_start_audio_dma and
  _tm6000_stop_audio_dma
* in tm6000-input tm6000_ir_config
* in tm6000-core ?? init_analog_mode and init_digital_mode
* in tm6000-core tm6000_set_audio_bitrate

My rework in tm6000-video, isoc usb buffer and vbi device, I move this
into summer 2011!!

Stefan Ringel
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJNOIxEAAoJEAWtPFjxMvFG3LQIAKlIMVWYTTPA5RD45Sw4QBQH
I+yqhs89Qe7bKl+JjDrSiCG/ttRDtTy0+ksUFmicglntLmmtPVQnv59tIU9evQmn
Yt7n1XWHcq442+ySbQ/3fVLay1WG1eJ3UEsC7bkpT2hSUhmUf6zjSZ3ockIJfxEJ
geqFOy630vfwcKcS7KWgAJO8LKYQXcW8TLmkb3/D4W1G8o7zCKIH624Q5u+k1IGk
mmm5CiqO17FS/oK0pxTZAY8uqWr3DH3UUqiMR3GdGoivaOR+1QCdrrYZXkQxklai
zPQ6AYx/zPStZK8iUSSOHpVkfqHTgB3f6BSpsWhNGT3mgW8tTxnAz/MyECUiEms=
=Cxjk
-END PGP SIGNATURE-

--
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: Add Terratec Grabster support to tm6000

2011-01-04 Thread Stefan Ringel

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Am 04.01.2011 20:12, schrieb Holger Nelson:
 Hi,

 the following patch adds support for a Terratec Grabster AV MX150
 (and maybe other devices in the Grabster series). This device is an
 analog frame grabber device using a tm5600. This device doesn't have
 a tuner, so I changed the code to skip the tuner reset if neither
 has_tuner nor has_dvb is set.
it skip, if you has no tuner gpio defined. You does'nt need more. Work
the driver with input select (tv (conposite0), composite, s-vhs)?

 Holger

 diff -urpN --exclude='*~'
 linux-2.6.37-rc8/drivers/staging/tm6000/tm6000-cards.c
 linux-lts-backport-natty-2.6.37/drivers/staging/tm6000/tm6000-cards.c
 --- linux-2.6.37-rc8/drivers/staging/tm6000/tm6000-cards.c
 2010-12-29 02:05:48.0 +0100
 +++
 linux-lts-backport-natty-2.6.37/drivers/staging/tm6000/tm6000-cards.c
 2011-01-04 10:46:40.582497722 +0100
please use the lastest development kernel from
git://linuxtv.org/media_tree.git (http://linuxtv.org/git/media_tree.git).
 @@ -50,6 +50,7 @@
 #define TM6010_BOARD_BEHOLD_VOYAGER 11
 #define TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE 12
 #define TM6010_BOARD_TWINHAN_TU501 13
 +#define TM5600_BOARD_TERRATEC_GRABSTER 14

 #define TM6000_MAXBOARDS 16
 static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] =
 UNSET };
 @@ -303,6 +304,19 @@ struct tm6000_board tm6000_boards[] = {
 .dvb_led = TM6010_GPIO_5,
 .ir = TM6010_GPIO_0,
 },
 + },
 + [TM5600_BOARD_TERRATEC_GRABSTER] = {
 + .name = Terratec Grabster Series,
 + .type = TM5600,
 + .caps = {
 + .has_tuner = 0,
 + .has_dvb = 0,
 + .has_zl10353 = 0,
 + .has_eeprom = 0,
 + .has_remote = 0,
 + },
 + .gpio = {
 + },
 }
 };

 @@ -325,6 +339,7 @@ struct usb_device_id tm6000_id_table[] =
 { USB_DEVICE(0x13d3, 0x3241), .driver_info =
 TM6010_BOARD_TWINHAN_TU501 },
 { USB_DEVICE(0x13d3, 0x3243), .driver_info =
 TM6010_BOARD_TWINHAN_TU501 },
 { USB_DEVICE(0x13d3, 0x3264), .driver_info =
 TM6010_BOARD_TWINHAN_TU501 },
 + { USB_DEVICE(0x0ccd, 0x0079), .driver_info =
 TM5600_BOARD_TERRATEC_GRABSTER },
 { },
 };

 @@ -505,33 +520,35 @@ int tm6000_cards_setup(struct tm6000_cor
 * reset, just add the code at the board-specific part
 */

 - if (dev-gpio.tuner_reset) {
 - for (i = 0; i  2; i++) {
 - rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
 - dev-gpio.tuner_reset, 0x00);
 - if (rc  0) {
 - printk(KERN_ERR Error %i doing tuner reset\n, rc);
 - return rc;
 - }
 + if (dev-caps.has_tuner||dev-caps.has_dvb) {
this is bad, if you mean skip tuner reset. We use the line if
(dev-gpio.tuner_reset) to check the true tuner reset gpio - if no
gpio set, it skip reset - , and you has no defined a tuner gpio, so it
skip alone.
Why you added then this line?
 + if (dev-gpio.tuner_reset) {
 + for (i = 0; i  2; i++) {
 + rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
 + dev-gpio.tuner_reset, 0x00);
 + if (rc  0) {
 + printk(KERN_ERR Error %i doing tuner reset\n,
 rc);
 + return rc;
 + }

 - msleep(10); /* Just to be conservative */
 - rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
 - dev-gpio.tuner_reset, 0x01);
 - if (rc  0) {
 - printk(KERN_ERR Error %i doing tuner reset\n, rc);
 - return rc;
 - }
 - msleep(10);
 + msleep(10); /* Just to be conservative */
 + rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
 + dev-gpio.tuner_reset, 0x01);
 + if (rc  0) {
 + printk(KERN_ERR Error %i doing tuner reset\n,
 rc);
 + return rc;
 + }
 + msleep(10);

 - if (!i) {
 - rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
 - if (rc = 0)
 - printk(KERN_DEBUG board=0x%08x\n, rc);
 + if (!i) {
 + rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION,
 0, 0);
 + if (rc = 0)
 + printk(KERN_DEBUG board=0x%08x\n, rc);
 + }
 }
 + } else {
 + printk(KERN_ERR Tuner reset is not configured\n);
 + return -1;
 }
 - } else {
 - printk(KERN_ERR Tuner reset is not configured\n);
 - return -1;
 }

 msleep(50);
 --
 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

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJNI34QAAoJEAWtPFjxMvFGZwEH/R51EPEp2a/+DC34YkW+ywk6
aF6dJQLSq97hcvm2l6u7P7ku6XNAHqK/uqxXmM7trlyoK9RA1v4GWJV/aod+WmHo
jDocoiYG3ZWANco9aqdcutMCiVFlSKZRk2PsiJQwS+LAOabQGGe3pe6EIPQDmO5h
6TaVVLpzOyvGOHxYAy6PMI4ahJzkeJi1YORFN1a43UzV2GrViroT+BDWDKJk9QPk
Mg2diBj29gR0dwPTusqU0I6mwCqwV13incRlROMiKV1WIkaX1XW64qD0FKfMkSZA
edAljweR/S8ktqYGVrBFPvLUmFaX5zTruSgbRvskAKNO5CZO8isihSEJk9zEEbw=
=Z6bs
-END PGP SIGNATURE-

--
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: tm6000 and IR

2010-12-18 Thread Stefan Ringel

Am 18.12.2010 14:56, schrieb Andy Walls:

On Fri, 2010-12-17 at 22:24 -0200, Mauro Carvalho Chehab wrote:



Despite all discussions, we didn't reach an agreement yet.

There are some points to consider whatever solution we do:

1) A keycode table should be able to work with a generic raw decoder. So, on all
drivers, the bit order and the number of bits for a given protocol should be 
the same;

2) we should avoid to cause regressions on the existing definitions.

That's said, suggestions to meet the needs are welcome.

Just to throw out some ideas:

It appears to me that what you are looking at are communications
protocols with

a. a common Physical layer (PHY): a pulse distance protocol with a
common carrier freq, bit symbol encoding, leader pulse, trailer pulse,
and repeat sequence.  The number of bits (and the leader pulse length?)
is allowed to vary.

b. differing Data Link layers (LL): the data link address can be
different lengths and in different places; so can the data payload, so
can the checks on address and data payload.

For the end user, I would present each PHY/LL combination a different
protocol.  How the kernel implements it internally doesn't matter much.
It could be one raw decoder handling all the PHY/LL combinations that it
can, or one PHY decoder and several LL decoders.

The keytables should probably be working on cooked LL output from the
raw decoder.  I think that will handle a lot of the issues you mention.
The output from a LL could include

destination address (from the transmitted code),
source address (useful if different remotes can be detected),
payload length,
payload, and
maybe button up/down.

The LL could swallow the automatic repeats, since they are just part of
the button up/down scheme.

Aside from backward compatibility with existing keytables, I don't see
much point in a decoder trying to flip bits from the PHY layer around to
present a pseudo-PHY layer output.  Don't keytables get updated with the
kernel release anyway, or did they all move to userspace utils?


Anyway, just some thoughts.

Regards,
Andy



Thanks,
Mauro



TM5600, TM6000 and TM6010 IR
==

It give two ways to receive data

1. over the control pipe (ep0)
- polling must stop if it loads firmware
- data length are a byte (command)

2. over interrupt pipe (only TM6010)
- data length are two bytes (address  8 | command)

It has any control registers to configure IR (protocol ...)

TM6010_REQ07_RD8_IR
??, we use 0x2f

TM6010_REQ07_RD8_IR_BSIZE
??

TM6010_REQ07_RD8_IR_WAKEUP_SEL
command mask, I think,   we use here 0xff

TM6010_REQ07_RD8_IR_WAKEUP_ADD
address mask, we use 0xff

TM6010_REQ07_RD8_IR_LEADER1
TM6010_REQ07_RD8_IR_LEADER0
is a 16bit register
for NEC 0xaa30

TM6010_REQ07_RD8_IR_PULSE_CNT1
TM6010_REQ07_RD8_IR_PULSE_CNT0
is a 16bit register
for NEC 0x20d0


Stefan Ringel
--
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: tm6000 and IR

2010-12-16 Thread Stefan Ringel

Am 17.12.2010 02:46, schrieb Dmitri Belimov:

Hi Stefan


Am 16.12.2010 10:38, schrieb Dmitri Belimov:

Hi


I think your mean is wrong. Our IR remotes send extended NEC it is
4 bytes. We removed inverted 4 byte and now we have 3 bytes from
remotes. I think we must have full RCMAP with this 3 bytes from
remotes. And use this remotes with some different IR recievers
like some TV cards and LIRC-hardware and other. No need different
RCMAP for the same remotes to different IR recievers like now.

Your change doesn't work with my terratec remote control !!

I found what happens. Try my new patch.

What about NEC. Original NEC send
address (inverted address) key (inverted key)
this is realy old standart now all remotes use extended NEC
(adress high) (address low) key (inverted key)
The trident 5600/6000/6010 use old protocol but didn't test
inverted address byte.

I think much better discover really address value and write it to
keytable. For your remotes I add low address byte. This value is
incorrent but usefull for tm6000. When you found correct value
update keytable.


That is not acceptable. Have you forgotten what Mauro have written?
The Terratec rc map are use from other devices.

NO
The RC_MAP_NEC_TERRATEC_CINERGY_XS used only in tm6000 module.
My patch didn't kill support any other devices.

That is not true.

The best are only the
received data without additional data. And I think the Trident chip
send only compatibly data (send all extended data like standard
data). The device decoded the protocols not the driver.

You can't use this remotes with normal working IR receivers because this 
receivers
returned FULL scancodes. Need add one more keytable.

1. With my variant we have one keytable of remote and some workaround in device 
drivers.
 And can switch keytable and remotes on the fly (of course when keytable 
has really value and device driver has workaround)

2. With your variant we have some keytables for one remote for different IR 
recevers.
 Can't use incompatible keytable with other IR recievers. It is black magic 
for understanding what remotes is working with this hardware.

I think my variant much better.

With my best regards, Dmitry.


I think your variant is bad.

Then the function call usb_set_interface in tm6000_video, can
write for example:

stop_ir_pipe
usb_set_interface
start_ir_pipe

Ok, I'll try.

See dmesg. I was add function for start/stop interrupt urbs
All works well.

With my best regards, Dmitry.


--
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: tm6000 and IR

2010-12-15 Thread Stefan Ringel

Am 15.12.2010 08:46, schrieb Dmitri Belimov:

Hi Stefan


Am 14.12.2010 04:23, schrieb Dmitri Belimov:

Hi

What about my last patch?? This is OK or bad?
Our customers kick me every day with IR remotes.

With my best regards, Dmitry.

I think, you use the second variant, Dmitry.
Why you doesn't use this key map - RCMAP_BEHOLD.

No this remotes is different. RCMAP_BEHOLD has more buttons and some other 
scancodes.
People from linux community who was made this keymap and function for reading 
data from
IR decoder has error with scancode.
Our true address of scancode is
0x86 0x6B
They wrote
0x6B 0x86
Need fix some code of the saa7134-input and RCMAP_BEHOLD keytable.

RCMAP_BEHOLD_WANDER same as RCMAP_BEHOLD_COLUMBUS but
from IR decoder the saa7134 received only one byte of scancode.
Need rework saa7134-input too for get address and restore full scancodes for 
extended NEC full
scancodes.

I'll make it after some time.


The power led we can change to a separate function, right.

Ok


The nec initiation looks right and must adding code for tm5600/6000 (going
over message pipe).

I haven't USB stick with tm5600/6000 for test. Need people with this TV cards.


then add a todo line.

rc5 need some code for tm6010 (for tm5600/6000 are the hack).

I didn't touch this code because I haven't RC5 remotes and tm5600/6000


And the logic for your remote control is unused  for
the second variant, but ir-rc_type = rc_type are o.k.

but the line ir-rc_type = rc_type; are o.k.


I think your mean is wrong. Our IR remotes send extended NEC it is 4 bytes.
We removed inverted 4 byte and now we have 3 bytes from remotes. I think we
must have full RCMAP with this 3 bytes from remotes. And use this remotes with 
some
different IR recievers like some TV cards and LIRC-hardware and other.
No need different RCMAP for the same remotes to different IR recievers like now.

Your change doesn't work with my terratec remote control !!

If we use second variant I can't use RCMAP_BEHOLD because it has full 3 bytes 
scancodes.
As you wrote.

And if you use two bytes rc map table. We have add filter for address 
and commands to pass all. With an external tool can change the map ( 
ir_keytable). Why you will use more than two bytes.

Then the function call usb_set_interface in tm6000_video, can write
for example:

stop_ir_pipe
usb_set_interface
start_ir_pipe

Ok, I'll try.


I will adding vbi_buffer and device in the next, and isoc calculating
without video_buffer size.

I try add radio.

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


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


Re: tm6000 and IR

2010-12-14 Thread Stefan Ringel

Am 14.12.2010 04:23, schrieb Dmitri Belimov:

Hi

What about my last patch?? This is OK or bad?
Our customers kick me every day with IR remotes.

With my best regards, Dmitry.

I think, you use the second variant, Dmitry.
Why you doesn't use this key map - RCMAP_BEHOLD.
The power led we can change to a separate function, right. The nec 
initiation looks right and must adding code for tm5600/6000 (going over 
message pipe). rc5 need some code for tm6010 (for tm5600/6000 are the 
hack). And the logic for your remote control is unused  for the second 
variant, but ir-rc_type = rc_type are o.k..
Then the function call usb_set_interface in tm6000_video, can write for 
example:


stop_ir_pipe
usb_set_interface
start_ir_pipe

I will adding vbi_buffer and device in the next, and isoc calculating 
without video_buffer size.


Stefan Ringel
--
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: tm6000 and IR

2010-12-08 Thread Stefan Ringel

Am 08.12.2010 04:55, schrieb Dmitri Belimov:

Hi Stefan


Am 06.12.2010 11:02, schrieb Dmitri Belimov:

Thank you. When I switched to this branch modules is not crash
when USB removed. But disable IR over interrupt after start
video/radio

With my best regards, Dmitry.


changing the interface configuration by initiation isoc urb can
deactivating the interrupt in endpoint

We configure USB stick when modules is loaded

/* Selects the proper interface */
   rc = usb_set_interface(usbdev, 0, 1);

The USB controller reserved one half of bandwith for ISOC. Other
device on USB can work slowely. Much better:

when module loaded
/* Selects the proper interface */
   rc = usb_set_interface(usbdev, 0, 2);

when start video/audio/TS
/* Selects the proper interface */
   rc = usb_set_interface(usbdev, 0, 1);

when stop video/audio/TS
/* Selects the proper interface */
   rc = usb_set_interface(usbdev, 0, 2);

And restart int pipe after each selection. What you mean about it?
Dynamic bandwith utilization.

With my best regards, Dmitry.


No. Here (tm6000_prepare_isoc) is that problem. It resetted the
active interrupt urb pipe and interrupt urb  must reinitialize after
call usb_set_interface, I think.

static int tm6000_prepare_isoc(struct tm6000_core *dev, unsigned int
framesize)
{
  struct tm6000_dmaqueue *dma_q =dev-vidq;
  int i, j, sb_size, pipe, size, max_packets, num_bufs = 8;
  struct urb *urb;

  /* De-allocates all pending stuff */
  tm6000_uninit_isoc(dev);

  usb_set_interface(dev-udev,
dev-isoc_in.bInterfaceNumber,
dev-isoc_in.bAlternateSetting);


  pipe = usb_rcvisocpipe(dev-udev,
 dev-isoc_in.endp-desc.bEndpointAddress
 USB_ENDPOINT_NUMBER_MASK);

  size = usb_maxpacket(dev-udev, pipe, usb_pipeout(pipe));

Can you test without call usb_set_interface?

Of course. It works. The interrupt pipe is a live after start/stop watch TV.
Are you make a patch for this?


Mauro, what do you think about this?

Other point is IR remotes. The tm6010 may be tm5600/tm6000 too returned only
two right bytes when received extended nec.

Our remotes was send:

0x86 0x6B 0x00 0xFF

tm6010 return after decode:

0x86 0x00 0x86 0x00

If we use full lenght of key for ir_table

1. need add some code for restore losing byte.

if (ir_table.name == OUR_TV_CARD_IR_TABLE)
  return to ir core byte1 0x6B byte0

Or

2. use only high byte of address for filtering a key.

I'll try number 2 as more robust.

What you mean about it?


second once are better, easier and need small code.

Stefan Ringel
--
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: tm6000 and IR

2010-12-07 Thread Stefan Ringel

Am 06.12.2010 11:02, schrieb Dmitri Belimov:


Thank you. When I switched to this branch modules is not crash when
USB removed. But disable IR over interrupt after start video/radio

With my best regards, Dmitry.


changing the interface configuration by initiation isoc urb can
deactivating the interrupt in endpoint

We configure USB stick when modules is loaded

/* Selects the proper interface */
  rc = usb_set_interface(usbdev, 0, 1);

The USB controller reserved one half of bandwith for ISOC. Other device on USB 
can work slowely.
Much better:

when module loaded
/* Selects the proper interface */
  rc = usb_set_interface(usbdev, 0, 2);

when start video/audio/TS
/* Selects the proper interface */
  rc = usb_set_interface(usbdev, 0, 1);

when stop video/audio/TS
/* Selects the proper interface */
  rc = usb_set_interface(usbdev, 0, 2);

And restart int pipe after each selection. What you mean about it?
Dynamic bandwith utilization.

With my best regards, Dmitry.

No. Here (tm6000_prepare_isoc) is that problem. It resetted the active 
interrupt urb pipe and interrupt urb  must reinitialize after call 
usb_set_interface, I think.


static int tm6000_prepare_isoc(struct tm6000_core *dev, unsigned int 
framesize)

{
struct tm6000_dmaqueue *dma_q = dev-vidq;
int i, j, sb_size, pipe, size, max_packets, num_bufs = 8;
struct urb *urb;

/* De-allocates all pending stuff */
tm6000_uninit_isoc(dev);

usb_set_interface(dev-udev,
  dev-isoc_in.bInterfaceNumber,
  dev-isoc_in.bAlternateSetting);


pipe = usb_rcvisocpipe(dev-udev,
   dev-isoc_in.endp-desc.bEndpointAddress 
   USB_ENDPOINT_NUMBER_MASK);

size = usb_maxpacket(dev-udev, pipe, usb_pipeout(pipe));

Can you test without call usb_set_interface?

Stefan Ringel

--
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: tm6000 and IR

2010-12-05 Thread Stefan Ringel
 received 01 86 01 86
[  170.711642] tm6000_ir_urb_received start
[  170.711649] int_in ir urb received 02 86 02 86
[  171.082425] tm6000_ir_urb_received start
[  171.082429] int_in ir urb received 00 86 00 86

start watch a TV
[  214.446038] tm6000: open called (dev=video0)
[  216.265019] xc5000: waiting for firmware upload
(dvb-fe-xc5000-1.6.114.fw)... [  216.267055] xc5000: firmware read
12401 bytes. [  216.267057] xc5000: firmware uploading...
[  222.942009] xc5000: firmware upload complete...

try press a key
[  224.137976] tm6000_ir_urb_received start
[  224.137981] not ready
[  224.138014] usb 1-1: unlink qh0-00ff/f4fa0b00 start 0 [1/0 us]
[  224.138177] usb 1-1: link qh0-00ff/f4fa0b00 start 0 [1/0 us]
[  224.138458] usb 1-1: unlink qh0-00ff/f4fa0b00 start 0 [1/0 us]
[  224.139225] tm6000_ir_urb_received start
[  224.139225] not ready

IR over int die here
[  224.139225] ehci_hcd :00:1d.7: shutdown urb f4ee58c0
ep3in-intr [  224.155239] tm6000 tm6000_irq_callback :urb resubmit
failed (error=-1) [  224.160990] tm6000 tm6000_irq_callback :urb
resubmit failed (error=-1)

With my best regards, Dmitry.


I attched my diffs.
This file has some debug junk.
With my best regards, Dmitry.


Stefan Ringel

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


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


Re: tm6000 and IR

2010-12-01 Thread Stefan Ringel

Am 01.12.2010 06:47, schrieb Dmitri Belimov:

Hi Stefan


Am 29.11.2010 09:44, schrieb Dmitri Belimov:

Hi

I try add IR for our TV cards.
After my some changes IR is working. But when I remove USB stick
from USB port

What has you change?

1. Add vendor-specific init code for IR.
2. Add vendor-specific key filter for IR.
3. Add some code for show IR activity via power led
4. Move TV card defines to header file.

work it also with TM6010_REQ07_RD8_IR_WAKEUP_SEL = 0xff and 
TM6010_REQ07_RD8_IR_WAKEUP_ADD = 0xff? I think, this both values are 
setting the remote control address mask and so. And it is not good if we 
set individual remote controls (better one setting for all).



Has it received keys?

Yes. I received keys, and can control any programm via lirc


Which protocol you it?

Our remotes has NEC protocol.

Damn, has you values for rc5 protocols, any idea?

As
I wrote that I haven't the right value for rc5 protocol, and nec
protocol works, that I have tested.

IR over int works well. But I found two main problems:
1. crash after remove

has you test it with lastest git branch (for_v2.6.38)?

2. disable IR after start video/radio. Try solve this problem right now.

sorry, I don't understand that.

I attched my diffs.
This file has some debug junk.
With my best regards, Dmitry.


Stefan Ringel
--
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: tm6000 and IR

2010-12-01 Thread Stefan Ringel

Am 01.12.2010 17:41, schrieb Stefan Ringel:

Am 01.12.2010 06:47, schrieb Dmitri Belimov:

Hi Stefan


Am 29.11.2010 09:44, schrieb Dmitri Belimov:

Hi

I try add IR for our TV cards.
After my some changes IR is working. But when I remove USB stick
from USB port

What has you change?

1. Add vendor-specific init code for IR.
2. Add vendor-specific key filter for IR.

I forgot, init code and key filter are implemented in the init tab.

Stefan Ringel

3. Add some code for show IR activity via power led
4. Move TV card defines to header file.

work it also with TM6010_REQ07_RD8_IR_WAKEUP_SEL = 0xff and 
TM6010_REQ07_RD8_IR_WAKEUP_ADD = 0xff? I think, this both values are 
setting the remote control address mask and so. And it is not good if 
we set individual remote controls (better one setting for all).



Has it received keys?

Yes. I received keys, and can control any programm via lirc


Which protocol you it?

Our remotes has NEC protocol.

Damn, has you values for rc5 protocols, any idea?

As
I wrote that I haven't the right value for rc5 protocol, and nec
protocol works, that I have tested.

IR over int works well. But I found two main problems:
1. crash after remove

has you test it with lastest git branch (for_v2.6.38)?

2. disable IR after start video/radio. Try solve this problem right now.

sorry, I don't understand that.

I attched my diffs.
This file has some debug junk.
With my best regards, Dmitry.


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


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


Re: tm6000 and IR

2010-11-30 Thread Stefan Ringel

Am 29.11.2010 09:44, schrieb Dmitri Belimov:

Hi

I try add IR for our TV cards.
After my some changes IR is working. But when I remove USB stick from USB port
What has you change? Has it received keys? Which protocol you it? As I 
wrote that I haven't the right value for rc5 protocol, and nec protocol 
works, that I have tested.


Stefan Ringel

modules crashed with dmesg

[  133.881750] tm6000: New video device @ 480 Mbps (6000:dec0, ifnum 0)
[  133.881759] tm6000: Found Beholder Wander DVB-T/TV/FM USB2.0
[  134.343012] Board version = 0x67980bf4
[  134.484013] board=0x67980bf4
[  134.575011] tm6000 #0: i2c eeprom 00: 42 59 54 45 12 01 00 02 00 00 00 40 00 
60 c0 de  byte...@.`..
[  134.687012] tm6000 #0: i2c eeprom 10: 01 00 10 20 40 01 28 03 42 00 65 00 68 
00 6f 00  ... @.(.B.e.h.o.
[  134.799014] tm6000 #0: i2c eeprom 20: 6c 00 64 00 65 00 72 00 20 00 49 00 6e 
00 74 00  l.d.e.r. .I.n.t.
[  134.911012] tm6000 #0: i2c eeprom 30: 6c 00 2e 00 20 00 4c 00 74 00 64 00 2e 
00 ff ff  l... .L.t.d.
[  135.023013] tm6000 #0: i2c eeprom 40: 22 03 42 00 65 00 68 00 6f 00 6c 00 64 00 
20 00  .B.e.h.o.l.d. .
[  135.135015] tm6000 #0: i2c eeprom 50: 54 00 56 00 20 00 57 00 61 00 6e 00 64 
00 65 00  T.V. .W.a.n.d.e.
[  135.247014] tm6000 #0: i2c eeprom 60: 72 00 ff ff ff ff ff ff ff ff 1a 03 56 
00 69 00  r...V.i.
[  135.359013] tm6000 #0: i2c eeprom 70: 64 00 65 00 6f 00 43 00 61 00 70 00 74 
00 75 00  d.e.o.C.a.p.t.u.
[  135.471013] tm6000 #0: i2c eeprom 80: 72 00 65 00 ff ff ff ff ff ff ff ff ff 
ff ff ff  r.e.
[  135.583010] tm6000 #0: i2c eeprom 90: ff ff ff ff 16 03 30 00 30 00 30 00 30 
00 30 00  ..0.0.0.0.0.
[  135.695010] tm6000 #0: i2c eeprom a0: 30 00 32 00 30 00 34 00 31 00 ff ff ff 
ff ff ff  0.2.0.4.1...
[  135.807012] tm6000 #0: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff  
[  135.919011] tm6000 #0: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff  
[  136.031014] tm6000 #0: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff  
[  136.143010] tm6000 #0: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff  
[  136.255014] tm6000 #0: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff  
[  136.360015]   
[  136.362337] tuner 7-0061: chip found @ 0xc2 (tm6000 #0)
[  136.421801] xc5000 7-0061: creating new instance
[  136.450015] xc5000: Successfully identified at address 0x61
[  136.450019] xc5000: Firmware has not been loaded previously
[  136.450025] tuner 7-0061: Tuner frontend module has no way to set config
[  136.504012] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
[  136.564545] xc5000: firmware read 12401 bytes.
[  136.564549] xc5000: firmware uploading...
[  143.241011] xc5000: firmware upload complete...
[  144.670093] Trident TVMaster TM5600/TM6000/TM6010 USB2 board (Load status: 0)
[  144.671201] tm6000: open called (dev=video0)
[  144.825125] usb 1-1: link qh0-00ff/f6762340 start 0 [1/0 us]
[  144.888012] Registered IR keymap rc-behold-columbus
[  144.888159] input: tm5600/60x0 IR (tm6000 #0) as /class/input/input5
[  144.888217] rc0: tm5600/60x0 IR (tm6000 #0) as /class/rc/rc0
[  145.044067] usbcore: registered new interface driver tm6000
[  145.882658] tm6000: open called (dev=video0)
[  156.860296] hub 1-0:1.0: state 7 ports 8 chg  evt 0002
[  156.860310] ehci_hcd :00:1d.7: GetStatus port 1 status 001002 POWER 
sig=se0 CSC
[  156.860323] hub 1-0:1.0: port 1, status 0100, change 0001, 12 Mb/s
[  156.860328] usb 1-1: USB disconnect, address 2
[  156.860332] usb 1-1: unregistering device
[  156.860336] usb 1-1: usb_disable_device nuking all URBs
[  156.860370] usb 1-1: unlink qh0-00ff/f6762340 start 0 [1/0 us]
[  156.860432] tm6000_ir_urb_received start
[  156.860435] not ready
[  156.860440] ehci_hcd :00:1d.7: shutdown urb f4900cc0 ep3in-intr
[  156.860446] usb 1-1: unregistering interface 1-1:1.0
[  156.860492] tm6000: disconnecting tm6000 #0
[  156.860494] befor if (!ir)
[  156.860495] befor ir_input_unregister(ir-input-input_dev);
[  156.862220] BUG: unable to handle kernel NULL pointer dereference at 00f0
[  156.862223] IP: [f80370a9] ir_close+0x12/0x20 [ir_core]
[  156.862230] *pde = 
[  156.862232] Oops:  [#1] PREEMPT SMP
[  156.862235] last sysfs file: /sys/class/video4linux/video0/uevent
[  156.862238] Modules linked in: rc_behold_columbus xc5000 tuner tm6000(C) 
v4l2_common ir_lirc_codec videodev lirc_dev ir_sony_decoder v4l1_compat 
videobuf_vmalloc ir_jvc_decoder videobuf_core ir_rc6_decoder ir_rc5_decoder 
ir_nec_decoder ir_common ir_core ppdev lp ipv6 nls_utf8 ntfs dm_snapshot 
dm_mirror dm_region_hash dm_log dm_mod sha1_generic arc4 ecb ppp_mppe 
ppp_generic slhc loop nvidia(P) snd_hda_codec_realtek snd_hda_intel 
snd_hda_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss 
snd_seq_midi snd_rawmidi

Re: HVR900H : IR Remote Control

2010-11-16 Thread Stefan Ringel

 Am 16.11.2010 21:42, schrieb Massis Sirapian:

Le 16/11/2010 21:32, Stefan Ringel a écrit :

Am 16.11.2010 21:26, schrieb Massis Sirapian:

Le 15/11/2010 22:08, Stefan Ringel a écrit :

Am 15.11.2010 22:00, schrieb Massis Sirapian:

Le 15/11/2010 18:43, Stefan Ringel a écrit :

Am 15.11.2010 10:15, schrieb Richard Zidlicky:

On Sun, Nov 14, 2010 at 08:22:44PM +0100, Massis Sirapian wrote:


Thanks Stefan. I've checked the /drivers/media/IR/keymaps of the
kernel
source directory, but nothing seems to fit my remote, which is a
DSR-0012 :
http://lirc.sourceforge.net/remotes/hauppauge/DSR-0112.jpg.

FYI, this remote is identical to that shipped with (most?) Haupauge
Ministicks
and the codes reportedly match the rc-dib0700-rc5.c keymap. 
However I

have not figured
out how to make the userspace work with the new ir-code yet.

Richard
With my terratec cinergy hybrid xe (equal yours hvr900h) I have 
this:


localhost:/usr/src/src/tm6000_alsa/utils/v4l-utils # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event5) with:
Driver tm6000, table rc-nec-terratec-cinergy-xs
Supported protocols: NEC RC-5 Enabled protocols: NEC

I can change outside the keytable.



Just loading tm6000-dvb, I have this :
[ 253.829422] IR NEC protocol handler initialized
[ 253.846608] IR RC5(x) protocol handler initialized
[ 253.883882] tm6000: module is from the staging directory, the
quality is unknown, you have been warned.
[ 253.886611] tm6000 v4l2 driver version 0.0.2 loaded
[ 253.887558] tm6000: alt 0, interface 0, class 255
[ 253.887574] tm6000: alt 0, interface 0, class 255
[ 253.887575] tm6000: Bulk IN endpoint: 0x82 (max size=512 bytes)
[ 253.887577] tm6000: alt 0, interface 0, class 255
[ 253.887578] tm6000: alt 1, interface 0, class 255
[ 253.887579] tm6000: ISOC IN endpoint: 0x81 (max size=3072 bytes)
[ 253.887580] tm6000: alt 1, interface 0, class 255
[ 253.887581] tm6000: alt 1, interface 0, class 255
[ 253.887582] tm6000: INT IN endpoint: 0x83 (max size=4 bytes)
[ 253.887583] tm6000: alt 2, interface 0, class 255
[ 253.887584] tm6000: alt 2, interface 0, class 255
[ 253.887586] tm6000: alt 2, interface 0, class 255
[ 253.887587] tm6000: alt 3, interface 0, class 255
[ 253.887588] tm6000: alt 3, interface 0, class 255
[ 253.887589] tm6000: alt 3, interface 0, class 255
[ 253.887590] tm6000: New video device @ 480 Mbps (2040:6600, 
ifnum 0)
[ 253.887591] tm6000: Found Hauppauge WinTV HVR-900H / WinTV 
USB2-Stick

[ 253.48] IR RC6 protocol handler initialized
[ 253.890209] IR JVC protocol handler initialized
[ 253.891515] IR Sony protocol handler initialized
[ 253.893815] lirc_dev: IR Remote Control driver registered, major 
250

[ 253.894722] IR LIRC bridge handler initialized
[ 254.806122] Board version = 0x67980bf4
[ 255.197098] board=0x67980bf4
[ 255.320786] tm6000 #0: i2c eeprom 00: 01 59 54 45 12 01 00 02 00 00
00 40 40 20 00 66 .YTE...@@ .f
[ 255.512277] tm6000 #0: i2c eeprom 10: 69 00 10 20 40 01 02 03 48 00
79 00 62 00 72 00 i.. @...H.y.b.r.
[ 255.703783] tm6000 #0: i2c eeprom 20: ff 00 64 ff ff ff ff ff ff ff
ff ff ff ff ff ff ..d.
[ 255.895281] tm6000 #0: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 256.086786] tm6000 #0: i2c eeprom 40: 10 03 48 00 56 00 52 00 39 00
30 00 30 00 48 00 ..H.V.R.9.0.0.H.
[ 256.278289] tm6000 #0: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 256.469783] tm6000 #0: i2c eeprom 60: 30 ff ff ff 0f ff ff ff ff ff
0a 03 32 00 2e 00 0...2...
[ 256.661287] tm6000 #0: i2c eeprom 70: 3f 00 ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ?...
[ 256.852786] tm6000 #0: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 257.044307] tm6000 #0: i2c eeprom 90: 30 ff ff ff 16 03 34 00 30 00
33 00 32 00 32 00 0.4.0.3.2.2.
[ 257.235798] tm6000 #0: i2c eeprom a0: 33 00 36 00 39 00 30 00 35 00
00 00 77 00 ff ff 3.6.9.0.5...w...
[ 257.427295] tm6000 #0: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 257.618794] tm6000 #0: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 257.810303] tm6000 #0: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 258.001810] tm6000 #0: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 258.193291] tm6000 #0: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff 
[ 258.372825] 
[ 258.378849] tuner 4-0061: chip found @ 0xc2 (tm6000 #0)
[ 258.400777] xc2028 4-0061: creating new instance
[ 258.400779] xc2028 4-0061: type set to XCeive xc2028/xc3028 tuner
[ 258.400781] Setting firmware parameters for xc2028
[ 258.427221] xc2028 4-0061: Loading 81 firmware images from
xc3028L-v36.fw, type: xc2028 firmware, ver 3.6
[ 258.668063] xc2028 4-0061: Loading firmware for type=BASE (1), id
.
[ 333.245767] xc2028 4-0061: Loading firmware for type=(0), id

Re: HVR900H : IR Remote Control

2010-11-15 Thread Stefan Ringel

 Am 15.11.2010 10:15, schrieb Richard Zidlicky:

On Sun, Nov 14, 2010 at 08:22:44PM +0100, Massis Sirapian wrote:


Thanks Stefan. I've checked the /drivers/media/IR/keymaps of the kernel
source directory, but nothing seems to fit my remote, which is a
DSR-0012 : http://lirc.sourceforge.net/remotes/hauppauge/DSR-0112.jpg.

FYI, this remote is identical to that shipped with (most?) Haupauge Ministicks
and the codes reportedly match the rc-dib0700-rc5.c keymap. However I have not 
figured
out how to make the userspace work with the new ir-code yet.

Richard

With my terratec cinergy hybrid xe (equal yours hvr900h) I have this:

localhost:/usr/src/src/tm6000_alsa/utils/v4l-utils # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event5) with:
Driver tm6000, table rc-nec-terratec-cinergy-xs
Supported protocols: NEC RC-5   Enabled protocols: NEC

I can change outside the keytable.

--
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: HVR900H : IR Remote Control

2010-11-15 Thread Stefan Ringel

 Am 15.11.2010 22:00, schrieb Massis Sirapian:

Le 15/11/2010 18:43, Stefan Ringel a écrit :

Am 15.11.2010 10:15, schrieb Richard Zidlicky:

On Sun, Nov 14, 2010 at 08:22:44PM +0100, Massis Sirapian wrote:

Thanks Stefan. I've checked the /drivers/media/IR/keymaps of the 
kernel

source directory, but nothing seems to fit my remote, which is a
DSR-0012 : http://lirc.sourceforge.net/remotes/hauppauge/DSR-0112.jpg.

FYI, this remote is identical to that shipped with (most?) Haupauge
Ministicks
and the codes reportedly match the rc-dib0700-rc5.c keymap. However I
have not figured
out how to make the userspace work with the new ir-code yet.

Richard

With my terratec cinergy hybrid xe (equal yours hvr900h) I have this:

localhost:/usr/src/src/tm6000_alsa/utils/v4l-utils # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event5) with:
Driver tm6000, table rc-nec-terratec-cinergy-xs
Supported protocols: NEC RC-5 Enabled protocols: NEC

I can change outside the keytable.



Just loading tm6000-dvb, I have this :
[  253.829422] IR NEC protocol handler initialized
[  253.846608] IR RC5(x) protocol handler initialized
[  253.883882] tm6000: module is from the staging directory, the 
quality is unknown, you have been warned.

[  253.886611] tm6000 v4l2 driver version 0.0.2 loaded
[  253.887558] tm6000: alt 0, interface 0, class 255
[  253.887574] tm6000: alt 0, interface 0, class 255
[  253.887575] tm6000: Bulk IN endpoint: 0x82 (max size=512 bytes)
[  253.887577] tm6000: alt 0, interface 0, class 255
[  253.887578] tm6000: alt 1, interface 0, class 255
[  253.887579] tm6000: ISOC IN endpoint: 0x81 (max size=3072 bytes)
[  253.887580] tm6000: alt 1, interface 0, class 255
[  253.887581] tm6000: alt 1, interface 0, class 255
[  253.887582] tm6000: INT IN endpoint: 0x83 (max size=4 bytes)
[  253.887583] tm6000: alt 2, interface 0, class 255
[  253.887584] tm6000: alt 2, interface 0, class 255
[  253.887586] tm6000: alt 2, interface 0, class 255
[  253.887587] tm6000: alt 3, interface 0, class 255
[  253.887588] tm6000: alt 3, interface 0, class 255
[  253.887589] tm6000: alt 3, interface 0, class 255
[  253.887590] tm6000: New video device @ 480 Mbps (2040:6600, ifnum 0)
[  253.887591] tm6000: Found Hauppauge WinTV HVR-900H / WinTV USB2-Stick
[  253.48] IR RC6 protocol handler initialized
[  253.890209] IR JVC protocol handler initialized
[  253.891515] IR Sony protocol handler initialized
[  253.893815] lirc_dev: IR Remote Control driver registered, major 250
[  253.894722] IR LIRC bridge handler initialized
[  254.806122] Board version = 0x67980bf4
[  255.197098] board=0x67980bf4
[  255.320786] tm6000 #0: i2c eeprom 00: 01 59 54 45 12 01 00 02 00 00 
00 40 40 20 00 66  .YTE...@@ .f
[  255.512277] tm6000 #0: i2c eeprom 10: 69 00 10 20 40 01 02 03 48 00 
79 00 62 00 72 00  i.. @...H.y.b.r.
[  255.703783] tm6000 #0: i2c eeprom 20: ff 00 64 ff ff ff ff ff ff ff 
ff ff ff ff ff ff  ..d.
[  255.895281] tm6000 #0: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  
[  256.086786] tm6000 #0: i2c eeprom 40: 10 03 48 00 56 00 52 00 39 00 
30 00 30 00 48 00  ..H.V.R.9.0.0.H.
[  256.278289] tm6000 #0: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  
[  256.469783] tm6000 #0: i2c eeprom 60: 30 ff ff ff 0f ff ff ff ff ff 
0a 03 32 00 2e 00  0...2...
[  256.661287] tm6000 #0: i2c eeprom 70: 3f 00 ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  ?...
[  256.852786] tm6000 #0: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  
[  257.044307] tm6000 #0: i2c eeprom 90: 30 ff ff ff 16 03 34 00 30 00 
33 00 32 00 32 00  0.4.0.3.2.2.
[  257.235798] tm6000 #0: i2c eeprom a0: 33 00 36 00 39 00 30 00 35 00 
00 00 77 00 ff ff  3.6.9.0.5...w...
[  257.427295] tm6000 #0: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  
[  257.618794] tm6000 #0: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  
[  257.810303] tm6000 #0: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  
[  258.001810] tm6000 #0: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  
[  258.193291] tm6000 #0: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff  

[  258.372825]   
[  258.378849] tuner 4-0061: chip found @ 0xc2 (tm6000 #0)
[  258.400777] xc2028 4-0061: creating new instance
[  258.400779] xc2028 4-0061: type set to XCeive xc2028/xc3028 tuner
[  258.400781] Setting firmware parameters for xc2028
[  258.427221] xc2028 4-0061: Loading 81 firmware images from 
xc3028L-v36.fw, type: xc2028 firmware, ver 3.6
[  258.668063] xc2028 4-0061: Loading firmware for type=BASE (1), id 
.
[  333.245767] xc2028 4-0061: Loading firmware for type=(0), id 
b700.

[  334.510473] SCODE (2000), id b700:
[  334.510476] xc2028 4-0061: Loading SCODE

Re: HVR900H : IR Remote Control

2010-11-14 Thread Stefan Ringel

 Am 14.11.2010 15:37, schrieb Massis Sirapian:

Hi,

I have discovered, upgrading my old WinTV PCI Hauppauge card to a 
HVR-900H USB stick how much the IR userspace has evolved.


I'm using the 2.6.36 kernel provided by Debian in its experimental 
repository.


Loading the tm6000_dvb works fine (even if it takes a while when I 
modprobe it while the USB stick is already plugged). Kaffeine sees and 
uses correctly the device.


However, I'd like to use the IR remote control. It seems to be 
recognized, as dmesg | grep -i lirc gives :


[  123.306153] lirc_dev: IR Remote Control driver registered, major 250
[  123.306932] IR LIRC bridge handler initialized

I have no event nor input device created. I've understood from Jarod's 
pages that the new IR userspace doesn't necessarily require lirc, but 
sees the IR receiver as a keyboard. No such device is present in 
/proc/bus/input/devices


inputlirc + irw don't show anything.

Am I missing something here ? Do I have to load a specific module ?

I have found a lot of information concerning imon, but none I can 
apply to my HVR-900H/tm6000 case.


Thanks in advance

Massis
--
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
HVR900H doesn't use lirc. It generates an input device, if a rc_map is 
present for this device.

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


Re: [git:v4l-dvb/for_v2.6.38] [media] tm6000: bugfix set tv standards

2010-11-09 Thread Stefan Ringel

 Am 09.11.2010 13:20, schrieb Mauro Carvalho Chehab:

This is an automatic generated email to let you know that the following patch 
were queued at the
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] tm6000: bugfix set tv standards
Author:  Stefan Ringelstefan.rin...@arcor.de
Date:Wed Oct 27 16:48:05 2010 -0300

bugfix set tv standards

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
Signed-off-by: Mauro Carvalho Chehabmche...@redhat.com

  drivers/staging/tm6000/tm6000-video.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=8eb5e30293e2460a37feaaa94abc7c6ede6cc29d

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 9ec8279..c5690b2 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1032,6 +1032,7 @@ static int vidioc_s_std (struct file *file, void *priv, 
v4l2_std_id *norm)
struct tm6000_fh   *fh=priv;
struct tm6000_core *dev = fh-dev;

+   dev-norm = *norm;
rc = tm6000_init_analog_mode(dev);

fh-width  = dev-width;

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


[PATCH v2] tm6000: add revision check

2010-11-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

adding chip revision check


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |7 ---
 drivers/staging/tm6000/tm6000-core.c  |   27 ---
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 664e603..1c9374a 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -521,13 +521,6 @@ int tm6000_cards_setup(struct tm6000_core *dev)
printk(KERN_ERR Error %i doing tuner reset\n, 
rc);
return rc;
}
-   msleep(10);
-
-   if (!i) {
-   rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 
0, 0);
-   if (rc = 0)
-   printk(KERN_DEBUG board=0x%08x\n, rc);
-   }
}
} else {
printk(KERN_ERR Tuner reset is not configured\n);
diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index df3f187..121dc46 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -542,6 +542,26 @@ int tm6000_init(struct tm6000_core *dev)
int board, rc = 0, i, size;
struct reg_init *tab;
 
+   /* Check board revision */
+   board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
+   if (board = 0) {
+   switch (board  0xff) {
+   case 0xf3:
+   printk(KERN_INFO Found tm6000\n);
+   if (dev-dev_type != TM6000)
+   dev-dev_type = TM6000;
+   break;
+   case 0xf4:
+   printk(KERN_INFO Found tm6010\n);
+   if (dev-dev_type != TM6010)
+   dev-dev_type = TM6010;
+   break;
+   default:
+   printk(KERN_INFO Unknown board version = 0x%08x\n, 
board);
+   }
+   } else
+   printk(KERN_ERR Error %i while retrieving board version\n, 
board);
+
if (dev-dev_type == TM6010) {
tab = tm6010_init_tab;
size = ARRAY_SIZE(tm6010_init_tab);
@@ -563,13 +583,6 @@ int tm6000_init(struct tm6000_core *dev)
 
msleep(5); /* Just to be conservative */
 
-   /* Check board version - maybe 10Moons specific */
-   board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
-   if (board = 0)
-   printk(KERN_INFO Board version = 0x%08x\n, board);
-   else
-   printk(KERN_ERR Error %i while retrieving board version\n, 
board);
-
rc = tm6000_cards_setup(dev);
 
return rc;
-- 
1.7.2.2

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


[PATCH] tm6000: add revision check

2010-11-06 Thread stefan . ringel
From: root stefan.rin...@arcor.de

adding chip revision check

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |7 ---
 drivers/staging/tm6000/tm6000-core.c  |   26 +++---
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 664e603..1c9374a 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -521,13 +521,6 @@ int tm6000_cards_setup(struct tm6000_core *dev)
printk(KERN_ERR Error %i doing tuner reset\n, 
rc);
return rc;
}
-   msleep(10);
-
-   if (!i) {
-   rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 
0, 0);
-   if (rc = 0)
-   printk(KERN_DEBUG board=0x%08x\n, rc);
-   }
}
} else {
printk(KERN_ERR Tuner reset is not configured\n);
diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index df3f187..efefa6a 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -542,6 +542,25 @@ int tm6000_init(struct tm6000_core *dev)
int board, rc = 0, i, size;
struct reg_init *tab;
 
+   /* Check board revision */
+   board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
+   if (board = 0) {
+   switch (board  0xff)
+   case 0xf3:
+   printk(KERN_INFO Found tm6000\n);
+   if (dev-dev_type != TM6000)
+   dev-dev_type = TM6000;
+   break;
+   case 0xf4:
+   printk(KERN_INFO Found tm6010\n);
+   if (dev-dev_type != TM6010)
+   dev-dev_type = TM6010;
+   break;
+   default:
+   printk(KERN_INFO Unknown board version = 0x%08x\n, 
board);
+   } else
+   printk(KERN_ERR Error %i while retrieving board version\n, 
board);
+
if (dev-dev_type == TM6010) {
tab = tm6010_init_tab;
size = ARRAY_SIZE(tm6010_init_tab);
@@ -563,13 +582,6 @@ int tm6000_init(struct tm6000_core *dev)
 
msleep(5); /* Just to be conservative */
 
-   /* Check board version - maybe 10Moons specific */
-   board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
-   if (board = 0)
-   printk(KERN_INFO Board version = 0x%08x\n, board);
-   else
-   printk(KERN_ERR Error %i while retrieving board version\n, 
board);
-
rc = tm6000_cards_setup(dev);
 
return rc;
-- 
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


tm6000 problems with picture

2010-10-27 Thread Stefan Ringel

 Hello Mauro,

I have actually problems with my terratec cinergy hybrid xe (tm6010). 
Today as I test with last git update, it don't work with my stick, but a 
few weeks before it has work (black/white picture; bottom position). But 
I found the worried points.



Signed-off-by: Stefan Ringel stefan.rin...@arcor.de

@@ -1030,10 +1030,11 @@ static int vidioc_s_std (struct file *file, void 
*priv, v4l2_std_id *norm)

 {
 int rc=0;
 struct tm6000_fh   *fh=priv;
 struct tm6000_core *dev = fh-dev;

+dev-norm = *norm;
 rc = tm6000_init_analog_mode(dev);

 fh-width  = dev-width;
 fh-height = dev-height;



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


Re: [RFC PATCH] Audio standards on tm6000

2010-10-12 Thread Stefan Ringel

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Am 12.10.2010 20:28, schrieb Dmitri Belimov:
 Hi

 Em 08-10-2010 16:03, Dmitri Belimov escreveu:
 Hi Mauro

 Not so good. Audio with this patch has bad white noise
 sometimes and bad quality. I try found better configuration for
 SECAM-DK.

 Ok. Well, feel free to modify it. I think that this approach may
 be better, especially if we need to add later some sort of code
 to detect and change audio standard for some standards that have
 more than one audio standard associated (we needed do to it on
 other drivers, in order to work in Russia and other Countries
 that use different variants of the audio standard).

 The association between video and audio standard is not complete.
 For example, it misses NTSC-Kr and NTSC-Jp.

 Rework audio. Add SECAM-DK, move SECAM to SECAM-B | SECAM-G. Add
 some new audio standards and tricks for future, see
 tm6000_set_audio_std For SECAM-DK it works. Try on your standards.


 Two files in attach. Patch after latest patch from Mauro and full
 file tm6000-std.c

 Cheers, Mauro.


 With my best regards, Dmitry.
Where is defined tv_audio_mode?
Stefan Ringel
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJMtJLTAAoJEAWtPFjxMvFGnFAH/Rrk274byzL8IvQd6fjAIl4D
izk31/k4CY1Y2EdHvygef4ZQxIGE4PGDaOogWEIBLtlHTx6XHUASpiZ8aJW1z7oF
YQk9rtfC3ZChmaGQDBzwLI+EUg9t7TzeQ8BpC11WxiOapyKLXFv0SdMNs2Y0WHOz
BNlQkL+9kZ+Hq6nSdJJxOihu+tiwbmvvSd7b/Cz9kdLpSNGr99F+ELbM0g3oU2Ts
ue7r3FnvHFnpNlV7Ceiuj7jF5ozeo3jSdWJI3S8ph4Wdi3CkPxTnTQXJAU09JU1k
we8+/TdplP+3Rdf206r/SL4RlI5wiZr/jm4IdLcwLOm/9yHthb89qyuW5upvV6k=
=LQiB
-END PGP SIGNATURE-

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


[PATCH 1/2] tm6000: bugfix param string

2010-08-24 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-input.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-input.c 
b/drivers/staging/tm6000/tm6000-input.c
index 32f7a0a..7b07096 100644
--- a/drivers/staging/tm6000/tm6000-input.c
+++ b/drivers/staging/tm6000/tm6000-input.c
@@ -36,7 +36,7 @@ MODULE_PARM_DESC(ir_debug, enable debug message [IR]);
 
 static unsigned int enable_ir = 1;
 module_param(enable_ir, int, 0644);
-MODULE_PARM_DESC(enable_ir, enable ir (default is enable);
+MODULE_PARM_DESC(enable_ir, enable ir (default is enable));
 
 #undef dprintk
 
-- 
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 2/2] tm6000: bugfix data handling

2010-08-24 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-input.c |   59 +
 1 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-input.c 
b/drivers/staging/tm6000/tm6000-input.c
index 7b07096..4fcd5ff 100644
--- a/drivers/staging/tm6000/tm6000-input.c
+++ b/drivers/staging/tm6000/tm6000-input.c
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(enable_ir, enable ir (default is enable));
}
 
 struct tm6000_ir_poll_result {
-   u8 rc_data[4];
+   u16 rc_data;
 };
 
 struct tm6000_IR {
@@ -60,9 +60,9 @@ struct tm6000_IR {
int polling;
struct delayed_work work;
u8  wait:1;
+   u8  key:1;
struct urb  *int_urb;
u8  *urb_data;
-   u8  key:1;
 
int (*get_key) (struct tm6000_IR *, struct tm6000_ir_poll_result *);
 
@@ -122,13 +122,14 @@ static void tm6000_ir_urb_received(struct urb *urb)
 
if (urb-status != 0)
printk(KERN_INFO not ready\n);
-   else if (urb-actual_length  0)
+   else if (urb-actual_length  0) {
memcpy(ir-urb_data, urb-transfer_buffer, urb-actual_length);
 
-   dprintk(data %02x %02x %02x %02x\n, ir-urb_data[0],
-   ir-urb_data[1], ir-urb_data[2], ir-urb_data[3]);
+   dprintk(data %02x %02x %02x %02x\n, ir-urb_data[0],
+   ir-urb_data[1], ir-urb_data[2], ir-urb_data[3]);
 
-   ir-key = 1;
+   ir-key = 1;
+   }
 
rc = usb_submit_urb(urb, GFP_ATOMIC);
 }
@@ -140,30 +141,47 @@ static int default_polling_getkey(struct tm6000_IR *ir,
int rc;
u8 buf[2];
 
-   if (ir-wait  !dev-int_in) {
-   poll_result-rc_data[0] = 0xff;
+   if (ir-wait  !dev-int_in)
return 0;
-   }
 
if (dev-int_in) {
-   poll_result-rc_data[0] = ir-urb_data[0];
-   poll_result-rc_data[1] = ir-urb_data[1];
+   if (ir-ir.ir_type == IR_TYPE_RC5)
+   poll_result-rc_data = ir-urb_data[0];
+   else
+   poll_result-rc_data = ir-urb_data[0] | 
ir-urb_data[1]  8;
} else {
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 2, 0);
msleep(10);
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 2, 1);
msleep(10);
 
-   rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR |
-USB_RECIP_DEVICE, REQ_02_GET_IR_CODE, 0, 0, buf, 1);
+   if (ir-ir.ir_type == IR_TYPE_RC5) {
+   rc = tm6000_read_write_usb(dev, USB_DIR_IN |
+   USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+   REQ_02_GET_IR_CODE, 0, 0, buf, 1);
 
-   msleep(10);
+   msleep(10);
 
-   dprintk(read data=%02x\n, buf[0]);
-   if (rc  0)
-   return rc;
+   dprintk(read data=%02x\n, buf[0]);
+   if (rc  0)
+   return rc;
 
-   poll_result-rc_data[0] = buf[0];
+   poll_result-rc_data = buf[0];
+   } else {
+   rc = tm6000_read_write_usb(dev, USB_DIR_IN |
+   USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+   REQ_02_GET_IR_CODE, 0, 0, buf, 2);
+
+   msleep(10);
+
+   dprintk(read data=%04x\n, buf[0] | buf[1]  8);
+   if (rc  0)
+   return rc;
+
+   poll_result-rc_data = buf[0] | buf[1]  8;
+   }
+   if ((poll_result-rc_data  0x00ff) != 0xff)
+   ir-key = 1;
}
return 0;
 }
@@ -180,12 +198,11 @@ static void tm6000_ir_handle_key(struct tm6000_IR *ir)
return;
}
 
-   dprintk(ir-get_key result data=%02x %02x\n,
-   poll_result.rc_data[0], poll_result.rc_data[1]);
+   dprintk(ir-get_key result data=%02x %04x\n, poll_result.rc_data);
 
if (poll_result.rc_data[0] != 0xff  ir-key == 1) {
ir_input_keydown(ir-input-input_dev, ir-ir,
-   poll_result.rc_data[0] | poll_result.rc_data[1]  8);
+   (u32)poll_result.rc_data);
 
ir_input_nokey(ir-input-input_dev, ir-ir);
ir-key = 0;
-- 
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] tm6000: bugfix bad marge

2010-07-27 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-core.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 9f60ad5..1fea5a0 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -341,12 +341,6 @@ int tm6000_init_analog_mode(struct tm6000_core *dev)
dev-gpio.dvb_led, 0x01);
}
 
-   /* switch dvb led off */
-   if (dev-gpio.dvb_led) {
-   tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
-   dev-gpio.dvb_led, 0x01);
-   }
-
return 0;
 }
 
-- 
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: tm6000 bad marge staging/tm6000 into staging/all

2010-07-26 Thread Stefan Ringel

 Am 25.07.2010 19:58, schrieb Mauro Carvalho Chehab:

Em 25-07-2010 04:28, Stefan Ringel escreveu:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Mauro,

This marge are wrong! It's added double dvb led off, but my patch has
only ones.

raw | combined (merge: 011906d 6e5e76f)

Merge branch 'staging/tm6000' into staging/all
Mauro Carvalho Chehab [Sun, 4 Jul 2010 19:33:26 + (16:33 -0300)]

* staging/tm6000: (29 commits)
   tm6000: Partially revert some copybuf logic
   tm6000: Be sure that the new buffer is empty
   tm6000: Fix copybuf continue logic Signed-off-by: Mauro Carvalho
Chehabmche...@redhat.com
   tm6000: audio packet has always 180 bytes
   tm6000: Improve set bitrate routines used by alsa
   tm6000-alsa: Implement a routine to store data received from URB
   tm6000-alsa: Fix several bugs at the driver initialization code
   tm6000: avoid unknown symbol tm6000_debug
   tm6000: Add a callback code for buffer fill
   tm6000: Use an emum for extension type
   tm6000-alsa: rework audio buffer allocation/deallocation
   tm6000: Avoid OOPS when loading tm6000-alsa module
   tm6000: Fix compilation breakages
   V4L/DVB: Staging: tm6000: Fix coding style issues
   V4L/DVB: tm6000: move dvb into a separate kern module
   V4L/DVB: tm6000: rewrite init and fini
   V4L/DVB: tm6000: Fix Video decoder initialization
   V4L/DVB: tm6000: rewrite copy_streams
   V4L/DVB: tm6000: add DVB support for tuner xc5000
   V4L/DVB: tm6000: set variable dev_mode in function tm6000_start_stream
   ...

diff --cc drivers/staging/tm6000/tm6000-core.c

index 27f3f55,1fea5a0..9f60ad5
- --- 1/drivers/staging/tm6000/tm6000-core.c
- --- 2/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@@ -336,11 -332,11 +332,17 @@@ int tm6000_init_analog_mode(struct tm60
 mutex_unlock(dev-lock);

 msleep(100);
- -   tm6000_set_standard (dev,dev-norm);
- -   tm6000_set_audio_bitrate (dev,48000);
+   tm6000_set_standard(dev,dev-norm);
+   tm6000_set_audio_bitrate(dev, 48000);
+
+   /* switch dvb led off */
+   if (dev-gpio.dvb_led) {
++  tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
++  dev-gpio.dvb_led, 0x01);
++  }
  +
  +  /* switch dvb led off */
  +  if (dev-gpio.dvb_led) {
 tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
 dev-gpio.dvb_led, 0x01);
 }

I hate those merge conflicts ;)

could you please send me a patch fixing it at staging/all? I won't apply it
upstream, but we shouldn't simply revert a patch at staging, otherwise, we'll
break every clone of my tree.

cannot found staging/all.



-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMS+eJAAoJEAWtPFjxMvFGDw8IAJnmTxTehH4TeqwI3Gn+8gcn
Xp8VPH/F67npT3zHQMq4luBEWdnMKkI/y54en8czoqG+EHEnxZjFZUxJUkAKPbpd
pU9vVUrQGtUQOf7zY6qYSqaSPIJr+abTmE1k2Wnd47Zwlu35tfRhuVXqfrTu7JkT
/Jy4Xf/IOtJvCa62eDCnhB6+gAq+hj5peHiZb7KBxOQO1NH8DQ8DYQPT9xNn5SFs
mCmQv9BdNrLdXS4mCkufBWEinennolOIoaSIyj2GkvJm8aSvzIWGvm28zxjPLKPL
PLH7A+WPMHCdor7Psn7QJKCm3DPEKu3vcOTOmFYsBJfV/pUNMK+5y3qV1WP9Ayg=
=HCq5
-END PGP SIGNATURE-



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


tm6000 bad marge staging/tm6000 into staging/all

2010-07-25 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Mauro,

This marge are wrong! It's added double dvb led off, but my patch has
only ones.

raw | combined (merge: 011906d 6e5e76f)

Merge branch 'staging/tm6000' into staging/all
Mauro Carvalho Chehab [Sun, 4 Jul 2010 19:33:26 + (16:33 -0300)]

* staging/tm6000: (29 commits)
  tm6000: Partially revert some copybuf logic
  tm6000: Be sure that the new buffer is empty
  tm6000: Fix copybuf continue logic Signed-off-by: Mauro Carvalho
Chehab mche...@redhat.com
  tm6000: audio packet has always 180 bytes
  tm6000: Improve set bitrate routines used by alsa
  tm6000-alsa: Implement a routine to store data received from URB
  tm6000-alsa: Fix several bugs at the driver initialization code
  tm6000: avoid unknown symbol tm6000_debug
  tm6000: Add a callback code for buffer fill
  tm6000: Use an emum for extension type
  tm6000-alsa: rework audio buffer allocation/deallocation
  tm6000: Avoid OOPS when loading tm6000-alsa module
  tm6000: Fix compilation breakages
  V4L/DVB: Staging: tm6000: Fix coding style issues
  V4L/DVB: tm6000: move dvb into a separate kern module
  V4L/DVB: tm6000: rewrite init and fini
  V4L/DVB: tm6000: Fix Video decoder initialization
  V4L/DVB: tm6000: rewrite copy_streams
  V4L/DVB: tm6000: add DVB support for tuner xc5000
  V4L/DVB: tm6000: set variable dev_mode in function tm6000_start_stream
  ...

diff --cc drivers/staging/tm6000/tm6000-core.c

index 27f3f55,1fea5a0..9f60ad5
- --- 1/drivers/staging/tm6000/tm6000-core.c
- --- 2/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@@ -336,11 -332,11 +332,17 @@@ int tm6000_init_analog_mode(struct tm60
mutex_unlock(dev-lock);
 
msleep(100);
- -   tm6000_set_standard (dev, dev-norm);
- -   tm6000_set_audio_bitrate (dev,48000);
+   tm6000_set_standard(dev, dev-norm);
+   tm6000_set_audio_bitrate(dev, 48000);
+
+   /* switch dvb led off */
+   if (dev-gpio.dvb_led) {
++  tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
++  dev-gpio.dvb_led, 0x01);
++  }
 +
 +  /* switch dvb led off */
 +  if (dev-gpio.dvb_led) {
tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
dev-gpio.dvb_led, 0x01);
}



-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJMS+eJAAoJEAWtPFjxMvFGDw8IAJnmTxTehH4TeqwI3Gn+8gcn
Xp8VPH/F67npT3zHQMq4luBEWdnMKkI/y54en8czoqG+EHEnxZjFZUxJUkAKPbpd
pU9vVUrQGtUQOf7zY6qYSqaSPIJr+abTmE1k2Wnd47Zwlu35tfRhuVXqfrTu7JkT
/Jy4Xf/IOtJvCa62eDCnhB6+gAq+hj5peHiZb7KBxOQO1NH8DQ8DYQPT9xNn5SFs
mCmQv9BdNrLdXS4mCkufBWEinennolOIoaSIyj2GkvJm8aSvzIWGvm28zxjPLKPL
PLH7A+WPMHCdor7Psn7QJKCm3DPEKu3vcOTOmFYsBJfV/pUNMK+5y3qV1WP9Ayg=
=HCq5
-END PGP SIGNATURE-

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


tm6000 and losing blocks

2010-06-30 Thread Stefan Ringel
Hi Mauro,

I have tested your patch, but that logic to detect the end of urb is wrong. 
Many blocks going to lost. 
byte 0x47 can 2 different state:
1. sync byte
2. data byte

Your logic has that problem, that if receive the new urb and search the new 
sync byte, the first 0x47 will use and 
that are not always the sync byte.

From: Mauro Carvalho Chehab mche...@redhat.com
Date: Mon, 7 Jun 2010 15:10:14 + (-0300)
Subject: tm6000: Fix copybuf continue logic
X-Git-Url: 
http://git.linuxtv.org/v4l-dvb.git?a=commitdiff_plain;h=dcdc55b917681378f84e6db26dcd56931ae2f1c8

tm6000: Fix copybuf continue logic
Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
---

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 6bf2b13..9a0b5a7 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -285,7 +285,7 @@ static int copy_streams(u8 *data, unsigned long len,
   break;
   case TM6000_URB_MSG_AUDIO:
   case TM6000_URB_MSG_PTS:
-  cpysize = pktsize;  /* Size is always 180 
bytes */
+  size = pktsize; /* Size is always 180 
bytes */
   break;
   }
   } else {
@@ -315,7 +315,7 @@ static int copy_streams(u8 *data, unsigned long len,
   break;
   }
   }
-  if (ptr + pktsize  endp) {
+  if (cpysize  size) {
   /* End of URB packet, but cmd processing is not
* complete. Preserve the state for a next packet
*/

I think that is wrong

@@ -323,7 +323,7 @@ static int copy_streams(u8 *data, unsigned long len,
   dev-isoc_ctl.size = size - cpysize;
   dev-isoc_ctl.cmd = cmd;
   dev-isoc_ctl.pktsize = pktsize - (endp - ptr);
-  ptr += endp - ptr;
+  ptr += cpysize;
   } else {
   dev-isoc_ctl.cmd = 0;
   ptr += pktsize;

dito


Stefan Ringel

-- 
Stefan Ringel stefan.rin...@arcor.de

--
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: tm6000 and losing blocks

2010-06-30 Thread Stefan Ringel
Am 30.06.2010 22:22, schrieb Mauro Carvalho Chehab:
 Em 30-06-2010 16:57, Stefan Ringel escreveu:
   
 Hi Mauro,

 I have tested your patch, but that logic to detect the end of urb is wrong. 
 Many blocks going to lost. 
 byte 0x47 can 2 different state:
 1. sync byte
 2. data byte

 Your logic has that problem, that if receive the new urb and search the new 
 sync byte, the first 0x47 will use and 
 that are not always the sync byte.
 
 Stefan,

   
 
 From: Mauro Carvalho Chehab mche...@redhat.com
 Date: Mon, 7 Jun 2010 15:10:14 + (-0300)
 Subject: tm6000: Fix copybuf continue logic
 X-Git-Url: 
 http://git.linuxtv.org/v4l-dvb.git?a=commitdiff_plain;h=dcdc55b917681378f84e6db26dcd56931ae2f1c8

 tm6000: Fix copybuf continue logic
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 ---

 diff --git a/drivers/staging/tm6000/tm6000-video.c 
 b/drivers/staging/tm6000/tm6000-video.c
 index 6bf2b13..9a0b5a7 100644
 --- a/drivers/staging/tm6000/tm6000-video.c
 +++ b/drivers/staging/tm6000/tm6000-video.c
 @@ -285,7 +285,7 @@ static int copy_streams(u8 *data, unsigned long len,
 break;
 case TM6000_URB_MSG_AUDIO:
 case TM6000_URB_MSG_PTS:
 -   cpysize = pktsize;  /* Size is always 180 
 bytes */
 +   size = pktsize; /* Size is always 180 
 bytes */
 break;
 }
   
 This is OK: with audio and TS URB's, the packet has always 180 bytes, and the 
 size information
 from the header is not used.

   
 } else {
 @@ -315,7 +315,7 @@ static int copy_streams(u8 *data, unsigned long len,
 break;
 }
 }
 -   if (ptr + pktsize  endp) {
 +   if (cpysize  size) {
 /* End of URB packet, but cmd processing is not
  * complete. Preserve the state for a next packet
  */
   
 I think that is wrong

 
 @@ -323,7 +323,7 @@ static int copy_streams(u8 *data, unsigned long len,
 dev-isoc_ctl.size = size - cpysize;
 dev-isoc_ctl.cmd = cmd;
 dev-isoc_ctl.pktsize = pktsize - (endp - ptr);
 -   ptr += endp - ptr;
 +   ptr += cpysize;
 } else {
 dev-isoc_ctl.cmd = 0;
 ptr += pktsize;
   
 dito

 
 Hm...
   cpysize = (endp - ptr  size) ? size : endp - ptr;

 and size = pktsize (for Audio/PTS), this is OK for audio and PTS.

 For VBI and video, size comes from the data package. It should be equal to 
 180 bytes
 as well, but, if it is different than 180, then we may have a problem.

 As, in practice, all packets have 180 byes of payload, and it is somewhat 
 common to get
 broken URB 's with this device, I agree that it is safer to reverse those two 
 hunks.

 Cheers,
 Mauro.
   
Mauro here the log without your patch and enable vbi, t (numbers of
frames), t1 (time in seconds), t2 (rest time in milliseconds) are from
pts (sequence of 4 bytes filled to 180 bytes) decoding:

Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521501] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521503] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521504] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521506] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521508] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521510] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521511] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521513] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521515] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521516] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521518] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.521520] 4299325817: cmd=vbi,
size=48
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538785] 4299325834: cmd=pts,
size=180
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538789] t 0x000135e8, t1
0x0632, t2 0x02d0
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538791] 4299325834: cmd=vbi,
size=68
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538793] 4299325834: cmd=vbi,
size=68
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538795] 4299325834: cmd=vbi,
size=68
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538797] 4299325834: cmd=vbi,
size=68
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538798] 4299325834: cmd=vbi,
size=68
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538800] 4299325834: cmd=vbi,
size=68
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538802] 4299325834: cmd=vbi,
size=68
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538804] 4299325834: cmd=vbi,
size=28
Jun 30 23:21:15 linux-b5ii kernel: [ 4658.538805

tm6000 + audio

2010-06-27 Thread Stefan Ringel
Mauro,

I have great problems with _tm6000_start_audio_dma if I started mencoder
or arecord. It creashed and after a while it frosts in. (It hasn't logged).

Stefan Ringel

-- 
Stefan Ringel stefan.rin...@arcor.de

--
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] tm6000: add ir support

2010-06-20 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/Makefile   |3 +-
 drivers/staging/tm6000/tm6000-cards.c |   27 +++-
 drivers/staging/tm6000/tm6000-input.c |  357 +
 drivers/staging/tm6000/tm6000.h   |   11 +
 4 files changed, 396 insertions(+), 2 deletions(-)
 create mode 100644 drivers/staging/tm6000/tm6000-input.c

diff --git a/drivers/staging/tm6000/Makefile b/drivers/staging/tm6000/Makefile
index 4129c18..77e06bf 100644
--- a/drivers/staging/tm6000/Makefile
+++ b/drivers/staging/tm6000/Makefile
@@ -2,7 +2,8 @@ tm6000-objs := tm6000-cards.o \
   tm6000-core.o  \
   tm6000-i2c.o   \
   tm6000-video.o \
-  tm6000-stds.o
+  tm6000-stds.o \
+  tm6000-input.o
 
 obj-$(CONFIG_VIDEO_TM6000) += tm6000.o
 obj-$(CONFIG_VIDEO_TM6000_ALSA) += tm6000-alsa.o
diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 50756e5..55d05ac 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -68,6 +68,8 @@ struct tm6000_board {
int demod_addr; /* demodulator address */
 
struct tm6000_gpio gpio;
+
+   char*ir_codes;
 };
 
 struct tm6000_board tm6000_boards[] = {
@@ -275,6 +277,7 @@ struct tm6000_board tm6000_boards[] = {
.dvb_led= TM6010_GPIO_5,
.ir = TM6010_GPIO_0,
},
+   .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
},
[TM6010_BOARD_TWINHAN_TU501] = {
.name = Twinhan TU501(704D1),
@@ -360,6 +363,8 @@ int tm6000_tuner_callback(void *ptr, int component, int 
command, int arg)
 
switch (command) {
case XC2028_RESET_CLK:
+   tm6000_ir_wait(dev, 0);
+
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
0x02, arg);
msleep(10);
@@ -409,13 +414,14 @@ int tm6000_tuner_callback(void *ptr, int component, int 
command, int arg)
msleep(130);
break;
}
+
+   tm6000_ir_wait(dev, 1);
break;
case 1:
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
0x02, 0x01);
msleep(10);
break;
-
case 2:
rc = tm6000_i2c_reset(dev, 100);
break;
@@ -635,6 +641,8 @@ static int tm6000_init_dev(struct tm6000_core *dev)
 
dev-gpio = tm6000_boards[dev-model].gpio;
 
+   dev-ir_codes = tm6000_boards[dev-model].ir_codes;
+
dev-demod_addr = tm6000_boards[dev-model].demod_addr;
 
dev-caps = tm6000_boards[dev-model].caps;
@@ -683,6 +691,8 @@ static int tm6000_init_dev(struct tm6000_core *dev)
tm6000_add_into_devlist(dev);
tm6000_init_extension(dev);
 
+   tm6000_ir_init(dev);
+
mutex_unlock(dev-lock);
return 0;
 
@@ -828,6 +838,19 @@ static int tm6000_usb_probe(struct usb_interface 
*interface,
 dev-isoc_out);
}
break;
+   case USB_ENDPOINT_XFER_INT:
+   if (!dir_out) {
+   get_max_endpoint(usbdev,
+   
interface-altsetting[i],
+   INT IN, e,
+   dev-int_in);
+   } else {
+   get_max_endpoint(usbdev,
+   
interface-altsetting[i],
+   INT OUT, e,
+   dev-int_out);
+   }
+   break;
}
}
}
@@ -886,6 +909,8 @@ static void tm6000_usb_disconnect(struct usb_interface 
*interface)
 
mutex_lock(dev-lock);
 
+   tm6000_ir_fini(dev);
+
if (dev-gpio.power_led) {
switch (dev-model) {
case TM6010_BOARD_HAUPPAUGE_900H:
diff --git a/drivers/staging/tm6000/tm6000-input.c 
b/drivers/staging/tm6000/tm6000-input.c
new file mode 100644
index 000..e45b443
--- /dev/null
+++ b/drivers/staging/tm6000/tm6000-input.c
@@ -0,0 +1,357 @@
+/*
+   tm6000-input.c - driver for TM5600/TM6000/TM6010 USB video capture devices
+
+   Copyright (C) 2010 Stefan Ringel stefan.rin...@arcor.de
+
+   This program is free software

Re: [PATCH] tm6000: add ir support

2010-06-20 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Am 20.06.2010 18:31, schrieb Jarod Wilson:
 On Sun, Jun 20, 2010 at 11:38 AM,  stefan.rin...@arcor.de wrote:
 From: Stefan Ringel stefan.rin...@arcor.de

 Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
 ---
  drivers/staging/tm6000/Makefile   |3 +-
  drivers/staging/tm6000/tm6000-cards.c |   27 +++-
  drivers/staging/tm6000/tm6000-input.c |  357
+
  drivers/staging/tm6000/tm6000.h   |   11 +
  4 files changed, 396 insertions(+), 2 deletions(-)
  create mode 100644 drivers/staging/tm6000/tm6000-input.c
 ...
 diff --git a/drivers/staging/tm6000/tm6000-input.c
b/drivers/staging/tm6000/tm6000-input.c
 new file mode 100644
 index 000..e45b443
 --- /dev/null
 +++ b/drivers/staging/tm6000/tm6000-input.c
 @@ -0,0 +1,357 @@
 +/*
 +   tm6000-input.c - driver for TM5600/TM6000/TM6010 USB video capture
devices
 +
 +   Copyright (C) 2010 Stefan Ringel stefan.rin...@arcor.de
 +
 +   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 version 2
 +
 +   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.
 + */
 +
 +#include linux/module.h
 +#include linux/init.h
 +#include linux/delay.h
 +
 +#include linux/input.h
 +#include linux/usb.h
 +
 +#include compat.h
 +#include tm6000.h
 +#include tm6000-regs.h

 Please use the new ir-core infrastructure here. (#include
 media/ir-core.h, #include media/rc-map.h, and assorted code in
 drivers/media/IR/).


It use the new code (for example rc map in tm6000-card.c), but I can
added the header files. It doesn't use software encoding, it use
hardware encodeing.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJMHkVtAAoJEAWtPFjxMvFGgA8IAKeW68Acv0jgJcV4gIWFiEk1
DFVdcvqbWQHbFzLPi427QjFFao8YRXT+XDnADVmYzneBAlcnsdfwHgi4ufCjB9BX
FqPhrhaePluGW4YmSGLHX135wNhfa8ZLSg7WMN0gNkif+4bJ1ZAXUtE1nVwzasVW
LHCY1IX5JtUH19PYdsozkJBgfyLAfgqmP7S35not6zsAjXsimp2vid4UNJ55MyOo
gcrkzcCxqaMkxLc3wKBtwrtb3hUQbJp3znkjPvIJTcFh5wzm+4yr9sk2heObNJVY
n7DVS+YMegBugq9wKNWNiL+eZQQ/IR8okm0qDneleP0seKirL2JHGeDw2z9CePk=
=09n5
-END PGP SIGNATURE-

--
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] tm6000: add ir support

2010-06-20 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/Makefile   |3 +-
 drivers/staging/tm6000/tm6000-cards.c |   28 +++-
 drivers/staging/tm6000/tm6000-input.c |  365 +
 drivers/staging/tm6000/tm6000.h   |9 +
 4 files changed, 403 insertions(+), 2 deletions(-)
 create mode 100644 drivers/staging/tm6000/tm6000-input.c

diff --git a/drivers/staging/tm6000/Makefile b/drivers/staging/tm6000/Makefile
index 4129c18..77e06bf 100644
--- a/drivers/staging/tm6000/Makefile
+++ b/drivers/staging/tm6000/Makefile
@@ -2,7 +2,8 @@ tm6000-objs := tm6000-cards.o \
   tm6000-core.o  \
   tm6000-i2c.o   \
   tm6000-video.o \
-  tm6000-stds.o
+  tm6000-stds.o \
+  tm6000-input.o
 
 obj-$(CONFIG_VIDEO_TM6000) += tm6000.o
 obj-$(CONFIG_VIDEO_TM6000_ALSA) += tm6000-alsa.o
diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 50756e5..9860c55 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -28,6 +28,7 @@
 #include media/tuner.h
 #include media/tvaudio.h
 #include media/i2c-addr.h
+#include media/rc-map.h
 
 #include tm6000.h
 #include tm6000-regs.h
@@ -68,6 +69,8 @@ struct tm6000_board {
int demod_addr; /* demodulator address */
 
struct tm6000_gpio gpio;
+
+   char*ir_codes;
 };
 
 struct tm6000_board tm6000_boards[] = {
@@ -275,6 +278,7 @@ struct tm6000_board tm6000_boards[] = {
.dvb_led= TM6010_GPIO_5,
.ir = TM6010_GPIO_0,
},
+   .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
},
[TM6010_BOARD_TWINHAN_TU501] = {
.name = Twinhan TU501(704D1),
@@ -360,6 +364,8 @@ int tm6000_tuner_callback(void *ptr, int component, int 
command, int arg)
 
switch (command) {
case XC2028_RESET_CLK:
+   tm6000_ir_wait(dev, 0);
+
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
0x02, arg);
msleep(10);
@@ -409,13 +415,14 @@ int tm6000_tuner_callback(void *ptr, int component, int 
command, int arg)
msleep(130);
break;
}
+
+   tm6000_ir_wait(dev, 1);
break;
case 1:
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
0x02, 0x01);
msleep(10);
break;
-
case 2:
rc = tm6000_i2c_reset(dev, 100);
break;
@@ -635,6 +642,8 @@ static int tm6000_init_dev(struct tm6000_core *dev)
 
dev-gpio = tm6000_boards[dev-model].gpio;
 
+   dev-ir_codes = tm6000_boards[dev-model].ir_codes;
+
dev-demod_addr = tm6000_boards[dev-model].demod_addr;
 
dev-caps = tm6000_boards[dev-model].caps;
@@ -683,6 +692,8 @@ static int tm6000_init_dev(struct tm6000_core *dev)
tm6000_add_into_devlist(dev);
tm6000_init_extension(dev);
 
+   tm6000_ir_init(dev);
+
mutex_unlock(dev-lock);
return 0;
 
@@ -828,6 +839,19 @@ static int tm6000_usb_probe(struct usb_interface 
*interface,
 dev-isoc_out);
}
break;
+   case USB_ENDPOINT_XFER_INT:
+   if (!dir_out) {
+   get_max_endpoint(usbdev,
+   
interface-altsetting[i],
+   INT IN, e,
+   dev-int_in);
+   } else {
+   get_max_endpoint(usbdev,
+   
interface-altsetting[i],
+   INT OUT, e,
+   dev-int_out);
+   }
+   break;
}
}
}
@@ -886,6 +910,8 @@ static void tm6000_usb_disconnect(struct usb_interface 
*interface)
 
mutex_lock(dev-lock);
 
+   tm6000_ir_fini(dev);
+
if (dev-gpio.power_led) {
switch (dev-model) {
case TM6010_BOARD_HAUPPAUGE_900H:
diff --git a/drivers/staging/tm6000/tm6000-input.c 
b/drivers/staging/tm6000/tm6000-input.c
new file mode 100644
index 000..d44182c
--- /dev/null
+++ b/drivers/staging/tm6000/tm6000-input.c
@@ -0,0 +1,365 @@
+/*
+   tm6000

Aw: Re: [PATCH 6/6] Staging: tm6000: Fix coding style issues Fixed coding style issues founded by checkpatch.pl in files: tm6000-alsa.c, tm6000-cards, tm6000-core.c, tm6000-dvb.c, tm6000-i2c.c, tm60

2010-06-19 Thread Stefan Ringel
 


- Original Nachricht 
Von: Greg KH g...@kroah.com
An:  Stefan Ringel stefan.rin...@arcor.de
Datum:   19.06.2010 19:25
Betreff: Re: [PATCH 6/6] Staging: tm6000: Fix coding style issues Fixed
 coding style issues founded by checkpatch.pl in files: tm6000-alsa.c,
 tm6000-cards, tm6000-core.c, tm6000-dvb.c, tm6000-i2c.c, tm6000-stds.c,
 tm6000-usb-isoc.h, tm6000.h Signed-off-by: Timofey Trofimov
 tumo...@gmail.com

 On Sat, Jun 19, 2010 at 07:34:57AM +0200, Stefan Ringel wrote:
  Am 19.06.2010 01:46, schrieb Greg KH:
   This patch does not apply properly.  What tree did you make it against?
   Please redo it against the latest linux-next tree and resend it.
  
   thanks,
  
   greg k-h
 
  please look in staging/tm6000 brunch.
 
 brunch?
 
 I'm still confused.
 
 greg k-h

here http://git.linuxtv.org/v4l-dvb.git?a=shortlog;h=refs/heads/staging/tm6000
 
--
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 6/6] Staging: tm6000: Fix coding style issues Fixed coding style issues founded by checkpatch.pl in files: tm6000-alsa.c, tm6000-cards, tm6000-core.c, tm6000-dvb.c, tm6000-i2c.c, tm6000-std

2010-06-18 Thread Stefan Ringel
Am 19.06.2010 01:46, schrieb Greg KH:
 This patch does not apply properly.  What tree did you make it against?
 Please redo it against the latest linux-next tree and resend it.

 thanks,

 greg k-h
   
please look in staging/tm6000 brunch.

Stefan Ringel

-- 
Stefan Ringel stefan.rin...@arcor.de

--
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: tm6000 audio buffer

2010-06-07 Thread Stefan Ringel
Am 06.06.2010 17:19, schrieb Mauro Carvalho Chehab:
 Hi Luis,

 Em 04-06-2010 16:39, Luis Henrique Fagundes escreveu:
   
 Hi,

 I'm sending a patch that hypothetically would allocate a memory buffer
 for the audio and copy the data from urb to buffer. It doesn't work,
 so I'm not putting a [PATCH] in subject and send it just for feedback.
 Am I going on the right way of implementing this? The patch was made
 against the mercurial version at http://linuxtv.org/hg/v4l-dvb.

 I can see the audio packets at tm6000-video.c. Mauro said that the urb
 audio packets had just 4 bytes of relevant data, 2 for each channel,
 but the audio buffer has 128Kb and I see too few packets. Anyway, the
 tm6000_audio_isocirq function receives the size of the packet and now
 is copying everything to the buffer, I guess next step will be to find
 what is relevant in this stream and make sure I have all packets here.

 I haven't applied all the recent patches from Stefan yet.
 
 I found some time to fix several bugs at the alsa driver, and to properly
 add a function to copy the audio data into the buffers. It seems to be
 working, but I found the same problem as you: the number of packages is
 incredibly small. So, or the audio is not properly programmed on the
 device or the routine that decodes the URB packages are wrong. Yet, if you
 wait for enough time (several minutes), with for example:
   $ arecord -D hw:1,0 -r 48000 -c 2 -f S16_LE -M

   
Mauro, if I recorded I have this log with mencoder:

Not enough audio samples!

Error reading audio: Broken pipe
ALSA xrun!!! (at least 1275923299492.352 ms long)
ALSA Status:
  state   : XRUN
  trigger_time: 13520.253382890
  tstamp  : 13520.253544610
  delay   : 0
  avail   : 77920
  avail_max   : 77920

 You'll see some random data at stdout. So, the alsa code seems to be ok.

 As I'm preparing to travel to V4L mini-summit, I doubt I would have any
 time to touch on the code during the next weeks, but maybe one of you
 may find some time to fix.

 I suggest to use some USB traffic analyzer to see what is happening, 
 comparing the results on Linux and with the original driver, using the 
 same source (for example, you may use one test signal with some audio 
 buzz inside).

 As reference for you, I'm enclosing a patch that adds some additional debug
 code at copy_streams(), plus a trial I did, in order to play with some bits
 related to audio, but it didn't help.

 All the patches are at staging/tm6000 branch, on my tree.

 Cheers,
 Mauro.


 diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
 b/drivers/staging/tm6000/tm6000-alsa.c
 index d31b525..aa38577 100644
 --- a/drivers/staging/tm6000/tm6000-alsa.c
 +++ b/drivers/staging/tm6000/tm6000-alsa.c
 @@ -84,6 +84,8 @@ static int _tm6000_start_audio_dma(struct snd_tm6000_card 
 *chip)
   val |= 0x20;
   tm6000_set_reg(core, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val);
  
 + tm6000_set_audio_bitrate(core, 48000);
 +
   tm6000_set_reg(core, TM6010_REQ08_R01_A_INIT, 0x80);
  
   return 0;
 diff --git a/drivers/staging/tm6000/tm6000-core.c 
 b/drivers/staging/tm6000/tm6000-core.c
 index 46b9ec5..1fea5a0 100644
 --- a/drivers/staging/tm6000/tm6000-core.c
 +++ b/drivers/staging/tm6000/tm6000-core.c
 @@ -602,8 +602,17 @@ int tm6000_set_audio_bitrate(struct tm6000_core *dev, 
 int bitrate)
  {
   int val;
  
 + if (dev-dev_type == TM6010) {
 + val = tm6000_get_reg(dev, TM6010_REQ08_R0A_A_I2S_MOD, 0);
 + if (val  0)
 + return val;
 + val = (val  0xf0) | 0x1;
 + val = tm6000_set_reg(dev, TM6010_REQ08_R0A_A_I2S_MOD, val);
 + if (val  0)
 + return val;
 + }
 +
   val = tm6000_get_reg(dev, REQ_07_SET_GET_AVREG, 0xeb, 0x0);
 - printk(Original value=%d\n, val);
   if (val  0)
   return val;
  
 diff --git a/drivers/staging/tm6000/tm6000-video.c 
 b/drivers/staging/tm6000/tm6000-video.c
 index 34e8ef5..cc4298e 100644
 --- a/drivers/staging/tm6000/tm6000-video.c
 +++ b/drivers/staging/tm6000/tm6000-video.c
 @@ -303,6 +304,15 @@ static int copy_streams(u8 *data, unsigned long len,
   break;
   case TM6000_URB_MSG_AUDIO:
   tm6000_call_fillbuf(dev, TM6000_AUDIO, ptr, 
 cpysize);
 +if (cpysize  pktsize) {
 +printk(Audio[%d] = %02x %02x %02x %02x\n,
 +cpysize,
 +ptr[cpysize],
 +ptr[cpysize+1],
 +ptr[cpysize+2],
 +ptr[cpysize+3]);
 +}
 +
   break;
   case TM6000_URB_MSG_VBI:
   /* Need some code to copy vbi buffer */

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


-- 
Stefan Ringel stefan.rin...@arcor.de

attachment: stefan_ringel.vcf

tm6000 autio isoc blocks

2010-06-04 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Mauro,

I have check the windows usb log and if I have audio block it's say 0
byte, but the data is complete 180 bytes until next block header. So I
think it's good if that audio block (cmd=2) resize from 0 to 180
(actual read 0 without resize it).
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJMCWhtAAoJEAWtPFjxMvFGgyAH/jCgxFhc6pA7umakxaYAwfnf
Yrg/V+JDEPUGzGVmvl4a7jzHkzn1hrZ3Pn3YCgNP7CIGeaoaiWgx+4ptLpKSyuH3
noG36DXQBX19g35Dhch4vpCrhVlCE4M+fD6gsBRgcCFEmAdWojsHDpyhOBoPnxrS
t9xkh59SEcYSPKvleB3HGVP9/tKggbGXoeRh7Ag7lBtzKAraqQMA/C0REwT4OHmc
/IL2+z1D1fb/vR2MU5uYHLgANI3WdiRbdr9yHzBdpOJ57IrytsoVRL8WdhbmuFI8
/PH2NXYfOAoyi/boFbVidmu0MSj7+OA0XrHUORjKPnmrgleOahbitDYZAxh6Jfo=
=CRkV
-END PGP SIGNATURE-

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


tm6000 and ir

2010-06-04 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Mauro,

I write actually the ir implementation (tm6000-input.c). Can you give
me any stuff what can help me?

Stefan Ringel
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
iQEcBAEBAgAGBQJMCWoFAAoJEAWtPFjxMvFGvn8H/iJ2Xg4cabtrdDEgQ9WbXA+C
TH6FTsqQ6eOZTkEOUxAkKOWXi+12UGrdqhQC6twqulhPpRi4bJm6kEqM8reeZJCl
EUvqkfQdkqOrnhDnAvj1Q1sp/RLHLjXpCUFOk43f+fwnA2bc3/CJk2uKeMNDtLa7
f1pIN4Eu7+by7K0SPFW3qlmKoTO6bEFmBUCxtrszJFBVVpcpeX4iAoQ693Q5LFCb
FTjPRpKFRdS47WGlXP4jBgC8DQ70KjNCVoXFiqeVbfCDEdYunhjPytxzVkD0Zgij
WXbuTrfpoGIzOJ0QOXr7Fj8XaAMmlEIjzqTeviY/MLUMdOKxpaR4TMHXYkvuQvA=
=loGv
-END PGP SIGNATURE-

--
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] tm6000: bugfix unkown symbol tm6000_debug

2010-06-03 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

May 30 07:54:09 linux-v5dy kernel: [ 2555.727426] tm6000: Unknown symbol
tm6000_debug


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-core.c  |2 ++
 drivers/staging/tm6000/tm6000-dvb.c   |4 ++--
 drivers/staging/tm6000/tm6000-video.c |2 +-
 drivers/staging/tm6000/tm6000.h   |2 --
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 2fbf4f6..350770e 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -29,6 +29,8 @@
 #include media/v4l2-common.h
 #include media/tuner.h
 
+static int tm6000_debug;
+
 #define USB_TIMEOUT5*HZ /* ms */
 
 int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
diff --git a/drivers/staging/tm6000/tm6000-dvb.c 
b/drivers/staging/tm6000/tm6000-dvb.c
index 3ccc466..34dc8e5 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -38,9 +38,9 @@ MODULE_SUPPORTED_DEVICE({{Trident, tm5600},
{{Trident, tm6000},
{{Trident, tm6010});
 
-static int debug
+static int tm6000_debug;
 
-module_param(debug, int, 0644);
+module_param_named(debug, tm6000_debug, int, 0644);
 MODULE_PARM_DESC(debug, enable debug message);
 
 static inline void print_err_status(struct tm6000_core *dev,
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 1e348ac..1663dd2 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -55,7 +55,7 @@ static unsigned int vid_limit = 16;   /* Video memory limit, 
in Mb */
 static int video_nr = -1;  /* /dev/videoN, -1 for autodetect */
 
 /* Debug level */
-int tm6000_debug;
+static int tm6000_debug;
 
 /* supported controls */
 static struct v4l2_queryctrl tm6000_qctrl[] = {
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index 4b65094..ed7fece 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -318,8 +318,6 @@ int tm6000_queue_init(struct tm6000_core *dev);
 
 /* Debug stuff */
 
-extern int tm6000_debug;
-
 #define dprintk(dev, level, fmt, arg...) do {\
if (tm6000_debug  level) \
printk(KERN_INFO (%lu) %s %s :fmt, jiffies, \
-- 
1.7.0.3

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


[PATCH] tm6000: rewrite copy_streams

2010-06-01 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

fusion function copy streams and copy_packets to new function copy_streams.

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
 drivers/staging/tm6000/tm6000-video.c|  326 +++---
 2 files changed, 119 insertions(+), 212 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
b/drivers/staging/tm6000/tm6000-usb-isoc.h
index 5a5049a..138716a 100644
--- a/drivers/staging/tm6000/tm6000-usb-isoc.h
+++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
@@ -39,7 +39,7 @@ struct usb_isoc_ctl {
int pos, size, pktsize;
 
/* Last field: ODD or EVEN? */
-   int field;
+   int vfield;
 
/* Stores incomplete commands */
u32 tmp_buf;
@@ -47,7 +47,4 @@ struct usb_isoc_ctl {
 
/* Stores already requested buffers */
struct tm6000_buffer*buf;
-
-   /* Stores the number of received fields */
-   int nfields;
 };
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 4f7e743..9746fe7 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -186,229 +186,143 @@ const char *tm6000_msg_type[] = {
 /*
  * Identify the tm5600/6000 buffer header type and properly handles
  */
-static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
-   u8 *out_p, struct tm6000_buffer **buf)
-{
-   struct tm6000_dmaqueue  *dma_q = urb-context;
-   struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
-   u8 c;
-   unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
-   int rc = 0;
-   /* FIXME: move to tm6000-isoc */
-   static int last_line = -2, start_line = -2, last_field = -2;
-
-   /* FIXME: this is the hardcoded window size
-*/
-   unsigned int linewidth = (*buf)-vb.width  1;
-
-   if (!dev-isoc_ctl.cmd) {
-   c = (header  24)  0xff;
-
-   /* split the header fields */
-   size  = ((header  0x7e)  1);
-
-   if (size  0)
-   size -= 4;
-
-   block = (header  7)  0xf;
-   field = (header  11)  0x1;
-   line  = (header  12)  0x1ff;
-   cmd   = (header  21)  0x7;
-
-   /* Validates header fields */
-   if(size  TM6000_URB_MSG_LEN)
-   size = TM6000_URB_MSG_LEN;
-
-   if (cmd == TM6000_URB_MSG_VIDEO) {
-   if ((block+1)*TM6000_URB_MSG_LENlinewidth)
-   cmd = TM6000_URB_MSG_ERR;
-
-   /* FIXME: Mounts the image as field0+field1
-* It should, instead, check if the user selected
-* entrelaced or non-entrelaced mode
-*/
-   pos= ((line1)+field)*linewidth +
-   block*TM6000_URB_MSG_LEN;
-
-   /* Don't allow to write out of the buffer */
-   if (pos+TM6000_URB_MSG_LEN  (*buf)-vb.size) {
-   dprintk(dev, V4L2_DEBUG_ISOC,
-   ERR: size=%d, num=%d, line=%d, 
-   field=%d\n,
-   size, block, line, field);
-
-   cmd = TM6000_URB_MSG_ERR;
-   }
-   } else {
-   pos=0;
-   }
-
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, size=%d, num=%d, 
-line=%d, field=%d\n,
-   size, block, line, field);
-
-   if ((last_line!=line)(last_line+1!=line) 
-   (cmd != TM6000_URB_MSG_ERR) )  {
-   if (cmd != TM6000_URB_MSG_VIDEO)  {
-   dprintk(dev, V4L2_DEBUG_ISOC,  cmd=%d, 
-   size=%d, num=%d, line=%d, field=%d\n,
-   cmd, size, block, line, field);
-   }
-   if (start_line0)
-   start_line=last_line;
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, lines= %d-%d, 
-   field=%d\n,
-   start_line, last_line, field);
-
-   if ((start_line6  last_line200) 
-   (last_field != field) ) {
-
-   dev-isoc_ctl.nfields++;
-   if (dev-isoc_ctl.nfields=2

[PATCH] tm6000: rewrite copy_streams

2010-05-31 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

fusion function copy streams and copy_packets to new function copy_streams.


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
 drivers/staging/tm6000/tm6000-video.c|  335 +++---
 2 files changed, 122 insertions(+), 218 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
b/drivers/staging/tm6000/tm6000-usb-isoc.h
index 5a5049a..138716a 100644
--- a/drivers/staging/tm6000/tm6000-usb-isoc.h
+++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
@@ -39,7 +39,7 @@ struct usb_isoc_ctl {
int pos, size, pktsize;
 
/* Last field: ODD or EVEN? */
-   int field;
+   int vfield;
 
/* Stores incomplete commands */
u32 tmp_buf;
@@ -47,7 +47,4 @@ struct usb_isoc_ctl {
 
/* Stores already requested buffers */
struct tm6000_buffer*buf;
-
-   /* Stores the number of received fields */
-   int nfields;
 };
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 2a61cc3..9746fe7 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -186,234 +186,145 @@ const char *tm6000_msg_type[] = {
 /*
  * Identify the tm5600/6000 buffer header type and properly handles
  */
-static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
-   u8 *out_p, struct tm6000_buffer **buf)
-{
-   struct tm6000_dmaqueue  *dma_q = urb-context;
-   struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
-   u8 c;
-   unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
-   int rc = 0;
-   /* FIXME: move to tm6000-isoc */
-   static int last_line = -2, start_line = -2, last_field = -2;
-
-   /* FIXME: this is the hardcoded window size
-*/
-   unsigned int linewidth = (*buf)-vb.width  1;
-
-   if (!dev-isoc_ctl.cmd) {
-   c = (header  24)  0xff;
-
-   /* split the header fields */
-   size  = ((header  0x7e)  1);
-
-   if (size  0)
-   size -= 4;
-
-   block = (header  7)  0xf;
-   field = (header  11)  0x1;
-   line  = (header  12)  0x1ff;
-   cmd   = (header  21)  0x7;
-
-   /* Validates header fields */
-   if(size  TM6000_URB_MSG_LEN)
-   size = TM6000_URB_MSG_LEN;
-
-   if (cmd == TM6000_URB_MSG_VIDEO) {
-   if ((block+1)*TM6000_URB_MSG_LENlinewidth)
-   cmd = TM6000_URB_MSG_ERR;
-
-   /* FIXME: Mounts the image as field0+field1
-* It should, instead, check if the user selected
-* entrelaced or non-entrelaced mode
-*/
-   pos= ((line1)+field)*linewidth +
-   block*TM6000_URB_MSG_LEN;
-
-   /* Don't allow to write out of the buffer */
-   if (pos+TM6000_URB_MSG_LEN  (*buf)-vb.size) {
-   dprintk(dev, V4L2_DEBUG_ISOC,
-   ERR: size=%d, num=%d, line=%d, 
-   field=%d\n,
-   size, block, line, field);
-
-   cmd = TM6000_URB_MSG_ERR;
-   }
-   } else {
-   pos=0;
-   }
-
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, size=%d, num=%d, 
-line=%d, field=%d\n,
-   size, block, line, field);
-
-   if ((last_line!=line)(last_line+1!=line) 
-   (cmd != TM6000_URB_MSG_ERR) )  {
-   if (cmd != TM6000_URB_MSG_VIDEO)  {
-   dprintk(dev, V4L2_DEBUG_ISOC,  cmd=%d, 
-   size=%d, num=%d, line=%d, field=%d\n,
-   cmd, size, block, line, field);
-   }
-   if (start_line0)
-   start_line=last_line;
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, lines= %d-%d, 
-   field=%d\n,
-   start_line, last_line, field);
-
-   if ((start_line6  last_line200) 
-   (last_field != field) ) {
-
-   dev-isoc_ctl.nfields++;
-   if (dev-isoc_ctl.nfields=2

Re: [PATCH] tm6000: rewrite copy_streams

2010-05-31 Thread Stefan Ringel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Am 01.06.2010 00:09, schrieb Mauro Carvalho Chehab:
 Em 31-05-2010 12:25, stefan.rin...@arcor.de escreveu:
 From: Stefan Ringel stefan.rin...@arcor.de

 fusion function copy streams and copy_packets to new function
copy_streams.


 There's something wrong with this patch:

 $ patch -p1 -i /tmp/tm6000\:\ rewrite\ copy_streams.eml -l
 (Stripping trailing CRs from patch.)
 patching file drivers/staging/tm6000/tm6000-usb-isoc.h
 (Stripping trailing CRs from patch.)
 patching file drivers/staging/tm6000/tm6000-video.c
 Hunk #1 FAILED at 186.
 Hunk #2 FAILED at 439.
 Hunk #3 FAILED at 451.
 3 out of 6 hunks FAILED -- saving rejects to file
drivers/staging/tm6000/tm6000-video.c.rej

 Please rebase it against git branch devel/for_v2.6.35 of my
v4l-dvb.git tree.

Thanks, I rebase it and send it new today.



  static int copy_streams(u8 *data, unsigned long len,
  struct urb *urb)
  {
  struct tm6000_dmaqueue  *dma_q = urb-context;
  struct tm6000_core *dev= container_of(dma_q,struct tm6000_core,vidq);
 -u8 *ptr=data, *endp=data+len;
 +u8 *ptr=data, *endp=data+len, c;
  unsigned long header=0;
  int rc=0;
 -struct tm6000_buffer *buf;
 -char *outp = NULL;
 -
 -get_next_buf(dma_q, buf);
 -if (buf)
 -outp = videobuf_to_vmalloc(buf-vb);
 +unsigned int cmd, cpysize, pktsize, size, field, block, line, pos
= 0;
 +struct tm6000_buffer *vbuf;
 +char *voutp = NULL;
 +unsigned int linewidth;
 
 -if (!outp)
 +/* get video buffer */
 +get_next_buf (dma_q, vbuf);
 +if (!vbuf)
 +return rc;
 +voutp = videobuf_to_vmalloc(vbuf-vb);
 +if (!voutp)
  return 0;
 
 -for (ptr=data; ptrendp;) {
 +for (ptr = data; ptr  endp;) {
  if (!dev-isoc_ctl.cmd) {
 -u8 *p=(u8 *)dev-isoc_ctl.tmp_buf;
 -/* FIXME: This seems very complex
 - * It just recovers up to 3 bytes of the header that
 - * might be at the previous packet
 - */
 -if (dev-isoc_ctl.tmp_buf_len) {
 -while (dev-isoc_ctl.tmp_buf_len) {
 -if ( *(ptr+3-dev-isoc_ctl.tmp_buf_len) == 0x47) {
 -break;
 -}
 -p++;
 -dev-isoc_ctl.tmp_buf_len--;
 -}
 -if (dev-isoc_ctl.tmp_buf_len) {
 -memcpy(header, p,
 -dev-isoc_ctl.tmp_buf_len);
 -memcpy((u8 *)header +
 +/* Header */
 +if (dev-isoc_ctl.tmp_buf_len  0) {
 +/* from last urb or packet */
 +header = dev-isoc_ctl.tmp_buf;
 +if (4 - dev-isoc_ctl.tmp_buf_len  0) {
 +memcpy ((u8 *)header +
  dev-isoc_ctl.tmp_buf_len,
  ptr,
  4 - dev-isoc_ctl.tmp_buf_len);
  ptr += 4 - dev-isoc_ctl.tmp_buf_len;
 -goto HEADER;
  }
 +dev-isoc_ctl.tmp_buf_len = 0;
 +} else {
 +if (ptr + 3 = endp) {
 +/* have incomplete header */
 +dev-isoc_ctl.tmp_buf_len = endp - ptr;
 +memcpy (dev-isoc_ctl.tmp_buf, ptr,
 +dev-isoc_ctl.tmp_buf_len);
 +return rc;
 +}
 +/* Seek for sync */
 +for (; ptr  endp - 3; ptr++) {
 +if (*(ptr + 3) == 0x47)
 +break;
 +}
 +/* Get message header */
 +header = *(unsigned long *)ptr;
 +ptr += 4;
  }
 -/* Seek for sync */
 -for (;ptrendp-3;ptr++) {
 -if (*(ptr+3)==0x47)
 -break;
 +/* split the header fields */
 +c = (header  24)  0xff;
 +size = ((header  0x7e)  1);
 +if (size  0)
 +size -= 4;
 +block = (header  7)  0xf;
 +field = (header  11)  0x1;
 +line  = (header  12)  0x1ff;
 +cmd   = (header  21)  0x7;
 +/* Validates haeder fields */
 +if (size  TM6000_URB_MSG_LEN)
 +size = TM6000_URB_MSG_LEN;
 +pktsize = TM6000_URB_MSG_LEN;
 +/* calculate position in buffer
 + * and change the buffer
 + */
 +switch (cmd) {
 +case TM6000_URB_MSG_VIDEO:
 +if ((dev-isoc_ctl.vfield != field) 
 +(field == 1)) {
 +/* Announces that a new buffer
 + * were filled
 + */
 +buffer_filled (dev, dma_q, vbuf);
 +dprintk (dev, V4L2_DEBUG_ISOC,
 +new

[PATCH 1/3] tm6000: rewrite init and fini

2010-05-30 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

rewrite tm6000_audio_init and tm6000_audio_fini

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-alsa.c |  127 +-
 drivers/staging/tm6000/tm6000.h  |   15 
 2 files changed, 63 insertions(+), 79 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
b/drivers/staging/tm6000/tm6000-alsa.c
index ce081cd..477dd78 100644
--- a/drivers/staging/tm6000/tm6000-alsa.c
+++ b/drivers/staging/tm6000/tm6000-alsa.c
@@ -35,29 +35,6 @@
} while (0)
 
 /
-   Data type declarations - Can be moded to a header file later
- /
-
-struct snd_tm6000_card {
-   struct snd_card*card;
-
-   spinlock_t reg_lock;
-
-   atomic_t   count;
-
-   unsigned int   period_size;
-   unsigned int   num_periods;
-
-   struct tm6000_core *core;
-   struct tm6000_buffer   *buf;
-
-   intbufsize;
-
-   struct snd_pcm_substream *substream;
-};
-
-
-/
Module global static vars
  /
 
@@ -311,21 +288,6 @@ static struct snd_pcm_ops snd_tm6000_pcm_ops = {
 /*
  * create a PCM device
  */
-static int __devinit snd_tm6000_pcm(struct snd_tm6000_card *chip,
-   int device, char *name)
-{
-   int err;
-   struct snd_pcm *pcm;
-
-   err = snd_pcm_new(chip-card, name, device, 0, 1, pcm);
-   if (err  0)
-   return err;
-   pcm-private_data = chip;
-   strcpy(pcm-name, name);
-   snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, snd_tm6000_pcm_ops);
-
-   return 0;
-}
 
 /* FIXME: Control interface - How to control volume/mute? */
 
@@ -336,73 +298,64 @@ static int __devinit snd_tm6000_pcm(struct 
snd_tm6000_card *chip,
 /*
  * Alsa Constructor - Component probe
  */
-
-int tm6000_audio_init(struct tm6000_core *dev, int idx)
+int tm6000_audio_init(struct tm6000_core *dev)
 {
-   struct snd_card *card;
-   struct snd_tm6000_card  *chip;
-   int rc, len;
-   charcomponent[14];
+   struct snd_card *card;
+   struct snd_tm6000_card  *chip;
+   int rc;
+   static int  devnr;
+   charcomponent[14];
+   struct snd_pcm  *pcm;
+
+   if (!dev)
+   return 0;
 
-   if (idx = SNDRV_CARDS)
+   if (devnr = SNDRV_CARDS)
return -ENODEV;
 
-   if (!enable[idx])
+   if (!enable[devnr])
return -ENOENT;
 
-   rc = snd_card_create(index[idx], id[idx], THIS_MODULE, 0, card);
+   rc = snd_card_create(index[devnr], id[devnr], THIS_MODULE, 0, card);
if (rc  0) {
-   snd_printk(KERN_ERR cannot create card instance %d\n, idx);
+   snd_printk(KERN_ERR cannot create card instance %d\n, devnr);
return rc;
}
 
-   chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+   chip = kzalloc(sizeof(struct snd_tm6000_card), GFP_KERNEL);
if (!chip) {
rc = -ENOMEM;
goto error;
}
 
-   chip-core = dev;
-   chip-card = card;
-
-   strcpy(card-driver, tm6000-alsa);
sprintf(component, USB%04x:%04x,
le16_to_cpu(dev-udev-descriptor.idVendor),
le16_to_cpu(dev-udev-descriptor.idProduct));
-   snd_component_add(card, component);
-
-   if (dev-udev-descriptor.iManufacturer)
-   len = usb_string(dev-udev,
-dev-udev-descriptor.iManufacturer,
-card-longname, sizeof(card-longname));
-   else
-   len = 0;
-
-   if (len  0)
-   strlcat(card-longname,  , sizeof(card-longname));
+   snd_component_add(card, component); 
 
-   strlcat(card-longname, card-shortname, sizeof(card-longname));
-
-   len = strlcat(card-longname,  at , sizeof(card-longname));
-
-   if (len  sizeof(card-longname))
-   usb_make_path(dev-udev, card-longname + len,
- sizeof(card-longname) - len);
-
-   strlcat(card-longname,
-   dev-udev-speed == USB_SPEED_LOW ? , low speed :
-   dev-udev-speed == USB_SPEED_FULL ? , full speed :
-  , high speed,
-   sizeof(card-longname));
-
-   rc = snd_tm6000_pcm(chip, 0, tm6000 Digital);
+   spin_lock_init(chip-reg_lock);
+   rc = snd_pcm_new(card, TM6000 Audio, 0, 0, 1, pcm);
if (rc

[PATCH 3/3] tm6000: move dvb into a separate kern module

2010-05-30 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

move dvb into a separate kern module


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/Kconfig|4 +-
 drivers/staging/tm6000/Makefile   |5 +--
 drivers/staging/tm6000/tm6000-cards.c |   31 +---
 drivers/staging/tm6000/tm6000-core.c  |1 +
 drivers/staging/tm6000/tm6000-dvb.c   |   83 -
 drivers/staging/tm6000/tm6000.h   |1 +
 6 files changed, 89 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/tm6000/Kconfig b/drivers/staging/tm6000/Kconfig
index 3657e33..c725356 100644
--- a/drivers/staging/tm6000/Kconfig
+++ b/drivers/staging/tm6000/Kconfig
@@ -26,8 +26,8 @@ config VIDEO_TM6000_ALSA
  module will be called tm6000-alsa.
 
 config VIDEO_TM6000_DVB
-   bool DVB Support for tm6000 based TV cards
-   depends on VIDEO_TM6000  DVB_CORE  EXPERIMENTAL
+   tristate DVB Support for tm6000 based TV cards
+   depends on VIDEO_TM6000  DVB_CORE  USB  EXPERIMENTAL
select DVB_ZL10353
---help---
  This adds support for DVB cards based on the tm5600/tm6000 chip.
diff --git a/drivers/staging/tm6000/Makefile b/drivers/staging/tm6000/Makefile
index 93370fc..4129c18 100644
--- a/drivers/staging/tm6000/Makefile
+++ b/drivers/staging/tm6000/Makefile
@@ -4,12 +4,9 @@ tm6000-objs := tm6000-cards.o \
   tm6000-video.o \
   tm6000-stds.o
 
-ifeq ($(CONFIG_VIDEO_TM6000_DVB),y)
-tm6000-objs += tm6000-dvb.o
-endif
-
 obj-$(CONFIG_VIDEO_TM6000) += tm6000.o
 obj-$(CONFIG_VIDEO_TM6000_ALSA) += tm6000-alsa.o
+obj-$(CONFIG_VIDEO_TM6000_DVB) += tm6000-dvb.o
 
 EXTRA_CFLAGS = -Idrivers/media/video
 EXTRA_CFLAGS += -Idrivers/media/common/tuners
diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 553ebe4..87b0bc4 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -346,7 +346,7 @@ int tm6000_xc5000_callback(void *ptr, int component, int 
command, int arg)
}
return (rc);
 }
-
+EXPORT_SYMBOL_GPL(tm6000_xc5000_callback);
 
 /* Tuner callback to provide the proper gpio changes needed for xc2028 */
 
@@ -436,6 +436,7 @@ int tm6000_tuner_callback(void *ptr, int component, int 
command, int arg)
}
return rc;
 }
+EXPORT_SYMBOL_GPL(tm6000_tuner_callback);
 
 int tm6000_cards_setup(struct tm6000_core *dev)
 {
@@ -693,31 +694,12 @@ static int tm6000_init_dev(struct tm6000_core *dev)
goto err;
 
tm6000_add_into_devlist(dev);
-
tm6000_init_extension(dev);
 
-   if (dev-caps.has_dvb) {
-   dev-dvb = kzalloc(sizeof(*(dev-dvb)), GFP_KERNEL);
-   if (!dev-dvb) {
-   rc = -ENOMEM;
-   goto err2;
-   }
-
-#ifdef CONFIG_VIDEO_TM6000_DVB
-   rc = tm6000_dvb_register(dev);
-   if (rc  0) {
-   kfree(dev-dvb);
-   dev-dvb = NULL;
-   goto err2;
-   }
-#endif
}
mutex_unlock(dev-lock);
return 0;
 
-err2:
-   v4l2_device_unregister(dev-v4l2_dev);
-
 err:
mutex_unlock(dev-lock);
return rc;
@@ -918,13 +900,6 @@ static void tm6000_usb_disconnect(struct usb_interface 
*interface)
 
mutex_lock(dev-lock);
 
-#ifdef CONFIG_VIDEO_TM6000_DVB
-   if (dev-dvb) {
-   tm6000_dvb_unregister(dev);
-   kfree(dev-dvb);
-   }
-#endif
-
if (dev-gpio.power_led) {
switch (dev-model) {
case TM6010_BOARD_HAUPPAUGE_900H:
@@ -954,8 +929,8 @@ static void tm6000_usb_disconnect(struct usb_interface 
*interface)
 
usb_put_dev(dev-udev);
 
-   tm6000_remove_from_devlist(dev);
tm6000_close_extension(dev);
+   tm6000_remove_from_devlist(dev);
 
mutex_unlock(dev-lock);
kfree(dev);
diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index b5965a8..cd87b14 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -396,6 +396,7 @@ int tm6000_init_digital_mode (struct tm6000_core *dev)
 
return 0;
 }
+EXPORT_SYMBOL(tm6000_init_digial_mode);
 
 struct reg_init {
u8 req;
diff --git a/drivers/staging/tm6000/tm6000-dvb.c 
b/drivers/staging/tm6000/tm6000-dvb.c
index b9e9ef1..7830826 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -38,6 +38,19 @@
dev-name, __FUNCTION__, ##arg);\
} while (0)
 
+MODULE_DESCRIPTION(DVB driver extension module for tm5600/6000/6010 based TV 
cards);
+MODULE_AUTHOR(Mauro Carvalho Chehab mche...@redhat.com);
+MODULE_LICENSE(GPL);
+
+MODULE_SUPPORTED_DEVICE({{Trident, tm5600},
+   {{Trident, tm6000},
+   {{Trident, tm6010});
+
+static int debug

Re: [PATCH 5/5] tm6000: rewrite copy_streams

2010-05-28 Thread Stefan Ringel
Am 27.05.2010 23:23, schrieb Mauro Carvalho Chehab:
 Em Sun, 23 May 2010 20:31:45 +0200
 stefan.rin...@arcor.de escreveu:

   
 From: Stefan Ringel stefan.rin...@arcor.de

 fusion function copy streams and copy_packets to new function copy_streams.

 Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
 ---
  drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
  drivers/staging/tm6000/tm6000-video.c|  337 
 +++---
  2 files changed, 127 insertions(+), 215 deletions(-)

 diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
 b/drivers/staging/tm6000/tm6000-usb-isoc.h
 index 5a5049a..138716a 100644
 --- a/drivers/staging/tm6000/tm6000-usb-isoc.h
 +++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
 @@ -39,7 +39,7 @@ struct usb_isoc_ctl {
  int pos, size, pktsize;
  
  /* Last field: ODD or EVEN? */
 -int field;
 +int vfield;
  
  /* Stores incomplete commands */
  u32 tmp_buf;
 @@ -47,7 +47,4 @@ struct usb_isoc_ctl {
  
  /* Stores already requested buffers */
  struct tm6000_buffer*buf;
 -
 -/* Stores the number of received fields */
 -int nfields;
  };
 diff --git a/drivers/staging/tm6000/tm6000-video.c 
 b/drivers/staging/tm6000/tm6000-video.c
 index 2a61cc3..31c574f 100644
 --- a/drivers/staging/tm6000/tm6000-video.c
 +++ b/drivers/staging/tm6000/tm6000-video.c
 @@ -186,234 +186,153 @@ const char *tm6000_msg_type[] = {
  /*
   * Identify the tm5600/6000 buffer header type and properly handles
   */
 -static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
 -u8 *out_p, struct tm6000_buffer **buf)
 -{
 -struct tm6000_dmaqueue  *dma_q = urb-context;
 -struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
 -u8 c;
 -unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
 -int rc = 0;
 -/* FIXME: move to tm6000-isoc */
 -static int last_line = -2, start_line = -2, last_field = -2;
 -
 -/* FIXME: this is the hardcoded window size
 - */
 -unsigned int linewidth = (*buf)-vb.width  1;
 -
 -if (!dev-isoc_ctl.cmd) {
 -c = (header  24)  0xff;
 -
 -/* split the header fields */
 -size  = ((header  0x7e)  1);
 -
 -if (size  0)
 -size -= 4;
 -
 -block = (header  7)  0xf;
 -field = (header  11)  0x1;
 -line  = (header  12)  0x1ff;
 -cmd   = (header  21)  0x7;
 -
 -/* Validates header fields */
 -if(size  TM6000_URB_MSG_LEN)
 -size = TM6000_URB_MSG_LEN;
 -
 -if (cmd == TM6000_URB_MSG_VIDEO) {
 -if ((block+1)*TM6000_URB_MSG_LENlinewidth)
 -cmd = TM6000_URB_MSG_ERR;
 -
 -/* FIXME: Mounts the image as field0+field1
 - * It should, instead, check if the user selected
 - * entrelaced or non-entrelaced mode
 - */
 -pos= ((line1)+field)*linewidth +
 -block*TM6000_URB_MSG_LEN;
 -
 -/* Don't allow to write out of the buffer */
 -if (pos+TM6000_URB_MSG_LEN  (*buf)-vb.size) {
 -dprintk(dev, V4L2_DEBUG_ISOC,
 -ERR: size=%d, num=%d, line=%d, 
 -field=%d\n,
 -size, block, line, field);
 -
 -cmd = TM6000_URB_MSG_ERR;
 -}
 -} else {
 -pos=0;
 -}
 -
 -/* Prints debug info */
 -dprintk(dev, V4L2_DEBUG_ISOC, size=%d, num=%d, 
 - line=%d, field=%d\n,
 -size, block, line, field);
 -
 -if ((last_line!=line)(last_line+1!=line) 
 -(cmd != TM6000_URB_MSG_ERR) )  {
 -if (cmd != TM6000_URB_MSG_VIDEO)  {
 -dprintk(dev, V4L2_DEBUG_ISOC,  cmd=%d, 
 -size=%d, num=%d, line=%d, field=%d\n,
 -cmd, size, block, line, field);
 -}
 -if (start_line0)
 -start_line=last_line;
 -/* Prints debug info */
 -dprintk(dev, V4L2_DEBUG_ISOC, lines= %d-%d, 
 -field=%d\n,
 -start_line, last_line, field);
 -
 -if ((start_line6  last_line200) 
 -(last_field != field) ) {
 -
 -dev-isoc_ctl.nfields++;
 -if (dev

[PATCH] tm6000: rewrite copy_streams

2010-05-28 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

fusion function copy streams and copy_packets to new function copy_streams.

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
 drivers/staging/tm6000/tm6000-video.c|  329 +++---
 2 files changed, 119 insertions(+), 215 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
b/drivers/staging/tm6000/tm6000-usb-isoc.h
index 5a5049a..138716a 100644
--- a/drivers/staging/tm6000/tm6000-usb-isoc.h
+++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
@@ -39,7 +39,7 @@ struct usb_isoc_ctl {
int pos, size, pktsize;
 
/* Last field: ODD or EVEN? */
-   int field;
+   int vfield;
 
/* Stores incomplete commands */
u32 tmp_buf;
@@ -47,7 +47,4 @@ struct usb_isoc_ctl {
 
/* Stores already requested buffers */
struct tm6000_buffer*buf;
-
-   /* Stores the number of received fields */
-   int nfields;
 };
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 2a61cc3..058c6e9 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -186,234 +186,145 @@ const char *tm6000_msg_type[] = {
 /*
  * Identify the tm5600/6000 buffer header type and properly handles
  */
-static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
-   u8 *out_p, struct tm6000_buffer **buf)
-{
-   struct tm6000_dmaqueue  *dma_q = urb-context;
-   struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
-   u8 c;
-   unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
-   int rc = 0;
-   /* FIXME: move to tm6000-isoc */
-   static int last_line = -2, start_line = -2, last_field = -2;
-
-   /* FIXME: this is the hardcoded window size
-*/
-   unsigned int linewidth = (*buf)-vb.width  1;
-
-   if (!dev-isoc_ctl.cmd) {
-   c = (header  24)  0xff;
-
-   /* split the header fields */
-   size  = ((header  0x7e)  1);
-
-   if (size  0)
-   size -= 4;
-
-   block = (header  7)  0xf;
-   field = (header  11)  0x1;
-   line  = (header  12)  0x1ff;
-   cmd   = (header  21)  0x7;
-
-   /* Validates header fields */
-   if(size  TM6000_URB_MSG_LEN)
-   size = TM6000_URB_MSG_LEN;
-
-   if (cmd == TM6000_URB_MSG_VIDEO) {
-   if ((block+1)*TM6000_URB_MSG_LENlinewidth)
-   cmd = TM6000_URB_MSG_ERR;
-
-   /* FIXME: Mounts the image as field0+field1
-* It should, instead, check if the user selected
-* entrelaced or non-entrelaced mode
-*/
-   pos= ((line1)+field)*linewidth +
-   block*TM6000_URB_MSG_LEN;
-
-   /* Don't allow to write out of the buffer */
-   if (pos+TM6000_URB_MSG_LEN  (*buf)-vb.size) {
-   dprintk(dev, V4L2_DEBUG_ISOC,
-   ERR: size=%d, num=%d, line=%d, 
-   field=%d\n,
-   size, block, line, field);
-
-   cmd = TM6000_URB_MSG_ERR;
-   }
-   } else {
-   pos=0;
-   }
-
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, size=%d, num=%d, 
-line=%d, field=%d\n,
-   size, block, line, field);
-
-   if ((last_line!=line)(last_line+1!=line) 
-   (cmd != TM6000_URB_MSG_ERR) )  {
-   if (cmd != TM6000_URB_MSG_VIDEO)  {
-   dprintk(dev, V4L2_DEBUG_ISOC,  cmd=%d, 
-   size=%d, num=%d, line=%d, field=%d\n,
-   cmd, size, block, line, field);
-   }
-   if (start_line0)
-   start_line=last_line;
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, lines= %d-%d, 
-   field=%d\n,
-   start_line, last_line, field);
-
-   if ((start_line6  last_line200) 
-   (last_field != field) ) {
-
-   dev-isoc_ctl.nfields++;
-   if (dev-isoc_ctl.nfields=2

[PATCH] tm6000: rewrite copy_streams

2010-05-28 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

fusion function copy streams and copy_packets to new function copy_streams.

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
 drivers/staging/tm6000/tm6000-video.c|  329 +++---
 2 files changed, 119 insertions(+), 215 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
b/drivers/staging/tm6000/tm6000-usb-isoc.h
index 5a5049a..138716a 100644
--- a/drivers/staging/tm6000/tm6000-usb-isoc.h
+++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
@@ -39,7 +39,7 @@ struct usb_isoc_ctl {
int pos, size, pktsize;
 
/* Last field: ODD or EVEN? */
-   int field;
+   int vfield;
 
/* Stores incomplete commands */
u32 tmp_buf;
@@ -47,7 +47,4 @@ struct usb_isoc_ctl {
 
/* Stores already requested buffers */
struct tm6000_buffer*buf;
-
-   /* Stores the number of received fields */
-   int nfields;
 };
diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 2a61cc3..058c6e9 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -186,234 +186,145 @@ const char *tm6000_msg_type[] = {
 /*
  * Identify the tm5600/6000 buffer header type and properly handles
  */
-static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
-   u8 *out_p, struct tm6000_buffer **buf)
-{
-   struct tm6000_dmaqueue  *dma_q = urb-context;
-   struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
-   u8 c;
-   unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
-   int rc = 0;
-   /* FIXME: move to tm6000-isoc */
-   static int last_line = -2, start_line = -2, last_field = -2;
-
-   /* FIXME: this is the hardcoded window size
-*/
-   unsigned int linewidth = (*buf)-vb.width  1;
-
-   if (!dev-isoc_ctl.cmd) {
-   c = (header  24)  0xff;
-
-   /* split the header fields */
-   size  = ((header  0x7e)  1);
-
-   if (size  0)
-   size -= 4;
-
-   block = (header  7)  0xf;
-   field = (header  11)  0x1;
-   line  = (header  12)  0x1ff;
-   cmd   = (header  21)  0x7;
-
-   /* Validates header fields */
-   if(size  TM6000_URB_MSG_LEN)
-   size = TM6000_URB_MSG_LEN;
-
-   if (cmd == TM6000_URB_MSG_VIDEO) {
-   if ((block+1)*TM6000_URB_MSG_LENlinewidth)
-   cmd = TM6000_URB_MSG_ERR;
-
-   /* FIXME: Mounts the image as field0+field1
-* It should, instead, check if the user selected
-* entrelaced or non-entrelaced mode
-*/
-   pos= ((line1)+field)*linewidth +
-   block*TM6000_URB_MSG_LEN;
-
-   /* Don't allow to write out of the buffer */
-   if (pos+TM6000_URB_MSG_LEN  (*buf)-vb.size) {
-   dprintk(dev, V4L2_DEBUG_ISOC,
-   ERR: size=%d, num=%d, line=%d, 
-   field=%d\n,
-   size, block, line, field);
-
-   cmd = TM6000_URB_MSG_ERR;
-   }
-   } else {
-   pos=0;
-   }
-
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, size=%d, num=%d, 
-line=%d, field=%d\n,
-   size, block, line, field);
-
-   if ((last_line!=line)(last_line+1!=line) 
-   (cmd != TM6000_URB_MSG_ERR) )  {
-   if (cmd != TM6000_URB_MSG_VIDEO)  {
-   dprintk(dev, V4L2_DEBUG_ISOC,  cmd=%d, 
-   size=%d, num=%d, line=%d, field=%d\n,
-   cmd, size, block, line, field);
-   }
-   if (start_line0)
-   start_line=last_line;
-   /* Prints debug info */
-   dprintk(dev, V4L2_DEBUG_ISOC, lines= %d-%d, 
-   field=%d\n,
-   start_line, last_line, field);
-
-   if ((start_line6  last_line200) 
-   (last_field != field) ) {
-
-   dev-isoc_ctl.nfields++;
-   if (dev-isoc_ctl.nfields=2

Re: [PATCH] tm6000: rewrite copy_streams

2010-05-28 Thread Stefan Ringel
Am 28.05.2010 20:03, schrieb stefan.rin...@arcor.de:
 From: Stefan Ringel stefan.rin...@arcor.de

 fusion function copy streams and copy_packets to new function copy_streams.

 Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
 ---
  drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
  drivers/staging/tm6000/tm6000-video.c|  329 
 +++---
  2 files changed, 119 insertions(+), 215 deletions(-)

 diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
 b/drivers/staging/tm6000/tm6000-usb-isoc.h
 -- snipp
   
Mauro can you superseded the patch from 28.05.2010 , 18:03 h

thanks
Stefan Ringel

-- 
Stefan Ringel stefan.rin...@arcor.de

attachment: stefan_ringel.vcf

Re: [PATCH 3/4] tm6000: bugfix video image

2010-05-27 Thread Stefan Ringel
Am 27.05.2010 16:43, schrieb Luis Henrique Fagundes:
 Hi Stefan,

 Looks like your patch sent on May 19th doesn't compile. I might be
 missing something, but I needed the attached patch to make it compile.

 Luis
   

That is bugfix in later patch ([5/5] tm6000:rewrite copy_streams
https://patchwork.kernel.org/patch/101759/ from 23.05.2010)




-- 
Stefan Ringel stefan.rin...@arcor.de

attachment: stefan_ringel.vcf

Re: [PATCH 2/2] tm6000: add extension

2010-05-27 Thread Stefan Ringel
Am 27.05.2010 17:21, schrieb Bee Hock Goh:
 Stefan,

 Did you have a kernel opps while loading the tm6000-alsa?

 regards,
  Hock.

   
No, but I rewrite the  init and fini function. If that works I send it.
 On Tue, May 11, 2010 at 12:22 AM,  stefan.rin...@arcor.de wrote:
   
 From: Stefan Ringel stefan.rin...@arcor.de

 add extension
 add module init over tm6000 extension


 Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
 ---
  drivers/staging/tm6000/tm6000-alsa.c  |   25 +-
  drivers/staging/tm6000/tm6000-cards.c |7 +++
  drivers/staging/tm6000/tm6000-core.c  |   92 
 +
  drivers/staging/tm6000/tm6000.h   |   23 -
  4 files changed, 145 insertions(+), 2 deletions(-)

 diff --git a/drivers/staging/tm6000/tm6000-alsa.c 
 b/drivers/staging/tm6000/tm6000-alsa.c
 index bc89f9d..ce081cd 100644
 --- a/drivers/staging/tm6000/tm6000-alsa.c
 +++ b/drivers/staging/tm6000/tm6000-alsa.c
 @@ -410,5 +410,28 @@ error:
snd_card_free(card);
return rc;
  }
 -EXPORT_SYMBOL_GPL(tm6000_audio_init);

 +static int tm6000_audio_fini(struct tm6000_core *dev)
 +{
 +   return 0;
 +}
 +
 +struct tm6000_ops audio_ops = {
 +   .id = TM6000_AUDIO,
 +   .name   = TM6000 Audio Extension,
 +   .init   = tm6000_audio_init,
 +   .fini   = tm6000_audio_fini,
 +};
 +
 +static int __init tm6000_alsa_register(void)
 +{
 +   return tm6000_register_extension(audio_ops);
 +}
 +
 +static void __exit tm6000_alsa_unregister(void)
 +{
 +   tm6000_unregister_extension(audio_ops);
 +}
 +
 +module_init(tm6000_alsa_register);
 +module_exit(tm6000_alsa_unregister);
 diff --git a/drivers/staging/tm6000/tm6000-cards.c 
 b/drivers/staging/tm6000/tm6000-cards.c
 index 9f6160b..33b134b 100644
 --- a/drivers/staging/tm6000/tm6000-cards.c
 +++ b/drivers/staging/tm6000/tm6000-cards.c
 @@ -692,6 +692,10 @@ static int tm6000_init_dev(struct tm6000_core *dev)
if (rc  0)
goto err;

 +   tm6000_add_into_devlist(dev);
 +
 +   tm6000_init_extension(dev);
 +
if (dev-caps.has_dvb) {
dev-dvb = kzalloc(sizeof(*(dev-dvb)), GFP_KERNEL);
if (!dev-dvb) {
 @@ -931,6 +935,9 @@ static void tm6000_usb_disconnect(struct usb_interface 
 *interface)

usb_put_dev(dev-udev);

 +   tm6000_remove_from_devlist(dev);
 +   tm6000_close_extension(dev);
 +
mutex_unlock(dev-lock);
kfree(dev);
  }
 diff --git a/drivers/staging/tm6000/tm6000-core.c 
 b/drivers/staging/tm6000/tm6000-core.c
 index bfbc53b..1259ae5 100644
 --- a/drivers/staging/tm6000/tm6000-core.c
 +++ b/drivers/staging/tm6000/tm6000-core.c
 @@ -600,3 +600,95 @@ printk(Original value=%d\n,val);
return val;
  }
  EXPORT_SYMBOL_GPL(tm6000_set_audio_bitrate);
 +
 +static LIST_HEAD(tm6000_devlist);
 +static DEFINE_MUTEX(tm6000_devlist_mutex);
 +
 +/*
 + * tm6000_realease_resource()
 + */
 +
 +void tm6000_remove_from_devlist(struct tm6000_core *dev)
 +{
 +   mutex_lock(tm6000_devlist_mutex);
 +   list_del(dev-devlist);
 +   mutex_unlock(tm6000_devlist_mutex);
 +};
 +
 +void tm6000_add_into_devlist(struct tm6000_core *dev)
 +{
 +   mutex_lock(tm6000_devlist_mutex);
 +   list_add_tail(dev-devlist, tm6000_devlist);
 +   mutex_unlock(tm6000_devlist_mutex);
 +};
 +
 +/*
 + * Extension interface
 + */
 +
 +static LIST_HEAD(tm6000_extension_devlist);
 +static DEFINE_MUTEX(tm6000_extension_devlist_lock);
 +
 +int tm6000_register_extension(struct tm6000_ops *ops)
 +{
 +   struct tm6000_core *dev = NULL;
 +
 +   mutex_lock(tm6000_devlist_mutex);
 +   mutex_lock(tm6000_extension_devlist_lock);
 +   list_add_tail(ops-next, tm6000_extension_devlist);
 +   list_for_each_entry(dev, tm6000_devlist, devlist) {
 +   if (dev)
 +   ops-init(dev);
 +   }
 +   printk(KERN_INFO tm6000: Initialized (%s) extension\n, ops-name);
 +   mutex_unlock(tm6000_extension_devlist_lock);
 +   mutex_unlock(tm6000_devlist_mutex);
 +   return 0;
 +}
 +EXPORT_SYMBOL(tm6000_register_extension);
 +
 +void tm6000_unregister_extension(struct tm6000_ops *ops)
 +{
 +   struct tm6000_core *dev = NULL;
 +
 +   mutex_lock(tm6000_devlist_mutex);
 +   list_for_each_entry(dev, tm6000_devlist, devlist) {
 +   if (dev)
 +   ops-fini(dev);
 +   }
 +
 +   mutex_lock(tm6000_extension_devlist_lock);
 +   printk(KERN_INFO tm6000: Remove (%s) extension\n, ops-name);
 +   list_del(ops-next);
 +   mutex_unlock(tm6000_extension_devlist_lock);
 +   mutex_unlock(tm6000_devlist_mutex);
 +}
 +EXPORT_SYMBOL(tm6000_unregister_extension);
 +
 +void tm6000_init_extension(struct tm6000_core *dev)
 +{
 +   struct tm6000_ops *ops = NULL;
 +
 +   mutex_lock(tm6000_extension_devlist_lock);
 +   if (!list_empty(tm6000_extension_devlist)) {
 +   list_for_each_entry(ops, tm6000_extension_devlist, next

Re: [PATCH 3/4] tm6000: bugfix video image

2010-05-27 Thread Stefan Ringel
Am 27.05.2010 16:43, schrieb Luis Henrique Fagundes:
 Hi Stefan,

 Looks like your patch sent on May 19th doesn't compile. I might be
 missing something, but I needed the attached patch to make it compile.

 Luis
   

@@ -452,7 +452,7 @@
while (len0) {
cpysize=min(len,buf-vb.size-pos);
//printk(Copying %d bytes (max=%lu) from %p to 
%p[%u]\n,cpysize,(*buf)-vb.size,ptr,out_p,pos);
-   memcpy(out_p[pos], ptr, cpysize);
+   memcpy(outp[pos], ptr, cpysize);
pos+=cpysize;
ptr+=cpysize;
len-=cpysize;
@@ -464,8 +464,8 @@
get_next_buf (dma_q, buf);
if (!buf)
break;
-   out_p = videobuf_to_vmalloc((buf-vb));
-   if (!out_p)
+   outp = videobuf_to_vmalloc((buf-vb));
+   if (!outp)
return rc;
pos = 0;
}


I have overseen that, as I generate a patch. In my devel-tree I have outp.

-- 
Stefan Ringel stefan.rin...@arcor.de

attachment: stefan_ringel.vcf

[PATCH] tm6000: bugfix outp in function copy_multiplexed

2010-05-27 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

bugfix outp in function copy_multiplexed


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-video.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 31c574f..96cbbf7 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -358,7 +358,7 @@ static int copy_multiplexed(u8 *ptr, unsigned long len,
while (len0) {
cpysize=min(len,buf-vb.size-pos);
//printk(Copying %d bytes (max=%lu) from %p to 
%p[%u]\n,cpysize,(*buf)-vb.size,ptr,out_p,pos);
-   memcpy(out_p[pos], ptr, cpysize);
+   memcpy(outp[pos], ptr, cpysize);
pos+=cpysize;
ptr+=cpysize;
len-=cpysize;
@@ -370,8 +370,8 @@ static int copy_multiplexed(u8 *ptr, unsigned long len,
get_next_buf (dma_q, buf);
if (!buf)
break;
-   out_p = videobuf_to_vmalloc((buf-vb));
-   if (!out_p)
+   outp = videobuf_to_vmalloc((buf-vb));
+   if (!outp)
return rc;
pos = 0;
}
-- 
1.7.0.3

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


Re: [PATCH 5/5] tm6000: rewrite copy_streams

2010-05-27 Thread Stefan Ringel
Am 27.05.2010 23:23, schrieb Mauro Carvalho Chehab:
 Em Sun, 23 May 2010 20:31:45 +0200
 stefan.rin...@arcor.de escreveu:

   
 From: Stefan Ringel stefan.rin...@arcor.de

 fusion function copy streams and copy_packets to new function copy_streams.

 Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
 ---
  drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
  drivers/staging/tm6000/tm6000-video.c|  337 
 +++---
  2 files changed, 127 insertions(+), 215 deletions(-)

 diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
 b/drivers/staging/tm6000/tm6000-usb-isoc.h
 index 5a5049a..138716a 100644
 --- a/drivers/staging/tm6000/tm6000-usb-isoc.h
 +++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
 @@ -39,7 +39,7 @@ struct usb_isoc_ctl {
  int pos, size, pktsize;
  
  /* Last field: ODD or EVEN? */
 -int field;
 +int vfield;
  
  /* Stores incomplete commands */
  u32 tmp_buf;
 @@ -47,7 +47,4 @@ struct usb_isoc_ctl {
  
  /* Stores already requested buffers */
  struct tm6000_buffer*buf;
 -
 -/* Stores the number of received fields */
 -int nfields;
  };
 diff --git a/drivers/staging/tm6000/tm6000-video.c 
 b/drivers/staging/tm6000/tm6000-video.c
 index 2a61cc3..31c574f 100644
 --- a/drivers/staging/tm6000/tm6000-video.c
 +++ b/drivers/staging/tm6000/tm6000-video.c
 @@ -186,234 +186,153 @@ const char *tm6000_msg_type[] = {
  /*
   * Identify the tm5600/6000 buffer header type and properly handles
   */
 -static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
 -u8 *out_p, struct tm6000_buffer **buf)
 -{
 -struct tm6000_dmaqueue  *dma_q = urb-context;
 -struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
 -u8 c;
 -unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
 -int rc = 0;
 -/* FIXME: move to tm6000-isoc */
 -static int last_line = -2, start_line = -2, last_field = -2;
 -
 -/* FIXME: this is the hardcoded window size
 - */
 -unsigned int linewidth = (*buf)-vb.width  1;
 -
 -if (!dev-isoc_ctl.cmd) {
 -c = (header  24)  0xff;
 -
 -/* split the header fields */
 -size  = ((header  0x7e)  1);
 -
 -if (size  0)
 -size -= 4;
 -
 -block = (header  7)  0xf;
 -field = (header  11)  0x1;
 -line  = (header  12)  0x1ff;
 -cmd   = (header  21)  0x7;
 -
 -/* Validates header fields */
 -if(size  TM6000_URB_MSG_LEN)
 -size = TM6000_URB_MSG_LEN;
 -
 -if (cmd == TM6000_URB_MSG_VIDEO) {
 -if ((block+1)*TM6000_URB_MSG_LENlinewidth)
 -cmd = TM6000_URB_MSG_ERR;
 -
 -/* FIXME: Mounts the image as field0+field1
 - * It should, instead, check if the user selected
 - * entrelaced or non-entrelaced mode
 - */
 -pos= ((line1)+field)*linewidth +
 -block*TM6000_URB_MSG_LEN;
 -
 -/* Don't allow to write out of the buffer */
 -if (pos+TM6000_URB_MSG_LEN  (*buf)-vb.size) {
 -dprintk(dev, V4L2_DEBUG_ISOC,
 -ERR: size=%d, num=%d, line=%d, 
 -field=%d\n,
 -size, block, line, field);
 -
 -cmd = TM6000_URB_MSG_ERR;
 -}
 -} else {
 -pos=0;
 -}
 -
 -/* Prints debug info */
 -dprintk(dev, V4L2_DEBUG_ISOC, size=%d, num=%d, 
 - line=%d, field=%d\n,
 -size, block, line, field);
 -
 -if ((last_line!=line)(last_line+1!=line) 
 -(cmd != TM6000_URB_MSG_ERR) )  {
 -if (cmd != TM6000_URB_MSG_VIDEO)  {
 -dprintk(dev, V4L2_DEBUG_ISOC,  cmd=%d, 
 -size=%d, num=%d, line=%d, field=%d\n,
 -cmd, size, block, line, field);
 -}
 -if (start_line0)
 -start_line=last_line;
 -/* Prints debug info */
 -dprintk(dev, V4L2_DEBUG_ISOC, lines= %d-%d, 
 -field=%d\n,
 -start_line, last_line, field);
 -
 -if ((start_line6  last_line200) 
 -(last_field != field) ) {
 -
 -dev-isoc_ctl.nfields++;
 -if (dev

Re: [PATCH 5/5] tm6000: rewrite copy_streams

2010-05-27 Thread Stefan Ringel
Am 27.05.2010 23:23, schrieb Mauro Carvalho Chehab:
 Em Sun, 23 May 2010 20:31:45 +0200
 stefan.rin...@arcor.de escreveu:

   
 From: Stefan Ringel stefan.rin...@arcor.de

 fusion function copy streams and copy_packets to new function copy_streams.

 Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
 ---
  drivers/staging/tm6000/tm6000-usb-isoc.h |5 +-
  drivers/staging/tm6000/tm6000-video.c|  337 
 +++---
  2 files changed, 127 insertions(+), 215 deletions(-)

 diff --git a/drivers/staging/tm6000/tm6000-usb-isoc.h 
 b/drivers/staging/tm6000/tm6000-usb-isoc.h
 index 5a5049a..138716a 100644
 --- a/drivers/staging/tm6000/tm6000-usb-isoc.h
 +++ b/drivers/staging/tm6000/tm6000-usb-isoc.h
 @@ -39,7 +39,7 @@ struct usb_isoc_ctl {
  int pos, size, pktsize;
  
  /* Last field: ODD or EVEN? */
 -int field;
 +int vfield;
  
  /* Stores incomplete commands */
  u32 tmp_buf;
 @@ -47,7 +47,4 @@ struct usb_isoc_ctl {
  
  /* Stores already requested buffers */
  struct tm6000_buffer*buf;
 -
 -/* Stores the number of received fields */
 -int nfields;
  };
 diff --git a/drivers/staging/tm6000/tm6000-video.c 
 b/drivers/staging/tm6000/tm6000-video.c
 index 2a61cc3..31c574f 100644
 --- a/drivers/staging/tm6000/tm6000-video.c
 +++ b/drivers/staging/tm6000/tm6000-video.c
 @@ -186,234 +186,153 @@ const char *tm6000_msg_type[] = {
  /*
   * Identify the tm5600/6000 buffer header type and properly handles
   */
 -static int copy_packet(struct urb *urb, u32 header, u8 **ptr, u8 *endp,
 -u8 *out_p, struct tm6000_buffer **buf)
 -{
 -struct tm6000_dmaqueue  *dma_q = urb-context;
 -struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
 -u8 c;
 -unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
 -int rc = 0;
 -/* FIXME: move to tm6000-isoc */
 -static int last_line = -2, start_line = -2, last_field = -2;
 -
 -/* FIXME: this is the hardcoded window size
 - */
 -unsigned int linewidth = (*buf)-vb.width  1;
 -
 -if (!dev-isoc_ctl.cmd) {
 -c = (header  24)  0xff;
 -
 -/* split the header fields */
 -size  = ((header  0x7e)  1);
 -
 -if (size  0)
 -size -= 4;
 -
 -block = (header  7)  0xf;
 -field = (header  11)  0x1;
 -line  = (header  12)  0x1ff;
 -cmd   = (header  21)  0x7;
 -
 -/* Validates header fields */
 -if(size  TM6000_URB_MSG_LEN)
 -size = TM6000_URB_MSG_LEN;
 -
 -if (cmd == TM6000_URB_MSG_VIDEO) {
 -if ((block+1)*TM6000_URB_MSG_LENlinewidth)
 -cmd = TM6000_URB_MSG_ERR;
 -
 -/* FIXME: Mounts the image as field0+field1
 - * It should, instead, check if the user selected
 - * entrelaced or non-entrelaced mode
 - */
 -pos= ((line1)+field)*linewidth +
 -block*TM6000_URB_MSG_LEN;
 -
 -/* Don't allow to write out of the buffer */
 -if (pos+TM6000_URB_MSG_LEN  (*buf)-vb.size) {
 -dprintk(dev, V4L2_DEBUG_ISOC,
 -ERR: size=%d, num=%d, line=%d, 
 -field=%d\n,
 -size, block, line, field);
 -
 -cmd = TM6000_URB_MSG_ERR;
 -}
 -} else {
 -pos=0;
 -}
 -
 -/* Prints debug info */
 -dprintk(dev, V4L2_DEBUG_ISOC, size=%d, num=%d, 
 - line=%d, field=%d\n,
 -size, block, line, field);
 -
 -if ((last_line!=line)(last_line+1!=line) 
 -(cmd != TM6000_URB_MSG_ERR) )  {
 -if (cmd != TM6000_URB_MSG_VIDEO)  {
 -dprintk(dev, V4L2_DEBUG_ISOC,  cmd=%d, 
 -size=%d, num=%d, line=%d, field=%d\n,
 -cmd, size, block, line, field);
 -}
 -if (start_line0)
 -start_line=last_line;
 -/* Prints debug info */
 -dprintk(dev, V4L2_DEBUG_ISOC, lines= %d-%d, 
 -field=%d\n,
 -start_line, last_line, field);
 -
 -if ((start_line6  last_line200) 
 -(last_field != field) ) {
 -
 -dev-isoc_ctl.nfields++;
 -if (dev

[PATCH 1/5] tm6000: bugfix select moduls

2010-05-23 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/Kconfig |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/tm6000/Kconfig b/drivers/staging/tm6000/Kconfig
index 5fe759c..3657e33 100644
--- a/drivers/staging/tm6000/Kconfig
+++ b/drivers/staging/tm6000/Kconfig
@@ -2,7 +2,8 @@ config VIDEO_TM6000
tristate TV Master TM5600/6000/6010 driver
depends on VIDEO_DEV  I2C  INPUT  USB  EXPERIMENTAL
select VIDEO_TUNER
-   select TUNER_XC2028
+   select MEDIA_TUNER_XC2028
+   select MEDIA_TUNER_XC5000
select VIDEOBUF_VMALLOC
help
  Support for TM5600/TM6000/TM6010 USB Device
-- 
1.7.0.3

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


[PATCH 2/5] tm6000: add power led off

2010-05-23 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

- add power led off, if device is disconnected



Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |   19 +++
 drivers/staging/tm6000/tm6000-core.c  |   13 +
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 33b134b..553ebe4 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -925,6 +925,25 @@ static void tm6000_usb_disconnect(struct usb_interface 
*interface)
}
 #endif
 
+   if (dev-gpio.power_led) {
+   switch (dev-model) {
+   case TM6010_BOARD_HAUPPAUGE_900H:
+   case TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE:
+   case TM6010_BOARD_TWINHAN_TU501:
+   /* Power led off */
+   tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
+   dev-gpio.power_led, 0x01);
+   msleep(15);
+   break;
+   case TM6010_BOARD_BEHOLD_WANDER:
+   case TM6010_BOARD_BEHOLD_VOYAGER:
+   /* Power led off */
+   tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
+   dev-gpio.power_led, 0x00);
+   msleep(15);
+   break;
+   }
+   }
tm6000_v4l2_unregister(dev);
 
tm6000_i2c_unregister(dev);
diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index 1259ae5..624c276 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -323,6 +323,12 @@ int tm6000_init_analog_mode (struct tm6000_core *dev)
tm6000_set_standard (dev, dev-norm);
tm6000_set_audio_bitrate (dev,48000);
 
+   /* switch dvb led off */
+   if (dev-gpio.dvb_led) {
+   tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
+   dev-gpio.dvb_led, 0x01);
+   }
+
return 0;
 }
 
@@ -375,6 +381,13 @@ int tm6000_init_digital_mode (struct tm6000_core *dev)
tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00);
msleep(100);
}
+
+   /* switch dvb led on */
+   if (dev-gpio.dvb_led) {
+   tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
+   dev-gpio.dvb_led, 0x00);
+   }
+
return 0;
 }
 
-- 
1.7.0.3

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


[PATCH 3/5] tm6000: set variable dev_mode in function tm6000_start_stream

2010-05-23 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

set variable dev_mode in function tm6000_start_stream and check mode

Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-dvb.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-dvb.c 
b/drivers/staging/tm6000/tm6000-dvb.c
index eafc89c..e6a802e 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -100,7 +100,10 @@ int tm6000_start_stream(struct tm6000_core *dev)
 
printk(KERN_INFO tm6000: got start stream request %s\n,__FUNCTION__);
 
-   tm6000_init_digital_mode(dev);
+   if (dev-mode != TM6000_MODE_DIGITAL) {
+   tm6000_init_digital_mode(dev);
+   dev-mode = TM6000_MODE_DIGITAL;
+   }
 
dvb-bulk_urb = usb_alloc_urb(0, GFP_KERNEL);
if(dvb-bulk_urb == NULL) {
-- 
1.7.0.3

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


  1   2   3   >