aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/xc5000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/common/tuners/xc5000.c')
-rw-r--r--drivers/media/common/tuners/xc5000.c39
1 files changed, 35 insertions, 4 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index 7f98984e4fad..eab2ea424200 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -54,6 +54,7 @@ struct xc5000_priv {
54 struct list_head hybrid_tuner_instance_list; 54 struct list_head hybrid_tuner_instance_list;
55 55
56 u32 if_khz; 56 u32 if_khz;
57 u32 xtal_khz;
57 u32 freq_hz; 58 u32 freq_hz;
58 u32 bandwidth; 59 u32 bandwidth;
59 u8 video_standard; 60 u8 video_standard;
@@ -214,9 +215,9 @@ static const struct xc5000_fw_cfg xc5000a_1_6_114 = {
214 .size = 12401, 215 .size = 12401,
215}; 216};
216 217
217static const struct xc5000_fw_cfg xc5000c_41_024_5_31875 = { 218static const struct xc5000_fw_cfg xc5000c_41_024_5 = {
218 .name = "dvb-fe-xc5000c-41.024.5-31875.fw", 219 .name = "dvb-fe-xc5000c-41.024.5.fw",
219 .size = 16503, 220 .size = 16497,
220}; 221};
221 222
222static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id) 223static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id)
@@ -226,7 +227,7 @@ static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id)
226 case XC5000A: 227 case XC5000A:
227 return &xc5000a_1_6_114; 228 return &xc5000a_1_6_114;
228 case XC5000C: 229 case XC5000C:
229 return &xc5000c_41_024_5_31875; 230 return &xc5000c_41_024_5;
230 } 231 }
231} 232}
232 233
@@ -572,6 +573,31 @@ static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz, int mode)
572 return found; 573 return found;
573} 574}
574 575
576static int xc_set_xtal(struct dvb_frontend *fe)
577{
578 struct xc5000_priv *priv = fe->tuner_priv;
579 int ret = XC_RESULT_SUCCESS;
580
581 switch (priv->chip_id) {
582 default:
583 case XC5000A:
584 /* 32.000 MHz xtal is default */
585 break;
586 case XC5000C:
587 switch (priv->xtal_khz) {
588 default:
589 case 32000:
590 /* 32.000 MHz xtal is default */
591 break;
592 case 31875:
593 /* 31.875 MHz xtal configuration */
594 ret = xc_write_reg(priv, 0x000f, 0x8081);
595 break;
596 }
597 break;
598 }
599 return ret;
600}
575 601
576static int xc5000_fwupload(struct dvb_frontend *fe) 602static int xc5000_fwupload(struct dvb_frontend *fe)
577{ 603{
@@ -603,6 +629,8 @@ static int xc5000_fwupload(struct dvb_frontend *fe)
603 } else { 629 } else {
604 printk(KERN_INFO "xc5000: firmware uploading...\n"); 630 printk(KERN_INFO "xc5000: firmware uploading...\n");
605 ret = xc_load_i2c_sequence(fe, fw->data); 631 ret = xc_load_i2c_sequence(fe, fw->data);
632 if (XC_RESULT_SUCCESS == ret)
633 ret = xc_set_xtal(fe);
606 printk(KERN_INFO "xc5000: firmware upload complete...\n"); 634 printk(KERN_INFO "xc5000: firmware upload complete...\n");
607 } 635 }
608 636
@@ -1164,6 +1192,9 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
1164 priv->if_khz = cfg->if_khz; 1192 priv->if_khz = cfg->if_khz;
1165 } 1193 }
1166 1194
1195 if (priv->xtal_khz == 0)
1196 priv->xtal_khz = cfg->xtal_khz;
1197
1167 if (priv->radio_input == 0) 1198 if (priv->radio_input == 0)
1168 priv->radio_input = cfg->radio_input; 1199 priv->radio_input = cfg->radio_input;
1169 1200