public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/37] dvb: dst: Correcty Identify Tuner and Daughterboards
@ 2005-11-01  8:12 Michael Krufky
  2005-11-03  2:24 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Krufky @ 2005-11-01  8:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-dvb-maintainer

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]




[-- Attachment #2: 2353.patch --]
[-- Type: text/x-patch, Size: 3710 bytes --]

From: Manu Abraham <manu@linuxtv.org>

- Identify Tuner, Daughterboards correctly
- Added partial support for
  VP-10320A (DVB-S), VP-20210 (DVB-C), VP-3040 (DVB-T)

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>

 drivers/media/dvb/bt8xx/dst.c        |   58 +++++++++++++++++++++++++++++++++--
 drivers/media/dvb/bt8xx/dst_common.h |    2 +
 2 files changed, 58 insertions(+), 2 deletions(-)

--- linux-2.6.14-git3.orig/drivers/media/dvb/bt8xx/dst.c
+++ linux-2.6.14-git3/drivers/media/dvb/bt8xx/dst.c
@@ -690,8 +690,8 @@
 		.device_id = "DTT-CI",
 		.offset = 1,
 		.dst_type = DST_TYPE_IS_TERR,
-		.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_FW_2,
-		.dst_feature = 0
+		.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_MULTI_FE,
+		.dst_feature = DST_TYPE_HAS_CA
 	},
 
 	{
@@ -796,6 +796,56 @@
 	return 0;
 }
 
+static int dst_get_tuner_info(struct dst_state *state)
+{
+	u8 get_tuner_1[] = { 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+	u8 get_tuner_2[] = { 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+	get_tuner_1[7] = dst_check_sum(get_tuner_1, 7);
+	get_tuner_2[7] = dst_check_sum(get_tuner_2, 7);
+	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
+		if (dst_command(state, get_tuner_2, 8) < 0) {
+			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
+			return -1;
+		}
+	} else {
+		if (dst_command(state, get_tuner_1, 8) < 0) {
+			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
+			return -1;
+		}
+	}
+	memset(&state->board_info, '\0', 8);
+	memcpy(&state->board_info, &state->rxbuffer, 8);
+	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
+		if (state->board_info[1] == 0x0b) {
+			if (state->type_flags & DST_TYPE_HAS_TS204)
+				state->type_flags &= ~DST_TYPE_HAS_TS204;
+			state->type_flags |= DST_TYPE_HAS_NEWTUNE;
+			dprintk(verbose, DST_INFO, 1, "DST type has TS=188");
+		} else {
+			if (state->type_flags & DST_TYPE_HAS_NEWTUNE)
+				state->type_flags &= ~DST_TYPE_HAS_NEWTUNE;
+			state->type_flags |= DST_TYPE_HAS_TS204;
+			dprintk(verbose, DST_INFO, 1, "DST type has TS=204");
+		}
+	} else {
+		if (state->board_info[0] == 0xbc) {
+			if (state->type_flags & DST_TYPE_HAS_TS204)
+				state->type_flags &= ~DST_TYPE_HAS_TS204;
+			state->type_flags |= DST_TYPE_HAS_NEWTUNE;
+			dprintk(verbose, DST_INFO, 1, "DST type has TS=188, Daughterboard=[%d]", state->board_info[1]);
+
+		} else if (state->board_info[0] == 0xcc) {
+			if (state->type_flags & DST_TYPE_HAS_NEWTUNE)
+				state->type_flags &= ~DST_TYPE_HAS_NEWTUNE;
+			state->type_flags |= DST_TYPE_HAS_TS204;
+			dprintk(verbose, DST_INFO, 1, "DST type has TS=204 Daughterboard=[%d]", state->board_info[1]);
+		}
+	}
+
+	return 0;
+}
+
 static int dst_get_device_id(struct dst_state *state)
 {
 	u8 reply;
@@ -886,6 +936,10 @@
 		dprintk(verbose, DST_INFO, 1, "MAC: Unsupported command");
 		return 0;
 	}
+	if ((state->type_flags & DST_TYPE_HAS_MULTI_FE) || (state->type_flags & DST_TYPE_HAS_FW_BUILD)) {
+		if (dst_get_tuner_info(state) < 0)
+			dprintk(verbose, DST_INFO, 1, "Tuner: Unsupported command");
+	}
 	if (state->type_flags & DST_TYPE_HAS_FW_BUILD) {
 		if (dst_fw_ver(state) < 0) {
 			dprintk(verbose, DST_INFO, 1, "FW: Unsupported command");
--- linux-2.6.14-git3.orig/drivers/media/dvb/bt8xx/dst_common.h
+++ linux-2.6.14-git3/drivers/media/dvb/bt8xx/dst_common.h
@@ -49,6 +49,7 @@
 #define DST_TYPE_HAS_FW_BUILD	64
 #define DST_TYPE_HAS_OBS_REGS	128
 #define DST_TYPE_HAS_INC_COUNT	256
+#define DST_TYPE_HAS_MULTI_FE	512
 
 /*	Card capability list	*/
 
@@ -117,6 +118,7 @@
 	u8 fw_version[8];
 	u8 card_info[8];
 	u8 vendor[8];
+	u8 board_info[8];
 };
 
 struct dst_types {




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 01/37] dvb: dst: Correcty Identify Tuner and Daughterboards
  2005-11-01  8:12 [PATCH 01/37] dvb: dst: Correcty Identify Tuner and Daughterboards Michael Krufky
@ 2005-11-03  2:24 ` Andrew Morton
  2005-11-03  9:21   ` Manu Abraham
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2005-11-03  2:24 UTC (permalink / raw)
  To: Michael Krufky; +Cc: linux-kernel, linux-dvb-maintainer

Michael Krufky <mkrufky@m1k.net> wrote:
>
>  +static int dst_get_tuner_info(struct dst_state *state)
>  +{
>  +	u8 get_tuner_1[] = { 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
>  +	u8 get_tuner_2[] = { 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
>  +
>  +	get_tuner_1[7] = dst_check_sum(get_tuner_1, 7);
>  +	get_tuner_2[7] = dst_check_sum(get_tuner_2, 7);
>  +	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
>  +		if (dst_command(state, get_tuner_2, 8) < 0) {
>  +			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
>  +			return -1;
>  +		}
>  +	} else {
>  +		if (dst_command(state, get_tuner_1, 8) < 0) {
>  +			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
>  +			return -1;
>  +		}
>  +	}
>  +	memset(&state->board_info, '\0', 8);
>  +	memcpy(&state->board_info, &state->rxbuffer, 8);

The memset is unneeded...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 01/37] dvb: dst: Correcty Identify Tuner and Daughterboards
  2005-11-03  2:24 ` Andrew Morton
@ 2005-11-03  9:21   ` Manu Abraham
  2005-11-03 14:24     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Manu Abraham @ 2005-11-03  9:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Michael Krufky, linux-kernel, linux-dvb-maintainer

Andrew Morton wrote:

>Michael Krufky <mkrufky@m1k.net> wrote:
>  
>
>> +static int dst_get_tuner_info(struct dst_state *state)
>> +{
>> +	u8 get_tuner_1[] = { 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
>> +	u8 get_tuner_2[] = { 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
>> +
>> +	get_tuner_1[7] = dst_check_sum(get_tuner_1, 7);
>> +	get_tuner_2[7] = dst_check_sum(get_tuner_2, 7);
>> +	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
>> +		if (dst_command(state, get_tuner_2, 8) < 0) {
>> +			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
>> +			return -1;
>> +		}
>> +	} else {
>> +		if (dst_command(state, get_tuner_1, 8) < 0) {
>> +			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
>> +			return -1;
>> +		}
>> +	}
>> +	memset(&state->board_info, '\0', 8);
>> +	memcpy(&state->board_info, &state->rxbuffer, 8);
>>    
>>
>
>The memset is unneeded...
>  
>
Hello Andrew,

I will have that changed in dvb-kernel CVS. Would you like me to send in 
a patch for the same. Or you can have it changed .. ?


Thanks,
Manu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 01/37] dvb: dst: Correcty Identify Tuner and Daughterboards
  2005-11-03  9:21   ` Manu Abraham
@ 2005-11-03 14:24     ` Andrew Morton
  2005-11-03 16:52       ` Manu Abraham
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2005-11-03 14:24 UTC (permalink / raw)
  To: Manu Abraham; +Cc: mkrufky, linux-kernel, linux-dvb-maintainer

Manu Abraham <manu@linuxtv.org> wrote:
>
> Andrew Morton wrote:
> 
> >Michael Krufky <mkrufky@m1k.net> wrote:
> >  
> >
> >> +static int dst_get_tuner_info(struct dst_state *state)
> >> +{
> >> +	u8 get_tuner_1[] = { 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
> >> +	u8 get_tuner_2[] = { 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
> >> +
> >> +	get_tuner_1[7] = dst_check_sum(get_tuner_1, 7);
> >> +	get_tuner_2[7] = dst_check_sum(get_tuner_2, 7);
> >> +	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
> >> +		if (dst_command(state, get_tuner_2, 8) < 0) {
> >> +			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
> >> +			return -1;
> >> +		}
> >> +	} else {
> >> +		if (dst_command(state, get_tuner_1, 8) < 0) {
> >> +			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
> >> +			return -1;
> >> +		}
> >> +	}
> >> +	memset(&state->board_info, '\0', 8);
> >> +	memcpy(&state->board_info, &state->rxbuffer, 8);
> >>    
> >>
> >
> >The memset is unneeded...
> >  
> >
> Hello Andrew,
> 
> I will have that changed in dvb-kernel CVS. Would you like me to send in 
> a patch for the same. Or you can have it changed .. ?
> 

There's certainly no rush ;)  Please just add it to the 2.6.16 to-do list.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 01/37] dvb: dst: Correcty Identify Tuner and Daughterboards
  2005-11-03 14:24     ` Andrew Morton
@ 2005-11-03 16:52       ` Manu Abraham
  0 siblings, 0 replies; 5+ messages in thread
From: Manu Abraham @ 2005-11-03 16:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Manu Abraham, mkrufky, linux-kernel, linux-dvb-maintainer

Andrew Morton wrote:

>Manu Abraham <manu@linuxtv.org> wrote:
>  
>
>>Andrew Morton wrote:
>>
>>    
>>
>>>Michael Krufky <mkrufky@m1k.net> wrote:
>>> 
>>>
>>>      
>>>
>>>>+static int dst_get_tuner_info(struct dst_state *state)
>>>>+{
>>>>+	u8 get_tuner_1[] = { 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
>>>>+	u8 get_tuner_2[] = { 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
>>>>+
>>>>+	get_tuner_1[7] = dst_check_sum(get_tuner_1, 7);
>>>>+	get_tuner_2[7] = dst_check_sum(get_tuner_2, 7);
>>>>+	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
>>>>+		if (dst_command(state, get_tuner_2, 8) < 0) {
>>>>+			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
>>>>+			return -1;
>>>>+		}
>>>>+	} else {
>>>>+		if (dst_command(state, get_tuner_1, 8) < 0) {
>>>>+			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
>>>>+			return -1;
>>>>+		}
>>>>+	}
>>>>+	memset(&state->board_info, '\0', 8);
>>>>+	memcpy(&state->board_info, &state->rxbuffer, 8);
>>>>   
>>>>
>>>>        
>>>>
>>>The memset is unneeded...
>>> 
>>>
>>>      
>>>
>>Hello Andrew,
>>
>>I will have that changed in dvb-kernel CVS. Would you like me to send in 
>>a patch for the same. Or you can have it changed .. ?
>>
>>    
>>
>
>There's certainly no rush ;)  Please just add it to the 2.6.16 to-do list.
>
>  
>

Ok, done. I will queue it up in the TODO list for 2.6.16.


Thanks,
Manu


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-03 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01  8:12 [PATCH 01/37] dvb: dst: Correcty Identify Tuner and Daughterboards Michael Krufky
2005-11-03  2:24 ` Andrew Morton
2005-11-03  9:21   ` Manu Abraham
2005-11-03 14:24     ` Andrew Morton
2005-11-03 16:52       ` Manu Abraham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox