1d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
2cb7a01acSMauro Carvalho Chehab /*
3cb7a01acSMauro Carvalho Chehab * Driver for AK8813 / AK8814 TV-ecoders from Asahi Kasei Microsystems Co., Ltd. (AKM)
4cb7a01acSMauro Carvalho Chehab *
5cb7a01acSMauro Carvalho Chehab * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
6cb7a01acSMauro Carvalho Chehab */
7cb7a01acSMauro Carvalho Chehab
8cb7a01acSMauro Carvalho Chehab #include <linux/i2c.h>
9cb7a01acSMauro Carvalho Chehab #include <linux/init.h>
10cb7a01acSMauro Carvalho Chehab #include <linux/platform_device.h>
11cb7a01acSMauro Carvalho Chehab #include <linux/slab.h>
12cb7a01acSMauro Carvalho Chehab #include <linux/videodev2.h>
13cb7a01acSMauro Carvalho Chehab #include <linux/module.h>
14cb7a01acSMauro Carvalho Chehab
15b5dcee22SMauro Carvalho Chehab #include <media/i2c/ak881x.h>
16cb7a01acSMauro Carvalho Chehab #include <media/v4l2-common.h>
17cb7a01acSMauro Carvalho Chehab #include <media/v4l2-device.h>
18cb7a01acSMauro Carvalho Chehab
19cb7a01acSMauro Carvalho Chehab #define AK881X_INTERFACE_MODE 0
20cb7a01acSMauro Carvalho Chehab #define AK881X_VIDEO_PROCESS1 1
21cb7a01acSMauro Carvalho Chehab #define AK881X_VIDEO_PROCESS2 2
22cb7a01acSMauro Carvalho Chehab #define AK881X_VIDEO_PROCESS3 3
23cb7a01acSMauro Carvalho Chehab #define AK881X_DAC_MODE 5
24cb7a01acSMauro Carvalho Chehab #define AK881X_STATUS 0x24
25cb7a01acSMauro Carvalho Chehab #define AK881X_DEVICE_ID 0x25
26cb7a01acSMauro Carvalho Chehab #define AK881X_DEVICE_REVISION 0x26
27cb7a01acSMauro Carvalho Chehab
28cb7a01acSMauro Carvalho Chehab struct ak881x {
29cb7a01acSMauro Carvalho Chehab struct v4l2_subdev subdev;
30cb7a01acSMauro Carvalho Chehab struct ak881x_pdata *pdata;
31cb7a01acSMauro Carvalho Chehab unsigned int lines;
32cb7a01acSMauro Carvalho Chehab char revision; /* DEVICE_REVISION content */
33cb7a01acSMauro Carvalho Chehab };
34cb7a01acSMauro Carvalho Chehab
reg_read(struct i2c_client * client,const u8 reg)35cb7a01acSMauro Carvalho Chehab static int reg_read(struct i2c_client *client, const u8 reg)
36cb7a01acSMauro Carvalho Chehab {
37cb7a01acSMauro Carvalho Chehab return i2c_smbus_read_byte_data(client, reg);
38cb7a01acSMauro Carvalho Chehab }
39cb7a01acSMauro Carvalho Chehab
reg_write(struct i2c_client * client,const u8 reg,const u8 data)40cb7a01acSMauro Carvalho Chehab static int reg_write(struct i2c_client *client, const u8 reg,
41cb7a01acSMauro Carvalho Chehab const u8 data)
42cb7a01acSMauro Carvalho Chehab {
43cb7a01acSMauro Carvalho Chehab return i2c_smbus_write_byte_data(client, reg, data);
44cb7a01acSMauro Carvalho Chehab }
45cb7a01acSMauro Carvalho Chehab
reg_set(struct i2c_client * client,const u8 reg,const u8 data,u8 mask)46cb7a01acSMauro Carvalho Chehab static int reg_set(struct i2c_client *client, const u8 reg,
47cb7a01acSMauro Carvalho Chehab const u8 data, u8 mask)
48cb7a01acSMauro Carvalho Chehab {
49cb7a01acSMauro Carvalho Chehab int ret = reg_read(client, reg);
50cb7a01acSMauro Carvalho Chehab if (ret < 0)
51cb7a01acSMauro Carvalho Chehab return ret;
52cb7a01acSMauro Carvalho Chehab return reg_write(client, reg, (ret & ~mask) | (data & mask));
53cb7a01acSMauro Carvalho Chehab }
54cb7a01acSMauro Carvalho Chehab
to_ak881x(const struct i2c_client * client)55cb7a01acSMauro Carvalho Chehab static struct ak881x *to_ak881x(const struct i2c_client *client)
56cb7a01acSMauro Carvalho Chehab {
57cb7a01acSMauro Carvalho Chehab return container_of(i2c_get_clientdata(client), struct ak881x, subdev);
58cb7a01acSMauro Carvalho Chehab }
59cb7a01acSMauro Carvalho Chehab
60cb7a01acSMauro Carvalho Chehab #ifdef CONFIG_VIDEO_ADV_DEBUG
ak881x_g_register(struct v4l2_subdev * sd,struct v4l2_dbg_register * reg)61cb7a01acSMauro Carvalho Chehab static int ak881x_g_register(struct v4l2_subdev *sd,
62cb7a01acSMauro Carvalho Chehab struct v4l2_dbg_register *reg)
63cb7a01acSMauro Carvalho Chehab {
64cb7a01acSMauro Carvalho Chehab struct i2c_client *client = v4l2_get_subdevdata(sd);
65cb7a01acSMauro Carvalho Chehab
66e1277110SHans Verkuil if (reg->reg > 0x26)
67cb7a01acSMauro Carvalho Chehab return -EINVAL;
68cb7a01acSMauro Carvalho Chehab
6915c4fee3SHans Verkuil reg->size = 1;
70cb7a01acSMauro Carvalho Chehab reg->val = reg_read(client, reg->reg);
71cb7a01acSMauro Carvalho Chehab
72cb7a01acSMauro Carvalho Chehab if (reg->val > 0xffff)
73cb7a01acSMauro Carvalho Chehab return -EIO;
74cb7a01acSMauro Carvalho Chehab
75cb7a01acSMauro Carvalho Chehab return 0;
76cb7a01acSMauro Carvalho Chehab }
77cb7a01acSMauro Carvalho Chehab
ak881x_s_register(struct v4l2_subdev * sd,const struct v4l2_dbg_register * reg)78cb7a01acSMauro Carvalho Chehab static int ak881x_s_register(struct v4l2_subdev *sd,
79977ba3b1SHans Verkuil const struct v4l2_dbg_register *reg)
80cb7a01acSMauro Carvalho Chehab {
81cb7a01acSMauro Carvalho Chehab struct i2c_client *client = v4l2_get_subdevdata(sd);
82cb7a01acSMauro Carvalho Chehab
83e1277110SHans Verkuil if (reg->reg > 0x26)
84cb7a01acSMauro Carvalho Chehab return -EINVAL;
85cb7a01acSMauro Carvalho Chehab
86cb7a01acSMauro Carvalho Chehab if (reg_write(client, reg->reg, reg->val) < 0)
87cb7a01acSMauro Carvalho Chehab return -EIO;
88cb7a01acSMauro Carvalho Chehab
89cb7a01acSMauro Carvalho Chehab return 0;
90cb7a01acSMauro Carvalho Chehab }
91cb7a01acSMauro Carvalho Chehab #endif
92cb7a01acSMauro Carvalho Chehab
ak881x_fill_fmt(struct v4l2_subdev * sd,struct v4l2_subdev_state * sd_state,struct v4l2_subdev_format * format)93da298c6dSHans Verkuil static int ak881x_fill_fmt(struct v4l2_subdev *sd,
940d346d2aSTomi Valkeinen struct v4l2_subdev_state *sd_state,
95da298c6dSHans Verkuil struct v4l2_subdev_format *format)
96cb7a01acSMauro Carvalho Chehab {
97da298c6dSHans Verkuil struct v4l2_mbus_framefmt *mf = &format->format;
98cb7a01acSMauro Carvalho Chehab struct i2c_client *client = v4l2_get_subdevdata(sd);
99cb7a01acSMauro Carvalho Chehab struct ak881x *ak881x = to_ak881x(client);
100cb7a01acSMauro Carvalho Chehab
101da298c6dSHans Verkuil if (format->pad)
102da298c6dSHans Verkuil return -EINVAL;
103da298c6dSHans Verkuil
104cb7a01acSMauro Carvalho Chehab v4l_bound_align_image(&mf->width, 0, 720, 2,
105cb7a01acSMauro Carvalho Chehab &mf->height, 0, ak881x->lines, 1, 0);
106cb7a01acSMauro Carvalho Chehab mf->field = V4L2_FIELD_INTERLACED;
107f5fe58fdSBoris BREZILLON mf->code = MEDIA_BUS_FMT_YUYV8_2X8;
108cb7a01acSMauro Carvalho Chehab mf->colorspace = V4L2_COLORSPACE_SMPTE170M;
109cb7a01acSMauro Carvalho Chehab
110cb7a01acSMauro Carvalho Chehab return 0;
111cb7a01acSMauro Carvalho Chehab }
112cb7a01acSMauro Carvalho Chehab
ak881x_enum_mbus_code(struct v4l2_subdev * sd,struct v4l2_subdev_state * sd_state,struct v4l2_subdev_mbus_code_enum * code)113ebcff5fcSHans Verkuil static int ak881x_enum_mbus_code(struct v4l2_subdev *sd,
1140d346d2aSTomi Valkeinen struct v4l2_subdev_state *sd_state,
115ebcff5fcSHans Verkuil struct v4l2_subdev_mbus_code_enum *code)
116cb7a01acSMauro Carvalho Chehab {
117ebcff5fcSHans Verkuil if (code->pad || code->index)
118cb7a01acSMauro Carvalho Chehab return -EINVAL;
119cb7a01acSMauro Carvalho Chehab
120ebcff5fcSHans Verkuil code->code = MEDIA_BUS_FMT_YUYV8_2X8;
121cb7a01acSMauro Carvalho Chehab return 0;
122cb7a01acSMauro Carvalho Chehab }
123cb7a01acSMauro Carvalho Chehab
ak881x_get_selection(struct v4l2_subdev * sd,struct v4l2_subdev_state * sd_state,struct v4l2_subdev_selection * sel)12410d5509cSHans Verkuil static int ak881x_get_selection(struct v4l2_subdev *sd,
1250d346d2aSTomi Valkeinen struct v4l2_subdev_state *sd_state,
12610d5509cSHans Verkuil struct v4l2_subdev_selection *sel)
127cb7a01acSMauro Carvalho Chehab {
128cb7a01acSMauro Carvalho Chehab struct i2c_client *client = v4l2_get_subdevdata(sd);
129cb7a01acSMauro Carvalho Chehab struct ak881x *ak881x = to_ak881x(client);
130cb7a01acSMauro Carvalho Chehab
13110d5509cSHans Verkuil if (sel->which != V4L2_SUBDEV_FORMAT_ACTIVE)
13210d5509cSHans Verkuil return -EINVAL;
133cb7a01acSMauro Carvalho Chehab
13410d5509cSHans Verkuil switch (sel->target) {
13510d5509cSHans Verkuil case V4L2_SEL_TGT_CROP_BOUNDS:
13610d5509cSHans Verkuil sel->r.left = 0;
13710d5509cSHans Verkuil sel->r.top = 0;
13810d5509cSHans Verkuil sel->r.width = 720;
13910d5509cSHans Verkuil sel->r.height = ak881x->lines;
140cb7a01acSMauro Carvalho Chehab return 0;
14110d5509cSHans Verkuil default:
14210d5509cSHans Verkuil return -EINVAL;
14310d5509cSHans Verkuil }
144cb7a01acSMauro Carvalho Chehab }
145cb7a01acSMauro Carvalho Chehab
ak881x_s_std_output(struct v4l2_subdev * sd,v4l2_std_id std)146cb7a01acSMauro Carvalho Chehab static int ak881x_s_std_output(struct v4l2_subdev *sd, v4l2_std_id std)
147cb7a01acSMauro Carvalho Chehab {
148cb7a01acSMauro Carvalho Chehab struct i2c_client *client = v4l2_get_subdevdata(sd);
149cb7a01acSMauro Carvalho Chehab struct ak881x *ak881x = to_ak881x(client);
150cb7a01acSMauro Carvalho Chehab u8 vp1;
151cb7a01acSMauro Carvalho Chehab
152cb7a01acSMauro Carvalho Chehab if (std == V4L2_STD_NTSC_443) {
153cb7a01acSMauro Carvalho Chehab vp1 = 3;
154cb7a01acSMauro Carvalho Chehab ak881x->lines = 480;
155cb7a01acSMauro Carvalho Chehab } else if (std == V4L2_STD_PAL_M) {
156cb7a01acSMauro Carvalho Chehab vp1 = 5;
157cb7a01acSMauro Carvalho Chehab ak881x->lines = 480;
158cb7a01acSMauro Carvalho Chehab } else if (std == V4L2_STD_PAL_60) {
159cb7a01acSMauro Carvalho Chehab vp1 = 7;
160cb7a01acSMauro Carvalho Chehab ak881x->lines = 480;
161517ef255SHans Verkuil } else if (std & V4L2_STD_NTSC) {
162cb7a01acSMauro Carvalho Chehab vp1 = 0;
163cb7a01acSMauro Carvalho Chehab ak881x->lines = 480;
164517ef255SHans Verkuil } else if (std & V4L2_STD_PAL) {
165517ef255SHans Verkuil vp1 = 0xf;
166517ef255SHans Verkuil ak881x->lines = 576;
167cb7a01acSMauro Carvalho Chehab } else {
168cb7a01acSMauro Carvalho Chehab /* No SECAM or PAL_N/Nc supported */
169cb7a01acSMauro Carvalho Chehab return -EINVAL;
170cb7a01acSMauro Carvalho Chehab }
171cb7a01acSMauro Carvalho Chehab
172cb7a01acSMauro Carvalho Chehab reg_set(client, AK881X_VIDEO_PROCESS1, vp1, 0xf);
173cb7a01acSMauro Carvalho Chehab
174cb7a01acSMauro Carvalho Chehab return 0;
175cb7a01acSMauro Carvalho Chehab }
176cb7a01acSMauro Carvalho Chehab
ak881x_s_stream(struct v4l2_subdev * sd,int enable)177cb7a01acSMauro Carvalho Chehab static int ak881x_s_stream(struct v4l2_subdev *sd, int enable)
178cb7a01acSMauro Carvalho Chehab {
179cb7a01acSMauro Carvalho Chehab struct i2c_client *client = v4l2_get_subdevdata(sd);
180cb7a01acSMauro Carvalho Chehab struct ak881x *ak881x = to_ak881x(client);
181cb7a01acSMauro Carvalho Chehab
182cb7a01acSMauro Carvalho Chehab if (enable) {
183cb7a01acSMauro Carvalho Chehab u8 dac;
184cb7a01acSMauro Carvalho Chehab /* For colour-bar testing set bit 6 of AK881X_VIDEO_PROCESS1 */
185cb7a01acSMauro Carvalho Chehab /* Default: composite output */
186cb7a01acSMauro Carvalho Chehab if (ak881x->pdata->flags & AK881X_COMPONENT)
187cb7a01acSMauro Carvalho Chehab dac = 3;
188cb7a01acSMauro Carvalho Chehab else
189cb7a01acSMauro Carvalho Chehab dac = 4;
190cb7a01acSMauro Carvalho Chehab /* Turn on the DAC(s) */
191cb7a01acSMauro Carvalho Chehab reg_write(client, AK881X_DAC_MODE, dac);
192cb7a01acSMauro Carvalho Chehab dev_dbg(&client->dev, "chip status 0x%x\n",
193cb7a01acSMauro Carvalho Chehab reg_read(client, AK881X_STATUS));
194cb7a01acSMauro Carvalho Chehab } else {
195cb7a01acSMauro Carvalho Chehab /* ...and clear bit 6 of AK881X_VIDEO_PROCESS1 here */
196cb7a01acSMauro Carvalho Chehab reg_write(client, AK881X_DAC_MODE, 0);
197cb7a01acSMauro Carvalho Chehab dev_dbg(&client->dev, "chip status 0x%x\n",
198cb7a01acSMauro Carvalho Chehab reg_read(client, AK881X_STATUS));
199cb7a01acSMauro Carvalho Chehab }
200cb7a01acSMauro Carvalho Chehab
201cb7a01acSMauro Carvalho Chehab return 0;
202cb7a01acSMauro Carvalho Chehab }
203cb7a01acSMauro Carvalho Chehab
2044d7aa5e9SBhumika Goyal static const struct v4l2_subdev_core_ops ak881x_subdev_core_ops = {
205cb7a01acSMauro Carvalho Chehab #ifdef CONFIG_VIDEO_ADV_DEBUG
206cb7a01acSMauro Carvalho Chehab .g_register = ak881x_g_register,
207cb7a01acSMauro Carvalho Chehab .s_register = ak881x_s_register,
208cb7a01acSMauro Carvalho Chehab #endif
209cb7a01acSMauro Carvalho Chehab };
210cb7a01acSMauro Carvalho Chehab
2114d7aa5e9SBhumika Goyal static const struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {
212cb7a01acSMauro Carvalho Chehab .s_std_output = ak881x_s_std_output,
213cb7a01acSMauro Carvalho Chehab .s_stream = ak881x_s_stream,
214cb7a01acSMauro Carvalho Chehab };
215cb7a01acSMauro Carvalho Chehab
216ebcff5fcSHans Verkuil static const struct v4l2_subdev_pad_ops ak881x_subdev_pad_ops = {
217ebcff5fcSHans Verkuil .enum_mbus_code = ak881x_enum_mbus_code,
21810d5509cSHans Verkuil .get_selection = ak881x_get_selection,
219da298c6dSHans Verkuil .set_fmt = ak881x_fill_fmt,
220da298c6dSHans Verkuil .get_fmt = ak881x_fill_fmt,
221ebcff5fcSHans Verkuil };
222ebcff5fcSHans Verkuil
2234d7aa5e9SBhumika Goyal static const struct v4l2_subdev_ops ak881x_subdev_ops = {
224cb7a01acSMauro Carvalho Chehab .core = &ak881x_subdev_core_ops,
225cb7a01acSMauro Carvalho Chehab .video = &ak881x_subdev_video_ops,
226ebcff5fcSHans Verkuil .pad = &ak881x_subdev_pad_ops,
227cb7a01acSMauro Carvalho Chehab };
228cb7a01acSMauro Carvalho Chehab
ak881x_probe(struct i2c_client * client)229da6381baSUwe Kleine-König static int ak881x_probe(struct i2c_client *client)
230cb7a01acSMauro Carvalho Chehab {
2315197051fSWolfram Sang struct i2c_adapter *adapter = client->adapter;
232cb7a01acSMauro Carvalho Chehab struct ak881x *ak881x;
233cb7a01acSMauro Carvalho Chehab u8 ifmode, data;
234cb7a01acSMauro Carvalho Chehab
235cb7a01acSMauro Carvalho Chehab if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
236cb7a01acSMauro Carvalho Chehab dev_warn(&adapter->dev,
237cb7a01acSMauro Carvalho Chehab "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
238cb7a01acSMauro Carvalho Chehab return -EIO;
239cb7a01acSMauro Carvalho Chehab }
240cb7a01acSMauro Carvalho Chehab
241c02b211dSLaurent Pinchart ak881x = devm_kzalloc(&client->dev, sizeof(*ak881x), GFP_KERNEL);
242cb7a01acSMauro Carvalho Chehab if (!ak881x)
243cb7a01acSMauro Carvalho Chehab return -ENOMEM;
244cb7a01acSMauro Carvalho Chehab
245cb7a01acSMauro Carvalho Chehab v4l2_i2c_subdev_init(&ak881x->subdev, client, &ak881x_subdev_ops);
246cb7a01acSMauro Carvalho Chehab
247cb7a01acSMauro Carvalho Chehab data = reg_read(client, AK881X_DEVICE_ID);
248cb7a01acSMauro Carvalho Chehab
249cb7a01acSMauro Carvalho Chehab switch (data) {
250cb7a01acSMauro Carvalho Chehab case 0x13:
251cb7a01acSMauro Carvalho Chehab case 0x14:
252cb7a01acSMauro Carvalho Chehab break;
253cb7a01acSMauro Carvalho Chehab default:
254cb7a01acSMauro Carvalho Chehab dev_err(&client->dev,
255cb7a01acSMauro Carvalho Chehab "No ak881x chip detected, register read %x\n", data);
256cb7a01acSMauro Carvalho Chehab return -ENODEV;
257cb7a01acSMauro Carvalho Chehab }
258cb7a01acSMauro Carvalho Chehab
259cb7a01acSMauro Carvalho Chehab ak881x->revision = reg_read(client, AK881X_DEVICE_REVISION);
260cb7a01acSMauro Carvalho Chehab ak881x->pdata = client->dev.platform_data;
261cb7a01acSMauro Carvalho Chehab
262cb7a01acSMauro Carvalho Chehab if (ak881x->pdata) {
263cb7a01acSMauro Carvalho Chehab if (ak881x->pdata->flags & AK881X_FIELD)
264cb7a01acSMauro Carvalho Chehab ifmode = 4;
265cb7a01acSMauro Carvalho Chehab else
266cb7a01acSMauro Carvalho Chehab ifmode = 0;
267cb7a01acSMauro Carvalho Chehab
268cb7a01acSMauro Carvalho Chehab switch (ak881x->pdata->flags & AK881X_IF_MODE_MASK) {
269cb7a01acSMauro Carvalho Chehab case AK881X_IF_MODE_BT656:
270cb7a01acSMauro Carvalho Chehab ifmode |= 1;
271cb7a01acSMauro Carvalho Chehab break;
272cb7a01acSMauro Carvalho Chehab case AK881X_IF_MODE_MASTER:
273cb7a01acSMauro Carvalho Chehab ifmode |= 2;
274cb7a01acSMauro Carvalho Chehab break;
275cb7a01acSMauro Carvalho Chehab case AK881X_IF_MODE_SLAVE:
276cb7a01acSMauro Carvalho Chehab default:
277cb7a01acSMauro Carvalho Chehab break;
278cb7a01acSMauro Carvalho Chehab }
279cb7a01acSMauro Carvalho Chehab
280cb7a01acSMauro Carvalho Chehab dev_dbg(&client->dev, "IF mode %x\n", ifmode);
281cb7a01acSMauro Carvalho Chehab
282cb7a01acSMauro Carvalho Chehab /*
283cb7a01acSMauro Carvalho Chehab * "Line Blanking No." seems to be the same as the number of
284cb7a01acSMauro Carvalho Chehab * "black" lines on, e.g., SuperH VOU, whose default value of 20
285cb7a01acSMauro Carvalho Chehab * "incidentally" matches ak881x' default
286cb7a01acSMauro Carvalho Chehab */
287cb7a01acSMauro Carvalho Chehab reg_write(client, AK881X_INTERFACE_MODE, ifmode | (20 << 3));
288cb7a01acSMauro Carvalho Chehab }
289cb7a01acSMauro Carvalho Chehab
290cb7a01acSMauro Carvalho Chehab /* Hardware default: NTSC-M */
291cb7a01acSMauro Carvalho Chehab ak881x->lines = 480;
292cb7a01acSMauro Carvalho Chehab
293cb7a01acSMauro Carvalho Chehab dev_info(&client->dev, "Detected an ak881x chip ID %x, revision %x\n",
294cb7a01acSMauro Carvalho Chehab data, ak881x->revision);
295cb7a01acSMauro Carvalho Chehab
296cb7a01acSMauro Carvalho Chehab return 0;
297cb7a01acSMauro Carvalho Chehab }
298cb7a01acSMauro Carvalho Chehab
ak881x_remove(struct i2c_client * client)299ed5c2f5fSUwe Kleine-König static void ak881x_remove(struct i2c_client *client)
300cb7a01acSMauro Carvalho Chehab {
301cb7a01acSMauro Carvalho Chehab struct ak881x *ak881x = to_ak881x(client);
302cb7a01acSMauro Carvalho Chehab
303cb7a01acSMauro Carvalho Chehab v4l2_device_unregister_subdev(&ak881x->subdev);
304cb7a01acSMauro Carvalho Chehab }
305cb7a01acSMauro Carvalho Chehab
306cb7a01acSMauro Carvalho Chehab static const struct i2c_device_id ak881x_id[] = {
307cb7a01acSMauro Carvalho Chehab { "ak8813", 0 },
308cb7a01acSMauro Carvalho Chehab { "ak8814", 0 },
309cb7a01acSMauro Carvalho Chehab { }
310cb7a01acSMauro Carvalho Chehab };
311cb7a01acSMauro Carvalho Chehab MODULE_DEVICE_TABLE(i2c, ak881x_id);
312cb7a01acSMauro Carvalho Chehab
313cb7a01acSMauro Carvalho Chehab static struct i2c_driver ak881x_i2c_driver = {
314cb7a01acSMauro Carvalho Chehab .driver = {
315cb7a01acSMauro Carvalho Chehab .name = "ak881x",
316cb7a01acSMauro Carvalho Chehab },
317*aaeb31c0SUwe Kleine-König .probe = ak881x_probe,
318cb7a01acSMauro Carvalho Chehab .remove = ak881x_remove,
319cb7a01acSMauro Carvalho Chehab .id_table = ak881x_id,
320cb7a01acSMauro Carvalho Chehab };
321cb7a01acSMauro Carvalho Chehab
322cb7a01acSMauro Carvalho Chehab module_i2c_driver(ak881x_i2c_driver);
323cb7a01acSMauro Carvalho Chehab
324cb7a01acSMauro Carvalho Chehab MODULE_DESCRIPTION("TV-output driver for ak8813/ak8814");
325cb7a01acSMauro Carvalho Chehab MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
326cb7a01acSMauro Carvalho Chehab MODULE_LICENSE("GPL v2");
327