[linux-dvb] FE_GET_FRONTEND returns wrong frequency for TwinHan DST cards

Manu Abraham abraham.manu at gmail.com
Tue Sep 13 11:37:42 CEST 2005


Tom Hughes wrote:

>The FE_GET_FRONTEND ioctl seems to return the wrong frequency
>for TwinHan DST cards - looking at the code in dst_get_tuna shows
>that it only looks at two bytes while fills in three when setting
>the frequency for DVB-T and DVB-C cards.
>
>  
>

Yep, you are right !

>In addition it doesn't multiply the extracted value by 1000 to
>match the division by 1000 that dst_set_freq does when setting
>the frequency.
>
>All this seems to match up with the resut being off by a factor
>of 256000 on my DVB-T card.
>
>The attached patch corrects both issues and seems to resolve the
>problem on my system.
>
>  
>

Would you mind the Signed-off-by: line ?

Thanks,
Manu

>------------------------------------------------------------------------
>
>Index: linux/drivers/media/dvb/bt8xx/dst.c
>===================================================================
>RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/bt8xx/dst.c,v
>retrieving revision 1.39
>diff -u -u -r1.39 dst.c
>--- linux/drivers/media/dvb/bt8xx/dst.c	10 Sep 2005 16:20:12 -0000	1.39
>+++ linux/drivers/media/dvb/bt8xx/dst.c	12 Sep 2005 18:21:59 -0000
>@@ -1093,7 +1093,13 @@
> 	}
> 	if (state->rx_tuna[2] == 0 && state->rx_tuna[3] == 0)
> 		return 0;
>-	state->decode_freq = ((state->rx_tuna[2] & 0x7f) << 8) + state->rx_tuna[3];
>+        
>+	if (state->dst_type == DST_TYPE_IS_SAT) {
>+		state->decode_freq = ((state->rx_tuna[2] & 0x7f) << 8) + state->rx_tuna[3];
>+	} else {
>+		state->decode_freq = ((state->rx_tuna[2] & 0x7f) << 16) + (state->rx_tuna[3] << 8) + state->rx_tuna[4];
>+	}
>+	state->decode_freq = state->decode_freq * 1000;
> 	state->decode_lock = 1;
> 	state->diseq_flags |= HAS_LOCK;
> 
>  
>
>------------------------------------------------------------------------
>




More information about the linux-dvb mailing list