[media] em28xx-dvb: create RF connector on DVB-only mode
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 11 Feb 2016 19:17:30 +0000 (17:17 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 16 Feb 2016 10:44:24 +0000 (08:44 -0200)
When in analog mode, the RF connector will be created by
em28xx-video. However, when the device is in digital mode only,
the RF connector is not shown. In this case, let the DVB
core to create it for us.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/em28xx/em28xx-dvb.c
drivers/media/usb/em28xx/em28xx-video.c

index ea80541d58f065190b738730d93b3e8cd048750f..7ca2fbd3b14a0d1a01e5083642f745f56c92b6ad 100644 (file)
@@ -905,6 +905,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
                               struct em28xx *dev, struct device *device)
 {
        int result;
+       bool create_rf_connector = false;
 
        mutex_init(&dvb->lock);
 
@@ -998,7 +999,11 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
        /* register network adapter */
        dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
 
-       result = dvb_create_media_graph(&dvb->adapter, false);
+       /* If the analog part won't create RF connectors, DVB will do it */
+       if (!dev->has_video || (dev->tuner_type == TUNER_ABSENT))
+               create_rf_connector = true;
+
+       result = dvb_create_media_graph(&dvb->adapter, create_rf_connector);
        if (result < 0)
                goto fail_create_graph;
 
index e7fd0bac4a08cbcce45bd8099881814f36b66726..f772e261260852c15455bb2899bd3e739bffdb0f 100644 (file)
@@ -990,7 +990,8 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev)
                        ent->function = MEDIA_ENT_F_CONN_SVIDEO;
                        break;
                default: /* EM28XX_VMUX_TELEVISION or EM28XX_RADIO */
-                       ent->function = MEDIA_ENT_F_CONN_RF;
+                       if (dev->tuner_type != TUNER_ABSENT)
+                               ent->function = MEDIA_ENT_F_CONN_RF;
                        break;
                }