]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/media/usb/dvb-usb-v2/af9035.c
[media] af9035: fix device order in ID list
[karo-tx-linux.git] / drivers / media / usb / dvb-usb-v2 / af9035.c
index 80a29f5377ea54bd2be9fbe7be687bb0f9082565..2ae1f2e8f2abbd2048b719b580c77717f3415e4b 100644 (file)
@@ -1265,11 +1265,6 @@ static struct tda18218_config af9035_tda18218_config = {
        .i2c_wr_max = 21,
 };
 
-static const struct fc2580_config af9035_fc2580_config = {
-       .i2c_addr = 0x56,
-       .clock = 16384000,
-};
-
 static const struct fc0012_config af9035_fc0012_config[] = {
        {
                .i2c_address = 0x63,
@@ -1390,7 +1385,11 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
                fe = dvb_attach(tda18218_attach, adap->fe[0],
                                &d->i2c_adap, &af9035_tda18218_config);
                break;
-       case AF9033_TUNER_FC2580:
+       case AF9033_TUNER_FC2580: {
+               struct fc2580_platform_data fc2580_pdata = {
+                       .dvb_frontend = adap->fe[0],
+               };
+
                /* Tuner enable using gpiot2_o, gpiot2_en and gpiot2_on  */
                ret = af9035_wr_reg_mask(d, 0xd8eb, 0x01, 0x01);
                if (ret < 0)
@@ -1406,9 +1405,14 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
 
                usleep_range(10000, 50000);
                /* attach tuner */
-               fe = dvb_attach(fc2580_attach, adap->fe[0],
-                               &d->i2c_adap, &af9035_fc2580_config);
+               ret = af9035_add_i2c_dev(d, "fc2580", 0x56, &fc2580_pdata,
+                                        &d->i2c_adap);
+               if (ret)
+                       goto err;
+
+               fe = adap->fe[0];
                break;
+       }
        case AF9033_TUNER_FC0012:
                /*
                 * AF9035 gpiot2 = FC0012 enable
@@ -1569,6 +1573,7 @@ static int it930x_tuner_attach(struct dvb_usb_adapter *adap)
 
        memset(&si2157_config, 0, sizeof(si2157_config));
        si2157_config.fe = adap->fe[0];
+       si2157_config.if_port = 1;
        ret = af9035_add_i2c_dev(d, "si2157", 0x63,
                        &si2157_config, state->i2c_adapter_demod);
 
@@ -1611,6 +1616,7 @@ static int af9035_tuner_detach(struct dvb_usb_adapter *adap)
        dev_dbg(&d->udev->dev, "%s: adap->id=%d\n", __func__, adap->id);
 
        switch (state->af9033_config[adap->id].tuner) {
+       case AF9033_TUNER_FC2580:
        case AF9033_TUNER_IT9135_38:
        case AF9033_TUNER_IT9135_51:
        case AF9033_TUNER_IT9135_52:
@@ -2021,6 +2027,7 @@ static const struct usb_device_id af9035_id_table[] = {
                &af9035_props, "Asus U3100Mini Plus", NULL) },
        { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa,
                &af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) },
+
        /* IT9135 devices */
        { DVB_USB_DEVICE(USB_VID_ITETECH, USB_PID_ITETECH_IT9135,
                &af9035_props, "ITE 9135 Generic", RC_MAP_IT913X_V1) },
@@ -2046,9 +2053,6 @@ static const struct usb_device_id af9035_id_table[] = {
        { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_CTVDIGDUAL_V2,
                &af9035_props, "Digital Dual TV Receiver CTVDIGDUAL_V2",
                                                        RC_MAP_IT913X_V1) },
-       /* IT930x devices */
-       { DVB_USB_DEVICE(USB_VID_ITETECH, USB_PID_ITETECH_IT9303,
-               &it930x_props, "ITE 9303 Generic", NULL) },
        /* XXX: that same ID [0ccd:0099] is used by af9015 driver too */
        { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x0099,
                &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)",
@@ -2061,6 +2065,10 @@ static const struct usb_device_id af9035_id_table[] = {
                &af9035_props, "PCTV AndroiDTV (78e)", RC_MAP_IT913X_V1) },
        { DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_79E,
                &af9035_props, "PCTV microStick (79e)", RC_MAP_IT913X_V2) },
+
+       /* IT930x devices */
+       { DVB_USB_DEVICE(USB_VID_ITETECH, USB_PID_ITETECH_IT9303,
+               &it930x_props, "ITE 9303 Generic", NULL) },
        { }
 };
 MODULE_DEVICE_TABLE(usb, af9035_id_table);