[media] dvb_usb_v2: use IS_ENABLED() macro
[firefly-linux-kernel-4.4.55.git] / drivers / media / usb / dvb-usb-v2 / rtl28xxu.c
index 093f1acce403e7fa35ddea58914dd386ee32f426..2d024716d630d7c3205e57349bfd4975e49884ac 100644 (file)
@@ -835,6 +835,11 @@ static struct tua9001_config rtl2832u_tua9001_config = {
        .i2c_addr = 0x60,
 };
 
+static const struct fc0012_config rtl2832u_fc0012_config = {
+       .i2c_address = 0x63, /* 0xc6 >> 1 */
+       .xtal_freq = FC_XTAL_28_8_MHZ,
+};
+
 static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
 {
        int ret;
@@ -847,7 +852,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
        switch (priv->tuner) {
        case TUNER_RTL2832_FC0012:
                fe = dvb_attach(fc0012_attach, adap->fe[0],
-                       &d->i2c_adap, 0xc6>>1, 0, FC_XTAL_28_8_MHZ);
+                       &d->i2c_adap, &rtl2832u_fc0012_config);
 
                /* since fc0012 includs reading the signal strength delegate
                 * that to the tuner driver */
@@ -1120,7 +1125,7 @@ err:
        return ret;
 }
 
-
+#if IS_ENABLED(CONFIG_RC_CORE)
 static int rtl2831u_rc_query(struct dvb_usb_device *d)
 {
        int ret, i;
@@ -1197,13 +1202,17 @@ static int rtl2831u_get_rc_config(struct dvb_usb_device *d,
                struct dvb_usb_rc *rc)
 {
        rc->map_name = RC_MAP_EMPTY;
-       rc->allowed_protos = RC_TYPE_NEC;
+       rc->allowed_protos = RC_BIT_NEC;
        rc->query = rtl2831u_rc_query;
        rc->interval = 400;
 
        return 0;
 }
+#else
+       #define rtl2831u_get_rc_config NULL
+#endif
 
+#if IS_ENABLED(CONFIG_RC_CORE)
 static int rtl2832u_rc_query(struct dvb_usb_device *d)
 {
        int ret, i;
@@ -1269,12 +1278,15 @@ static int rtl2832u_get_rc_config(struct dvb_usb_device *d,
                struct dvb_usb_rc *rc)
 {
        rc->map_name = RC_MAP_EMPTY;
-       rc->allowed_protos = RC_TYPE_NEC;
+       rc->allowed_protos = RC_BIT_NEC;
        rc->query = rtl2832u_rc_query;
        rc->interval = 400;
 
        return 0;
 }
+#else
+       #define rtl2832u_get_rc_config NULL
+#endif
 
 static const struct dvb_usb_device_properties rtl2831u_props = {
        .driver_name = KBUILD_MODNAME,
@@ -1338,6 +1350,8 @@ static const struct usb_device_id rtl28xxu_id_table[] = {
                &rtl2832u_props, "G-Tek Electronics Group Lifeview LV5TDLX DVB-T", NULL) },
        { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK,
                &rtl2832u_props, "NOXON DAB/DAB+ USB dongle", NULL) },
+       { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK_REV2,
+               &rtl2832u_props, "NOXON DAB/DAB+ USB dongle (rev 2)", NULL) },
        { DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_TREKSTOR_TERRES_2_0,
                &rtl2832u_props, "Trekstor DVB-T Stick Terres 2.0", NULL) },
        { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1101,