31 #include <linux/module.h>
32 #include <linux/types.h>
33 #include <linux/slab.h>
35 #include <asm/uaccess.h>
36 #include <linux/i2c.h>
37 #include <linux/videodev2.h>
62 static int bt866_write(
struct bt866 *encoder,
u8 subaddr,
u8 data)
73 v4l_dbg(1,
debug, client,
"write 0x%02x = 0x%02x\n", subaddr, data);
75 for (err = 0; err < 3;) {
79 v4l_warn(client,
"error #%d writing to 0x%02x\n",
93 v4l2_dbg(1,
debug, sd,
"set norm %llx\n", (
unsigned long long)std);
113 0x70, 0xEB, 0x90, 0x80, 0xB0, 0x80,
114 0x72, 0xA2, 0x92, 0x8E, 0xB2, 0x2C,
115 0x74, 0x83, 0x94, 0x2C, 0xB4, 0x9C,
116 0x76, 0x70, 0x96, 0x3A, 0xB6, 0x48,
117 0x78, 0x54, 0x98, 0xC6, 0xB8, 0xB8,
118 0x7A, 0x41, 0x9A, 0xD4, 0xBA, 0x64,
119 0x7C, 0x23, 0x9C, 0x72, 0xBC, 0xD4,
120 0x7E, 0x10, 0x9E, 0x80, 0xBE, 0x80,
122 0x60, 0xEB, 0x80, 0x80, 0xc0, 0x80,
123 0x62, 0xA2, 0x82, 0x8E, 0xc2, 0x2C,
124 0x64, 0x83, 0x84, 0x2C, 0xc4, 0x9C,
125 0x66, 0x70, 0x86, 0x3A, 0xc6, 0x48,
126 0x68, 0x54, 0x88, 0xC6, 0xc8, 0xB8,
127 0x6A, 0x41, 0x8A, 0xD4, 0xcA, 0x64,
128 0x6C, 0x23, 0x8C, 0x72, 0xcC, 0xD4,
129 0x6E, 0x10, 0x8E, 0x80, 0xcE, 0x80,
131 struct bt866 *encoder = to_bt866(sd);
136 bt866_write(encoder, init[i], init[i+1]);
138 val = encoder->
reg[0xdc];
145 bt866_write(encoder, 0xdc, val);
147 val = encoder->
reg[0xcc];
152 bt866_write(encoder, 0xcc, val);
170 val = encoder->
reg[0xdc];
175 bt866_write(client, 0xdc, val);
180 struct i2c_client *client = v4l2_get_subdevdata(sd);
188 .g_chip_ident = bt866_g_chip_ident,
192 .s_std_output = bt866_s_std_output,
193 .s_routing = bt866_s_routing,
197 .core = &bt866_core_ops,
198 .video = &bt866_video_ops,
201 static int bt866_probe(
struct i2c_client *client,
204 struct bt866 *encoder;
207 v4l_info(client,
"chip found @ 0x%x (%s)\n",
210 encoder = kzalloc(
sizeof(*encoder),
GFP_KERNEL);
218 static int bt866_remove(
struct i2c_client *client)
220 struct v4l2_subdev *sd = i2c_get_clientdata(client);
238 .probe = bt866_probe,
239 .remove = bt866_remove,
240 .id_table = bt866_id,