aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/mantis/mantis_vp2040.c
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2009-12-04 03:57:28 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 08:55:43 -0500
commitbc832fa2c0310c25ed60204616ccef4f8db088f3 (patch)
tree4544c2e786cc462d2b9d143b3c3a0ad7cd74a424 /drivers/media/dvb/mantis/mantis_vp2040.c
parent3e978a8284080d801d20cda377d9cf7c12fe68b9 (diff)
V4L/DVB (13798): [Mantis] Enable power for all cards, use byte mode only on relevant devices
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/mantis/mantis_vp2040.c')
-rw-r--r--drivers/media/dvb/mantis/mantis_vp2040.c51
1 files changed, 34 insertions, 17 deletions
diff --git a/drivers/media/dvb/mantis/mantis_vp2040.c b/drivers/media/dvb/mantis/mantis_vp2040.c
index 51b082f7f91..e2019884ac3 100644
--- a/drivers/media/dvb/mantis/mantis_vp2040.c
+++ b/drivers/media/dvb/mantis/mantis_vp2040.c
@@ -31,6 +31,8 @@
31 31
32#include "tda1002x.h" 32#include "tda1002x.h"
33#include "mantis_common.h" 33#include "mantis_common.h"
34#include "mantis_ioc.h"
35#include "mantis_dvb.h"
34#include "mantis_vp2040.h" 36#include "mantis_vp2040.h"
35 37
36#define MANTIS_MODEL_NAME "VP-2040" 38#define MANTIS_MODEL_NAME "VP-2040"
@@ -123,34 +125,47 @@ static int vp2040_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
123{ 125{
124 struct i2c_adapter *adapter = &mantis->adapter; 126 struct i2c_adapter *adapter = &mantis->adapter;
125 127
126 dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); 128 int err = 0;
127 fe = tda10021_attach(&vp2040_tda1002x_cu1216_config,
128 adapter,
129 read_pwm(mantis));
130 129
131 if (fe) { 130 err = mantis_frontend_power(mantis, POWER_ON);
132 dprintk(MANTIS_ERROR, 1, 131 if (err == 0) {
133 "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", 132 mantis_frontend_soft_reset(mantis);
134 vp2040_tda1002x_cu1216_config.demod_address); 133 msleep(250);
135 } else { 134
136 fe = tda10023_attach(&vp2040_tda10023_cu1216_config, 135 dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)");
136 fe = tda10021_attach(&vp2040_tda1002x_cu1216_config,
137 adapter, 137 adapter,
138 read_pwm(mantis)); 138 read_pwm(mantis));
139 139
140 if (fe) { 140 if (fe) {
141 dprintk(MANTIS_ERROR, 1, 141 dprintk(MANTIS_ERROR, 1,
142 "found Philips CU1216 DVB-C frontend (TDA10023) @ 0x%02x", 142 "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x",
143 vp2040_tda1002x_cu1216_config.demod_address); 143 vp2040_tda1002x_cu1216_config.demod_address);
144 } else {
145 fe = tda10023_attach(&vp2040_tda10023_cu1216_config,
146 adapter,
147 read_pwm(mantis));
148
149 if (fe) {
150 dprintk(MANTIS_ERROR, 1,
151 "found Philips CU1216 DVB-C frontend (TDA10023) @ 0x%02x",
152 vp2040_tda1002x_cu1216_config.demod_address);
153 }
144 } 154 }
145 }
146 155
147 if (fe) { 156 if (fe) {
148 fe->ops.tuner_ops.set_params = tda1002x_cu1216_tuner_set; 157 fe->ops.tuner_ops.set_params = tda1002x_cu1216_tuner_set;
149 dprintk(MANTIS_ERROR, 1, "Mantis DVB-C Philips CU1216 frontend attach success"); 158 dprintk(MANTIS_ERROR, 1, "Mantis DVB-C Philips CU1216 frontend attach success");
159 } else {
160 return -1;
161 }
150 } else { 162 } else {
151 return -1; 163 dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",
152 } 164 adapter->name,
165 err);
153 166
167 return -EIO;
168 }
154 mantis->fe = fe; 169 mantis->fe = fe;
155 dprintk(MANTIS_DEBUG, 1, "Done!"); 170 dprintk(MANTIS_DEBUG, 1, "Done!");
156 171
@@ -167,4 +182,6 @@ struct mantis_hwconfig vp2040_config = {
167 .bytes = 0, 182 .bytes = 0,
168 183
169 .frontend_init = vp2040_frontend_init, 184 .frontend_init = vp2040_frontend_init,
185 .power = GPIF_A12,
186 .reset = GPIF_A13,
170}; 187};