18 #include <linux/module.h>
20 #include <linux/i2c.h>
21 #include <linux/videodev2.h>
23 #include <linux/slab.h>
35 static u8 initial_registers[] =
114 for (i = 0; regs[
i] != 0x00; i += 2)
120 static int wis_saa7113_command(
struct i2c_client *client,
121 unsigned int cmd,
void *
arg)
123 struct wis_saa7113 *dec = i2c_get_clientdata(client);
132 *input < 6 ? 0x40 : 0x80);
201 if (ctrl->
value > 255)
203 else if (ctrl->
value < 0)
210 if (ctrl->
value > 127)
212 else if (ctrl->
value < 0)
219 if (ctrl->
value > 127)
221 else if (ctrl->
value < 0)
228 if (ctrl->
value > 127)
230 else if (ctrl->
value < -128)
265 static int wis_saa7113_probe(
struct i2c_client *client,
283 i2c_set_clientdata(client, dec);
286 "wis-saa7113: initializing SAA7113 at address %d on %s\n",
289 if (write_regs(client, initial_registers) < 0) {
291 "wis-saa7113: error initializing SAA7113\n");
299 static int wis_saa7113_remove(
struct i2c_client *client)
301 struct wis_saa7113 *dec = i2c_get_clientdata(client);
308 {
"wis_saa7113", 0 },
313 static struct i2c_driver wis_saa7113_driver = {
315 .name =
"WIS SAA7113 I2C driver",
317 .probe = wis_saa7113_probe,
318 .remove = wis_saa7113_remove,
319 .command = wis_saa7113_command,
320 .id_table = wis_saa7113_id,
323 static int __init wis_saa7113_init(
void)
325 return i2c_add_driver(&wis_saa7113_driver);
328 static void __exit wis_saa7113_cleanup(
void)