diff options
Diffstat (limited to 'drivers/media/dvb/mantis/mantis_vp3030.c')
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp3030.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/drivers/media/dvb/mantis/mantis_vp3030.c b/drivers/media/dvb/mantis/mantis_vp3030.c index 4b974eeefa9e..9efcfa7b8ab4 100644 --- a/drivers/media/dvb/mantis/mantis_vp3030.c +++ b/drivers/media/dvb/mantis/mantis_vp3030.c | |||
@@ -30,46 +30,41 @@ | |||
30 | #include "dvb_net.h" | 30 | #include "dvb_net.h" |
31 | 31 | ||
32 | #include "zl10353.h" | 32 | #include "zl10353.h" |
33 | #include "tda665x.h" | ||
33 | #include "mantis_common.h" | 34 | #include "mantis_common.h" |
35 | #include "mantis_ioc.h" | ||
36 | #include "mantis_dvb.h" | ||
34 | #include "mantis_vp3030.h" | 37 | #include "mantis_vp3030.h" |
35 | 38 | ||
36 | struct zl10353_config mantis_vp3030_config = { | 39 | struct zl10353_config mantis_vp3030_config = { |
37 | .demod_address = 0x0f, | 40 | .demod_address = 0x0f, |
41 | }; | ||
42 | |||
43 | struct tda665x_config env57h12d5_config = { | ||
44 | .name = "ENV57H12D5 (ET-50DT)", | ||
45 | .addr = 0x60, | ||
46 | .frequency_min = 47000000, | ||
47 | .frequency_max = 862000000, | ||
48 | .frequency_offst = 3616667, | ||
49 | .ref_multiplier = 6, /* 1/6 MHz */ | ||
50 | .ref_divider = 100000, /* 1/6 MHz */ | ||
38 | }; | 51 | }; |
39 | 52 | ||
40 | #define MANTIS_MODEL_NAME "VP-3030" | 53 | #define MANTIS_MODEL_NAME "VP-3030" |
41 | #define MANTIS_DEV_TYPE "DVB-T" | 54 | #define MANTIS_DEV_TYPE "DVB-T" |
42 | 55 | ||
43 | int panasonic_en57h12d5_set_params(struct dvb_frontend *fe, | ||
44 | struct dvb_frontend_parameters *params) | ||
45 | { | ||
46 | u8 buf[4]; | ||
47 | int rc; | ||
48 | struct mantis_pci *mantis = fe->dvb->priv; | ||
49 | |||
50 | struct i2c_msg tuner_msg = { | ||
51 | .addr = 0x60, | ||
52 | .flags = 0, | ||
53 | .buf = buf, | ||
54 | .len = sizeof (buf) | ||
55 | }; | ||
56 | |||
57 | if ((params->frequency < 950000) || (params->frequency > 2150000)) | ||
58 | return -EINVAL; | ||
59 | rc = i2c_transfer(&mantis->adapter, &tuner_msg, 1); | ||
60 | if (rc != 1) { | ||
61 | printk("%s: I2C Transfer returned [%d]\n", __func__, rc); | ||
62 | return -EIO; | ||
63 | } | ||
64 | msleep_interruptible(1); | ||
65 | printk("%s: Send params to tuner ok!!!\n", __func__); | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | 56 | ||
70 | static int vp3030_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe) | 57 | static int vp3030_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe) |
71 | { | 58 | { |
72 | struct i2c_adapter *adapter = &mantis->adapter; | 59 | struct i2c_adapter *adapter = &mantis->adapter; |
60 | struct mantis_hwconfig *config = mantis->hwconfig; | ||
61 | int err = 0; | ||
62 | |||
63 | gpio_set_bits(mantis, config->reset, 0); | ||
64 | msleep(100); | ||
65 | err = mantis_frontend_power(mantis, POWER_ON); | ||
66 | msleep(100); | ||
67 | gpio_set_bits(mantis, config->reset, 1); | ||
73 | 68 | ||
74 | dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); | 69 | dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); |
75 | fe = zl10353_attach(&mantis_vp3030_config, adapter); | 70 | fe = zl10353_attach(&mantis_vp3030_config, adapter); |
@@ -77,6 +72,7 @@ static int vp3030_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
77 | if (!fe) | 72 | if (!fe) |
78 | return -1; | 73 | return -1; |
79 | 74 | ||
75 | tda665x_attach(fe, &env57h12d5_config, adapter); | ||
80 | mantis->fe = fe; | 76 | mantis->fe = fe; |
81 | dprintk(MANTIS_ERROR, 1, "Done!"); | 77 | dprintk(MANTIS_ERROR, 1, "Done!"); |
82 | 78 | ||
@@ -93,4 +89,6 @@ struct mantis_hwconfig vp3030_config = { | |||
93 | .bytes = 0, | 89 | .bytes = 0, |
94 | 90 | ||
95 | .frontend_init = vp3030_frontend_init, | 91 | .frontend_init = vp3030_frontend_init, |
92 | .power = GPIF_A12, | ||
93 | .reset = GPIF_A13, | ||
96 | }; | 94 | }; |