24 #include <linux/module.h>
25 #include <linux/kernel.h>
26 #include <linux/i2c.h>
27 #include <linux/videodev2.h>
28 #include <linux/slab.h>
66 static u8 upd64083_init[] = {
67 0x1f, 0x01, 0xa0, 0x2d, 0x29,
68 0x36, 0xdd, 0x05, 0x56, 0x48,
69 0x00, 0x3a, 0xa0, 0x05, 0x08,
70 0x44, 0x60, 0x08, 0x52, 0xf8,
83 v4l2_dbg(1,
debug, sd,
"write reg: %02x val: %02x\n", reg, val);
85 v4l2_err(sd,
"I/O error write 0x%02x/0x%02x\n", reg, val);
90 #ifdef CONFIG_VIDEO_ADV_DEBUG
93 struct i2c_client *client = v4l2_get_subdevdata(sd);
96 if (reg >=
sizeof(buf))
105 static int upd64083_s_routing(
struct v4l2_subdev *sd,
111 if (input > 7 || (input & 6) == 6)
113 state->
mode = (input & 3) << 6;
115 r00 = (state->
regs[
R00] & ~(3 << 6)) | state->
mode;
117 upd64083_write(sd,
R00, r00);
118 upd64083_write(sd,
R02, r02);
122 #ifdef CONFIG_VIDEO_ADV_DEBUG
125 struct i2c_client *client = v4l2_get_subdevdata(sd);
131 reg->
val = upd64083_read(sd, reg->
reg & 0xff);
138 struct i2c_client *client = v4l2_get_subdevdata(sd);
144 upd64083_write(sd, reg->
reg & 0xff, reg->
val & 0xff);
151 struct i2c_client *client = v4l2_get_subdevdata(sd);
156 static int upd64083_log_status(
struct v4l2_subdev *sd)
158 struct i2c_client *client = v4l2_get_subdevdata(sd);
162 v4l2_info(sd,
"Status: SA00=%02x SA01=%02x SA02=%02x SA03=%02x "
163 "SA04=%02x SA05=%02x SA06=%02x\n",
164 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
171 .log_status = upd64083_log_status,
172 .g_chip_ident = upd64083_g_chip_ident,
173 #ifdef CONFIG_VIDEO_ADV_DEBUG
174 .g_register = upd64083_g_register,
175 .s_register = upd64083_s_register,
180 .s_routing = upd64083_s_routing,
184 .core = &upd64083_core_ops,
185 .video = &upd64083_video_ops,
192 static int upd64083_probe(
struct i2c_client *client,
202 v4l_info(client,
"chip found @ 0x%x (%s)\n",
215 upd64083_write(sd, i, state->
regs[i]);
219 static int upd64083_remove(
struct i2c_client *client)
221 struct v4l2_subdev *sd = i2c_get_clientdata(client);
241 .probe = upd64083_probe,
242 .remove = upd64083_remove,
243 .id_table = upd64083_id,