All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: unlisted-recipients:; (no To-header on input)@casper.infradead.org
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 07/11] [media] em28xx-dvb: create RF connector on DVB-only mode
Date: Fri, 12 Feb 2016 07:45:02 -0200	[thread overview]
Message-ID: <b7dff6d1f91cdaa9102f7002e3ada0359e48cb3a.1455269986.git.mchehab@osg.samsung.com> (raw)
In-Reply-To: <cover.1455269986.git.mchehab@osg.samsung.com>
In-Reply-To: <cover.1455269986.git.mchehab@osg.samsung.com>

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   | 7 ++++++-
 drivers/media/usb/em28xx/em28xx-video.c | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index ea80541d58f0..7ca2fbd3b14a 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -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;
 
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index e7fd0bac4a08..f772e2612608 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -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;
 		}
 
-- 
2.5.0



  parent reply	other threads:[~2016-02-12  9:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12  9:44 [PATCH 00/11] Some improvements/fixes Mauro Carvalho Chehab
2016-02-12  9:44 ` [PATCH 01/11] [media] v4l2-mc.h: prevent it for being included twice Mauro Carvalho Chehab
2016-02-12  9:50   ` Hans Verkuil
2016-02-12  9:44 ` [PATCH 02/11] [media] v4l2-mc: add a routine to create USB media_device Mauro Carvalho Chehab
2016-02-12  9:52   ` Hans Verkuil
2016-02-12  9:44 ` [PATCH 03/11] [media] rc-core: don't lock device at rc_register_device() Mauro Carvalho Chehab
2016-02-12  9:44 ` [PATCH 04/11] [media] allow overriding the driver name Mauro Carvalho Chehab
2016-02-12  9:45 ` [PATCH 05/11] [media] use v4l2_mc_usb_media_device_init() on most USB devices Mauro Carvalho Chehab
2016-02-12  9:45 ` [PATCH 06/11] [media] v4l2-mc: use usb_make_path() to provide bus info Mauro Carvalho Chehab
2016-02-12  9:55   ` Hans Verkuil
2016-02-12  9:45 ` Mauro Carvalho Chehab [this message]
2016-02-12  9:45 ` [PATCH 08/11] [media] cx231xx: use v4l2 core function to create the MC graph Mauro Carvalho Chehab
2016-02-12 10:40   ` kbuild test robot
2016-02-12  9:45 ` [PATCH 09/11] [media] si2157: register as a tuner entity Mauro Carvalho Chehab
2016-02-12  9:45 ` [PATCH 10/11] [media] cx231xx, em28xx: pass media_device to si2157 Mauro Carvalho Chehab
2016-02-12  9:45 ` [PATCH 11/11] [media] cx231xx: create connectors at the media graph Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7dff6d1f91cdaa9102f7002e3ada0359e48cb3a.1455269986.git.mchehab@osg.samsung.com \
    --to=mchehab@osg.samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.