All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD.
@ 2010-09-12 19:03 Tommy Jonsson
  2010-09-15 11:48 ` Stefan Richter
  2010-09-15 11:58 ` Stefan Richter
  0 siblings, 2 replies; 9+ messages in thread
From: Tommy Jonsson @ 2010-09-12 19:03 UTC (permalink / raw)
  To: linux-media

This is the first i have ever developed for linux, cant really wrap my
head around how to submit this..
Hope im sending this correctly, diff made with 'hg diff' from latest
"hg clone http://linuxtv.org/hg/v4l-dvb"

It adds support for tuning with PSK8 modulation, pilot and rolloff
with the S2 versions of firedtv.

Signed-off-by: Tommy Jonsson <quazzie2@gmail.com>



diff -r 6e0befab696a linux/drivers/media/dvb/firewire/firedtv-avc.c
--- a/linux/drivers/media/dvb/firewire/firedtv-avc.c	Fri Sep 03
00:28:05 2010 -0300
+++ b/linux/drivers/media/dvb/firewire/firedtv-avc.c	Sun Sep 12
06:52:02 2010 +0200
@@ -4,6 +4,7 @@
  * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
  * Copyright (C) 2008 Ben Backx <ben@bbackx.com>
  * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
+ * Copyright (C) 2010 Tommy Jonsson <quazzie2@gmail.com>
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License as
@@ -318,7 +319,7 @@
  * tuning command for setting the relative LNB frequency
  * (not supported by the AVC standard)
  */
-static int avc_tuner_tuneqpsk(struct firedtv *fdtv,
+static int avc_tuner_tuneqpsk(struct dvb_frontend *fe, struct firedtv *fdtv,
 			      struct dvb_frontend_parameters *params)
 {
 	struct avc_command_frame *c = (void *)fdtv->avc_data;
@@ -368,10 +369,30 @@
 		c->operand[12] = 0;

 	if (fdtv->type == FIREDTV_DVB_S2) {
-		c->operand[13] = 0x1;
-		c->operand[14] = 0xff;
-		c->operand[15] = 0xff;
-
+ 		if (fe->dtv_property_cache.delivery_system == SYS_DVBS2) {
+			switch (fe->dtv_property_cache.modulation) {
+			case QAM_16:		c->operand[13] = 0x1; break;
+			case QPSK:		c->operand[13] = 0x2; break;
+			case PSK_8:		c->operand[13] = 0x3; break;
+			default:		c->operand[13] = 0x2; break;
+			}
+ 			switch (fe->dtv_property_cache.rolloff) {
+			case ROLLOFF_AUTO:	c->operand[14] = 0x2; break;
+			case ROLLOFF_35:	c->operand[14] = 0x2; break;
+			case ROLLOFF_20:	c->operand[14] = 0x0; break;
+			case ROLLOFF_25:	c->operand[14] = 0x1; break;
+			/* case ROLLOFF_NONE:	c->operand[14] = 0xff; break; */
+			}
+			switch (fe->dtv_property_cache.pilot) {
+			case PILOT_AUTO:	c->operand[15] = 0x0; break;
+			case PILOT_OFF:		c->operand[15] = 0x0; break;
+			case PILOT_ON:		c->operand[15] = 0x1; break;
+			}
+		} else {
+			c->operand[13] = 0x1;  /* auto modulation */
+			c->operand[14] = 0xff; /* disable rolloff */
+			c->operand[15] = 0xff; /* disable pilot */
+		}
 		return 16;
 	} else {
 		return 13;
@@ -548,7 +569,7 @@
 	return 17 + add_pid_filter(fdtv, &c->operand[17]);
 }

-int avc_tuner_dsd(struct firedtv *fdtv,
+int avc_tuner_dsd(struct dvb_frontend *fe, struct firedtv *fdtv,
 		  struct dvb_frontend_parameters *params)
 {
 	struct avc_command_frame *c = (void *)fdtv->avc_data;
@@ -561,7 +582,7 @@

 	switch (fdtv->type) {
 	case FIREDTV_DVB_S:
-	case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, params); break;
+	case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fe, fdtv, params); break;
 	case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, params); break;
 	case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, params); break;
 	default:
diff -r 6e0befab696a linux/drivers/media/dvb/firewire/firedtv-fe.c
--- a/linux/drivers/media/dvb/firewire/firedtv-fe.c	Fri Sep 03
00:28:05 2010 -0300
+++ b/linux/drivers/media/dvb/firewire/firedtv-fe.c	Sun Sep 12
06:52:02 2010 +0200
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
  * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
+ * Copyright (C) 2010 Tommy Jonsson <quazzie2@gmail.com>
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License as
@@ -146,7 +147,7 @@
 {
 	struct firedtv *fdtv = fe->sec_priv;

-	return avc_tuner_dsd(fdtv, params);
+	return avc_tuner_dsd(fe, fdtv, params);
 }

 static int fdtv_get_frontend(struct dvb_frontend *fe,
@@ -155,6 +156,17 @@
 	return -EOPNOTSUPP;
 }

+static int fdtv_get_property(struct dvb_frontend *fe,
+                             struct dtv_property *tvp)
+{
+	return 0;
+}
+static int fdtv_set_property(struct dvb_frontend *fe,
+                             struct dtv_property *tvp)
+{
+	return 0;
+}
+
 void fdtv_frontend_init(struct firedtv *fdtv)
 {
 	struct dvb_frontend_ops *ops = &fdtv->fe.ops;
@@ -166,6 +178,9 @@
 	ops->set_frontend		= fdtv_set_frontend;
 	ops->get_frontend		= fdtv_get_frontend;

+	ops->get_property		= fdtv_get_property;
+	ops->set_property		= fdtv_set_property;
+
 	ops->read_status		= fdtv_read_status;
 	ops->read_ber			= fdtv_read_ber;
 	ops->read_signal_strength	= fdtv_read_signal_strength;
@@ -179,6 +194,24 @@

 	switch (fdtv->type) {
 	case FIREDTV_DVB_S:
+		fi->type		= FE_QPSK;
+
+		fi->frequency_min	= 950000;
+		fi->frequency_max	= 2150000;
+		fi->frequency_stepsize	= 125;
+		fi->symbol_rate_min	= 1000000;
+		fi->symbol_rate_max	= 40000000;
+
+		fi->caps		= FE_CAN_INVERSION_AUTO |
+					  FE_CAN_FEC_1_2	|
+					  FE_CAN_FEC_2_3	|
+					  FE_CAN_FEC_3_4	|
+					  FE_CAN_FEC_5_6	|
+					  FE_CAN_FEC_7_8	|
+					  FE_CAN_FEC_AUTO	|
+					  FE_CAN_QPSK;
+		break;
+
 	case FIREDTV_DVB_S2:
 		fi->type		= FE_QPSK;

@@ -188,14 +221,15 @@
 		fi->symbol_rate_min	= 1000000;
 		fi->symbol_rate_max	= 40000000;

-		fi->caps 		= FE_CAN_INVERSION_AUTO	|
-					  FE_CAN_FEC_1_2	|
-					  FE_CAN_FEC_2_3	|
-					  FE_CAN_FEC_3_4	|
-					  FE_CAN_FEC_5_6	|
-					  FE_CAN_FEC_7_8	|
-					  FE_CAN_FEC_AUTO	|
-					  FE_CAN_QPSK;
+		fi->caps		= FE_CAN_INVERSION_AUTO |
+					  FE_CAN_FEC_1_2        |
+					  FE_CAN_FEC_2_3        |
+					  FE_CAN_FEC_3_4        |
+					  FE_CAN_FEC_5_6        |
+					  FE_CAN_FEC_7_8        |
+					  FE_CAN_FEC_AUTO       |
+					  FE_CAN_QPSK           |
+					  FE_CAN_2G_MODULATION;
 		break;

 	case FIREDTV_DVB_C:
diff -r 6e0befab696a linux/drivers/media/dvb/firewire/firedtv.h
--- a/linux/drivers/media/dvb/firewire/firedtv.h	Fri Sep 03 00:28:05 2010 -0300
+++ b/linux/drivers/media/dvb/firewire/firedtv.h	Sun Sep 12 06:52:02 2010 +0200
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
  * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
+ * Copyright (C) 2010 Tommy Jonsson <quazzie2@gmail.com>
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License as
@@ -131,7 +132,7 @@
 int avc_recv(struct firedtv *fdtv, void *data, size_t length);
 int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
 struct dvb_frontend_parameters;
-int avc_tuner_dsd(struct firedtv *fdtv, struct
dvb_frontend_parameters *params);
+int avc_tuner_dsd(struct dvb_frontend *fe, struct firedtv *fdtv,
struct dvb_frontend_parameters *params);
 int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
 int avc_tuner_get_ts(struct firedtv *fdtv);
 int avc_identify_subunit(struct firedtv *fdtv);

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

* Re: [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD.
  2010-09-12 19:03 [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD Tommy Jonsson
@ 2010-09-15 11:48 ` Stefan Richter
  2010-09-15 17:46   ` Tommy Jonsson
  2010-09-15 11:58 ` Stefan Richter
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Richter @ 2010-09-15 11:48 UTC (permalink / raw)
  To: Tommy Jonsson; +Cc: linux-media, linux1394-devel, Mauro Carvalho Chehab

Tommy Jonsson wrote at linux-media:
> This is the first i have ever developed for linux, cant really wrap my
> head around how to submit this..
> Hope im sending this correctly, diff made with 'hg diff' from latest
> "hg clone http://linuxtv.org/hg/v4l-dvb"
> 
> It adds support for tuning with PSK8 modulation, pilot and rolloff
> with the S2 versions of firedtv.
> 
> Signed-off-by: Tommy Jonsson <quazzie2@gmail.com>
[...]

Excellent!  This has been on the wishlist of FireDTV/FloppyDTV-S2 owners for
quite some time.

The patch was a little bit mangled by the mail user agent, and there appear to
be some whitespace issues in it.  I will have a closer look at it later today
and repost the patch so that Mauro can apply it without manual intervention.
-- 
Stefan Richter
-=====-==-=- =--= -====
http://arcgraph.de/sr/

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

* Re: [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD.
  2010-09-12 19:03 [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD Tommy Jonsson
  2010-09-15 11:48 ` Stefan Richter
@ 2010-09-15 11:58 ` Stefan Richter
  2010-09-15 18:01   ` Tommy Jonsson
  2010-09-15 18:05   ` Tommy Jonsson
  1 sibling, 2 replies; 9+ messages in thread
From: Stefan Richter @ 2010-09-15 11:58 UTC (permalink / raw)
  To: Tommy Jonsson; +Cc: linux-media, linux1394-devel, Mauro Carvalho Chehab

Tommy Jonsson wrote:
> --- a/linux/drivers/media/dvb/firewire/firedtv-avc.c	Fri Sep 03
> 00:28:05 2010 -0300
> +++ b/linux/drivers/media/dvb/firewire/firedtv-avc.c	Sun Sep 12
> 06:52:02 2010 +0200
[...]
> @@ -368,10 +369,30 @@
>  		c->operand[12] = 0;
> 
>  	if (fdtv->type == FIREDTV_DVB_S2) {
> -		c->operand[13] = 0x1;
> -		c->operand[14] = 0xff;
> -		c->operand[15] = 0xff;
> -
> + 		if (fe->dtv_property_cache.delivery_system == SYS_DVBS2) {
> +			switch (fe->dtv_property_cache.modulation) {
> +			case QAM_16:		c->operand[13] = 0x1; break;
> +			case QPSK:		c->operand[13] = 0x2; break;
> +			case PSK_8:		c->operand[13] = 0x3; break;
> +			default:		c->operand[13] = 0x2; break;
> +			}
> + 			switch (fe->dtv_property_cache.rolloff) {
> +			case ROLLOFF_AUTO:	c->operand[14] = 0x2; break;
> +			case ROLLOFF_35:	c->operand[14] = 0x2; break;
> +			case ROLLOFF_20:	c->operand[14] = 0x0; break;
> +			case ROLLOFF_25:	c->operand[14] = 0x1; break;
> +			/* case ROLLOFF_NONE:	c->operand[14] = 0xff; break; */
> +			}
> +			switch (fe->dtv_property_cache.pilot) {
> +			case PILOT_AUTO:	c->operand[15] = 0x0; break;
> +			case PILOT_OFF:		c->operand[15] = 0x0; break;
> +			case PILOT_ON:		c->operand[15] = 0x1; break;
> +			}
> +		} else {
> +			c->operand[13] = 0x1;  /* auto modulation */
> +			c->operand[14] = 0xff; /* disable rolloff */
> +			c->operand[15] = 0xff; /* disable pilot */
> +		}
>  		return 16;

Is it correct that there is no default: case for operand[14] and [15]?

>  	} else {
>  		return 13;
> @@ -548,7 +569,7 @@
>  	return 17 + add_pid_filter(fdtv, &c->operand[17]);
>  }
> 
> -int avc_tuner_dsd(struct firedtv *fdtv,
> +int avc_tuner_dsd(struct dvb_frontend *fe, struct firedtv *fdtv,
>  		  struct dvb_frontend_parameters *params)
>  {
>  	struct avc_command_frame *c = (void *)fdtv->avc_data;

The frontend can be accessed via fdtv->fe also.  (I can change this together
with the whitespace things if you agree.)

> @@ -561,7 +582,7 @@
> 
>  	switch (fdtv->type) {
>  	case FIREDTV_DVB_S:
> -	case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, params); break;
> +	case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fe, fdtv, params); break;
>  	case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, params); break;
>  	case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, params); break;
>  	default:
> diff -r 6e0befab696a linux/drivers/media/dvb/firewire/firedtv-fe.c
> --- a/linux/drivers/media/dvb/firewire/firedtv-fe.c	Fri Sep 03
> 00:28:05 2010 -0300
> +++ b/linux/drivers/media/dvb/firewire/firedtv-fe.c	Sun Sep 12
> 06:52:02 2010 +0200
[...]
> @@ -155,6 +156,17 @@
>  	return -EOPNOTSUPP;
>  }
> 
> +static int fdtv_get_property(struct dvb_frontend *fe,
> +                             struct dtv_property *tvp)
> +{
> +	return 0;
> +}
> +static int fdtv_set_property(struct dvb_frontend *fe,
> +                             struct dtv_property *tvp)
> +{
> +	return 0;
> +}
> +
>  void fdtv_frontend_init(struct firedtv *fdtv)
>  {
>  	struct dvb_frontend_ops *ops = &fdtv->fe.ops;
> @@ -166,6 +178,9 @@
>  	ops->set_frontend		= fdtv_set_frontend;
>  	ops->get_frontend		= fdtv_get_frontend;
> 
> +	ops->get_property		= fdtv_get_property;
> +	ops->set_property		= fdtv_set_property;
> +
>  	ops->read_status		= fdtv_read_status;
>  	ops->read_ber			= fdtv_read_ber;
>  	ops->read_signal_strength	= fdtv_read_signal_strength;
[...]

(Hmm, note to self:  Can't DVB core provide empty default methods?)
-- 
Stefan Richter
-=====-==-=- =--= -====
http://arcgraph.de/sr/

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

* Re: [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD.
  2010-09-15 11:48 ` Stefan Richter
@ 2010-09-15 17:46   ` Tommy Jonsson
  0 siblings, 0 replies; 9+ messages in thread
From: Tommy Jonsson @ 2010-09-15 17:46 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linux-media

Nice, thanks! I used gmail, never used a mailing-list or dealt with
patches before.
Never developed or even looked at the Linux source, so there might be
some strangeness in the code :]
I recently fixed a server-box and started using TvHeadend. Noticed
that the psk8 didn't work,
so i put the card back in a windows box and sniffed out the difference.

On Wed, Sep 15, 2010 at 1:48 PM, Stefan Richter
<stefanr@s5r6.in-berlin.de> wrote:
> Tommy Jonsson wrote at linux-media:
>> This is the first i have ever developed for linux, cant really wrap my
>> head around how to submit this..
>> Hope im sending this correctly, diff made with 'hg diff' from latest
>> "hg clone http://linuxtv.org/hg/v4l-dvb"
>>
>> It adds support for tuning with PSK8 modulation, pilot and rolloff
>> with the S2 versions of firedtv.
>>
>> Signed-off-by: Tommy Jonsson <quazzie2@gmail.com>
> [...]
>
> Excellent!  This has been on the wishlist of FireDTV/FloppyDTV-S2 owners for
> quite some time.
>
> The patch was a little bit mangled by the mail user agent, and there appear to
> be some whitespace issues in it.  I will have a closer look at it later today
> and repost the patch so that Mauro can apply it without manual intervention.
> --
> Stefan Richter
> -=====-==-=- =--= -====
> http://arcgraph.de/sr/
>

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

* Re: [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD.
  2010-09-15 11:58 ` Stefan Richter
@ 2010-09-15 18:01   ` Tommy Jonsson
  2010-09-15 18:05   ` Tommy Jonsson
  1 sibling, 0 replies; 9+ messages in thread
From: Tommy Jonsson @ 2010-09-15 18:01 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linux-media

Sorry, that's the only values i was able to find out.
The _AUTO for both ROLLOFF and PILOT are my own as there where no auto
in the scanning program i used to scan with. I set them to what i
thought was best.

About the set_property and get_property i don't know if you need to
define them, i just saw that other drivers where doing it so i did to.

On Wed, Sep 15, 2010 at 1:58 PM, Stefan Richter
<stefanr@s5r6.in-berlin.de> wrote:
> Tommy Jonsson wrote:
>> --- a/linux/drivers/media/dvb/firewire/firedtv-avc.c  Fri Sep 03
>> 00:28:05 2010 -0300
>> +++ b/linux/drivers/media/dvb/firewire/firedtv-avc.c  Sun Sep 12
>> 06:52:02 2010 +0200
> [...]
>> @@ -368,10 +369,30 @@
>>               c->operand[12] = 0;
>>
>>       if (fdtv->type == FIREDTV_DVB_S2) {
>> -             c->operand[13] = 0x1;
>> -             c->operand[14] = 0xff;
>> -             c->operand[15] = 0xff;
>> -
>> +             if (fe->dtv_property_cache.delivery_system == SYS_DVBS2) {
>> +                     switch (fe->dtv_property_cache.modulation) {
>> +                     case QAM_16:            c->operand[13] = 0x1; break;
>> +                     case QPSK:              c->operand[13] = 0x2; break;
>> +                     case PSK_8:             c->operand[13] = 0x3; break;
>> +                     default:                c->operand[13] = 0x2; break;
>> +                     }
>> +                     switch (fe->dtv_property_cache.rolloff) {
>> +                     case ROLLOFF_AUTO:      c->operand[14] = 0x2; break;
>> +                     case ROLLOFF_35:        c->operand[14] = 0x2; break;
>> +                     case ROLLOFF_20:        c->operand[14] = 0x0; break;
>> +                     case ROLLOFF_25:        c->operand[14] = 0x1; break;
>> +                     /* case ROLLOFF_NONE:   c->operand[14] = 0xff; break; */
>> +                     }
>> +                     switch (fe->dtv_property_cache.pilot) {
>> +                     case PILOT_AUTO:        c->operand[15] = 0x0; break;
>> +                     case PILOT_OFF:         c->operand[15] = 0x0; break;
>> +                     case PILOT_ON:          c->operand[15] = 0x1; break;
>> +                     }
>> +             } else {
>> +                     c->operand[13] = 0x1;  /* auto modulation */
>> +                     c->operand[14] = 0xff; /* disable rolloff */
>> +                     c->operand[15] = 0xff; /* disable pilot */
>> +             }
>>               return 16;
>
> Is it correct that there is no default: case for operand[14] and [15]?
>
>>       } else {
>>               return 13;
>> @@ -548,7 +569,7 @@
>>       return 17 + add_pid_filter(fdtv, &c->operand[17]);
>>  }
>>
>> -int avc_tuner_dsd(struct firedtv *fdtv,
>> +int avc_tuner_dsd(struct dvb_frontend *fe, struct firedtv *fdtv,
>>                 struct dvb_frontend_parameters *params)
>>  {
>>       struct avc_command_frame *c = (void *)fdtv->avc_data;
>
> The frontend can be accessed via fdtv->fe also.  (I can change this together
> with the whitespace things if you agree.)
>
>> @@ -561,7 +582,7 @@
>>
>>       switch (fdtv->type) {
>>       case FIREDTV_DVB_S:
>> -     case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, params); break;
>> +     case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fe, fdtv, params); break;
>>       case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, params); break;
>>       case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, params); break;
>>       default:
>> diff -r 6e0befab696a linux/drivers/media/dvb/firewire/firedtv-fe.c
>> --- a/linux/drivers/media/dvb/firewire/firedtv-fe.c   Fri Sep 03
>> 00:28:05 2010 -0300
>> +++ b/linux/drivers/media/dvb/firewire/firedtv-fe.c   Sun Sep 12
>> 06:52:02 2010 +0200
> [...]
>> @@ -155,6 +156,17 @@
>>       return -EOPNOTSUPP;
>>  }
>>
>> +static int fdtv_get_property(struct dvb_frontend *fe,
>> +                             struct dtv_property *tvp)
>> +{
>> +     return 0;
>> +}
>> +static int fdtv_set_property(struct dvb_frontend *fe,
>> +                             struct dtv_property *tvp)
>> +{
>> +     return 0;
>> +}
>> +
>>  void fdtv_frontend_init(struct firedtv *fdtv)
>>  {
>>       struct dvb_frontend_ops *ops = &fdtv->fe.ops;
>> @@ -166,6 +178,9 @@
>>       ops->set_frontend               = fdtv_set_frontend;
>>       ops->get_frontend               = fdtv_get_frontend;
>>
>> +     ops->get_property               = fdtv_get_property;
>> +     ops->set_property               = fdtv_set_property;
>> +
>>       ops->read_status                = fdtv_read_status;
>>       ops->read_ber                   = fdtv_read_ber;
>>       ops->read_signal_strength       = fdtv_read_signal_strength;
> [...]
>
> (Hmm, note to self:  Can't DVB core provide empty default methods?)
> --
> Stefan Richter
> -=====-==-=- =--= -====
> http://arcgraph.de/sr/
>

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

* Re: [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD.
  2010-09-15 11:58 ` Stefan Richter
  2010-09-15 18:01   ` Tommy Jonsson
@ 2010-09-15 18:05   ` Tommy Jonsson
  2010-10-04 18:25     ` [PATCH update] V4L/DVB: firedtv: " Stefan Richter
  1 sibling, 1 reply; 9+ messages in thread
From: Tommy Jonsson @ 2010-09-15 18:05 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linux-media

Oh, read the first question a bit wrong, yeah i have missed the
default case for 14 & 15.
Should probably be AUTO/35 & AUTO/OFF.

On Wed, Sep 15, 2010 at 1:58 PM, Stefan Richter
<stefanr@s5r6.in-berlin.de> wrote:
> Tommy Jonsson wrote:
>> --- a/linux/drivers/media/dvb/firewire/firedtv-avc.c  Fri Sep 03
>> 00:28:05 2010 -0300
>> +++ b/linux/drivers/media/dvb/firewire/firedtv-avc.c  Sun Sep 12
>> 06:52:02 2010 +0200
> [...]
>> @@ -368,10 +369,30 @@
>>               c->operand[12] = 0;
>>
>>       if (fdtv->type == FIREDTV_DVB_S2) {
>> -             c->operand[13] = 0x1;
>> -             c->operand[14] = 0xff;
>> -             c->operand[15] = 0xff;
>> -
>> +             if (fe->dtv_property_cache.delivery_system == SYS_DVBS2) {
>> +                     switch (fe->dtv_property_cache.modulation) {
>> +                     case QAM_16:            c->operand[13] = 0x1; break;
>> +                     case QPSK:              c->operand[13] = 0x2; break;
>> +                     case PSK_8:             c->operand[13] = 0x3; break;
>> +                     default:                c->operand[13] = 0x2; break;
>> +                     }
>> +                     switch (fe->dtv_property_cache.rolloff) {
>> +                     case ROLLOFF_AUTO:      c->operand[14] = 0x2; break;
>> +                     case ROLLOFF_35:        c->operand[14] = 0x2; break;
>> +                     case ROLLOFF_20:        c->operand[14] = 0x0; break;
>> +                     case ROLLOFF_25:        c->operand[14] = 0x1; break;
>> +                     /* case ROLLOFF_NONE:   c->operand[14] = 0xff; break; */
>> +                     }
>> +                     switch (fe->dtv_property_cache.pilot) {
>> +                     case PILOT_AUTO:        c->operand[15] = 0x0; break;
>> +                     case PILOT_OFF:         c->operand[15] = 0x0; break;
>> +                     case PILOT_ON:          c->operand[15] = 0x1; break;
>> +                     }
>> +             } else {
>> +                     c->operand[13] = 0x1;  /* auto modulation */
>> +                     c->operand[14] = 0xff; /* disable rolloff */
>> +                     c->operand[15] = 0xff; /* disable pilot */
>> +             }
>>               return 16;
>
> Is it correct that there is no default: case for operand[14] and [15]?
>
>>       } else {
>>               return 13;
>> @@ -548,7 +569,7 @@
>>       return 17 + add_pid_filter(fdtv, &c->operand[17]);
>>  }
>>
>> -int avc_tuner_dsd(struct firedtv *fdtv,
>> +int avc_tuner_dsd(struct dvb_frontend *fe, struct firedtv *fdtv,
>>                 struct dvb_frontend_parameters *params)
>>  {
>>       struct avc_command_frame *c = (void *)fdtv->avc_data;
>
> The frontend can be accessed via fdtv->fe also.  (I can change this together
> with the whitespace things if you agree.)
>
>> @@ -561,7 +582,7 @@
>>
>>       switch (fdtv->type) {
>>       case FIREDTV_DVB_S:
>> -     case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, params); break;
>> +     case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fe, fdtv, params); break;
>>       case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, params); break;
>>       case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, params); break;
>>       default:
>> diff -r 6e0befab696a linux/drivers/media/dvb/firewire/firedtv-fe.c
>> --- a/linux/drivers/media/dvb/firewire/firedtv-fe.c   Fri Sep 03
>> 00:28:05 2010 -0300
>> +++ b/linux/drivers/media/dvb/firewire/firedtv-fe.c   Sun Sep 12
>> 06:52:02 2010 +0200
> [...]
>> @@ -155,6 +156,17 @@
>>       return -EOPNOTSUPP;
>>  }
>>
>> +static int fdtv_get_property(struct dvb_frontend *fe,
>> +                             struct dtv_property *tvp)
>> +{
>> +     return 0;
>> +}
>> +static int fdtv_set_property(struct dvb_frontend *fe,
>> +                             struct dtv_property *tvp)
>> +{
>> +     return 0;
>> +}
>> +
>>  void fdtv_frontend_init(struct firedtv *fdtv)
>>  {
>>       struct dvb_frontend_ops *ops = &fdtv->fe.ops;
>> @@ -166,6 +178,9 @@
>>       ops->set_frontend               = fdtv_set_frontend;
>>       ops->get_frontend               = fdtv_get_frontend;
>>
>> +     ops->get_property               = fdtv_get_property;
>> +     ops->set_property               = fdtv_set_property;
>> +
>>       ops->read_status                = fdtv_read_status;
>>       ops->read_ber                   = fdtv_read_ber;
>>       ops->read_signal_strength       = fdtv_read_signal_strength;
> [...]
>
> (Hmm, note to self:  Can't DVB core provide empty default methods?)
> --
> Stefan Richter
> -=====-==-=- =--= -====
> http://arcgraph.de/sr/
>

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

* [PATCH update] V4L/DVB: firedtv: support for PSK8 for S2 devices. To watch HD.
  2010-09-15 18:05   ` Tommy Jonsson
@ 2010-10-04 18:25     ` Stefan Richter
  2010-10-04 18:29       ` [PATCH update2] " Stefan Richter
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Richter @ 2010-10-04 18:25 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Tommy Jonsson, linux-media, linux1394-devel

Date: Sun, 12 Sep 2010 21:03:45 +0200
From: Tommy Jonsson <quazzie2@gmail.com>

This is the first i have ever developed for linux, cant really wrap my
head around how to submit this..
Hope im sending this correctly, diff made with 'hg diff' from latest
"hg clone http://linuxtv.org/hg/v4l-dvb"

It adds support for tuning with PSK8 modulation, pilot and rolloff
with the S2 versions of firedtv.

Signed-off-by: Tommy Jonsson <quazzie2@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (trivial simplification)
---
Update: resend with whitespace preserved, fe pointer does not have to be
put into function parameter lists, copyright notice removed (authorship
of smaller changes like this is tracked in the git changelog)

 drivers/media/dvb/firewire/firedtv-avc.c |   30 +++++++++++++++++--
 drivers/media/dvb/firewire/firedtv-fe.c  |   36 ++++++++++++++++++++++-
 2 files changed, 60 insertions(+), 6 deletions(-)

Index: b/drivers/media/dvb/firewire/firedtv-avc.c
===================================================================
--- a/drivers/media/dvb/firewire/firedtv-avc.c
+++ b/drivers/media/dvb/firewire/firedtv-avc.c
@@ -24,6 +24,8 @@
 #include <linux/wait.h>
 #include <linux/workqueue.h>
 
+#include <dvb_frontend.h>
+
 #include "firedtv.h"
 
 #define FCP_COMMAND_REGISTER		0xfffff0000b00ULL
@@ -368,10 +370,30 @@ static int avc_tuner_tuneqpsk(struct fir
 		c->operand[12] = 0;
 
 	if (fdtv->type == FIREDTV_DVB_S2) {
-		c->operand[13] = 0x1;
-		c->operand[14] = 0xff;
-		c->operand[15] = 0xff;
-
+ 		if (fdtv->fe.dtv_property_cache.delivery_system == SYS_DVBS2) {
+			switch (fdtv->fe.dtv_property_cache.modulation) {
+			case QAM_16:		c->operand[13] = 0x1; break;
+			case QPSK:		c->operand[13] = 0x2; break;
+			case PSK_8:		c->operand[13] = 0x3; break;
+			default:		c->operand[13] = 0x2; break;
+			}
+ 			switch (fdtv->fe.dtv_property_cache.rolloff) {
+			case ROLLOFF_AUTO:	c->operand[14] = 0x2; break;
+			case ROLLOFF_35:	c->operand[14] = 0x2; break;
+			case ROLLOFF_20:	c->operand[14] = 0x0; break;
+			case ROLLOFF_25:	c->operand[14] = 0x1; break;
+			/* case ROLLOFF_NONE:	c->operand[14] = 0xff; break; */
+			}
+			switch (fdtv->fe.dtv_property_cache.pilot) {
+			case PILOT_AUTO:	c->operand[15] = 0x0; break;
+			case PILOT_OFF:		c->operand[15] = 0x0; break;
+			case PILOT_ON:		c->operand[15] = 0x1; break;
+			}
+		} else {
+			c->operand[13] = 0x1;  /* auto modulation */
+			c->operand[14] = 0xff; /* disable rolloff */
+			c->operand[15] = 0xff; /* disable pilot */
+		}
 		return 16;
 	} else {
 		return 13;
Index: b/drivers/media/dvb/firewire/firedtv-fe.c
===================================================================
--- a/drivers/media/dvb/firewire/firedtv-fe.c
+++ b/drivers/media/dvb/firewire/firedtv-fe.c
@@ -155,6 +155,16 @@ static int fdtv_get_frontend(struct dvb_
 	return -EOPNOTSUPP;
 }
 
+static int fdtv_get_property(struct dvb_frontend *fe, struct dtv_property *tvp)
+{
+	return 0;
+}
+
+static int fdtv_set_property(struct dvb_frontend *fe, struct dtv_property *tvp)
+{
+	return 0;
+}
+
 void fdtv_frontend_init(struct firedtv *fdtv)
 {
 	struct dvb_frontend_ops *ops = &fdtv->fe.ops;
@@ -166,6 +176,9 @@ void fdtv_frontend_init(struct firedtv *
 	ops->set_frontend		= fdtv_set_frontend;
 	ops->get_frontend		= fdtv_get_frontend;
 
+	ops->get_property		= fdtv_get_property;
+	ops->set_property		= fdtv_set_property;
+
 	ops->read_status		= fdtv_read_status;
 	ops->read_ber			= fdtv_read_ber;
 	ops->read_signal_strength	= fdtv_read_signal_strength;
@@ -179,7 +192,6 @@ void fdtv_frontend_init(struct firedtv *
 
 	switch (fdtv->type) {
 	case FIREDTV_DVB_S:
-	case FIREDTV_DVB_S2:
 		fi->type		= FE_QPSK;
 
 		fi->frequency_min	= 950000;
@@ -188,7 +200,7 @@ void fdtv_frontend_init(struct firedtv *
 		fi->symbol_rate_min	= 1000000;
 		fi->symbol_rate_max	= 40000000;
 
-		fi->caps 		= FE_CAN_INVERSION_AUTO	|
+		fi->caps		= FE_CAN_INVERSION_AUTO |
 					  FE_CAN_FEC_1_2	|
 					  FE_CAN_FEC_2_3	|
 					  FE_CAN_FEC_3_4	|
@@ -198,6 +210,26 @@ void fdtv_frontend_init(struct firedtv *
 					  FE_CAN_QPSK;
 		break;
 
+	case FIREDTV_DVB_S2:
+		fi->type		= FE_QPSK;
+
+		fi->frequency_min	= 950000;
+		fi->frequency_max	= 2150000;
+		fi->frequency_stepsize	= 125;
+		fi->symbol_rate_min	= 1000000;
+		fi->symbol_rate_max	= 40000000;
+
+		fi->caps		= FE_CAN_INVERSION_AUTO |
+					  FE_CAN_FEC_1_2        |
+					  FE_CAN_FEC_2_3        |
+					  FE_CAN_FEC_3_4        |
+					  FE_CAN_FEC_5_6        |
+					  FE_CAN_FEC_7_8        |
+					  FE_CAN_FEC_AUTO       |
+					  FE_CAN_QPSK           |
+					  FE_CAN_2G_MODULATION;
+		break;
+
 	case FIREDTV_DVB_C:
 		fi->type		= FE_QAM;
 


-- 
Stefan Richter
-=====-==-=- =-=- --=--
http://arcgraph.de/sr/


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

* [PATCH update2] V4L/DVB: firedtv: support for PSK8 for S2 devices. To watch HD.
  2010-10-04 18:25     ` [PATCH update] V4L/DVB: firedtv: " Stefan Richter
@ 2010-10-04 18:29       ` Stefan Richter
  2010-10-13 21:37         ` [git pull] dvb/firewire update Stefan Richter
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Richter @ 2010-10-04 18:29 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Tommy Jonsson, linux-media, linux1394-devel

Date: Sun, 12 Sep 2010 21:03:45 +0200
From: Tommy Jonsson <quazzie2@gmail.com>

This is the first i have ever developed for linux, cant really wrap my
head around how to submit this..
Hope im sending this correctly, diff made with 'hg diff' from latest
"hg clone http://linuxtv.org/hg/v4l-dvb"

It adds support for tuning with PSK8 modulation, pilot and rolloff
with the S2 versions of firedtv.

Signed-off-by: Tommy Jonsson <quazzie2@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (trivial simplification)
---
Sorry, missed two space-before-tab.

 drivers/media/dvb/firewire/firedtv-avc.c |   30 +++++++++++++++++--
 drivers/media/dvb/firewire/firedtv-fe.c  |   36 ++++++++++++++++++++++-
 2 files changed, 60 insertions(+), 6 deletions(-)

Index: b/drivers/media/dvb/firewire/firedtv-avc.c
===================================================================
--- a/drivers/media/dvb/firewire/firedtv-avc.c
+++ b/drivers/media/dvb/firewire/firedtv-avc.c
@@ -24,6 +24,8 @@
 #include <linux/wait.h>
 #include <linux/workqueue.h>
 
+#include <dvb_frontend.h>
+
 #include "firedtv.h"
 
 #define FCP_COMMAND_REGISTER		0xfffff0000b00ULL
@@ -368,10 +370,30 @@ static int avc_tuner_tuneqpsk(struct fir
 		c->operand[12] = 0;
 
 	if (fdtv->type == FIREDTV_DVB_S2) {
-		c->operand[13] = 0x1;
-		c->operand[14] = 0xff;
-		c->operand[15] = 0xff;
-
+		if (fdtv->fe.dtv_property_cache.delivery_system == SYS_DVBS2) {
+			switch (fdtv->fe.dtv_property_cache.modulation) {
+			case QAM_16:		c->operand[13] = 0x1; break;
+			case QPSK:		c->operand[13] = 0x2; break;
+			case PSK_8:		c->operand[13] = 0x3; break;
+			default:		c->operand[13] = 0x2; break;
+			}
+			switch (fdtv->fe.dtv_property_cache.rolloff) {
+			case ROLLOFF_AUTO:	c->operand[14] = 0x2; break;
+			case ROLLOFF_35:	c->operand[14] = 0x2; break;
+			case ROLLOFF_20:	c->operand[14] = 0x0; break;
+			case ROLLOFF_25:	c->operand[14] = 0x1; break;
+			/* case ROLLOFF_NONE:	c->operand[14] = 0xff; break; */
+			}
+			switch (fdtv->fe.dtv_property_cache.pilot) {
+			case PILOT_AUTO:	c->operand[15] = 0x0; break;
+			case PILOT_OFF:		c->operand[15] = 0x0; break;
+			case PILOT_ON:		c->operand[15] = 0x1; break;
+			}
+		} else {
+			c->operand[13] = 0x1;  /* auto modulation */
+			c->operand[14] = 0xff; /* disable rolloff */
+			c->operand[15] = 0xff; /* disable pilot */
+		}
 		return 16;
 	} else {
 		return 13;
Index: b/drivers/media/dvb/firewire/firedtv-fe.c
===================================================================
--- a/drivers/media/dvb/firewire/firedtv-fe.c
+++ b/drivers/media/dvb/firewire/firedtv-fe.c
@@ -155,6 +155,16 @@ static int fdtv_get_frontend(struct dvb_
 	return -EOPNOTSUPP;
 }
 
+static int fdtv_get_property(struct dvb_frontend *fe, struct dtv_property *tvp)
+{
+	return 0;
+}
+
+static int fdtv_set_property(struct dvb_frontend *fe, struct dtv_property *tvp)
+{
+	return 0;
+}
+
 void fdtv_frontend_init(struct firedtv *fdtv)
 {
 	struct dvb_frontend_ops *ops = &fdtv->fe.ops;
@@ -166,6 +176,9 @@ void fdtv_frontend_init(struct firedtv *
 	ops->set_frontend		= fdtv_set_frontend;
 	ops->get_frontend		= fdtv_get_frontend;
 
+	ops->get_property		= fdtv_get_property;
+	ops->set_property		= fdtv_set_property;
+
 	ops->read_status		= fdtv_read_status;
 	ops->read_ber			= fdtv_read_ber;
 	ops->read_signal_strength	= fdtv_read_signal_strength;
@@ -179,7 +192,6 @@ void fdtv_frontend_init(struct firedtv *
 
 	switch (fdtv->type) {
 	case FIREDTV_DVB_S:
-	case FIREDTV_DVB_S2:
 		fi->type		= FE_QPSK;
 
 		fi->frequency_min	= 950000;
@@ -188,7 +200,7 @@ void fdtv_frontend_init(struct firedtv *
 		fi->symbol_rate_min	= 1000000;
 		fi->symbol_rate_max	= 40000000;
 
-		fi->caps 		= FE_CAN_INVERSION_AUTO	|
+		fi->caps		= FE_CAN_INVERSION_AUTO |
 					  FE_CAN_FEC_1_2	|
 					  FE_CAN_FEC_2_3	|
 					  FE_CAN_FEC_3_4	|
@@ -198,6 +210,26 @@ void fdtv_frontend_init(struct firedtv *
 					  FE_CAN_QPSK;
 		break;
 
+	case FIREDTV_DVB_S2:
+		fi->type		= FE_QPSK;
+
+		fi->frequency_min	= 950000;
+		fi->frequency_max	= 2150000;
+		fi->frequency_stepsize	= 125;
+		fi->symbol_rate_min	= 1000000;
+		fi->symbol_rate_max	= 40000000;
+
+		fi->caps		= FE_CAN_INVERSION_AUTO |
+					  FE_CAN_FEC_1_2        |
+					  FE_CAN_FEC_2_3        |
+					  FE_CAN_FEC_3_4        |
+					  FE_CAN_FEC_5_6        |
+					  FE_CAN_FEC_7_8        |
+					  FE_CAN_FEC_AUTO       |
+					  FE_CAN_QPSK           |
+					  FE_CAN_2G_MODULATION;
+		break;
+
 	case FIREDTV_DVB_C:
 		fi->type		= FE_QAM;
 

-- 
Stefan Richter
-=====-==-=- =-=- --=--
http://arcgraph.de/sr/


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

* [git pull] dvb/firewire update
  2010-10-04 18:29       ` [PATCH update2] " Stefan Richter
@ 2010-10-13 21:37         ` Stefan Richter
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Richter @ 2010-10-13 21:37 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, linux1394-devel

Hi Mauro,

please pull from the firedtv branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git firedtv

to receive the following update --- if you don't have it already in your
patch queue.  It adds a long asked for feature to FireWire sat
receivers.  Thanks.

Tommy Jonsson (1):
      V4L/DVB: firedtv: support for PSK8 for S2 devices. To watch HD.

 drivers/media/dvb/firewire/firedtv-avc.c |   30 +++++++++++++++++++++---
 drivers/media/dvb/firewire/firedtv-fe.c  |   36 ++++++++++++++++++++++++++++-
 2 files changed, 60 insertions(+), 6 deletions(-)
-- 
Stefan Richter
-=====-==-=- =-=- -==-=
http://arcgraph.de/sr/


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

end of thread, other threads:[~2010-10-13 21:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-12 19:03 [PATCH] firedtv driver: support for PSK8 for S2 devices. To watch HD Tommy Jonsson
2010-09-15 11:48 ` Stefan Richter
2010-09-15 17:46   ` Tommy Jonsson
2010-09-15 11:58 ` Stefan Richter
2010-09-15 18:01   ` Tommy Jonsson
2010-09-15 18:05   ` Tommy Jonsson
2010-10-04 18:25     ` [PATCH update] V4L/DVB: firedtv: " Stefan Richter
2010-10-04 18:29       ` [PATCH update2] " Stefan Richter
2010-10-13 21:37         ` [git pull] dvb/firewire update Stefan Richter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.