[media] firedtv: support for PSK8 for S2 devices. To watch HD
authorTommy Jonsson <quazzie2@gmail.com>
Sun, 12 Sep 2010 19:03:45 +0000 (16:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 09:54:09 +0000 (07:54 -0200)
Add 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)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/firewire/firedtv-avc.c
drivers/media/dvb/firewire/firedtv-fe.c

index 28294af..1f3d1fb 100644 (file)
@@ -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 firedtv *fdtv,
                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 e49cdc8..d10920e 100644 (file)
@@ -155,6 +155,16 @@ static int fdtv_get_frontend(struct dvb_frontend *fe,
        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 *fdtv)
        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 *fdtv)
 
        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 *fdtv)
                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 *fdtv)
                                          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;