blob: c7640fab5730d8dadcab775129ac894dd370e6fe [file] [log] [blame]
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -03001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * adv7175 - adv7175a video encoder driver version 0.0.3
3 *
4 * Copyright (C) 1998 Dave Perks <dperks@ibm.net>
5 * Copyright (C) 1999 Wolfgang Scherr <scherr@net4you.net>
6 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx>
7 * - some corrections for Pinnacle Systems Inc. DC10plus card.
8 *
9 * Changes by Ronald Bultje <rbultje@ronald.bitfreak.net>
10 * - moved over to linux>=2.4.x i2c protocol (9/9/2002)
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#include <linux/module.h>
Mauro Carvalho Chehab18f3fa12007-07-02 15:39:57 -030028#include <linux/types.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090029#include <linux/slab.h>
Hans Verkuilbba0d982008-09-07 07:58:46 -030030#include <linux/ioctl.h>
Mauro Carvalho Chehab18f3fa12007-07-02 15:39:57 -030031#include <asm/uaccess.h>
Hans Verkuilbba0d982008-09-07 07:58:46 -030032#include <linux/i2c.h>
Hans Verkuil35631dc2009-02-19 14:56:37 -030033#include <linux/videodev2.h>
34#include <media/v4l2-device.h>
35#include <media/v4l2-chip-ident.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
37MODULE_DESCRIPTION("Analog Devices ADV7175 video encoder driver");
38MODULE_AUTHOR("Dave Perks");
39MODULE_LICENSE("GPL");
40
Hans Verkuil35631dc2009-02-19 14:56:37 -030041#define I2C_ADV7175 0xd4
42#define I2C_ADV7176 0x54
43
Hans Verkuil35631dc2009-02-19 14:56:37 -030044
Douglas Schilling Landgrafff699e62008-04-22 14:41:48 -030045static int debug;
Linus Torvalds1da177e2005-04-16 15:20:36 -070046module_param(debug, int, 0);
47MODULE_PARM_DESC(debug, "Debug level (0-1)");
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049/* ----------------------------------------------------------------------- */
50
51struct adv7175 {
Hans Verkuil35631dc2009-02-19 14:56:37 -030052 struct v4l2_subdev sd;
Hans Verkuil107063c2009-02-18 17:26:06 -030053 v4l2_std_id norm;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 int input;
Linus Torvalds1da177e2005-04-16 15:20:36 -070055};
56
Hans Verkuil35631dc2009-02-19 14:56:37 -030057static inline struct adv7175 *to_adv7175(struct v4l2_subdev *sd)
58{
59 return container_of(sd, struct adv7175, sd);
60}
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Linus Torvalds1da177e2005-04-16 15:20:36 -070062static char *inputs[] = { "pass_through", "play_back", "color_bar" };
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Christian Gmeinerf1a84c92011-10-05 17:48:43 -030064static enum v4l2_mbus_pixelcode adv7175_codes[] = {
65 V4L2_MBUS_FMT_UYVY8_2X8,
66 V4L2_MBUS_FMT_UYVY8_1X16,
67};
68
Linus Torvalds1da177e2005-04-16 15:20:36 -070069/* ----------------------------------------------------------------------- */
70
Hans Verkuil35631dc2009-02-19 14:56:37 -030071static inline int adv7175_write(struct v4l2_subdev *sd, u8 reg, u8 value)
Linus Torvalds1da177e2005-04-16 15:20:36 -070072{
Hans Verkuil35631dc2009-02-19 14:56:37 -030073 struct i2c_client *client = v4l2_get_subdevdata(sd);
74
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 return i2c_smbus_write_byte_data(client, reg, value);
76}
77
Hans Verkuil35631dc2009-02-19 14:56:37 -030078static inline int adv7175_read(struct v4l2_subdev *sd, u8 reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -070079{
Hans Verkuil35631dc2009-02-19 14:56:37 -030080 struct i2c_client *client = v4l2_get_subdevdata(sd);
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082 return i2c_smbus_read_byte_data(client, reg);
83}
84
Hans Verkuil35631dc2009-02-19 14:56:37 -030085static int adv7175_write_block(struct v4l2_subdev *sd,
Hans Verkuilbba0d982008-09-07 07:58:46 -030086 const u8 *data, unsigned int len)
Linus Torvalds1da177e2005-04-16 15:20:36 -070087{
Hans Verkuil35631dc2009-02-19 14:56:37 -030088 struct i2c_client *client = v4l2_get_subdevdata(sd);
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 int ret = -1;
90 u8 reg;
91
92 /* the adv7175 has an autoincrement function, use it if
93 * the adapter understands raw I2C */
94 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
95 /* do raw I2C, not smbus compatible */
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 u8 block_data[32];
Jean Delvare9aa45e32006-03-22 03:48:35 -030097 int block_len;
Linus Torvalds1da177e2005-04-16 15:20:36 -070098
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 while (len >= 2) {
Jean Delvare9aa45e32006-03-22 03:48:35 -0300100 block_len = 0;
101 block_data[block_len++] = reg = data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 do {
Jean Delvare9aa45e32006-03-22 03:48:35 -0300103 block_data[block_len++] = data[1];
Jean Delvare2467a672006-03-22 03:48:34 -0300104 reg++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 len -= 2;
106 data += 2;
Hans Verkuilbba0d982008-09-07 07:58:46 -0300107 } while (len >= 2 && data[0] == reg && block_len < 32);
108 ret = i2c_master_send(client, block_data, block_len);
109 if (ret < 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 break;
111 }
112 } else {
113 /* do some slow I2C emulation kind of thing */
114 while (len >= 2) {
115 reg = *data++;
Hans Verkuil35631dc2009-02-19 14:56:37 -0300116 ret = adv7175_write(sd, reg, *data++);
Hans Verkuilbba0d982008-09-07 07:58:46 -0300117 if (ret < 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 break;
119 len -= 2;
120 }
121 }
122
123 return ret;
124}
125
Hans Verkuil35631dc2009-02-19 14:56:37 -0300126static void set_subcarrier_freq(struct v4l2_subdev *sd, int pass_through)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127{
128 /* for some reason pass_through NTSC needs
129 * a different sub-carrier freq to remain stable. */
Hans Verkuilbba0d982008-09-07 07:58:46 -0300130 if (pass_through)
Hans Verkuil35631dc2009-02-19 14:56:37 -0300131 adv7175_write(sd, 0x02, 0x00);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132 else
Hans Verkuil35631dc2009-02-19 14:56:37 -0300133 adv7175_write(sd, 0x02, 0x55);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134
Hans Verkuil35631dc2009-02-19 14:56:37 -0300135 adv7175_write(sd, 0x03, 0x55);
136 adv7175_write(sd, 0x04, 0x55);
137 adv7175_write(sd, 0x05, 0x25);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138}
139
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140/* ----------------------------------------------------------------------- */
Hans Verkuilbba0d982008-09-07 07:58:46 -0300141/* Output filter: S-Video Composite */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142
Hans Verkuilbba0d982008-09-07 07:58:46 -0300143#define MR050 0x11 /* 0x09 */
144#define MR060 0x14 /* 0x0c */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145
Hans Verkuilbba0d982008-09-07 07:58:46 -0300146/* ----------------------------------------------------------------------- */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147
148#define TR0MODE 0x46
149#define TR0RST 0x80
150
151#define TR1CAPT 0x80
152#define TR1PLAY 0x00
153
154static const unsigned char init_common[] = {
155
156 0x00, MR050, /* MR0, PAL enabled */
157 0x01, 0x00, /* MR1 */
158 0x02, 0x0c, /* subc. freq. */
159 0x03, 0x8c, /* subc. freq. */
160 0x04, 0x79, /* subc. freq. */
161 0x05, 0x26, /* subc. freq. */
162 0x06, 0x40, /* subc. phase */
163
164 0x07, TR0MODE, /* TR0, 16bit */
165 0x08, 0x21, /* */
166 0x09, 0x00, /* */
167 0x0a, 0x00, /* */
168 0x0b, 0x00, /* */
169 0x0c, TR1CAPT, /* TR1 */
170 0x0d, 0x4f, /* MR2 */
171 0x0e, 0x00, /* */
172 0x0f, 0x00, /* */
173 0x10, 0x00, /* */
174 0x11, 0x00, /* */
175};
176
177static const unsigned char init_pal[] = {
178 0x00, MR050, /* MR0, PAL enabled */
179 0x01, 0x00, /* MR1 */
180 0x02, 0x0c, /* subc. freq. */
181 0x03, 0x8c, /* subc. freq. */
182 0x04, 0x79, /* subc. freq. */
183 0x05, 0x26, /* subc. freq. */
184 0x06, 0x40, /* subc. phase */
185};
186
187static const unsigned char init_ntsc[] = {
188 0x00, MR060, /* MR0, NTSC enabled */
189 0x01, 0x00, /* MR1 */
190 0x02, 0x55, /* subc. freq. */
191 0x03, 0x55, /* subc. freq. */
192 0x04, 0x55, /* subc. freq. */
193 0x05, 0x25, /* subc. freq. */
194 0x06, 0x1a, /* subc. phase */
195};
196
Hans Verkuil35631dc2009-02-19 14:56:37 -0300197static int adv7175_init(struct v4l2_subdev *sd, u32 val)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198{
Hans Verkuil35631dc2009-02-19 14:56:37 -0300199 /* This is just for testing!!! */
200 adv7175_write_block(sd, init_common, sizeof(init_common));
201 adv7175_write(sd, 0x07, TR0MODE | TR0RST);
202 adv7175_write(sd, 0x07, TR0MODE);
203 return 0;
204}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205
Hans Verkuil35631dc2009-02-19 14:56:37 -0300206static int adv7175_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
207{
208 struct adv7175 *encoder = to_adv7175(sd);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
Hans Verkuil35631dc2009-02-19 14:56:37 -0300210 if (std & V4L2_STD_NTSC) {
211 adv7175_write_block(sd, init_ntsc, sizeof(init_ntsc));
212 if (encoder->input == 0)
213 adv7175_write(sd, 0x0d, 0x4f); /* Enable genlock */
214 adv7175_write(sd, 0x07, TR0MODE | TR0RST);
215 adv7175_write(sd, 0x07, TR0MODE);
216 } else if (std & V4L2_STD_PAL) {
217 adv7175_write_block(sd, init_pal, sizeof(init_pal));
218 if (encoder->input == 0)
219 adv7175_write(sd, 0x0d, 0x4f); /* Enable genlock */
220 adv7175_write(sd, 0x07, TR0MODE | TR0RST);
221 adv7175_write(sd, 0x07, TR0MODE);
222 } else if (std & V4L2_STD_SECAM) {
223 /* This is an attempt to convert
224 * SECAM->PAL (typically it does not work
225 * due to genlock: when decoder is in SECAM
226 * and encoder in in PAL the subcarrier can
227 * not be syncronized with horizontal
228 * quency) */
229 adv7175_write_block(sd, init_pal, sizeof(init_pal));
230 if (encoder->input == 0)
231 adv7175_write(sd, 0x0d, 0x49); /* Disable genlock */
232 adv7175_write(sd, 0x07, TR0MODE | TR0RST);
233 adv7175_write(sd, 0x07, TR0MODE);
234 } else {
Hans Verkuilcc5cef82009-03-06 10:15:01 -0300235 v4l2_dbg(1, debug, sd, "illegal norm: %llx\n",
236 (unsigned long long)std);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237 return -EINVAL;
238 }
Hans Verkuilcc5cef82009-03-06 10:15:01 -0300239 v4l2_dbg(1, debug, sd, "switched to %llx\n", (unsigned long long)std);
Hans Verkuil35631dc2009-02-19 14:56:37 -0300240 encoder->norm = std;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241 return 0;
242}
243
Hans Verkuil5325b422009-04-02 11:26:22 -0300244static int adv7175_s_routing(struct v4l2_subdev *sd,
245 u32 input, u32 output, u32 config)
Hans Verkuil35631dc2009-02-19 14:56:37 -0300246{
247 struct adv7175 *encoder = to_adv7175(sd);
248
Hans Verkuil5325b422009-04-02 11:26:22 -0300249 /* RJ: input = 0: input is from decoder
250 input = 1: input is from ZR36060
251 input = 2: color bar */
Hans Verkuil35631dc2009-02-19 14:56:37 -0300252
Hans Verkuil5325b422009-04-02 11:26:22 -0300253 switch (input) {
Hans Verkuil35631dc2009-02-19 14:56:37 -0300254 case 0:
255 adv7175_write(sd, 0x01, 0x00);
256
257 if (encoder->norm & V4L2_STD_NTSC)
258 set_subcarrier_freq(sd, 1);
259
260 adv7175_write(sd, 0x0c, TR1CAPT); /* TR1 */
261 if (encoder->norm & V4L2_STD_SECAM)
262 adv7175_write(sd, 0x0d, 0x49); /* Disable genlock */
263 else
264 adv7175_write(sd, 0x0d, 0x4f); /* Enable genlock */
265 adv7175_write(sd, 0x07, TR0MODE | TR0RST);
266 adv7175_write(sd, 0x07, TR0MODE);
267 /*udelay(10);*/
268 break;
269
270 case 1:
271 adv7175_write(sd, 0x01, 0x00);
272
273 if (encoder->norm & V4L2_STD_NTSC)
274 set_subcarrier_freq(sd, 0);
275
276 adv7175_write(sd, 0x0c, TR1PLAY); /* TR1 */
277 adv7175_write(sd, 0x0d, 0x49);
278 adv7175_write(sd, 0x07, TR0MODE | TR0RST);
279 adv7175_write(sd, 0x07, TR0MODE);
280 /* udelay(10); */
281 break;
282
283 case 2:
284 adv7175_write(sd, 0x01, 0x80);
285
286 if (encoder->norm & V4L2_STD_NTSC)
287 set_subcarrier_freq(sd, 0);
288
289 adv7175_write(sd, 0x0d, 0x49);
290 adv7175_write(sd, 0x07, TR0MODE | TR0RST);
291 adv7175_write(sd, 0x07, TR0MODE);
292 /* udelay(10); */
293 break;
294
295 default:
Hans Verkuil5325b422009-04-02 11:26:22 -0300296 v4l2_dbg(1, debug, sd, "illegal input: %d\n", input);
Hans Verkuil35631dc2009-02-19 14:56:37 -0300297 return -EINVAL;
298 }
Hans Verkuil5325b422009-04-02 11:26:22 -0300299 v4l2_dbg(1, debug, sd, "switched to %s\n", inputs[input]);
300 encoder->input = input;
Hans Verkuil35631dc2009-02-19 14:56:37 -0300301 return 0;
302}
303
Christian Gmeinerf1a84c92011-10-05 17:48:43 -0300304static int adv7175_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
305 enum v4l2_mbus_pixelcode *code)
306{
307 if (index >= ARRAY_SIZE(adv7175_codes))
308 return -EINVAL;
309
310 *code = adv7175_codes[index];
311 return 0;
312}
313
314static int adv7175_g_fmt(struct v4l2_subdev *sd,
315 struct v4l2_mbus_framefmt *mf)
316{
317 u8 val = adv7175_read(sd, 0x7);
318
319 if ((val & 0x40) == (1 << 6))
320 mf->code = V4L2_MBUS_FMT_UYVY8_1X16;
321 else
322 mf->code = V4L2_MBUS_FMT_UYVY8_2X8;
323
324 mf->colorspace = V4L2_COLORSPACE_SMPTE170M;
325 mf->width = 0;
326 mf->height = 0;
327 mf->field = V4L2_FIELD_ANY;
328
329 return 0;
330}
331
332static int adv7175_s_fmt(struct v4l2_subdev *sd,
333 struct v4l2_mbus_framefmt *mf)
334{
335 u8 val = adv7175_read(sd, 0x7);
336 int ret;
337
338 switch (mf->code) {
339 case V4L2_MBUS_FMT_UYVY8_2X8:
340 val &= ~0x40;
341 break;
342
343 case V4L2_MBUS_FMT_UYVY8_1X16:
344 val |= 0x40;
345 break;
346
347 default:
348 v4l2_dbg(1, debug, sd,
349 "illegal v4l2_mbus_framefmt code: %d\n", mf->code);
350 return -EINVAL;
351 }
352
353 ret = adv7175_write(sd, 0x7, val);
354
355 return ret;
356}
357
Hans Verkuil35631dc2009-02-19 14:56:37 -0300358static int adv7175_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip)
359{
360 struct i2c_client *client = v4l2_get_subdevdata(sd);
361
362 return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7175, 0);
363}
364
Christian Gmeinerb7eccc462011-01-08 18:45:35 -0300365static int adv7175_s_power(struct v4l2_subdev *sd, int on)
366{
367 if (on)
368 adv7175_write(sd, 0x01, 0x00);
369 else
370 adv7175_write(sd, 0x01, 0x78);
371
372 return 0;
373}
374
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375/* ----------------------------------------------------------------------- */
376
Hans Verkuil35631dc2009-02-19 14:56:37 -0300377static const struct v4l2_subdev_core_ops adv7175_core_ops = {
378 .g_chip_ident = adv7175_g_chip_ident,
379 .init = adv7175_init,
Christian Gmeinerb7eccc462011-01-08 18:45:35 -0300380 .s_power = adv7175_s_power,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382
Hans Verkuil35631dc2009-02-19 14:56:37 -0300383static const struct v4l2_subdev_video_ops adv7175_video_ops = {
384 .s_std_output = adv7175_s_std_output,
385 .s_routing = adv7175_s_routing,
Christian Gmeinerf1a84c92011-10-05 17:48:43 -0300386 .s_mbus_fmt = adv7175_s_fmt,
387 .g_mbus_fmt = adv7175_g_fmt,
388 .enum_mbus_fmt = adv7175_enum_fmt,
Hans Verkuil35631dc2009-02-19 14:56:37 -0300389};
390
391static const struct v4l2_subdev_ops adv7175_ops = {
392 .core = &adv7175_core_ops,
393 .video = &adv7175_video_ops,
394};
395
396/* ----------------------------------------------------------------------- */
Mauro Carvalho Chehabd56410e2006-03-25 09:19:53 -0300397
Hans Verkuilbba0d982008-09-07 07:58:46 -0300398static int adv7175_probe(struct i2c_client *client,
399 const struct i2c_device_id *id)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400{
401 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402 struct adv7175 *encoder;
Hans Verkuil35631dc2009-02-19 14:56:37 -0300403 struct v4l2_subdev *sd;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404
405 /* Check if the adapter supports the needed features */
Hans Verkuilbba0d982008-09-07 07:58:46 -0300406 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
407 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408
Hans Verkuilbba0d982008-09-07 07:58:46 -0300409 v4l_info(client, "chip found @ 0x%x (%s)\n",
410 client->addr << 1, client->adapter->name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
Panagiotis Issaris74081872006-01-11 19:40:56 -0200412 encoder = kzalloc(sizeof(struct adv7175), GFP_KERNEL);
Hans Verkuilbba0d982008-09-07 07:58:46 -0300413 if (encoder == NULL)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414 return -ENOMEM;
Hans Verkuil35631dc2009-02-19 14:56:37 -0300415 sd = &encoder->sd;
416 v4l2_i2c_subdev_init(sd, client, &adv7175_ops);
Hans Verkuil107063c2009-02-18 17:26:06 -0300417 encoder->norm = V4L2_STD_NTSC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418 encoder->input = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
Hans Verkuil35631dc2009-02-19 14:56:37 -0300420 i = adv7175_write_block(sd, init_common, sizeof(init_common));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421 if (i >= 0) {
Hans Verkuil35631dc2009-02-19 14:56:37 -0300422 i = adv7175_write(sd, 0x07, TR0MODE | TR0RST);
423 i = adv7175_write(sd, 0x07, TR0MODE);
424 i = adv7175_read(sd, 0x12);
425 v4l2_dbg(1, debug, sd, "revision %d\n", i & 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426 }
Hans Verkuilbba0d982008-09-07 07:58:46 -0300427 if (i < 0)
Hans Verkuil35631dc2009-02-19 14:56:37 -0300428 v4l2_dbg(1, debug, sd, "init error 0x%x\n", i);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429 return 0;
430}
431
Hans Verkuilbba0d982008-09-07 07:58:46 -0300432static int adv7175_remove(struct i2c_client *client)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433{
Hans Verkuil35631dc2009-02-19 14:56:37 -0300434 struct v4l2_subdev *sd = i2c_get_clientdata(client);
435
436 v4l2_device_unregister_subdev(sd);
437 kfree(to_adv7175(sd));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700438 return 0;
439}
440
441/* ----------------------------------------------------------------------- */
442
Hans Verkuilbba0d982008-09-07 07:58:46 -0300443static const struct i2c_device_id adv7175_id[] = {
444 { "adv7175", 0 },
445 { "adv7176", 0 },
446 { }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447};
Hans Verkuilbba0d982008-09-07 07:58:46 -0300448MODULE_DEVICE_TABLE(i2c, adv7175_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449
Hans Verkuildc714432010-09-15 15:29:53 -0300450static struct i2c_driver adv7175_driver = {
451 .driver = {
452 .owner = THIS_MODULE,
453 .name = "adv7175",
454 },
455 .probe = adv7175_probe,
456 .remove = adv7175_remove,
457 .id_table = adv7175_id,
Hans Verkuilbba0d982008-09-07 07:58:46 -0300458};
Hans Verkuildc714432010-09-15 15:29:53 -0300459
Axel Linc6e8d862012-02-12 06:56:32 -0300460module_i2c_driver(adv7175_driver);