Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * av7110_v4l.c: av7110 video4linux interface for DVB and Siemens DVB-C analog module |
| 3 | * |
| 4 | * Copyright (C) 1999-2002 Ralph Metzler |
| 5 | * & Marcus Metzler for convergence integrated media GmbH |
| 6 | * |
| 7 | * originally based on code by: |
| 8 | * Copyright (C) 1998,1999 Christian Theiss <mistert@rz.fh-augsburg.de> |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or |
| 11 | * modify it under the terms of the GNU General Public License |
| 12 | * as published by the Free Software Foundation; either version 2 |
| 13 | * of the License, or (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program; if not, write to the Free Software |
| 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 23 | * Or, point your browser to http://www.gnu.org/copyleft/gpl.html |
| 24 | * |
Justin P. Mattock | 631dd1a | 2010-10-18 11:03:14 +0200 | [diff] [blame] | 25 | * the project's page is at http://www.linuxtv.org/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | */ |
| 27 | |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 28 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 29 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #include <linux/kernel.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #include <linux/types.h> |
| 32 | #include <linux/delay.h> |
| 33 | #include <linux/fs.h> |
| 34 | #include <linux/timer.h> |
| 35 | #include <linux/poll.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
| 37 | #include "av7110.h" |
| 38 | #include "av7110_hw.h" |
| 39 | #include "av7110_av.h" |
| 40 | |
| 41 | int msp_writereg(struct av7110 *av7110, u8 dev, u16 reg, u16 val) |
| 42 | { |
| 43 | u8 msg[5] = { dev, reg >> 8, reg & 0xff, val >> 8 , val & 0xff }; |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 44 | struct i2c_msg msgs = { .flags = 0, .len = 5, .buf = msg }; |
| 45 | |
| 46 | switch (av7110->adac_type) { |
| 47 | case DVB_ADAC_MSP34x0: |
| 48 | msgs.addr = 0x40; |
| 49 | break; |
| 50 | case DVB_ADAC_MSP34x5: |
| 51 | msgs.addr = 0x42; |
| 52 | break; |
| 53 | default: |
| 54 | return 0; |
| 55 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
| 57 | if (i2c_transfer(&av7110->i2c_adap, &msgs, 1) != 1) { |
| 58 | dprintk(1, "dvb-ttpci: failed @ card %d, %u = %u\n", |
Johannes Stezenbach | fdc53a6 | 2005-05-16 21:54:39 -0700 | [diff] [blame] | 59 | av7110->dvb_adapter.num, reg, val); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | return -EIO; |
| 61 | } |
| 62 | return 0; |
| 63 | } |
| 64 | |
Johannes Stezenbach | d91b730 | 2005-05-16 21:54:38 -0700 | [diff] [blame] | 65 | static int msp_readreg(struct av7110 *av7110, u8 dev, u16 reg, u16 *val) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | { |
| 67 | u8 msg1[3] = { dev, reg >> 8, reg & 0xff }; |
| 68 | u8 msg2[2]; |
| 69 | struct i2c_msg msgs[2] = { |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 70 | { .flags = 0 , .len = 3, .buf = msg1 }, |
| 71 | { .flags = I2C_M_RD, .len = 2, .buf = msg2 } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | }; |
| 73 | |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 74 | switch (av7110->adac_type) { |
| 75 | case DVB_ADAC_MSP34x0: |
| 76 | msgs[0].addr = 0x40; |
| 77 | msgs[1].addr = 0x40; |
| 78 | break; |
| 79 | case DVB_ADAC_MSP34x5: |
| 80 | msgs[0].addr = 0x42; |
| 81 | msgs[1].addr = 0x42; |
| 82 | break; |
| 83 | default: |
| 84 | return 0; |
| 85 | } |
| 86 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | if (i2c_transfer(&av7110->i2c_adap, &msgs[0], 2) != 2) { |
| 88 | dprintk(1, "dvb-ttpci: failed @ card %d, %u\n", |
Johannes Stezenbach | fdc53a6 | 2005-05-16 21:54:39 -0700 | [diff] [blame] | 89 | av7110->dvb_adapter.num, reg); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | return -EIO; |
| 91 | } |
| 92 | *val = (msg2[0] << 8) | msg2[1]; |
| 93 | return 0; |
| 94 | } |
| 95 | |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 96 | static struct v4l2_input inputs[4] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | { |
| 98 | .index = 0, |
| 99 | .name = "DVB", |
| 100 | .type = V4L2_INPUT_TYPE_CAMERA, |
| 101 | .audioset = 1, |
| 102 | .tuner = 0, /* ignored */ |
| 103 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
| 104 | .status = 0, |
Hans Verkuil | 657f227 | 2010-12-29 14:29:55 -0300 | [diff] [blame] | 105 | .capabilities = V4L2_IN_CAP_STD, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | }, { |
| 107 | .index = 1, |
| 108 | .name = "Television", |
| 109 | .type = V4L2_INPUT_TYPE_TUNER, |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 110 | .audioset = 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | .tuner = 0, |
| 112 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
| 113 | .status = 0, |
Hans Verkuil | 657f227 | 2010-12-29 14:29:55 -0300 | [diff] [blame] | 114 | .capabilities = V4L2_IN_CAP_STD, |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 115 | }, { |
| 116 | .index = 2, |
| 117 | .name = "Video", |
| 118 | .type = V4L2_INPUT_TYPE_CAMERA, |
| 119 | .audioset = 0, |
| 120 | .tuner = 0, |
| 121 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
| 122 | .status = 0, |
Hans Verkuil | 657f227 | 2010-12-29 14:29:55 -0300 | [diff] [blame] | 123 | .capabilities = V4L2_IN_CAP_STD, |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 124 | }, { |
| 125 | .index = 3, |
| 126 | .name = "Y/C", |
| 127 | .type = V4L2_INPUT_TYPE_CAMERA, |
| 128 | .audioset = 0, |
| 129 | .tuner = 0, |
| 130 | .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, |
| 131 | .status = 0, |
Hans Verkuil | 657f227 | 2010-12-29 14:29:55 -0300 | [diff] [blame] | 132 | .capabilities = V4L2_IN_CAP_STD, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | } |
| 134 | }; |
| 135 | |
| 136 | static int ves1820_writereg(struct saa7146_dev *dev, u8 addr, u8 reg, u8 data) |
| 137 | { |
Oliver Endriss | 36c15f8 | 2007-07-23 13:59:55 -0300 | [diff] [blame] | 138 | struct av7110 *av7110 = dev->ext_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | u8 buf[] = { 0x00, reg, data }; |
| 140 | struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = 3 }; |
| 141 | |
| 142 | dprintk(4, "dev: %p\n", dev); |
| 143 | |
Oliver Endriss | 36c15f8 | 2007-07-23 13:59:55 -0300 | [diff] [blame] | 144 | if (1 != i2c_transfer(&av7110->i2c_adap, &msg, 1)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | return -1; |
| 146 | return 0; |
| 147 | } |
| 148 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data [4]) |
| 150 | { |
Oliver Endriss | 36c15f8 | 2007-07-23 13:59:55 -0300 | [diff] [blame] | 151 | struct av7110 *av7110 = dev->ext_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = data, .len = 4 }; |
| 153 | |
| 154 | dprintk(4, "dev: %p\n", dev); |
| 155 | |
Oliver Endriss | 36c15f8 | 2007-07-23 13:59:55 -0300 | [diff] [blame] | 156 | if (1 != i2c_transfer(&av7110->i2c_adap, &msg, 1)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | return -1; |
| 158 | return 0; |
| 159 | } |
| 160 | |
| 161 | static int ves1820_set_tv_freq(struct saa7146_dev *dev, u32 freq) |
| 162 | { |
| 163 | u32 div; |
| 164 | u8 config; |
| 165 | u8 buf[4]; |
| 166 | |
| 167 | dprintk(4, "freq: 0x%08x\n", freq); |
| 168 | |
| 169 | /* magic number: 614. tuning with the frequency given by v4l2 |
| 170 | is always off by 614*62.5 = 38375 kHz...*/ |
| 171 | div = freq + 614; |
| 172 | |
| 173 | buf[0] = (div >> 8) & 0x7f; |
| 174 | buf[1] = div & 0xff; |
| 175 | buf[2] = 0x8e; |
| 176 | |
| 177 | if (freq < (u32) (16 * 168.25)) |
| 178 | config = 0xa0; |
| 179 | else if (freq < (u32) (16 * 447.25)) |
| 180 | config = 0x90; |
| 181 | else |
| 182 | config = 0x30; |
| 183 | config &= ~0x02; |
| 184 | |
| 185 | buf[3] = config; |
| 186 | |
| 187 | return tuner_write(dev, 0x61, buf); |
| 188 | } |
| 189 | |
| 190 | static int stv0297_set_tv_freq(struct saa7146_dev *dev, u32 freq) |
| 191 | { |
Marco Schluessler | 89e4d59 | 2007-02-13 09:31:07 -0300 | [diff] [blame] | 192 | struct av7110 *av7110 = (struct av7110*)dev->ext_priv; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | u32 div; |
| 194 | u8 data[4]; |
| 195 | |
| 196 | div = (freq + 38900000 + 31250) / 62500; |
| 197 | |
| 198 | data[0] = (div >> 8) & 0x7f; |
| 199 | data[1] = div & 0xff; |
| 200 | data[2] = 0xce; |
| 201 | |
| 202 | if (freq < 45000000) |
| 203 | return -EINVAL; |
| 204 | else if (freq < 137000000) |
| 205 | data[3] = 0x01; |
| 206 | else if (freq < 403000000) |
| 207 | data[3] = 0x02; |
| 208 | else if (freq < 860000000) |
| 209 | data[3] = 0x04; |
| 210 | else |
| 211 | return -EINVAL; |
| 212 | |
Marco Schluessler | 89e4d59 | 2007-02-13 09:31:07 -0300 | [diff] [blame] | 213 | if (av7110->fe->ops.i2c_gate_ctrl) |
| 214 | av7110->fe->ops.i2c_gate_ctrl(av7110->fe, 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | return tuner_write(dev, 0x63, data); |
| 216 | } |
| 217 | |
| 218 | |
| 219 | |
| 220 | static struct saa7146_standard analog_standard[]; |
| 221 | static struct saa7146_standard dvb_standard[]; |
| 222 | static struct saa7146_standard standard[]; |
| 223 | |
| 224 | static struct v4l2_audio msp3400_v4l2_audio = { |
| 225 | .index = 0, |
| 226 | .name = "Television", |
| 227 | .capability = V4L2_AUDCAP_STEREO |
| 228 | }; |
| 229 | |
| 230 | static int av7110_dvb_c_switch(struct saa7146_fh *fh) |
| 231 | { |
| 232 | struct saa7146_dev *dev = fh->dev; |
| 233 | struct saa7146_vv *vv = dev->vv_data; |
| 234 | struct av7110 *av7110 = (struct av7110*)dev->ext_priv; |
| 235 | u16 adswitch; |
| 236 | int source, sync, err; |
| 237 | |
| 238 | dprintk(4, "%p\n", av7110); |
| 239 | |
| 240 | if ((vv->video_status & STATUS_OVERLAY) != 0) { |
| 241 | vv->ov_suspend = vv->video_fh; |
| 242 | err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */ |
| 243 | if (err != 0) { |
| 244 | dprintk(2, "suspending video failed\n"); |
| 245 | vv->ov_suspend = NULL; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | if (0 != av7110->current_input) { |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 250 | dprintk(1, "switching to analog TV:\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | adswitch = 1; |
| 252 | source = SAA7146_HPS_SOURCE_PORT_B; |
| 253 | sync = SAA7146_HPS_SYNC_PORT_B; |
| 254 | memcpy(standard, analog_standard, sizeof(struct saa7146_standard) * 2); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 256 | switch (av7110->current_input) { |
| 257 | case 1: |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 258 | dprintk(1, "switching SAA7113 to Analog Tuner Input\n"); |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 259 | msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0000); // loudspeaker source |
| 260 | msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0000); // headphone source |
| 261 | msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0000); // SCART 1 source |
| 262 | msp_writereg(av7110, MSP_WR_DSP, 0x000e, 0x3000); // FM matrix, mono |
| 263 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x4f00); // loudspeaker + headphone |
| 264 | msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x4f00); // SCART 1 volume |
| 265 | |
| 266 | if (av7110->analog_tuner_flags & ANALOG_TUNER_VES1820) { |
| 267 | if (ves1820_writereg(dev, 0x09, 0x0f, 0x60)) |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 268 | dprintk(1, "setting band in demodulator failed\n"); |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 269 | } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { |
Marco Schluessler | 6a85774 | 2006-07-10 03:34:16 -0300 | [diff] [blame] | 270 | saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9819 pin9(STD) |
| 271 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9819 pin30(VIF) |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 272 | } |
| 273 | if (i2c_writereg(av7110, 0x48, 0x02, 0xd0) != 1) |
| 274 | dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num); |
| 275 | break; |
| 276 | case 2: |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 277 | dprintk(1, "switching SAA7113 to Video AV CVBS Input\n"); |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 278 | if (i2c_writereg(av7110, 0x48, 0x02, 0xd2) != 1) |
| 279 | dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num); |
| 280 | break; |
| 281 | case 3: |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 282 | dprintk(1, "switching SAA7113 to Video AV Y/C Input\n"); |
thomas schorpp | f63f534 | 2005-09-09 13:03:06 -0700 | [diff] [blame] | 283 | if (i2c_writereg(av7110, 0x48, 0x02, 0xd9) != 1) |
| 284 | dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num); |
| 285 | break; |
| 286 | default: |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 287 | dprintk(1, "switching SAA7113 to Input: AV7110: SAA7113: invalid input\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | } |
| 289 | } else { |
| 290 | adswitch = 0; |
| 291 | source = SAA7146_HPS_SOURCE_PORT_A; |
| 292 | sync = SAA7146_HPS_SYNC_PORT_A; |
| 293 | memcpy(standard, dvb_standard, sizeof(struct saa7146_standard) * 2); |
| 294 | dprintk(1, "switching DVB mode\n"); |
| 295 | msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source |
| 296 | msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0220); // headphone source |
| 297 | msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0220); // SCART 1 source |
| 298 | msp_writereg(av7110, MSP_WR_DSP, 0x000e, 0x3000); // FM matrix, mono |
| 299 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone |
| 300 | msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x7f00); // SCART 1 volume |
| 301 | |
| 302 | if (av7110->analog_tuner_flags & ANALOG_TUNER_VES1820) { |
| 303 | if (ves1820_writereg(dev, 0x09, 0x0f, 0x20)) |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 304 | dprintk(1, "setting band in demodulator failed\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { |
Marco Schluessler | 6a85774 | 2006-07-10 03:34:16 -0300 | [diff] [blame] | 306 | saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD) |
| 307 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | } |
| 309 | } |
| 310 | |
| 311 | /* hmm, this does not do anything!? */ |
| 312 | if (av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, adswitch)) |
| 313 | dprintk(1, "ADSwitch error\n"); |
| 314 | |
| 315 | saa7146_set_hps_source_and_sync(dev, source, sync); |
| 316 | |
| 317 | if (vv->ov_suspend != NULL) { |
| 318 | saa7146_start_preview(vv->ov_suspend); |
| 319 | vv->ov_suspend = NULL; |
| 320 | } |
| 321 | |
| 322 | return 0; |
| 323 | } |
| 324 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 325 | static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | { |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 327 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 328 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 329 | u16 stereo_det; |
| 330 | s8 stereo; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 332 | dprintk(2, "VIDIOC_G_TUNER: %d\n", t->index); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 334 | if (!av7110->analog_tuner_flags || t->index != 0) |
| 335 | return -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 336 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 337 | memset(t, 0, sizeof(*t)); |
| 338 | strcpy((char *)t->name, "Television"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 340 | t->type = V4L2_TUNER_ANALOG_TV; |
| 341 | t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO | |
| 342 | V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP; |
| 343 | t->rangelow = 772; /* 48.25 MHZ / 62.5 kHz = 772, see fi1216mk2-specs, page 2 */ |
| 344 | t->rangehigh = 13684; /* 855.25 MHz / 62.5 kHz = 13684 */ |
| 345 | /* FIXME: add the real signal strength here */ |
| 346 | t->signal = 0xffff; |
| 347 | t->afc = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 348 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 349 | /* FIXME: standard / stereo detection is still broken */ |
| 350 | msp_readreg(av7110, MSP_RD_DEM, 0x007e, &stereo_det); |
| 351 | dprintk(1, "VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det); |
| 352 | msp_readreg(av7110, MSP_RD_DSP, 0x0018, &stereo_det); |
| 353 | dprintk(1, "VIDIOC_G_TUNER: msp3400 stereo detection: 0x%04x\n", stereo_det); |
| 354 | stereo = (s8)(stereo_det >> 8); |
| 355 | if (stereo > 0x10) { |
| 356 | /* stereo */ |
| 357 | t->rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO; |
| 358 | t->audmode = V4L2_TUNER_MODE_STEREO; |
| 359 | } else if (stereo < -0x10) { |
| 360 | /* bilingual */ |
| 361 | t->rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; |
| 362 | t->audmode = V4L2_TUNER_MODE_LANG1; |
| 363 | } else /* mono */ |
| 364 | t->rxsubchans = V4L2_TUNER_SUB_MONO; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 365 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 366 | return 0; |
| 367 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | |
Hans Verkuil | 2f73c7c | 2013-03-15 06:10:06 -0300 | [diff] [blame] | 369 | static int vidioc_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *t) |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 370 | { |
| 371 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 372 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 373 | u16 fm_matrix, src; |
| 374 | dprintk(2, "VIDIOC_S_TUNER: %d\n", t->index); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 376 | if (!av7110->analog_tuner_flags || av7110->current_input != 1) |
| 377 | return -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 379 | switch (t->audmode) { |
| 380 | case V4L2_TUNER_MODE_STEREO: |
| 381 | dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_STEREO\n"); |
| 382 | fm_matrix = 0x3001; /* stereo */ |
| 383 | src = 0x0020; |
| 384 | break; |
| 385 | case V4L2_TUNER_MODE_LANG1_LANG2: |
| 386 | dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1_LANG2\n"); |
| 387 | fm_matrix = 0x3000; /* bilingual */ |
| 388 | src = 0x0020; |
| 389 | break; |
| 390 | case V4L2_TUNER_MODE_LANG1: |
| 391 | dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1\n"); |
| 392 | fm_matrix = 0x3000; /* mono */ |
| 393 | src = 0x0000; |
| 394 | break; |
| 395 | case V4L2_TUNER_MODE_LANG2: |
| 396 | dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG2\n"); |
| 397 | fm_matrix = 0x3000; /* mono */ |
| 398 | src = 0x0010; |
| 399 | break; |
| 400 | default: /* case V4L2_TUNER_MODE_MONO: */ |
| 401 | dprintk(2, "VIDIOC_S_TUNER: TDA9840_SET_MONO\n"); |
| 402 | fm_matrix = 0x3000; /* mono */ |
| 403 | src = 0x0030; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 | break; |
| 405 | } |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 406 | msp_writereg(av7110, MSP_WR_DSP, 0x000e, fm_matrix); |
| 407 | msp_writereg(av7110, MSP_WR_DSP, 0x0008, src); |
| 408 | msp_writereg(av7110, MSP_WR_DSP, 0x0009, src); |
| 409 | msp_writereg(av7110, MSP_WR_DSP, 0x000a, src); |
| 410 | return 0; |
| 411 | } |
| 412 | |
| 413 | static int vidioc_g_frequency(struct file *file, void *fh, struct v4l2_frequency *f) |
| 414 | { |
| 415 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 416 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 417 | |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 418 | dprintk(2, "VIDIOC_G_FREQ: freq:0x%08x\n", f->frequency); |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 419 | |
| 420 | if (!av7110->analog_tuner_flags || av7110->current_input != 1) |
| 421 | return -EINVAL; |
| 422 | |
| 423 | memset(f, 0, sizeof(*f)); |
| 424 | f->type = V4L2_TUNER_ANALOG_TV; |
| 425 | f->frequency = av7110->current_freq; |
| 426 | return 0; |
| 427 | } |
| 428 | |
Hans Verkuil | b530a44 | 2013-03-19 04:09:26 -0300 | [diff] [blame] | 429 | static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *f) |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 430 | { |
| 431 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 432 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 433 | |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 434 | dprintk(2, "VIDIOC_S_FREQUENCY: freq:0x%08x\n", f->frequency); |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 435 | |
| 436 | if (!av7110->analog_tuner_flags || av7110->current_input != 1) |
| 437 | return -EINVAL; |
| 438 | |
| 439 | if (V4L2_TUNER_ANALOG_TV != f->type) |
| 440 | return -EINVAL; |
| 441 | |
| 442 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0xffe0); /* fast mute */ |
| 443 | msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0xffe0); |
| 444 | |
| 445 | /* tune in desired frequency */ |
| 446 | if (av7110->analog_tuner_flags & ANALOG_TUNER_VES1820) |
| 447 | ves1820_set_tv_freq(dev, f->frequency); |
| 448 | else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) |
| 449 | stv0297_set_tv_freq(dev, f->frequency); |
| 450 | av7110->current_freq = f->frequency; |
| 451 | |
| 452 | msp_writereg(av7110, MSP_WR_DSP, 0x0015, 0x003f); /* start stereo detection */ |
| 453 | msp_writereg(av7110, MSP_WR_DSP, 0x0015, 0x0000); |
| 454 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x4f00); /* loudspeaker + headphone */ |
| 455 | msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x4f00); /* SCART 1 volume */ |
| 456 | return 0; |
| 457 | } |
| 458 | |
| 459 | static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i) |
| 460 | { |
| 461 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 462 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 463 | |
| 464 | dprintk(2, "VIDIOC_ENUMINPUT: %d\n", i->index); |
| 465 | |
| 466 | if (av7110->analog_tuner_flags) { |
Roel Kluin | 223ffe5 | 2009-05-02 16:38:47 -0300 | [diff] [blame] | 467 | if (i->index >= 4) |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 468 | return -EINVAL; |
| 469 | } else { |
| 470 | if (i->index != 0) |
| 471 | return -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | } |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 473 | |
| 474 | memcpy(i, &inputs[i->index], sizeof(struct v4l2_input)); |
| 475 | |
| 476 | return 0; |
| 477 | } |
| 478 | |
| 479 | static int vidioc_g_input(struct file *file, void *fh, unsigned int *input) |
| 480 | { |
| 481 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 482 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 483 | |
| 484 | *input = av7110->current_input; |
| 485 | dprintk(2, "VIDIOC_G_INPUT: %d\n", *input); |
| 486 | return 0; |
| 487 | } |
| 488 | |
| 489 | static int vidioc_s_input(struct file *file, void *fh, unsigned int input) |
| 490 | { |
| 491 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 492 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 493 | |
| 494 | dprintk(2, "VIDIOC_S_INPUT: %d\n", input); |
| 495 | |
| 496 | if (!av7110->analog_tuner_flags) |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 497 | return input ? -EINVAL : 0; |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 498 | |
Roel Kluin | de81c3c | 2009-07-02 16:09:25 -0300 | [diff] [blame] | 499 | if (input >= 4) |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 500 | return -EINVAL; |
| 501 | |
| 502 | av7110->current_input = input; |
| 503 | return av7110_dvb_c_switch(fh); |
| 504 | } |
| 505 | |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 506 | static int vidioc_enumaudio(struct file *file, void *fh, struct v4l2_audio *a) |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 507 | { |
| 508 | dprintk(2, "VIDIOC_G_AUDIO: %d\n", a->index); |
| 509 | if (a->index != 0) |
| 510 | return -EINVAL; |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 511 | *a = msp3400_v4l2_audio; |
| 512 | return 0; |
| 513 | } |
| 514 | |
| 515 | static int vidioc_g_audio(struct file *file, void *fh, struct v4l2_audio *a) |
| 516 | { |
| 517 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 518 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 519 | |
| 520 | dprintk(2, "VIDIOC_G_AUDIO: %d\n", a->index); |
| 521 | if (a->index != 0) |
| 522 | return -EINVAL; |
| 523 | if (av7110->current_input >= 2) |
| 524 | return -EINVAL; |
| 525 | *a = msp3400_v4l2_audio; |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 526 | return 0; |
| 527 | } |
| 528 | |
Hans Verkuil | 0e8025b9 | 2012-09-04 11:59:31 -0300 | [diff] [blame] | 529 | static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a) |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 530 | { |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 531 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 532 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 533 | |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 534 | dprintk(2, "VIDIOC_S_AUDIO: %d\n", a->index); |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 535 | if (av7110->current_input >= 2) |
| 536 | return -EINVAL; |
| 537 | return a->index ? -EINVAL : 0; |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | static int vidioc_g_sliced_vbi_cap(struct file *file, void *fh, |
| 541 | struct v4l2_sliced_vbi_cap *cap) |
| 542 | { |
| 543 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 544 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 545 | |
| 546 | dprintk(2, "VIDIOC_G_SLICED_VBI_CAP\n"); |
Hans Verkuil | f97d207 | 2009-01-19 04:14:17 -0300 | [diff] [blame] | 547 | if (cap->type != V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) |
| 548 | return -EINVAL; |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 549 | if (FW_VERSION(av7110->arm_app) >= 0x2623) { |
| 550 | cap->service_set = V4L2_SLICED_WSS_625; |
| 551 | cap->service_lines[0][23] = V4L2_SLICED_WSS_625; |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 552 | } |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 553 | return 0; |
| 554 | } |
| 555 | |
| 556 | static int vidioc_g_fmt_sliced_vbi_out(struct file *file, void *fh, |
| 557 | struct v4l2_format *f) |
| 558 | { |
| 559 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 560 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 561 | |
| 562 | dprintk(2, "VIDIOC_G_FMT:\n"); |
| 563 | if (FW_VERSION(av7110->arm_app) < 0x2623) |
| 564 | return -EINVAL; |
| 565 | memset(&f->fmt.sliced, 0, sizeof f->fmt.sliced); |
| 566 | if (av7110->wssMode) { |
| 567 | f->fmt.sliced.service_set = V4L2_SLICED_WSS_625; |
| 568 | f->fmt.sliced.service_lines[0][23] = V4L2_SLICED_WSS_625; |
| 569 | f->fmt.sliced.io_size = sizeof(struct v4l2_sliced_vbi_data); |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 570 | } |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 571 | return 0; |
| 572 | } |
| 573 | |
| 574 | static int vidioc_s_fmt_sliced_vbi_out(struct file *file, void *fh, |
| 575 | struct v4l2_format *f) |
| 576 | { |
| 577 | struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; |
| 578 | struct av7110 *av7110 = (struct av7110 *)dev->ext_priv; |
| 579 | |
| 580 | dprintk(2, "VIDIOC_S_FMT\n"); |
| 581 | if (FW_VERSION(av7110->arm_app) < 0x2623) |
| 582 | return -EINVAL; |
| 583 | if (f->fmt.sliced.service_set != V4L2_SLICED_WSS_625 && |
| 584 | f->fmt.sliced.service_lines[0][23] != V4L2_SLICED_WSS_625) { |
| 585 | memset(&f->fmt.sliced, 0, sizeof(f->fmt.sliced)); |
| 586 | /* WSS controlled by firmware */ |
| 587 | av7110->wssMode = 0; |
| 588 | av7110->wssData = 0; |
| 589 | return av7110_fw_cmd(av7110, COMTYPE_ENCODER, |
| 590 | SetWSSConfig, 1, 0); |
| 591 | } else { |
| 592 | memset(&f->fmt.sliced, 0, sizeof(f->fmt.sliced)); |
| 593 | f->fmt.sliced.service_set = V4L2_SLICED_WSS_625; |
| 594 | f->fmt.sliced.service_lines[0][23] = V4L2_SLICED_WSS_625; |
| 595 | f->fmt.sliced.io_size = sizeof(struct v4l2_sliced_vbi_data); |
| 596 | /* WSS controlled by userspace */ |
| 597 | av7110->wssMode = 1; |
| 598 | av7110->wssData = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 599 | } |
| 600 | return 0; |
| 601 | } |
| 602 | |
Hans Verkuil | bec4366 | 2008-12-30 06:58:20 -0300 | [diff] [blame] | 603 | static int av7110_vbi_reset(struct file *file) |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 604 | { |
| 605 | struct saa7146_fh *fh = file->private_data; |
| 606 | struct saa7146_dev *dev = fh->dev; |
| 607 | struct av7110 *av7110 = (struct av7110*) dev->ext_priv; |
| 608 | |
Harvey Harrison | 3ca7fc8 | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 609 | dprintk(2, "%s\n", __func__); |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 610 | av7110->wssMode = 0; |
| 611 | av7110->wssData = 0; |
| 612 | if (FW_VERSION(av7110->arm_app) < 0x2623) |
| 613 | return 0; |
| 614 | else |
| 615 | return av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetWSSConfig, 1, 0); |
| 616 | } |
| 617 | |
| 618 | static ssize_t av7110_vbi_write(struct file *file, const char __user *data, size_t count, loff_t *ppos) |
| 619 | { |
| 620 | struct saa7146_fh *fh = file->private_data; |
| 621 | struct saa7146_dev *dev = fh->dev; |
| 622 | struct av7110 *av7110 = (struct av7110*) dev->ext_priv; |
| 623 | struct v4l2_sliced_vbi_data d; |
| 624 | int rc; |
| 625 | |
Harvey Harrison | 3ca7fc8 | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 626 | dprintk(2, "%s\n", __func__); |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 627 | if (FW_VERSION(av7110->arm_app) < 0x2623 || !av7110->wssMode || count != sizeof d) |
| 628 | return -EINVAL; |
| 629 | if (copy_from_user(&d, data, count)) |
| 630 | return -EFAULT; |
| 631 | if ((d.id != 0 && d.id != V4L2_SLICED_WSS_625) || d.field != 0 || d.line != 23) |
| 632 | return -EINVAL; |
Oliver Endriss | 4caba42 | 2006-03-17 05:29:15 -0300 | [diff] [blame] | 633 | if (d.id) |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 634 | av7110->wssData = ((d.data[1] << 8) & 0x3f00) | d.data[0]; |
Oliver Endriss | 4caba42 | 2006-03-17 05:29:15 -0300 | [diff] [blame] | 635 | else |
| 636 | av7110->wssData = 0x8000; |
| 637 | rc = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetWSSConfig, 2, 1, av7110->wssData); |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 638 | return (rc < 0) ? rc : count; |
| 639 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 640 | |
| 641 | /**************************************************************************** |
| 642 | * INITIALIZATION |
| 643 | ****************************************************************************/ |
| 644 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 645 | static u8 saa7113_init_regs[] = { |
| 646 | 0x02, 0xd0, |
| 647 | 0x03, 0x23, |
| 648 | 0x04, 0x00, |
| 649 | 0x05, 0x00, |
| 650 | 0x06, 0xe9, |
| 651 | 0x07, 0x0d, |
| 652 | 0x08, 0x98, |
| 653 | 0x09, 0x02, |
| 654 | 0x0a, 0x80, |
| 655 | 0x0b, 0x40, |
| 656 | 0x0c, 0x40, |
| 657 | 0x0d, 0x00, |
| 658 | 0x0e, 0x01, |
| 659 | 0x0f, 0x7c, |
| 660 | 0x10, 0x48, |
| 661 | 0x11, 0x0c, |
| 662 | 0x12, 0x8b, |
| 663 | 0x13, 0x1a, |
| 664 | 0x14, 0x00, |
| 665 | 0x15, 0x00, |
| 666 | 0x16, 0x00, |
| 667 | 0x17, 0x00, |
| 668 | 0x18, 0x00, |
| 669 | 0x19, 0x00, |
| 670 | 0x1a, 0x00, |
| 671 | 0x1b, 0x00, |
| 672 | 0x1c, 0x00, |
| 673 | 0x1d, 0x00, |
| 674 | 0x1e, 0x00, |
| 675 | |
| 676 | 0x41, 0x77, |
| 677 | 0x42, 0x77, |
| 678 | 0x43, 0x77, |
| 679 | 0x44, 0x77, |
| 680 | 0x45, 0x77, |
| 681 | 0x46, 0x77, |
| 682 | 0x47, 0x77, |
| 683 | 0x48, 0x77, |
| 684 | 0x49, 0x77, |
| 685 | 0x4a, 0x77, |
| 686 | 0x4b, 0x77, |
| 687 | 0x4c, 0x77, |
| 688 | 0x4d, 0x77, |
| 689 | 0x4e, 0x77, |
| 690 | 0x4f, 0x77, |
| 691 | 0x50, 0x77, |
| 692 | 0x51, 0x77, |
| 693 | 0x52, 0x77, |
| 694 | 0x53, 0x77, |
| 695 | 0x54, 0x77, |
| 696 | 0x55, 0x77, |
| 697 | 0x56, 0x77, |
| 698 | 0x57, 0xff, |
| 699 | |
| 700 | 0xff |
| 701 | }; |
| 702 | |
| 703 | |
| 704 | static struct saa7146_ext_vv av7110_vv_data_st; |
| 705 | static struct saa7146_ext_vv av7110_vv_data_c; |
| 706 | |
| 707 | int av7110_init_analog_module(struct av7110 *av7110) |
| 708 | { |
| 709 | u16 version1, version2; |
| 710 | |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 711 | if (i2c_writereg(av7110, 0x80, 0x0, 0x80) == 1 && |
| 712 | i2c_writereg(av7110, 0x80, 0x0, 0) == 1) { |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 713 | pr_info("DVB-C analog module @ card %d detected, initializing MSP3400\n", |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 714 | av7110->dvb_adapter.num); |
| 715 | av7110->adac_type = DVB_ADAC_MSP34x0; |
| 716 | } else if (i2c_writereg(av7110, 0x84, 0x0, 0x80) == 1 && |
| 717 | i2c_writereg(av7110, 0x84, 0x0, 0) == 1) { |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 718 | pr_info("DVB-C analog module @ card %d detected, initializing MSP3415\n", |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 719 | av7110->dvb_adapter.num); |
| 720 | av7110->adac_type = DVB_ADAC_MSP34x5; |
| 721 | } else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 722 | return -ENODEV; |
| 723 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 724 | msleep(100); // the probing above resets the msp... |
| 725 | msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1); |
| 726 | msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2); |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 727 | dprintk(1, "dvb-ttpci: @ card %d MSP34xx version 0x%04x 0x%04x\n", |
Johannes Stezenbach | fdc53a6 | 2005-05-16 21:54:39 -0700 | [diff] [blame] | 728 | av7110->dvb_adapter.num, version1, version2); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 729 | msp_writereg(av7110, MSP_WR_DSP, 0x0013, 0x0c00); |
| 730 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone |
| 731 | msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source |
| 732 | msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0220); // headphone source |
| 733 | msp_writereg(av7110, MSP_WR_DSP, 0x0004, 0x7f00); // loudspeaker volume |
| 734 | msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0220); // SCART 1 source |
| 735 | msp_writereg(av7110, MSP_WR_DSP, 0x0007, 0x7f00); // SCART 1 volume |
Tim Kaiser | 61391e0 | 2006-06-25 09:14:07 -0300 | [diff] [blame] | 736 | msp_writereg(av7110, MSP_WR_DSP, 0x000d, 0x1900); // prescale SCART |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 737 | |
| 738 | if (i2c_writereg(av7110, 0x48, 0x01, 0x00)!=1) { |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 739 | pr_info("saa7113 not accessible\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 740 | } else { |
| 741 | u8 *i = saa7113_init_regs; |
| 742 | |
| 743 | if ((av7110->dev->pci->subsystem_vendor == 0x110a) && (av7110->dev->pci->subsystem_device == 0x0000)) { |
| 744 | /* Fujitsu/Siemens DVB-Cable */ |
| 745 | av7110->analog_tuner_flags |= ANALOG_TUNER_VES1820; |
| 746 | } else if ((av7110->dev->pci->subsystem_vendor == 0x13c2) && (av7110->dev->pci->subsystem_device == 0x0002)) { |
| 747 | /* Hauppauge/TT DVB-C premium */ |
| 748 | av7110->analog_tuner_flags |= ANALOG_TUNER_VES1820; |
| 749 | } else if ((av7110->dev->pci->subsystem_vendor == 0x13c2) && (av7110->dev->pci->subsystem_device == 0x000A)) { |
| 750 | /* Hauppauge/TT DVB-C premium */ |
| 751 | av7110->analog_tuner_flags |= ANALOG_TUNER_STV0297; |
| 752 | } |
| 753 | |
| 754 | /* setup for DVB by default */ |
| 755 | if (av7110->analog_tuner_flags & ANALOG_TUNER_VES1820) { |
| 756 | if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20)) |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 757 | dprintk(1, "setting band in demodulator failed\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 758 | } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { |
Marco Schluessler | 6a85774 | 2006-07-10 03:34:16 -0300 | [diff] [blame] | 759 | saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD) |
| 760 | saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 761 | } |
| 762 | |
| 763 | /* init the saa7113 */ |
| 764 | while (*i != 0xff) { |
| 765 | if (i2c_writereg(av7110, 0x48, i[0], i[1]) != 1) { |
Johannes Stezenbach | fdc53a6 | 2005-05-16 21:54:39 -0700 | [diff] [blame] | 766 | dprintk(1, "saa7113 initialization failed @ card %d", av7110->dvb_adapter.num); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 767 | break; |
| 768 | } |
| 769 | i += 2; |
| 770 | } |
| 771 | /* setup msp for analog sound: B/G Dual-FM */ |
| 772 | msp_writereg(av7110, MSP_WR_DEM, 0x00bb, 0x02d0); // AD_CV |
| 773 | msp_writereg(av7110, MSP_WR_DEM, 0x0001, 3); // FIR1 |
| 774 | msp_writereg(av7110, MSP_WR_DEM, 0x0001, 18); // FIR1 |
| 775 | msp_writereg(av7110, MSP_WR_DEM, 0x0001, 27); // FIR1 |
| 776 | msp_writereg(av7110, MSP_WR_DEM, 0x0001, 48); // FIR1 |
| 777 | msp_writereg(av7110, MSP_WR_DEM, 0x0001, 66); // FIR1 |
| 778 | msp_writereg(av7110, MSP_WR_DEM, 0x0001, 72); // FIR1 |
| 779 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 4); // FIR2 |
| 780 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 64); // FIR2 |
| 781 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 0); // FIR2 |
| 782 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 3); // FIR2 |
| 783 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 18); // FIR2 |
| 784 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 27); // FIR2 |
| 785 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 48); // FIR2 |
| 786 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 66); // FIR2 |
| 787 | msp_writereg(av7110, MSP_WR_DEM, 0x0005, 72); // FIR2 |
| 788 | msp_writereg(av7110, MSP_WR_DEM, 0x0083, 0xa000); // MODE_REG |
| 789 | msp_writereg(av7110, MSP_WR_DEM, 0x0093, 0x00aa); // DCO1_LO 5.74MHz |
| 790 | msp_writereg(av7110, MSP_WR_DEM, 0x009b, 0x04fc); // DCO1_HI |
| 791 | msp_writereg(av7110, MSP_WR_DEM, 0x00a3, 0x038e); // DCO2_LO 5.5MHz |
| 792 | msp_writereg(av7110, MSP_WR_DEM, 0x00ab, 0x04c6); // DCO2_HI |
| 793 | msp_writereg(av7110, MSP_WR_DEM, 0x0056, 0); // LOAD_REG 1/2 |
| 794 | } |
| 795 | |
| 796 | memcpy(standard, dvb_standard, sizeof(struct saa7146_standard) * 2); |
| 797 | /* set dd1 stream a & b */ |
| 798 | saa7146_write(av7110->dev, DD1_STREAM_B, 0x00000000); |
| 799 | saa7146_write(av7110->dev, DD1_INIT, 0x03000700); |
| 800 | saa7146_write(av7110->dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26)); |
| 801 | |
| 802 | return 0; |
| 803 | } |
| 804 | |
| 805 | int av7110_init_v4l(struct av7110 *av7110) |
| 806 | { |
| 807 | struct saa7146_dev* dev = av7110->dev; |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 808 | struct saa7146_ext_vv *vv_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 809 | int ret; |
| 810 | |
| 811 | /* special case DVB-C: these cards have an analog tuner |
| 812 | plus need some special handling, so we have separate |
| 813 | saa7146_ext_vv data for these... */ |
| 814 | if (av7110->analog_tuner_flags) |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 815 | vv_data = &av7110_vv_data_c; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 816 | else |
Hans Verkuil | b960074 | 2009-01-18 19:59:11 -0300 | [diff] [blame] | 817 | vv_data = &av7110_vv_data_st; |
| 818 | ret = saa7146_vv_init(dev, vv_data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 819 | |
| 820 | if (ret) { |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 821 | ERR("cannot init capture device. skipping\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 822 | return -ENODEV; |
| 823 | } |
Hans Verkuil | ab49ae0 | 2012-05-01 12:57:57 -0300 | [diff] [blame] | 824 | vv_data->vid_ops.vidioc_enum_input = vidioc_enum_input; |
| 825 | vv_data->vid_ops.vidioc_g_input = vidioc_g_input; |
| 826 | vv_data->vid_ops.vidioc_s_input = vidioc_s_input; |
| 827 | vv_data->vid_ops.vidioc_g_tuner = vidioc_g_tuner; |
| 828 | vv_data->vid_ops.vidioc_s_tuner = vidioc_s_tuner; |
| 829 | vv_data->vid_ops.vidioc_g_frequency = vidioc_g_frequency; |
| 830 | vv_data->vid_ops.vidioc_s_frequency = vidioc_s_frequency; |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 831 | vv_data->vid_ops.vidioc_enumaudio = vidioc_enumaudio; |
Hans Verkuil | ab49ae0 | 2012-05-01 12:57:57 -0300 | [diff] [blame] | 832 | vv_data->vid_ops.vidioc_g_audio = vidioc_g_audio; |
| 833 | vv_data->vid_ops.vidioc_s_audio = vidioc_s_audio; |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 834 | vv_data->vid_ops.vidioc_g_fmt_vbi_cap = NULL; |
Hans Verkuil | 313fce7 | 2012-05-01 13:13:49 -0300 | [diff] [blame] | 835 | |
Hans Verkuil | 313fce7 | 2012-05-01 13:13:49 -0300 | [diff] [blame] | 836 | vv_data->vbi_ops.vidioc_g_tuner = vidioc_g_tuner; |
| 837 | vv_data->vbi_ops.vidioc_s_tuner = vidioc_s_tuner; |
| 838 | vv_data->vbi_ops.vidioc_g_frequency = vidioc_g_frequency; |
| 839 | vv_data->vbi_ops.vidioc_s_frequency = vidioc_s_frequency; |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 840 | vv_data->vbi_ops.vidioc_g_fmt_vbi_cap = NULL; |
Hans Verkuil | ab49ae0 | 2012-05-01 12:57:57 -0300 | [diff] [blame] | 841 | vv_data->vbi_ops.vidioc_g_sliced_vbi_cap = vidioc_g_sliced_vbi_cap; |
| 842 | vv_data->vbi_ops.vidioc_g_fmt_sliced_vbi_out = vidioc_g_fmt_sliced_vbi_out; |
| 843 | vv_data->vbi_ops.vidioc_s_fmt_sliced_vbi_out = vidioc_s_fmt_sliced_vbi_out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 844 | |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 845 | if (FW_VERSION(av7110->arm_app) < 0x2623) |
| 846 | vv_data->capabilities &= ~V4L2_CAP_SLICED_VBI_OUTPUT; |
| 847 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 848 | if (saa7146_register_device(&av7110->v4l_dev, dev, "av7110", VFL_TYPE_GRABBER)) { |
Joe Perches | 44d0b80 | 2011-08-21 19:56:44 -0300 | [diff] [blame] | 849 | ERR("cannot register capture device. skipping\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 850 | saa7146_vv_release(dev); |
| 851 | return -ENODEV; |
| 852 | } |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 853 | if (FW_VERSION(av7110->arm_app) >= 0x2623) { |
| 854 | if (saa7146_register_device(&av7110->vbi_dev, dev, "av7110", VFL_TYPE_VBI)) |
| 855 | ERR("cannot register vbi v4l2 device. skipping\n"); |
| 856 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 857 | return 0; |
| 858 | } |
| 859 | |
| 860 | int av7110_exit_v4l(struct av7110 *av7110) |
| 861 | { |
Marco Schluessler | e19c55f | 2007-01-31 14:32:29 -0300 | [diff] [blame] | 862 | struct saa7146_dev* dev = av7110->dev; |
| 863 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 864 | saa7146_unregister_device(&av7110->v4l_dev, av7110->dev); |
Oliver Endriss | 7857735 | 2007-01-27 21:13:06 -0300 | [diff] [blame] | 865 | saa7146_unregister_device(&av7110->vbi_dev, av7110->dev); |
Marco Schluessler | e19c55f | 2007-01-31 14:32:29 -0300 | [diff] [blame] | 866 | |
| 867 | saa7146_vv_release(dev); |
| 868 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 869 | return 0; |
| 870 | } |
| 871 | |
| 872 | |
| 873 | |
| 874 | /* FIXME: these values are experimental values that look better than the |
| 875 | values from the latest "official" driver -- at least for me... (MiHu) */ |
| 876 | static struct saa7146_standard standard[] = { |
| 877 | { |
| 878 | .name = "PAL", .id = V4L2_STD_PAL_BG, |
| 879 | .v_offset = 0x15, .v_field = 288, |
| 880 | .h_offset = 0x48, .h_pixels = 708, |
| 881 | .v_max_out = 576, .h_max_out = 768, |
| 882 | }, { |
| 883 | .name = "NTSC", .id = V4L2_STD_NTSC, |
| 884 | .v_offset = 0x10, .v_field = 244, |
| 885 | .h_offset = 0x40, .h_pixels = 708, |
| 886 | .v_max_out = 480, .h_max_out = 640, |
| 887 | } |
| 888 | }; |
| 889 | |
| 890 | static struct saa7146_standard analog_standard[] = { |
| 891 | { |
| 892 | .name = "PAL", .id = V4L2_STD_PAL_BG, |
| 893 | .v_offset = 0x1b, .v_field = 288, |
| 894 | .h_offset = 0x08, .h_pixels = 708, |
| 895 | .v_max_out = 576, .h_max_out = 768, |
| 896 | }, { |
| 897 | .name = "NTSC", .id = V4L2_STD_NTSC, |
| 898 | .v_offset = 0x10, .v_field = 244, |
| 899 | .h_offset = 0x40, .h_pixels = 708, |
| 900 | .v_max_out = 480, .h_max_out = 640, |
| 901 | } |
| 902 | }; |
| 903 | |
| 904 | static struct saa7146_standard dvb_standard[] = { |
| 905 | { |
| 906 | .name = "PAL", .id = V4L2_STD_PAL_BG, |
| 907 | .v_offset = 0x14, .v_field = 288, |
| 908 | .h_offset = 0x48, .h_pixels = 708, |
| 909 | .v_max_out = 576, .h_max_out = 768, |
| 910 | }, { |
| 911 | .name = "NTSC", .id = V4L2_STD_NTSC, |
| 912 | .v_offset = 0x10, .v_field = 244, |
| 913 | .h_offset = 0x40, .h_pixels = 708, |
| 914 | .v_max_out = 480, .h_max_out = 640, |
| 915 | } |
| 916 | }; |
| 917 | |
| 918 | static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std) |
| 919 | { |
| 920 | struct av7110 *av7110 = (struct av7110*) dev->ext_priv; |
| 921 | |
Johannes Stezenbach | 4ab3f08 | 2005-05-16 21:54:27 -0700 | [diff] [blame] | 922 | if (std->id & V4L2_STD_PAL) { |
Marco Schluessler | 58a4404 | 2007-10-31 01:20:42 -0300 | [diff] [blame] | 923 | av7110->vidmode = AV7110_VIDEO_MODE_PAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 924 | av7110_set_vidmode(av7110, av7110->vidmode); |
| 925 | } |
Johannes Stezenbach | 4ab3f08 | 2005-05-16 21:54:27 -0700 | [diff] [blame] | 926 | else if (std->id & V4L2_STD_NTSC) { |
Marco Schluessler | 58a4404 | 2007-10-31 01:20:42 -0300 | [diff] [blame] | 927 | av7110->vidmode = AV7110_VIDEO_MODE_NTSC; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 928 | av7110_set_vidmode(av7110, av7110->vidmode); |
| 929 | } |
| 930 | else |
| 931 | return -1; |
| 932 | |
| 933 | return 0; |
| 934 | } |
| 935 | |
| 936 | |
| 937 | static struct saa7146_ext_vv av7110_vv_data_st = { |
| 938 | .inputs = 1, |
| 939 | .audios = 1, |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 940 | .capabilities = V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_AUDIO, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 941 | .flags = 0, |
| 942 | |
| 943 | .stds = &standard[0], |
| 944 | .num_stds = ARRAY_SIZE(standard), |
| 945 | .std_callback = &std_callback, |
| 946 | |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 947 | .vbi_fops.open = av7110_vbi_reset, |
| 948 | .vbi_fops.release = av7110_vbi_reset, |
| 949 | .vbi_fops.write = av7110_vbi_write, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 950 | }; |
| 951 | |
| 952 | static struct saa7146_ext_vv av7110_vv_data_c = { |
| 953 | .inputs = 1, |
| 954 | .audios = 1, |
Hans Verkuil | a299e40 | 2012-05-06 13:31:27 -0300 | [diff] [blame] | 955 | .capabilities = V4L2_CAP_TUNER | V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_AUDIO, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 956 | .flags = SAA7146_USE_PORT_B_FOR_VBI, |
| 957 | |
| 958 | .stds = &standard[0], |
| 959 | .num_stds = ARRAY_SIZE(standard), |
| 960 | .std_callback = &std_callback, |
| 961 | |
Oliver Endriss | 5b0fa4f | 2006-01-09 18:21:37 -0200 | [diff] [blame] | 962 | .vbi_fops.open = av7110_vbi_reset, |
| 963 | .vbi_fops.release = av7110_vbi_reset, |
| 964 | .vbi_fops.write = av7110_vbi_write, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 965 | }; |
| 966 | |