Mauro Carvalho Chehab | d56410e | 2006-03-25 09:19:53 -0300 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * vpx3220a, vpx3216b & vpx3214c video decoder driver version 0.0.1 |
| 3 | * |
| 4 | * Copyright (C) 2001 Laurent Pinchart <lpinchart@freegates.be> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | */ |
| 20 | |
| 21 | #include <linux/module.h> |
| 22 | #include <linux/init.h> |
| 23 | #include <linux/delay.h> |
| 24 | #include <linux/types.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 25 | #include <linux/slab.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #include <asm/uaccess.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | #include <linux/i2c.h> |
Hans Verkuil | 107063c | 2009-02-18 17:26:06 -0300 | [diff] [blame] | 28 | #include <linux/videodev2.h> |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 29 | #include <media/v4l2-device.h> |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 30 | #include <media/v4l2-ctrls.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 32 | MODULE_DESCRIPTION("vpx3220a/vpx3216b/vpx3214c video decoder driver"); |
| 33 | MODULE_AUTHOR("Laurent Pinchart"); |
| 34 | MODULE_LICENSE("GPL"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
Douglas Schilling Landgraf | ff699e6 | 2008-04-22 14:41:48 -0300 | [diff] [blame] | 36 | static int debug; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | module_param(debug, int, 0); |
| 38 | MODULE_PARM_DESC(debug, "Debug level (0-1)"); |
| 39 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 40 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #define VPX_TIMEOUT_COUNT 10 |
| 42 | |
| 43 | /* ----------------------------------------------------------------------- */ |
| 44 | |
| 45 | struct vpx3220 { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 46 | struct v4l2_subdev sd; |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 47 | struct v4l2_ctrl_handler hdl; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | unsigned char reg[255]; |
| 49 | |
Hans Verkuil | 107063c | 2009-02-18 17:26:06 -0300 | [diff] [blame] | 50 | v4l2_std_id norm; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | int input; |
| 52 | int enable; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | }; |
| 54 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 55 | static inline struct vpx3220 *to_vpx3220(struct v4l2_subdev *sd) |
| 56 | { |
| 57 | return container_of(sd, struct vpx3220, sd); |
| 58 | } |
| 59 | |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 60 | static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl) |
| 61 | { |
| 62 | return &container_of(ctrl->handler, struct vpx3220, hdl)->sd; |
| 63 | } |
| 64 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | static char *inputs[] = { "internal", "composite", "svideo" }; |
| 66 | |
| 67 | /* ----------------------------------------------------------------------- */ |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 68 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 69 | static inline int vpx3220_write(struct v4l2_subdev *sd, u8 reg, u8 value) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 71 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | struct vpx3220 *decoder = i2c_get_clientdata(client); |
| 73 | |
| 74 | decoder->reg[reg] = value; |
| 75 | return i2c_smbus_write_byte_data(client, reg, value); |
| 76 | } |
| 77 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 78 | static inline int vpx3220_read(struct v4l2_subdev *sd, u8 reg) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 80 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
| 81 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | return i2c_smbus_read_byte_data(client, reg); |
| 83 | } |
| 84 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 85 | static int vpx3220_fp_status(struct v4l2_subdev *sd) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | { |
| 87 | unsigned char status; |
| 88 | unsigned int i; |
| 89 | |
| 90 | for (i = 0; i < VPX_TIMEOUT_COUNT; i++) { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 91 | status = vpx3220_read(sd, 0x29); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
| 93 | if (!(status & 4)) |
| 94 | return 0; |
| 95 | |
| 96 | udelay(10); |
| 97 | |
| 98 | if (need_resched()) |
| 99 | cond_resched(); |
| 100 | } |
| 101 | |
| 102 | return -1; |
| 103 | } |
| 104 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 105 | static int vpx3220_fp_write(struct v4l2_subdev *sd, u8 fpaddr, u16 data) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 107 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
| 108 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | /* Write the 16-bit address to the FPWR register */ |
| 110 | if (i2c_smbus_write_word_data(client, 0x27, swab16(fpaddr)) == -1) { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 111 | v4l2_dbg(1, debug, sd, "%s: failed\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | return -1; |
| 113 | } |
| 114 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 115 | if (vpx3220_fp_status(sd) < 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | return -1; |
| 117 | |
| 118 | /* Write the 16-bit data to the FPDAT register */ |
| 119 | if (i2c_smbus_write_word_data(client, 0x28, swab16(data)) == -1) { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 120 | v4l2_dbg(1, debug, sd, "%s: failed\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | return -1; |
| 122 | } |
| 123 | |
| 124 | return 0; |
| 125 | } |
| 126 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 127 | static u16 vpx3220_fp_read(struct v4l2_subdev *sd, u16 fpaddr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 129 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | s16 data; |
| 131 | |
| 132 | /* Write the 16-bit address to the FPRD register */ |
| 133 | if (i2c_smbus_write_word_data(client, 0x26, swab16(fpaddr)) == -1) { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 134 | v4l2_dbg(1, debug, sd, "%s: failed\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | return -1; |
| 136 | } |
| 137 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 138 | if (vpx3220_fp_status(sd) < 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | return -1; |
| 140 | |
| 141 | /* Read the 16-bit data from the FPDAT register */ |
| 142 | data = i2c_smbus_read_word_data(client, 0x28); |
| 143 | if (data == -1) { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 144 | v4l2_dbg(1, debug, sd, "%s: failed\n", __func__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | return -1; |
| 146 | } |
| 147 | |
| 148 | return swab16(data); |
| 149 | } |
| 150 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 151 | static int vpx3220_write_block(struct v4l2_subdev *sd, const u8 *data, unsigned int len) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | { |
| 153 | u8 reg; |
| 154 | int ret = -1; |
| 155 | |
| 156 | while (len >= 2) { |
| 157 | reg = *data++; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 158 | ret = vpx3220_write(sd, reg, *data++); |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 159 | if (ret < 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | break; |
| 161 | len -= 2; |
| 162 | } |
| 163 | |
| 164 | return ret; |
| 165 | } |
| 166 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 167 | static int vpx3220_write_fp_block(struct v4l2_subdev *sd, |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 168 | const u16 *data, unsigned int len) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | { |
| 170 | u8 reg; |
| 171 | int ret = 0; |
| 172 | |
| 173 | while (len > 1) { |
| 174 | reg = *data++; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 175 | ret |= vpx3220_fp_write(sd, reg, *data++); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | len -= 2; |
| 177 | } |
| 178 | |
| 179 | return ret; |
| 180 | } |
| 181 | |
| 182 | /* ---------------------------------------------------------------------- */ |
| 183 | |
| 184 | static const unsigned short init_ntsc[] = { |
| 185 | 0x1c, 0x00, /* NTSC tint angle */ |
| 186 | 0x88, 17, /* Window 1 vertical */ |
| 187 | 0x89, 240, /* Vertical lines in */ |
| 188 | 0x8a, 240, /* Vertical lines out */ |
| 189 | 0x8b, 000, /* Horizontal begin */ |
| 190 | 0x8c, 640, /* Horizontal length */ |
| 191 | 0x8d, 640, /* Number of pixels */ |
| 192 | 0x8f, 0xc00, /* Disable window 2 */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 193 | 0xf0, 0x73, /* 13.5 MHz transport, Forced |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | * mode, latch windows */ |
| 195 | 0xf2, 0x13, /* NTSC M, composite input */ |
| 196 | 0xe7, 0x1e1, /* Enable vertical standard |
| 197 | * locking @ 240 lines */ |
| 198 | }; |
| 199 | |
| 200 | static const unsigned short init_pal[] = { |
| 201 | 0x88, 23, /* Window 1 vertical begin */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 202 | 0x89, 288, /* Vertical lines in (16 lines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | * skipped by the VFE) */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 204 | 0x8a, 288, /* Vertical lines out (16 lines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | * skipped by the VFE) */ |
| 206 | 0x8b, 16, /* Horizontal begin */ |
| 207 | 0x8c, 768, /* Horizontal length */ |
| 208 | 0x8d, 784, /* Number of pixels |
| 209 | * Must be >= Horizontal begin + Horizontal length */ |
| 210 | 0x8f, 0xc00, /* Disable window 2 */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 211 | 0xf0, 0x77, /* 13.5 MHz transport, Forced |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | * mode, latch windows */ |
| 213 | 0xf2, 0x3d1, /* PAL B,G,H,I, composite input */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 214 | 0xe7, 0x241, /* PAL/SECAM set to 288 lines */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | }; |
| 216 | |
| 217 | static const unsigned short init_secam[] = { |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 218 | 0x88, 23, /* Window 1 vertical begin */ |
| 219 | 0x89, 288, /* Vertical lines in (16 lines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | * skipped by the VFE) */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 221 | 0x8a, 288, /* Vertical lines out (16 lines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 222 | * skipped by the VFE) */ |
| 223 | 0x8b, 16, /* Horizontal begin */ |
| 224 | 0x8c, 768, /* Horizontal length */ |
| 225 | 0x8d, 784, /* Number of pixels |
| 226 | * Must be >= Horizontal begin + Horizontal length */ |
| 227 | 0x8f, 0xc00, /* Disable window 2 */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 228 | 0xf0, 0x77, /* 13.5 MHz transport, Forced |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | * mode, latch windows */ |
| 230 | 0xf2, 0x3d5, /* SECAM, composite input */ |
Ronald S. Bultje | 9b3acc2 | 2005-10-16 20:29:24 -0700 | [diff] [blame] | 231 | 0xe7, 0x241, /* PAL/SECAM set to 288 lines */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 | }; |
| 233 | |
| 234 | static const unsigned char init_common[] = { |
| 235 | 0xf2, 0x00, /* Disable all outputs */ |
| 236 | 0x33, 0x0d, /* Luma : VIN2, Chroma : CIN |
| 237 | * (clamp off) */ |
| 238 | 0xd8, 0xa8, /* HREF/VREF active high, VREF |
| 239 | * pulse = 2, Odd/Even flag */ |
| 240 | 0x20, 0x03, /* IF compensation 0dB/oct */ |
| 241 | 0xe0, 0xff, /* Open up all comparators */ |
| 242 | 0xe1, 0x00, |
| 243 | 0xe2, 0x7f, |
| 244 | 0xe3, 0x80, |
| 245 | 0xe4, 0x7f, |
| 246 | 0xe5, 0x80, |
| 247 | 0xe6, 0x00, /* Brightness set to 0 */ |
| 248 | 0xe7, 0xe0, /* Contrast to 1.0, noise shaping |
| 249 | * 10 to 8 2-bit error diffusion */ |
| 250 | 0xe8, 0xf8, /* YUV422, CbCr binary offset, |
| 251 | * ... (p.32) */ |
| 252 | 0xea, 0x18, /* LLC2 connected, output FIFO |
| 253 | * reset with VACTintern */ |
| 254 | 0xf0, 0x8a, /* Half full level to 10, bus |
| 255 | * shuffler [7:0, 23:16, 15:8] */ |
| 256 | 0xf1, 0x18, /* Single clock, sync mode, no |
| 257 | * FE delay, no HLEN counter */ |
| 258 | 0xf8, 0x12, /* Port A, PIXCLK, HF# & FE# |
| 259 | * strength to 2 */ |
| 260 | 0xf9, 0x24, /* Port B, HREF, VREF, PREF & |
| 261 | * ALPHA strength to 4 */ |
| 262 | }; |
| 263 | |
| 264 | static const unsigned short init_fp[] = { |
| 265 | 0x59, 0, |
| 266 | 0xa0, 2070, /* ACC reference */ |
| 267 | 0xa3, 0, |
| 268 | 0xa4, 0, |
| 269 | 0xa8, 30, |
| 270 | 0xb2, 768, |
| 271 | 0xbe, 27, |
| 272 | 0x58, 0, |
| 273 | 0x26, 0, |
| 274 | 0x4b, 0x298, /* PLL gain */ |
| 275 | }; |
| 276 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 278 | static int vpx3220_init(struct v4l2_subdev *sd, u32 val) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 280 | struct vpx3220 *decoder = to_vpx3220(sd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 282 | vpx3220_write_block(sd, init_common, sizeof(init_common)); |
| 283 | vpx3220_write_fp_block(sd, init_fp, sizeof(init_fp) >> 1); |
| 284 | if (decoder->norm & V4L2_STD_NTSC) |
| 285 | vpx3220_write_fp_block(sd, init_ntsc, sizeof(init_ntsc) >> 1); |
| 286 | else if (decoder->norm & V4L2_STD_PAL) |
| 287 | vpx3220_write_fp_block(sd, init_pal, sizeof(init_pal) >> 1); |
| 288 | else if (decoder->norm & V4L2_STD_SECAM) |
| 289 | vpx3220_write_fp_block(sd, init_secam, sizeof(init_secam) >> 1); |
| 290 | else |
| 291 | vpx3220_write_fp_block(sd, init_pal, sizeof(init_pal) >> 1); |
| 292 | return 0; |
| 293 | } |
| 294 | |
| 295 | static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd) |
| 296 | { |
| 297 | int res = V4L2_IN_ST_NO_SIGNAL, status; |
Hans Verkuil | 32cb3b0 | 2013-05-29 10:19:01 -0300 | [diff] [blame] | 298 | v4l2_std_id std = pstd ? *pstd : V4L2_STD_ALL; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 299 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 300 | status = vpx3220_fp_read(sd, 0x0f3); |
| 301 | |
| 302 | v4l2_dbg(1, debug, sd, "status: 0x%04x\n", status); |
| 303 | |
| 304 | if (status < 0) |
| 305 | return status; |
| 306 | |
| 307 | if ((status & 0x20) == 0) { |
| 308 | res = 0; |
| 309 | |
| 310 | switch (status & 0x18) { |
| 311 | case 0x00: |
| 312 | case 0x10: |
| 313 | case 0x14: |
| 314 | case 0x18: |
Hans Verkuil | 32cb3b0 | 2013-05-29 10:19:01 -0300 | [diff] [blame] | 315 | std &= V4L2_STD_PAL; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 316 | break; |
| 317 | |
| 318 | case 0x08: |
Hans Verkuil | 32cb3b0 | 2013-05-29 10:19:01 -0300 | [diff] [blame] | 319 | std &= V4L2_STD_SECAM; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 320 | break; |
| 321 | |
| 322 | case 0x04: |
| 323 | case 0x0c: |
| 324 | case 0x1c: |
Hans Verkuil | 32cb3b0 | 2013-05-29 10:19:01 -0300 | [diff] [blame] | 325 | std &= V4L2_STD_NTSC; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 326 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 | } |
Hans Verkuil | 32cb3b0 | 2013-05-29 10:19:01 -0300 | [diff] [blame] | 328 | } else { |
| 329 | std = V4L2_STD_UNKNOWN; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 330 | } |
| 331 | if (pstd) |
| 332 | *pstd = std; |
| 333 | if (pstatus) |
Hans Verkuil | ba08831 | 2011-08-25 10:52:53 -0300 | [diff] [blame] | 334 | *pstatus = res; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 335 | return 0; |
| 336 | } |
| 337 | |
| 338 | static int vpx3220_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) |
| 339 | { |
Hans Verkuil | bccfa44 | 2009-03-30 06:55:27 -0300 | [diff] [blame] | 340 | v4l2_dbg(1, debug, sd, "querystd\n"); |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 341 | return vpx3220_status(sd, NULL, std); |
| 342 | } |
| 343 | |
| 344 | static int vpx3220_g_input_status(struct v4l2_subdev *sd, u32 *status) |
| 345 | { |
Hans Verkuil | bccfa44 | 2009-03-30 06:55:27 -0300 | [diff] [blame] | 346 | v4l2_dbg(1, debug, sd, "g_input_status\n"); |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 347 | return vpx3220_status(sd, status, NULL); |
| 348 | } |
| 349 | |
| 350 | static int vpx3220_s_std(struct v4l2_subdev *sd, v4l2_std_id std) |
| 351 | { |
| 352 | struct vpx3220 *decoder = to_vpx3220(sd); |
| 353 | int temp_input; |
| 354 | |
| 355 | /* Here we back up the input selection because it gets |
| 356 | overwritten when we fill the registers with the |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 357 | chosen video norm */ |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 358 | temp_input = vpx3220_fp_read(sd, 0xf2); |
| 359 | |
Hans Verkuil | bccfa44 | 2009-03-30 06:55:27 -0300 | [diff] [blame] | 360 | v4l2_dbg(1, debug, sd, "s_std %llx\n", (unsigned long long)std); |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 361 | if (std & V4L2_STD_NTSC) { |
| 362 | vpx3220_write_fp_block(sd, init_ntsc, sizeof(init_ntsc) >> 1); |
| 363 | v4l2_dbg(1, debug, sd, "norm switched to NTSC\n"); |
| 364 | } else if (std & V4L2_STD_PAL) { |
| 365 | vpx3220_write_fp_block(sd, init_pal, sizeof(init_pal) >> 1); |
| 366 | v4l2_dbg(1, debug, sd, "norm switched to PAL\n"); |
| 367 | } else if (std & V4L2_STD_SECAM) { |
| 368 | vpx3220_write_fp_block(sd, init_secam, sizeof(init_secam) >> 1); |
| 369 | v4l2_dbg(1, debug, sd, "norm switched to SECAM\n"); |
| 370 | } else { |
| 371 | return -EINVAL; |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 372 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 374 | decoder->norm = std; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 376 | /* And here we set the backed up video input again */ |
| 377 | vpx3220_fp_write(sd, 0xf2, temp_input | 0x0010); |
| 378 | udelay(10); |
| 379 | return 0; |
| 380 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 382 | static int vpx3220_s_routing(struct v4l2_subdev *sd, |
| 383 | u32 input, u32 output, u32 config) |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 384 | { |
| 385 | int data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 387 | /* RJ: input = 0: ST8 (PCTV) input |
| 388 | input = 1: COMPOSITE input |
| 389 | input = 2: SVHS input */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 391 | const int input_vals[3][2] = { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 392 | {0x0c, 0}, |
| 393 | {0x0d, 0}, |
| 394 | {0x0e, 1} |
| 395 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 396 | |
Roel Kluin | f14a297 | 2009-10-23 07:59:42 -0300 | [diff] [blame] | 397 | if (input > 2) |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 398 | return -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 400 | v4l2_dbg(1, debug, sd, "input switched to %s\n", inputs[input]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 401 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 402 | vpx3220_write(sd, 0x33, input_vals[input][0]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 403 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 404 | data = vpx3220_fp_read(sd, 0xf2) & ~(0x0020); |
| 405 | if (data < 0) |
| 406 | return data; |
| 407 | /* 0x0010 is required to latch the setting */ |
| 408 | vpx3220_fp_write(sd, 0xf2, |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 409 | data | (input_vals[input][1] << 5) | 0x0010); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 411 | udelay(10); |
| 412 | return 0; |
| 413 | } |
| 414 | |
| 415 | static int vpx3220_s_stream(struct v4l2_subdev *sd, int enable) |
| 416 | { |
Hans Verkuil | bccfa44 | 2009-03-30 06:55:27 -0300 | [diff] [blame] | 417 | v4l2_dbg(1, debug, sd, "s_stream %s\n", enable ? "on" : "off"); |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 418 | |
| 419 | vpx3220_write(sd, 0xf2, (enable ? 0x1b : 0x00)); |
| 420 | return 0; |
| 421 | } |
| 422 | |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 423 | static int vpx3220_s_ctrl(struct v4l2_ctrl *ctrl) |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 424 | { |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 425 | struct v4l2_subdev *sd = to_sd(ctrl); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 426 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 427 | switch (ctrl->id) { |
| 428 | case V4L2_CID_BRIGHTNESS: |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 429 | vpx3220_write(sd, 0xe6, ctrl->val); |
| 430 | return 0; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 431 | case V4L2_CID_CONTRAST: |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 432 | /* Bit 7 and 8 is for noise shaping */ |
| 433 | vpx3220_write(sd, 0xe7, ctrl->val + 192); |
| 434 | return 0; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 435 | case V4L2_CID_SATURATION: |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 436 | vpx3220_fp_write(sd, 0xa0, ctrl->val); |
| 437 | return 0; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 438 | case V4L2_CID_HUE: |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 439 | vpx3220_fp_write(sd, 0x1c, ctrl->val); |
| 440 | return 0; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 441 | } |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 442 | return -EINVAL; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 443 | } |
| 444 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 445 | /* ----------------------------------------------------------------------- */ |
| 446 | |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 447 | static const struct v4l2_ctrl_ops vpx3220_ctrl_ops = { |
| 448 | .s_ctrl = vpx3220_s_ctrl, |
| 449 | }; |
| 450 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 451 | static const struct v4l2_subdev_core_ops vpx3220_core_ops = { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 452 | .init = vpx3220_init, |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 453 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
| 454 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
| 455 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
| 456 | .g_ctrl = v4l2_subdev_g_ctrl, |
| 457 | .s_ctrl = v4l2_subdev_s_ctrl, |
| 458 | .queryctrl = v4l2_subdev_queryctrl, |
| 459 | .querymenu = v4l2_subdev_querymenu, |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 460 | .s_std = vpx3220_s_std, |
| 461 | }; |
| 462 | |
| 463 | static const struct v4l2_subdev_video_ops vpx3220_video_ops = { |
| 464 | .s_routing = vpx3220_s_routing, |
| 465 | .s_stream = vpx3220_s_stream, |
| 466 | .querystd = vpx3220_querystd, |
| 467 | .g_input_status = vpx3220_g_input_status, |
| 468 | }; |
| 469 | |
| 470 | static const struct v4l2_subdev_ops vpx3220_ops = { |
| 471 | .core = &vpx3220_core_ops, |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 472 | .video = &vpx3220_video_ops, |
| 473 | }; |
| 474 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 475 | /* ----------------------------------------------------------------------- |
Joe Perches | c84e603 | 2008-02-03 17:18:59 +0200 | [diff] [blame] | 476 | * Client management code |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 477 | */ |
| 478 | |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 479 | static int vpx3220_probe(struct i2c_client *client, |
| 480 | const struct i2c_device_id *id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 482 | struct vpx3220 *decoder; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 483 | struct v4l2_subdev *sd; |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 484 | const char *name = NULL; |
| 485 | u8 ver; |
| 486 | u16 pn; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 487 | |
| 488 | /* Check if the adapter supports the needed features */ |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 489 | if (!i2c_check_functionality(client->adapter, |
| 490 | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) |
| 491 | return -ENODEV; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 492 | |
Laurent Pinchart | c02b211 | 2013-05-02 08:29:43 -0300 | [diff] [blame] | 493 | decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 494 | if (decoder == NULL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | return -ENOMEM; |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 496 | sd = &decoder->sd; |
| 497 | v4l2_i2c_subdev_init(sd, client, &vpx3220_ops); |
Hans Verkuil | 107063c | 2009-02-18 17:26:06 -0300 | [diff] [blame] | 498 | decoder->norm = V4L2_STD_PAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 499 | decoder->input = 0; |
| 500 | decoder->enable = 1; |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 501 | v4l2_ctrl_handler_init(&decoder->hdl, 4); |
| 502 | v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, |
| 503 | V4L2_CID_BRIGHTNESS, -128, 127, 1, 0); |
| 504 | v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, |
| 505 | V4L2_CID_CONTRAST, 0, 63, 1, 32); |
| 506 | v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, |
| 507 | V4L2_CID_SATURATION, 0, 4095, 1, 2048); |
| 508 | v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, |
| 509 | V4L2_CID_HUE, -512, 511, 1, 0); |
| 510 | sd->ctrl_handler = &decoder->hdl; |
| 511 | if (decoder->hdl.error) { |
| 512 | int err = decoder->hdl.error; |
| 513 | |
| 514 | v4l2_ctrl_handler_free(&decoder->hdl); |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 515 | return err; |
| 516 | } |
| 517 | v4l2_ctrl_handler_setup(&decoder->hdl); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 518 | |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 519 | ver = i2c_smbus_read_byte_data(client, 0x00); |
| 520 | pn = (i2c_smbus_read_byte_data(client, 0x02) << 8) + |
| 521 | i2c_smbus_read_byte_data(client, 0x01); |
| 522 | if (ver == 0xec) { |
| 523 | switch (pn) { |
| 524 | case 0x4680: |
| 525 | name = "vpx3220a"; |
| 526 | break; |
| 527 | case 0x4260: |
| 528 | name = "vpx3216b"; |
| 529 | break; |
| 530 | case 0x4280: |
| 531 | name = "vpx3214c"; |
| 532 | break; |
| 533 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 534 | } |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 535 | if (name) |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 536 | v4l2_info(sd, "%s found @ 0x%x (%s)\n", name, |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 537 | client->addr << 1, client->adapter->name); |
| 538 | else |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 539 | v4l2_info(sd, "chip (%02x:%04x) found @ 0x%x (%s)\n", |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 540 | ver, pn, client->addr << 1, client->adapter->name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 542 | vpx3220_write_block(sd, init_common, sizeof(init_common)); |
| 543 | vpx3220_write_fp_block(sd, init_fp, sizeof(init_fp) >> 1); |
| 544 | /* Default to PAL */ |
| 545 | vpx3220_write_fp_block(sd, init_pal, sizeof(init_pal) >> 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | return 0; |
| 547 | } |
| 548 | |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 549 | static int vpx3220_remove(struct i2c_client *client) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 550 | { |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 551 | struct v4l2_subdev *sd = i2c_get_clientdata(client); |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 552 | struct vpx3220 *decoder = to_vpx3220(sd); |
Hans Verkuil | 7e5eaad | 2009-02-19 14:36:53 -0300 | [diff] [blame] | 553 | |
| 554 | v4l2_device_unregister_subdev(sd); |
Hans Verkuil | 9a77532 | 2010-12-12 08:45:59 -0300 | [diff] [blame] | 555 | v4l2_ctrl_handler_free(&decoder->hdl); |
Laurent Pinchart | c02b211 | 2013-05-02 08:29:43 -0300 | [diff] [blame] | 556 | |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 557 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 558 | } |
| 559 | |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 560 | static const struct i2c_device_id vpx3220_id[] = { |
| 561 | { "vpx3220a", 0 }, |
| 562 | { "vpx3216b", 0 }, |
| 563 | { "vpx3214c", 0 }, |
| 564 | { } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 565 | }; |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 566 | MODULE_DEVICE_TABLE(i2c, vpx3220_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 567 | |
Hans Verkuil | c2d999f | 2010-09-15 15:44:11 -0300 | [diff] [blame] | 568 | static struct i2c_driver vpx3220_driver = { |
| 569 | .driver = { |
| 570 | .owner = THIS_MODULE, |
| 571 | .name = "vpx3220", |
| 572 | }, |
| 573 | .probe = vpx3220_probe, |
| 574 | .remove = vpx3220_remove, |
| 575 | .id_table = vpx3220_id, |
Hans Verkuil | 23848b6 | 2008-09-07 08:01:39 -0300 | [diff] [blame] | 576 | }; |
Hans Verkuil | c2d999f | 2010-09-15 15:44:11 -0300 | [diff] [blame] | 577 | |
Axel Lin | c6e8d86 | 2012-02-12 06:56:32 -0300 | [diff] [blame] | 578 | module_i2c_driver(vpx3220_driver); |