diff options
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-dvb.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index f0882dd30d3f..c1309118ea87 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include "lgdt330x.h" | 35 | #include "lgdt330x.h" |
36 | #include "xc5000.h" | 36 | #include "xc5000.h" |
37 | #include "dvb-pll.h" | 37 | #include "dvb-pll.h" |
38 | #include "tuner-xc2028.h" | ||
39 | #include "tuner-xc2028-types.h" | ||
38 | 40 | ||
39 | static unsigned int debug = 0; | 41 | static unsigned int debug = 0; |
40 | 42 | ||
@@ -126,6 +128,14 @@ static struct s5h1409_config hauppauge_hvr1800lp_config = { | |||
126 | .status_mode = S5H1409_DEMODLOCKING | 128 | .status_mode = S5H1409_DEMODLOCKING |
127 | }; | 129 | }; |
128 | 130 | ||
131 | static struct s5h1409_config hauppauge_hvr1500_config = { | ||
132 | .demod_address = 0x32 >> 1, | ||
133 | .output_mode = S5H1409_SERIAL_OUTPUT, | ||
134 | .gpio = S5H1409_GPIO_OFF, | ||
135 | .inversion = S5H1409_INVERSION_OFF, | ||
136 | .status_mode = S5H1409_DEMODLOCKING | ||
137 | }; | ||
138 | |||
129 | static struct mt2131_config hauppauge_generic_tunerconfig = { | 139 | static struct mt2131_config hauppauge_generic_tunerconfig = { |
130 | 0x61 | 140 | 0x61 |
131 | }; | 141 | }; |
@@ -152,6 +162,36 @@ static struct xc5000_config hauppauge_hvr1500q_tunerconfig = { | |||
152 | .tuner_reset = hauppauge_hvr1500q_tuner_reset | 162 | .tuner_reset = hauppauge_hvr1500q_tuner_reset |
153 | }; | 163 | }; |
154 | 164 | ||
165 | static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg) | ||
166 | { | ||
167 | struct cx23885_tsport *port = ptr; | ||
168 | struct cx23885_dev *dev = port->dev; | ||
169 | |||
170 | switch (command) { | ||
171 | case XC2028_TUNER_RESET: | ||
172 | /* Send the tuner in then out of reset */ | ||
173 | /* GPIO-2 xc3028 tuner */ | ||
174 | dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __FUNCTION__, arg); | ||
175 | |||
176 | cx_set(GP0_IO, 0x00040000); | ||
177 | cx_clear(GP0_IO, 0x00000004); | ||
178 | msleep(5); | ||
179 | |||
180 | cx_set(GP0_IO, 0x00040004); | ||
181 | msleep(5); | ||
182 | break; | ||
183 | case XC2028_RESET_CLK: | ||
184 | dprintk(1, "%s: XC2028_RESET_CLK %d\n", __FUNCTION__, arg); | ||
185 | break; | ||
186 | default: | ||
187 | dprintk(1, "%s: unknown command %d, arg %d\n", __FUNCTION__, | ||
188 | command, arg); | ||
189 | return -EINVAL; | ||
190 | } | ||
191 | |||
192 | return 0; | ||
193 | } | ||
194 | |||
155 | static int dvb_register(struct cx23885_tsport *port) | 195 | static int dvb_register(struct cx23885_tsport *port) |
156 | { | 196 | { |
157 | struct cx23885_dev *dev = port->dev; | 197 | struct cx23885_dev *dev = port->dev; |
@@ -206,6 +246,31 @@ static int dvb_register(struct cx23885_tsport *port) | |||
206 | &hauppauge_hvr1500q_tunerconfig); | 246 | &hauppauge_hvr1500q_tunerconfig); |
207 | } | 247 | } |
208 | break; | 248 | break; |
249 | case CX23885_BOARD_HAUPPAUGE_HVR1500: | ||
250 | i2c_bus = &dev->i2c_bus[1]; | ||
251 | port->dvb.frontend = dvb_attach(s5h1409_attach, | ||
252 | &hauppauge_hvr1500_config, | ||
253 | &dev->i2c_bus[0].i2c_adap); | ||
254 | if (port->dvb.frontend != NULL) { | ||
255 | struct dvb_frontend *fe; | ||
256 | struct xc2028_config cfg = { | ||
257 | .i2c_adap = &i2c_bus->i2c_adap, | ||
258 | .i2c_addr = 0x61, | ||
259 | .video_dev = port, | ||
260 | .callback = cx23885_hvr1500_xc3028_callback, | ||
261 | }; | ||
262 | static struct xc2028_ctrl ctl = { | ||
263 | .fname = "xc3028-v27.fw", | ||
264 | .max_len = 64, | ||
265 | .scode_table = OREN538, | ||
266 | }; | ||
267 | |||
268 | fe = dvb_attach(xc2028_attach, | ||
269 | port->dvb.frontend, &cfg); | ||
270 | if (fe != NULL && fe->ops.tuner_ops.set_config != NULL) | ||
271 | fe->ops.tuner_ops.set_config(fe, &ctl); | ||
272 | } | ||
273 | break; | ||
209 | default: | 274 | default: |
210 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", | 275 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", |
211 | dev->name); | 276 | dev->name); |