]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/dvb/bt8xx/dst.c
V4L/DVB (4170): ATSC typecheck bugfix
[linux-2.6-omap-h63xx.git] / drivers / media / dvb / bt8xx / dst.c
index 21f327d9f7d59a98675254ea8d8e78af52e1c29c..97d6c632542a050fd1c96e488d8eb21e83bf7ac1 100644 (file)
@@ -543,6 +543,8 @@ static void dst_type_flags_print(u32 type_flags)
        dprintk(verbose, DST_ERROR, 0, "DST type flags :");
        if (type_flags & DST_TYPE_HAS_NEWTUNE)
                dprintk(verbose, DST_ERROR, 0, " 0x%x newtuner", DST_TYPE_HAS_NEWTUNE);
+       if (type_flags & DST_TYPE_HAS_NEWTUNE_2)
+               dprintk(verbose, DST_ERROR, 0, " 0x%x newtuner 2", DST_TYPE_HAS_NEWTUNE_2);
        if (type_flags & DST_TYPE_HAS_TS204)
                dprintk(verbose, DST_ERROR, 0, " 0x%x ts204", DST_TYPE_HAS_TS204);
        if (type_flags & DST_TYPE_HAS_SYMDIV)
@@ -588,28 +590,116 @@ static int dst_type_print(u8 type)
 
 struct tuner_types tuner_list[] = {
        {
-               .tuner_type = 2,
+               .tuner_type = TUNER_TYPE_L64724,
                .tuner_name = "L 64724",
-               .board_name = " "
+               .board_name = "UNKNOWN",
+               .fw_name    = "UNKNOWN"
        },
 
        {
-               .tuner_type = 4,
+               .tuner_type = TUNER_TYPE_STV0299,
                .tuner_name = "STV 0299",
-               .board_name = "VP1030"
+               .board_name = "VP1020",
+               .fw_name    = "DST-MOT"
        },
 
        {
-               .tuner_type = 8,
+               .tuner_type = TUNER_TYPE_STV0299,
+               .tuner_name = "STV 0299",
+               .board_name = "VP1020",
+               .fw_name    = "DST-03T"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_MB86A15,
                .tuner_name = "MB 86A15",
-               .board_name = "VP1025"
+               .board_name = "VP1022",
+               .fw_name    = "DST-03T"
        },
 
        {
-               .tuner_type = 16,
-               .tuner_name = "NXT 200x",
-               .board_name = "VP3250"
-       }
+               .tuner_type = TUNER_TYPE_MB86A15,
+               .tuner_name = "MB 86A15",
+               .board_name = "VP1025",
+               .fw_name    = "DST-03T"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_STV0299,
+               .tuner_name = "STV 0299",
+               .board_name = "VP1030",
+               .fw_name    = "DST-CI"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_STV0299,
+               .tuner_name = "STV 0299",
+               .board_name = "VP1030",
+               .fw_name    = "DSTMCI"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_UNKNOWN,
+               .tuner_name = "UNKNOWN",
+               .board_name = "VP2030",
+               .fw_name    = "DCT-CI"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_UNKNOWN,
+               .tuner_name = "UNKNOWN",
+               .board_name = "VP2031",
+               .fw_name    = "DCT-CI"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_UNKNOWN,
+               .tuner_name = "UNKNOWN",
+               .board_name = "VP2040",
+               .fw_name    = "DCT-CI"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_UNKNOWN,
+               .tuner_name = "UNKNOWN",
+               .board_name = "VP3020",
+               .fw_name    = "DTTFTA"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_UNKNOWN,
+               .tuner_name = "UNKNOWN",
+               .board_name = "VP3021",
+               .fw_name    = "DTTFTA"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_TDA10046,
+               .tuner_name = "TDA10046",
+               .board_name = "VP3040",
+               .fw_name    = "DTT-CI"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_UNKNOWN,
+               .tuner_name = "UNKNOWN",
+               .board_name = "VP3051",
+               .fw_name    = "DTTNXT"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_NXT200x,
+               .tuner_name = "NXT200x",
+               .board_name = "VP3220",
+               .fw_name    = "ATSCDI"
+       },
+
+       {
+               .tuner_type = TUNER_TYPE_NXT200x,
+               .tuner_name = "NXT200x",
+               .board_name = "VP3250",
+               .fw_name    = "ATSCAD"
+       },
 };
 
 /*
@@ -909,7 +999,12 @@ static int dst_get_tuner_info(struct dst_state *state)
        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;
+//             state->type_flags |= DST_TYPE_HAS_NEWTUNE;
+               if (state->type_flags != DST_TYPE_IS_ATSC))
+                       state->type_flags |= DST_TYPE_HAS_NEWTUNE;
+               else
+                       state->type_flags |= DST_TYPE_HAS_NEWTUNE_2;
+
                dprintk(verbose, DST_INFO, 1, "DST type has TS=188, Daughterboard=[%d]", state->board_info[1]);
 
        } else if (state->board_info[0] == 0xcc) {
@@ -1382,8 +1477,7 @@ static int dst_init(struct dvb_frontend *fe)
        static u8 ter_tuna_204[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
        static u8 cab_tuna_204[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
        static u8 cab_tuna_188[] = { 0x09, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
-       static u8 atsc_tuna_188[] = { 0x09, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
-       static u8 atsc_tuna_204[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
+       static u8 atsc_tuner[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
 
        state->inversion = INVERSION_OFF;
        state->voltage = SEC_VOLTAGE_13;
@@ -1399,7 +1493,7 @@ static int dst_init(struct dvb_frontend *fe)
        else if (state->dst_type == DST_TYPE_IS_CABLE)
                memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_NEWTUNE) ? cab_tuna_188 : cab_tuna_204), sizeof (cab_tuna_204));
        else if (state->dst_type == DST_TYPE_IS_ATSC)
-               memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_NEWTUNE) ? atsc_tuna_188 : atsc_tuna_204), sizeof (atsc_tuna_204));
+               memcpy(state->tx_tuna, atsc_tuner, sizeof (atsc_tuner));
 
        return 0;
 }