aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/xc4000.c
diff options
context:
space:
mode:
authorIstvan Varga <istvan_v@mailbox.hu>2011-06-03 08:38:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:52:36 -0400
commit0b4021321c0536a3368746497686ce56e5bcf3e5 (patch)
treeabe2125ee12c80dcc85a2726ef8f97d7d6705101 /drivers/media/common/tuners/xc4000.c
parent595a83f49a7536f43a68cab78098d5ad11d1c51f (diff)
[media] xc4000: added card_type
This patch adds support for selecting a card type in struct xc4000_config, to allow for implementing some card specific code in the driver. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/xc4000.c')
-rw-r--r--drivers/media/common/tuners/xc4000.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c
index 71739dc33438..0afb61f8eae5 100644
--- a/drivers/media/common/tuners/xc4000.c
+++ b/drivers/media/common/tuners/xc4000.c
@@ -90,6 +90,7 @@ struct xc4000_priv {
90 u32 bandwidth; 90 u32 bandwidth;
91 u8 video_standard; 91 u8 video_standard;
92 u8 rf_mode; 92 u8 rf_mode;
93 u8 card_type;
93 u8 ignore_i2c_write_errors; 94 u8 ignore_i2c_write_errors;
94 /* struct xc2028_ctrl ctrl; */ 95 /* struct xc2028_ctrl ctrl; */
95 struct firmware_properties cur_fw; 96 struct firmware_properties cur_fw;
@@ -1433,6 +1434,16 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
1433 int instance; 1434 int instance;
1434 u16 id = 0; 1435 u16 id = 0;
1435 1436
1437 if (cfg->card_type != XC4000_CARD_GENERIC) {
1438 if (cfg->card_type == XC4000_CARD_WINFAST_CX88) {
1439 cfg->i2c_address = 0x61;
1440 cfg->if_khz = 4560;
1441 } else { /* default to PCTV 340E */
1442 cfg->i2c_address = 0x61;
1443 cfg->if_khz = 5400;
1444 }
1445 }
1446
1436 dprintk(1, "%s(%d-%04x)\n", __func__, 1447 dprintk(1, "%s(%d-%04x)\n", __func__,
1437 i2c ? i2c_adapter_id(i2c) : -1, 1448 i2c ? i2c_adapter_id(i2c) : -1,
1438 cfg ? cfg->i2c_address : -1); 1449 cfg ? cfg->i2c_address : -1);
@@ -1442,6 +1453,8 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
1442 instance = hybrid_tuner_request_state(struct xc4000_priv, priv, 1453 instance = hybrid_tuner_request_state(struct xc4000_priv, priv,
1443 hybrid_tuner_instance_list, 1454 hybrid_tuner_instance_list,
1444 i2c, cfg->i2c_address, "xc4000"); 1455 i2c, cfg->i2c_address, "xc4000");
1456 if (cfg->card_type != XC4000_CARD_GENERIC)
1457 priv->card_type = cfg->card_type;
1445 switch (instance) { 1458 switch (instance) {
1446 case 0: 1459 case 0:
1447 goto fail; 1460 goto fail;
@@ -1458,7 +1471,7 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
1458 break; 1471 break;
1459 } 1472 }
1460 1473
1461 if (priv->if_khz == 0) { 1474 if (cfg->if_khz != 0) {
1462 /* If the IF hasn't been set yet, use the value provided by 1475 /* If the IF hasn't been set yet, use the value provided by
1463 the caller (occurs in hybrid devices where the analog 1476 the caller (occurs in hybrid devices where the analog
1464 call to xc4000_attach occurs before the digital side) */ 1477 call to xc4000_attach occurs before the digital side) */