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

V4L/DVB (9417): DVB_ATTACH for STB0899, STB6100, TDA8261

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Manu Abraham and committed by
Mauro Carvalho Chehab
ae9902da e0ee77ac

+55 -15
+16 -1
drivers/media/dvb/frontends/stb0899_drv.h
··· 97 97 int (*tuner_set_rfsiggain)(struct dvb_frontend *fe, u32 rf_gain); 98 98 }; 99 99 100 - extern struct dvb_frontend *stb0899_attach(struct stb0899_config *config, struct i2c_adapter *i2c); 100 + #if defined(CONFIG_DVB_STB0899) || (defined(CONFIG_DVB_STB0899_MODULE) && defined(MODULE)) 101 + 102 + extern struct dvb_frontend *stb0899_attach(struct stb0899_config *config, 103 + struct i2c_adapter *i2c); 104 + 105 + #else 106 + 107 + static inline struct dvb_frontend *stb0899_attach(struct stb0899_config *config, 108 + struct i2c_adapter *i2c) 109 + { 110 + printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); 111 + return NULL; 112 + } 113 + 114 + #endif //CONFIG_DVB_STB0899 115 + 101 116 102 117 #endif
+17 -3
drivers/media/dvb/frontends/stb6100.h
··· 94 94 u32 reference; 95 95 }; 96 96 97 - struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, 98 - struct stb6100_config* config, 99 - struct i2c_adapter *i2c); 97 + #if defined(CONFIG_DVB_STB6100) || (defined(CONFIG_DVB_STB6100_MODULE) && defined(MODULE)) 98 + 99 + extern struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, 100 + struct stb6100_config *config, 101 + struct i2c_adapter *i2c); 102 + 103 + #else 104 + 105 + static inline struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, 106 + struct stb6100_config *config, 107 + struct i2c_adapter *i2c) 108 + { 109 + printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); 110 + return NULL; 111 + } 112 + 113 + #endif //CONFIG_DVB_STB6100 100 114 101 115 #endif
+14
drivers/media/dvb/frontends/tda8261.h
··· 15 15 enum tda8261_step step_size; 16 16 }; 17 17 18 + #if defined(CONFIG_DVB_TDA8261) || (defined(CONFIG_DVB_TDA8261_MODULE) && defined(MODULE)) 19 + 18 20 extern struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, 19 21 const struct tda8261_config *config, 20 22 struct i2c_adapter *i2c); 23 + 24 + #else 25 + 26 + static inline struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, 27 + const struct tda8261_config *config, 28 + struct i2c_adapter *i2c) 29 + { 30 + printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); 31 + return NULL; 32 + } 33 + 34 + #endif //CONFIG_DVB_TDA8261 21 35 22 36 #endif// __TDA8261_H
+2 -2
drivers/media/dvb/ttpci/budget-av.c
··· 1603 1603 case SUBID_DVBS2_KNC1: 1604 1604 case SUBID_DVBS2_KNC1_OEM: 1605 1605 budget_av->reinitialise_demod = 1; 1606 - if ((fe = stb0899_attach(&knc1_dvbs2_config, &budget_av->budget.i2c_adap))) 1607 - tda8261_attach(fe, &sd1878c_config, &budget_av->budget.i2c_adap); 1606 + if ((fe = dvb_attach(stb0899_attach, &knc1_dvbs2_config, &budget_av->budget.i2c_adap))) 1607 + dvb_attach(tda8261_attach, fe, &sd1878c_config, &budget_av->budget.i2c_adap); 1608 1608 1609 1609 break; 1610 1610 case SUBID_DVBS_CINERGY1200:
+6 -9
drivers/media/dvb/ttpci/budget-ci.c
··· 1768 1768 break; 1769 1769 1770 1770 case 0x1019: // TT S2-3200 PCI 1771 - budget_ci->budget.dvb_frontend = stb0899_attach(&tt3200_config, &budget_ci->budget.i2c_adap); 1771 + budget_ci->budget.dvb_frontend = dvb_attach(stb0899_attach, &tt3200_config, &budget_ci->budget.i2c_adap); 1772 1772 if (budget_ci->budget.dvb_frontend) { 1773 - if (stb6100_attach(budget_ci->budget.dvb_frontend, &tt3200_stb6100_config, &budget_ci->budget.i2c_adap)) { 1774 - if (!lnbp21_attach(budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, 0, 0)) { 1773 + if (dvb_attach(stb6100_attach, budget_ci->budget.dvb_frontend, &tt3200_stb6100_config, &budget_ci->budget.i2c_adap)) { 1774 + if (!dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, 0, 0)) { 1775 1775 printk("%s: No LNBP21 found!\n", __FUNCTION__); 1776 - if (budget_ci->budget.dvb_frontend->ops.tuner_ops.release) 1777 - budget_ci->budget.dvb_frontend->ops.tuner_ops.release(budget_ci->budget.dvb_frontend); 1778 - if (budget_ci->budget.dvb_frontend->ops.release) 1779 - budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend); 1776 + dvb_frontend_detach(budget_ci->budget.dvb_frontend); 1780 1777 budget_ci->budget.dvb_frontend = NULL; 1781 1778 } 1782 1779 } else { 1783 - if (budget_ci->budget.dvb_frontend->ops.release) 1784 - budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend); 1780 + dvb_frontend_detach(budget_ci->budget.dvb_frontend); 1781 + budget_ci->budget.dvb_frontend = NULL; 1785 1782 } 1786 1783 } 1787 1784 break;