V4L/DVB (6660): Allow fully configuring xc3028 during xc2028_attach
authorMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 22 Nov 2007 15:19:37 +0000 (12:19 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:02:39 +0000 (19:02 -0200)
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>
drivers/media/video/tuner-xc2028.c
drivers/media/video/tuner-xc2028.h

index 6a6642ea48cec5d5f8e11f46dd7da1c0a717e450..c231e7a74ffb78084e8bd584fc62db393c7d6786 100644 (file)
@@ -1061,7 +1061,7 @@ void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg)
        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 @@ void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg)
 
        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;
index f24fb2a00f6fb15b886e2dc89691316ad898f4ab..a59d00fb2a36a6c8e2539f099539c917888ca164 100644 (file)
@@ -23,6 +23,7 @@ struct xc2028_config {
        struct i2c_adapter *i2c_adap;
        u8                 i2c_addr;
        void               *video_dev;
+       struct xc2028_ctrl *ctrl;
        int                (*callback) (void *dev, int command, int arg);
 };