aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/common/tuners')
-rw-r--r--drivers/media/common/tuners/tda18271-fe.c20
-rw-r--r--drivers/media/common/tuners/tda18271-priv.h20
-rw-r--r--drivers/media/common/tuners/tda18271.h3
-rw-r--r--drivers/media/common/tuners/tuner-simple.c6
-rw-r--r--drivers/media/common/tuners/tuner-types.c25
5 files changed, 62 insertions, 12 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c
index b10935630154..bc4b004ba7db 100644
--- a/drivers/media/common/tuners/tda18271-fe.c
+++ b/drivers/media/common/tuners/tda18271-fe.c
@@ -27,7 +27,7 @@ module_param_named(debug, tda18271_debug, int, 0644);
27MODULE_PARM_DESC(debug, "set debug level " 27MODULE_PARM_DESC(debug, "set debug level "
28 "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))"); 28 "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))");
29 29
30static int tda18271_cal_on_startup; 30static int tda18271_cal_on_startup = -1;
31module_param_named(cal, tda18271_cal_on_startup, int, 0644); 31module_param_named(cal, tda18271_cal_on_startup, int, 0644);
32MODULE_PARM_DESC(cal, "perform RF tracking filter calibration on startup"); 32MODULE_PARM_DESC(cal, "perform RF tracking filter calibration on startup");
33 33
@@ -1192,10 +1192,25 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
1192 case 0: 1192 case 0:
1193 goto fail; 1193 goto fail;
1194 case 1: 1194 case 1:
1195 {
1195 /* new tuner instance */ 1196 /* new tuner instance */
1197 int rf_cal_on_startup;
1198
1196 priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; 1199 priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO;
1197 priv->role = (cfg) ? cfg->role : TDA18271_MASTER; 1200 priv->role = (cfg) ? cfg->role : TDA18271_MASTER;
1198 priv->config = (cfg) ? cfg->config : 0; 1201 priv->config = (cfg) ? cfg->config : 0;
1202
1203 /* tda18271_cal_on_startup == -1 when cal
1204 * module option is unset */
1205 if (tda18271_cal_on_startup == -1) {
1206 /* honor attach-time configuration */
1207 rf_cal_on_startup =
1208 ((cfg) && (cfg->rf_cal_on_startup)) ? 1 : 0;
1209 } else {
1210 /* module option overrides attach configuration */
1211 rf_cal_on_startup = tda18271_cal_on_startup;
1212 }
1213
1199 priv->cal_initialized = false; 1214 priv->cal_initialized = false;
1200 mutex_init(&priv->lock); 1215 mutex_init(&priv->lock);
1201 1216
@@ -1213,11 +1228,12 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
1213 mutex_lock(&priv->lock); 1228 mutex_lock(&priv->lock);
1214 tda18271_init_regs(fe); 1229 tda18271_init_regs(fe);
1215 1230
1216 if ((tda18271_cal_on_startup) && (priv->id == TDA18271HDC2)) 1231 if ((rf_cal_on_startup) && (priv->id == TDA18271HDC2))
1217 tda18271c2_rf_cal_init(fe); 1232 tda18271c2_rf_cal_init(fe);
1218 1233
1219 mutex_unlock(&priv->lock); 1234 mutex_unlock(&priv->lock);
1220 break; 1235 break;
1236 }
1221 default: 1237 default:
1222 /* existing tuner instance */ 1238 /* existing tuner instance */
1223 fe->tuner_priv = priv; 1239 fe->tuner_priv = priv;
diff --git a/drivers/media/common/tuners/tda18271-priv.h b/drivers/media/common/tuners/tda18271-priv.h
index 74beb28806f8..e6a80ad09356 100644
--- a/drivers/media/common/tuners/tda18271-priv.h
+++ b/drivers/media/common/tuners/tda18271-priv.h
@@ -137,17 +137,17 @@ extern int tda18271_debug;
137#define tda_printk(kern, fmt, arg...) \ 137#define tda_printk(kern, fmt, arg...) \
138 printk(kern "%s: " fmt, __func__, ##arg) 138 printk(kern "%s: " fmt, __func__, ##arg)
139 139
140#define dprintk(kern, lvl, fmt, arg...) do {\ 140#define tda_dprintk(lvl, fmt, arg...) do {\
141 if (tda18271_debug & lvl) \ 141 if (tda18271_debug & lvl) \
142 tda_printk(kern, fmt, ##arg); } while (0) 142 tda_printk(KERN_DEBUG, fmt, ##arg); } while (0)
143 143
144#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) 144#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg)
145#define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg) 145#define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg)
146#define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg) 146#define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg)
147#define tda_dbg(fmt, arg...) dprintk(KERN_DEBUG, DBG_INFO, fmt, ##arg) 147#define tda_dbg(fmt, arg...) tda_dprintk(DBG_INFO, fmt, ##arg)
148#define tda_map(fmt, arg...) dprintk(KERN_DEBUG, DBG_MAP, fmt, ##arg) 148#define tda_map(fmt, arg...) tda_dprintk(DBG_MAP, fmt, ##arg)
149#define tda_reg(fmt, arg...) dprintk(KERN_DEBUG, DBG_REG, fmt, ##arg) 149#define tda_reg(fmt, arg...) tda_dprintk(DBG_REG, fmt, ##arg)
150#define tda_cal(fmt, arg...) dprintk(KERN_DEBUG, DBG_CAL, fmt, ##arg) 150#define tda_cal(fmt, arg...) tda_dprintk(DBG_CAL, fmt, ##arg)
151 151
152#define tda_fail(ret) \ 152#define tda_fail(ret) \
153({ \ 153({ \
diff --git a/drivers/media/common/tuners/tda18271.h b/drivers/media/common/tuners/tda18271.h
index 53a9892a18d0..71bac9593f1e 100644
--- a/drivers/media/common/tuners/tda18271.h
+++ b/drivers/media/common/tuners/tda18271.h
@@ -77,6 +77,9 @@ struct tda18271_config {
77 /* use i2c gate provided by analog or digital demod */ 77 /* use i2c gate provided by analog or digital demod */
78 enum tda18271_i2c_gate gate; 78 enum tda18271_i2c_gate gate;
79 79
80 /* force rf tracking filter calibration on startup */
81 unsigned int rf_cal_on_startup:1;
82
80 /* some i2c providers cant write all 39 registers at once */ 83 /* some i2c providers cant write all 39 registers at once */
81 unsigned int small_i2c:1; 84 unsigned int small_i2c:1;
82 85
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c
index 149d54cdf7b9..8abbcc5fcf95 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -144,6 +144,8 @@ static inline int tuner_stereo(const int type, const int status)
144 case TUNER_LG_NTSC_TAPE: 144 case TUNER_LG_NTSC_TAPE:
145 case TUNER_TCL_MF02GIP_5N: 145 case TUNER_TCL_MF02GIP_5N:
146 return ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3); 146 return ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3);
147 case TUNER_PHILIPS_FM1216MK5:
148 return status | TUNER_STEREO;
147 default: 149 default:
148 return status & TUNER_STEREO; 150 return status & TUNER_STEREO;
149 } 151 }
@@ -508,6 +510,10 @@ static int simple_radio_bandswitch(struct dvb_frontend *fe, u8 *buffer)
508 case TUNER_TCL_MF02GIP_5N: 510 case TUNER_TCL_MF02GIP_5N:
509 buffer[3] = 0x19; 511 buffer[3] = 0x19;
510 break; 512 break;
513 case TUNER_PHILIPS_FM1216MK5:
514 buffer[2] = 0x88;
515 buffer[3] = 0x09;
516 break;
511 case TUNER_TNF_5335MF: 517 case TUNER_TNF_5335MF:
512 buffer[3] = 0x11; 518 buffer[3] = 0x11;
513 break; 519 break;
diff --git a/drivers/media/common/tuners/tuner-types.c b/drivers/media/common/tuners/tuner-types.c
index 6a7f1a417c27..5c6ef1e23c94 100644
--- a/drivers/media/common/tuners/tuner-types.c
+++ b/drivers/media/common/tuners/tuner-types.c
@@ -1301,6 +1301,25 @@ static struct tuner_params tuner_fq1216lme_mk3_params[] = {
1301 }, 1301 },
1302}; 1302};
1303 1303
1304/* ----- TUNER_PARTSNIC_PTI_5NF05 - Partsnic (Daewoo) PTI-5NF05 NTSC ----- */
1305
1306static struct tuner_range tuner_partsnic_pti_5nf05_ranges[] = {
1307 /* The datasheet specified channel ranges and the bandswitch byte */
1308 /* The control byte value of 0x8e is just a guess */
1309 { 16 * 133.25 /*MHz*/, 0x8e, 0x01, }, /* Channels 2 - B */
1310 { 16 * 367.25 /*MHz*/, 0x8e, 0x02, }, /* Channels C - W+11 */
1311 { 16 * 999.99 , 0x8e, 0x08, }, /* Channels W+12 - 69 */
1312};
1313
1314static struct tuner_params tuner_partsnic_pti_5nf05_params[] = {
1315 {
1316 .type = TUNER_PARAM_TYPE_NTSC,
1317 .ranges = tuner_partsnic_pti_5nf05_ranges,
1318 .count = ARRAY_SIZE(tuner_partsnic_pti_5nf05_ranges),
1319 .cb_first_if_lower_freq = 1, /* not specified but safe to do */
1320 },
1321};
1322
1304/* --------------------------------------------------------------------- */ 1323/* --------------------------------------------------------------------- */
1305 1324
1306struct tunertype tuners[] = { 1325struct tunertype tuners[] = {
@@ -1753,6 +1772,12 @@ struct tunertype tuners[] = {
1753 .params = tuner_fq1216lme_mk3_params, 1772 .params = tuner_fq1216lme_mk3_params,
1754 .count = ARRAY_SIZE(tuner_fq1216lme_mk3_params), 1773 .count = ARRAY_SIZE(tuner_fq1216lme_mk3_params),
1755 }, 1774 },
1775
1776 [TUNER_PARTSNIC_PTI_5NF05] = {
1777 .name = "Partsnic (Daewoo) PTI-5NF05",
1778 .params = tuner_partsnic_pti_5nf05_params,
1779 .count = ARRAY_SIZE(tuner_partsnic_pti_5nf05_params),
1780 },
1756}; 1781};
1757EXPORT_SYMBOL(tuners); 1782EXPORT_SYMBOL(tuners);
1758 1783