]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6134): tuner: alter build to produce separate modules
authorMichael Krufky <mkrufky@linuxtv.org>
Tue, 28 Aug 2007 00:59:35 +0000 (21:59 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:07:43 +0000 (22:07 -0300)
Break tuner.ko into separate modules. This was a quick change -
Tuner sub-drivers are still static-linked to tuner.ko, this will
change after using dvb_attach and removing the probing functions.

After this change, one can deselect undesired tuner sub-drivers via Kconfig.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/Kconfig
drivers/media/video/Kconfig
drivers/media/video/Makefile
drivers/media/video/mt20xx.h
drivers/media/video/tda8290.h
drivers/media/video/tea5761.h
drivers/media/video/tea5767.h
drivers/media/video/tuner-simple.h

index d9d033e07e197cb0496218fc3f334bc1b33f06cf..3f8cfa873de526ee9877b2fb33ffbcc89aa21042 100644 (file)
@@ -69,6 +69,62 @@ source "drivers/media/common/Kconfig"
 config VIDEO_TUNER
        tristate
        depends on I2C
+       select TUNER_MT20XX if !VIDEO_TUNER_CUSTOMIZE
+       select TUNER_TDA8290 if !VIDEO_TUNER_CUSTOMIZE
+       select TUNER_TEA5761 if !VIDEO_TUNER_CUSTOMIZE
+       select TUNER_TEA5767 if !VIDEO_TUNER_CUSTOMIZE
+       select TUNER_SIMPLE if !VIDEO_TUNER_CUSTOMIZE
+
+menuconfig VIDEO_TUNER_CUSTOMIZE
+       bool "Customize analog tuner modules to build"
+       depends on VIDEO_TUNER
+       help
+         This allows the user to deselect tuner drivers unnecessary
+         for their hardware from the build. Use this option with care
+         as deselecting tuner drivers which are in fact necessary will
+         result in V4L devices which cannot be tuned due to lack of
+         driver support
+
+         If unsure say N.
+
+if VIDEO_TUNER_CUSTOMIZE
+
+config TUNER_MT20XX
+       tristate "Microtune 2032 / 2050 tuners"
+       depends on I2C
+       default m if VIDEO_TUNER_CUSTOMIZE
+       help
+         Say Y here to include support for the MT2032 / MT2050 tuner.
+
+config TUNER_TDA8290
+       tristate "TDA 8290+8275(a) tuner combo"
+       depends on I2C
+       default m if VIDEO_TUNER_CUSTOMIZE
+       help
+         Say Y here to include support for Philips TDA8290+8275(a) tuner.
+
+config TUNER_TEA5761
+       tristate "TEA 5761 radio tuner (EXPERIMENTAL)"
+       depends on I2C && EXPERIMENTAL
+       default m if VIDEO_TUNER_CUSTOMIZE
+       help
+         Say Y here to include support for the Philips TEA5761 radio tuner.
+
+config TUNER_TEA5767
+       tristate "TEA 5767 radio tuner"
+       depends on I2C
+       default m if VIDEO_TUNER_CUSTOMIZE
+       help
+         Say Y here to include support for the Philips TEA5767 radio tuner.
+
+config TUNER_SIMPLE
+       tristate "Simple tuner support"
+       depends on I2C
+       default m if VIDEO_TUNER_CUSTOMIZE
+       help
+         Say Y here to include support for various simple tuners.
+
+endif # VIDEO_TUNER_CUSTOMIZE
 
 config VIDEO_BUF
        depends on PCI
index 0e1d2ccc4e8164189ae2b78185c60424c7f404c8..04756c342cbacf5aafa0325e870527182682e4e0 100644 (file)
@@ -505,15 +505,6 @@ config TUNER_3036
          Say Y here to include support for Philips SAB3036 compatible tuners.
          If in doubt, say N.
 
-config TUNER_TEA5761
-       bool "TEA 5761 radio tuner (EXPERIMENTAL)"
-       depends on EXPERIMENTAL
-       depends on I2C
-       select VIDEO_TUNER
-       help
-         Say Y here to include support for Philips TEA5761 radio tuner.
-         If in doubt, say N.
-
 config VIDEO_VINO
        tristate "SGI Vino Video For Linux (EXPERIMENTAL)"
        depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L2
index 113e525f6dabdf3fdeb5eca4928c8345b3b61b8e..00699c36ec1a16a6f3694a299db7233234f0a789 100644 (file)
@@ -4,10 +4,7 @@
 
 zr36067-objs   :=      zoran_procfs.o zoran_device.o \
                        zoran_driver.o zoran_card.o
-tuner-objs     :=      tuner-core.o tuner-types.o tuner-simple.o \
-                       mt20xx.o tda8290.o tea5767.o tda9887.o
-
-tuner-$(CONFIG_TUNER_TEA5761)  += tea5761.o
+tuner-objs     :=      tuner-core.o tuner-types.o tda9887.o
 
 msp3400-objs   :=      msp3400-driver.o msp3400-kthreads.o
 
@@ -83,6 +80,13 @@ obj-$(CONFIG_VIDEO_DPC) += dpc7146.o
 obj-$(CONFIG_TUNER_3036) += tuner-3036.o
 
 obj-$(CONFIG_VIDEO_TUNER) += tuner.o
+
+obj-$(CONFIG_TUNER_SIMPLE) += tuner-simple.o
+obj-$(CONFIG_TUNER_MT20XX) += mt20xx.o
+obj-$(CONFIG_TUNER_TDA8290) += tda8290.o
+obj-$(CONFIG_TUNER_TEA5767) += tea5767.o
+obj-$(CONFIG_TUNER_TEA5761) += tea5761.o
+
 obj-$(CONFIG_VIDEO_BUF)   += video-buf.o
 obj-$(CONFIG_VIDEO_BUF_DVB) += video-buf-dvb.o
 obj-$(CONFIG_VIDEO_BTCX)  += btcx-risc.o
index 877dbef891ea0f21cfb383bc164f29bd208cc1c3..5e9c825d2e91bb392d283d04a776c6aa7dc1de11 100644 (file)
 #include <linux/i2c.h>
 #include "dvb_frontend.h"
 
+#if defined(CONFIG_TUNER_MT20XX) || (defined(CONFIG_TUNER_MT20XX_MODULE) && defined(MODULE))
 extern struct dvb_frontend *microtune_attach(struct dvb_frontend *fe,
                                             struct i2c_adapter* i2c_adap,
                                             u8 i2c_addr);
+#else
+static inline struct dvb_frontend *microtune_attach(struct dvb_frontend *fe,
+                                            struct i2c_adapter* i2c_adap,
+                                            u8 i2c_addr)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+       return NULL;
+}
+#endif
 
 #endif /* __MT20XX_H__ */
index 815ca1c78f806a42c6bbe9036adaf34a3bb06f2b..107b24b05aa189b3378a49d5930aff8c56840036 100644 (file)
@@ -26,10 +26,29 @@ struct tda8290_config
        int (*tuner_callback) (void *dev, int command,int arg);
 };
 
+#if defined(CONFIG_TUNER_TDA8290) || (defined(CONFIG_TUNER_TDA8290_MODULE) && defined(MODULE))
 extern int tda8290_probe(struct i2c_adapter* i2c_adap, u8 i2c_addr);
+
 extern struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe,
                                           struct i2c_adapter* i2c_adap,
                                           u8 i2c_addr,
                                           struct tda8290_config *cfg);
+#else
+static inline int tda8290_probe(struct i2c_adapter* i2c_adap, u8 i2c_addr)
+{
+       printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
+              __FUNCTION__);
+       return -EINVAL;
+}
+
+static inline struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe,
+                                                 struct i2c_adapter* i2c_adap,
+                                                 u8 i2c_addr,
+                                                 struct tda8290_config *cfg)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+       return NULL;
+}
+#endif
 
 #endif /* __TDA8290_H__ */
index f287c0291bffc01ec7e02cf29650cc6ddab7e977..73a03b427843f4466a3043c68eb6dc14a36a1b2b 100644 (file)
 #include <linux/i2c.h>
 #include "dvb_frontend.h"
 
+#if defined(CONFIG_TUNER_TEA5761) || (defined(CONFIG_TUNER_TEA5761_MODULE) && defined(MODULE))
 extern int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr);
+
 extern struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
                                           struct i2c_adapter* i2c_adap,
                                           u8 i2c_addr);
+#else
+static inline int tea5761_autodetection(struct i2c_adapter* i2c_adap,
+                                       u8 i2c_addr)
+{
+       printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
+              __FUNCTION__);
+       return -EINVAL;
+}
+
+static inline struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
+                                                  struct i2c_adapter* i2c_adap,
+                                                  u8 i2c_addr)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+       return NULL;
+}
+#endif
 
 #endif /* __TEA5761_H__ */
index 68e9263badfd4d6814f37b2b65a0a411eda2e4c7..5d78281adcc2acb5af002f844e1abdb9aecc73bb 100644 (file)
 #include <linux/i2c.h>
 #include "dvb_frontend.h"
 
+#if defined(CONFIG_TUNER_TEA5767) || (defined(CONFIG_TUNER_TEA5767_MODULE) && defined(MODULE))
 extern int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr);
 
 extern struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe,
                                           struct i2c_adapter* i2c_adap,
                                           u8 i2c_addr);
+#else
+static inline int tea5767_autodetection(struct i2c_adapter* i2c_adap,
+                                       u8 i2c_addr)
+{
+       printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
+              __FUNCTION__);
+       return -EINVAL;
+}
+
+static inline struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe,
+                                                  struct i2c_adapter* i2c_adap,
+                                                  u8 i2c_addr)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+       return NULL;
+}
+#endif
 
 #endif /* __TEA5767_H__ */
index 75cd45b7145d578adca7d425f237424251f9489d..9089939a8c0214e9b71c177f7880936efd14edb5 100644 (file)
@@ -27,9 +27,20 @@ struct simple_tuner_config
        struct tunertype *tun;
 };
 
+#if defined(CONFIG_TUNER_SIMPLE) || (defined(CONFIG_TUNER_SIMPLE_MODULE) && defined(MODULE))
 extern struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
                                                struct i2c_adapter *i2c_adap,
                                                u8 i2c_addr,
                                                struct simple_tuner_config *cfg);
+#else
+static inline struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
+                                                      struct i2c_adapter *i2c_adap,
+                                                      u8 i2c_addr,
+                                                      struct simple_tuner_config *cfg)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+       return NULL;
+}
+#endif
 
 #endif /* __TUNER_SIMPLE_H__ */