Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (6134): tuner: alter build to produce separate modules

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>

authored by

Michael Krufky and committed by
Mauro Carvalho Chehab
ca805d57 4adad287

+141 -13
+56
drivers/media/Kconfig
··· 69 69 config VIDEO_TUNER 70 70 tristate 71 71 depends on I2C 72 + select TUNER_MT20XX if !VIDEO_TUNER_CUSTOMIZE 73 + select TUNER_TDA8290 if !VIDEO_TUNER_CUSTOMIZE 74 + select TUNER_TEA5761 if !VIDEO_TUNER_CUSTOMIZE 75 + select TUNER_TEA5767 if !VIDEO_TUNER_CUSTOMIZE 76 + select TUNER_SIMPLE if !VIDEO_TUNER_CUSTOMIZE 77 + 78 + menuconfig VIDEO_TUNER_CUSTOMIZE 79 + bool "Customize analog tuner modules to build" 80 + depends on VIDEO_TUNER 81 + help 82 + This allows the user to deselect tuner drivers unnecessary 83 + for their hardware from the build. Use this option with care 84 + as deselecting tuner drivers which are in fact necessary will 85 + result in V4L devices which cannot be tuned due to lack of 86 + driver support 87 + 88 + If unsure say N. 89 + 90 + if VIDEO_TUNER_CUSTOMIZE 91 + 92 + config TUNER_MT20XX 93 + tristate "Microtune 2032 / 2050 tuners" 94 + depends on I2C 95 + default m if VIDEO_TUNER_CUSTOMIZE 96 + help 97 + Say Y here to include support for the MT2032 / MT2050 tuner. 98 + 99 + config TUNER_TDA8290 100 + tristate "TDA 8290+8275(a) tuner combo" 101 + depends on I2C 102 + default m if VIDEO_TUNER_CUSTOMIZE 103 + help 104 + Say Y here to include support for Philips TDA8290+8275(a) tuner. 105 + 106 + config TUNER_TEA5761 107 + tristate "TEA 5761 radio tuner (EXPERIMENTAL)" 108 + depends on I2C && EXPERIMENTAL 109 + default m if VIDEO_TUNER_CUSTOMIZE 110 + help 111 + Say Y here to include support for the Philips TEA5761 radio tuner. 112 + 113 + config TUNER_TEA5767 114 + tristate "TEA 5767 radio tuner" 115 + depends on I2C 116 + default m if VIDEO_TUNER_CUSTOMIZE 117 + help 118 + Say Y here to include support for the Philips TEA5767 radio tuner. 119 + 120 + config TUNER_SIMPLE 121 + tristate "Simple tuner support" 122 + depends on I2C 123 + default m if VIDEO_TUNER_CUSTOMIZE 124 + help 125 + Say Y here to include support for various simple tuners. 126 + 127 + endif # VIDEO_TUNER_CUSTOMIZE 72 128 73 129 config VIDEO_BUF 74 130 depends on PCI
-9
drivers/media/video/Kconfig
··· 505 505 Say Y here to include support for Philips SAB3036 compatible tuners. 506 506 If in doubt, say N. 507 507 508 - config TUNER_TEA5761 509 - bool "TEA 5761 radio tuner (EXPERIMENTAL)" 510 - depends on EXPERIMENTAL 511 - depends on I2C 512 - select VIDEO_TUNER 513 - help 514 - Say Y here to include support for Philips TEA5761 radio tuner. 515 - If in doubt, say N. 516 - 517 508 config VIDEO_VINO 518 509 tristate "SGI Vino Video For Linux (EXPERIMENTAL)" 519 510 depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L2
+8 -4
drivers/media/video/Makefile
··· 4 4 5 5 zr36067-objs := zoran_procfs.o zoran_device.o \ 6 6 zoran_driver.o zoran_card.o 7 - tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \ 8 - mt20xx.o tda8290.o tea5767.o tda9887.o 9 - 10 - tuner-$(CONFIG_TUNER_TEA5761) += tea5761.o 7 + tuner-objs := tuner-core.o tuner-types.o tda9887.o 11 8 12 9 msp3400-objs := msp3400-driver.o msp3400-kthreads.o 13 10 ··· 80 83 obj-$(CONFIG_TUNER_3036) += tuner-3036.o 81 84 82 85 obj-$(CONFIG_VIDEO_TUNER) += tuner.o 86 + 87 + obj-$(CONFIG_TUNER_SIMPLE) += tuner-simple.o 88 + obj-$(CONFIG_TUNER_MT20XX) += mt20xx.o 89 + obj-$(CONFIG_TUNER_TDA8290) += tda8290.o 90 + obj-$(CONFIG_TUNER_TEA5767) += tea5767.o 91 + obj-$(CONFIG_TUNER_TEA5761) += tea5761.o 92 + 83 93 obj-$(CONFIG_VIDEO_BUF) += video-buf.o 84 94 obj-$(CONFIG_VIDEO_BUF_DVB) += video-buf-dvb.o 85 95 obj-$(CONFIG_VIDEO_BTCX) += btcx-risc.o
+10
drivers/media/video/mt20xx.h
··· 20 20 #include <linux/i2c.h> 21 21 #include "dvb_frontend.h" 22 22 23 + #if defined(CONFIG_TUNER_MT20XX) || (defined(CONFIG_TUNER_MT20XX_MODULE) && defined(MODULE)) 23 24 extern struct dvb_frontend *microtune_attach(struct dvb_frontend *fe, 24 25 struct i2c_adapter* i2c_adap, 25 26 u8 i2c_addr); 27 + #else 28 + static inline struct dvb_frontend *microtune_attach(struct dvb_frontend *fe, 29 + struct i2c_adapter* i2c_adap, 30 + u8 i2c_addr) 31 + { 32 + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); 33 + return NULL; 34 + } 35 + #endif 26 36 27 37 #endif /* __MT20XX_H__ */
+19
drivers/media/video/tda8290.h
··· 26 26 int (*tuner_callback) (void *dev, int command,int arg); 27 27 }; 28 28 29 + #if defined(CONFIG_TUNER_TDA8290) || (defined(CONFIG_TUNER_TDA8290_MODULE) && defined(MODULE)) 29 30 extern int tda8290_probe(struct i2c_adapter* i2c_adap, u8 i2c_addr); 31 + 30 32 extern struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe, 31 33 struct i2c_adapter* i2c_adap, 32 34 u8 i2c_addr, 33 35 struct tda8290_config *cfg); 36 + #else 37 + static inline int tda8290_probe(struct i2c_adapter* i2c_adap, u8 i2c_addr) 38 + { 39 + printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n", 40 + __FUNCTION__); 41 + return -EINVAL; 42 + } 43 + 44 + static inline struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe, 45 + struct i2c_adapter* i2c_adap, 46 + u8 i2c_addr, 47 + struct tda8290_config *cfg) 48 + { 49 + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); 50 + return NULL; 51 + } 52 + #endif 34 53 35 54 #endif /* __TDA8290_H__ */
+19
drivers/media/video/tea5761.h
··· 20 20 #include <linux/i2c.h> 21 21 #include "dvb_frontend.h" 22 22 23 + #if defined(CONFIG_TUNER_TEA5761) || (defined(CONFIG_TUNER_TEA5761_MODULE) && defined(MODULE)) 23 24 extern int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr); 25 + 24 26 extern struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe, 25 27 struct i2c_adapter* i2c_adap, 26 28 u8 i2c_addr); 29 + #else 30 + static inline int tea5761_autodetection(struct i2c_adapter* i2c_adap, 31 + u8 i2c_addr) 32 + { 33 + printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n", 34 + __FUNCTION__); 35 + return -EINVAL; 36 + } 37 + 38 + static inline struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe, 39 + struct i2c_adapter* i2c_adap, 40 + u8 i2c_addr) 41 + { 42 + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); 43 + return NULL; 44 + } 45 + #endif 27 46 28 47 #endif /* __TEA5761_H__ */
+18
drivers/media/video/tea5767.h
··· 20 20 #include <linux/i2c.h> 21 21 #include "dvb_frontend.h" 22 22 23 + #if defined(CONFIG_TUNER_TEA5767) || (defined(CONFIG_TUNER_TEA5767_MODULE) && defined(MODULE)) 23 24 extern int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr); 24 25 25 26 extern struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe, 26 27 struct i2c_adapter* i2c_adap, 27 28 u8 i2c_addr); 29 + #else 30 + static inline int tea5767_autodetection(struct i2c_adapter* i2c_adap, 31 + u8 i2c_addr) 32 + { 33 + printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n", 34 + __FUNCTION__); 35 + return -EINVAL; 36 + } 37 + 38 + static inline struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe, 39 + struct i2c_adapter* i2c_adap, 40 + u8 i2c_addr) 41 + { 42 + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); 43 + return NULL; 44 + } 45 + #endif 28 46 29 47 #endif /* __TEA5767_H__ */
+11
drivers/media/video/tuner-simple.h
··· 27 27 struct tunertype *tun; 28 28 }; 29 29 30 + #if defined(CONFIG_TUNER_SIMPLE) || (defined(CONFIG_TUNER_SIMPLE_MODULE) && defined(MODULE)) 30 31 extern struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, 31 32 struct i2c_adapter *i2c_adap, 32 33 u8 i2c_addr, 33 34 struct simple_tuner_config *cfg); 35 + #else 36 + static inline struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, 37 + struct i2c_adapter *i2c_adap, 38 + u8 i2c_addr, 39 + struct simple_tuner_config *cfg) 40 + { 41 + printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); 42 + return NULL; 43 + } 44 + #endif 34 45 35 46 #endif /* __TUNER_SIMPLE_H__ */