V4L/DVB (6660): Allow fully configuring xc3028 during xc2028_attach
xc3028 can be used on some DTV only designs (for example, DVB-S boards). Before
this patch, a DTV only board would need to call set_tuner_config callback.
This patch allows to optionally pass a xc3028_ctrl parameter, via xc3028_config
struct, fully initializing the driver for DTV.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index 6a6642e..c231e7a 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -1061,7 +1061,7 @@
if (debug)
printk(KERN_DEBUG PREFIX ": Xcv2028/3028 init called!\n");
- if (NULL == cfg->video_dev)
+ if (NULL == cfg || NULL == cfg->video_dev)
return NULL;
if (!fe) {
@@ -1106,6 +1106,9 @@
tuner_info("type set to %s\n", "XCeive xc2028/xc3028 tuner");
+ if (cfg->ctrl)
+ xc2028_set_config(fe, cfg->ctrl);
+
mutex_unlock(&xc2028_list_mutex);
return fe;