]>
Commit | Line | Data |
---|---|---|
961b7146 AM |
1 | 30_bt832 |
2 | diff -u linux-2.4.23-pre7/drivers/media/video/bt832.c linux/drivers/media/video/bt832.c | |
3 | --- linux-2.4.23-pre7/drivers/media/video/bt832.c 2003-10-10 13:35:51.177543716 +0200 | |
4 | +++ linux/drivers/media/video/bt832.c 2003-10-10 15:04:24.029085890 +0200 | |
5 | @@ -1,5 +1,5 @@ | |
6 | /* Driver for Bt832 CMOS Camera Video Processor | |
7 | - i2c-adresses: 0x88 or 0x8a | |
8 | + i2c-addresses: 0x88 or 0x8a | |
9 | ||
10 | The BT832 interfaces to a Quartzsight Digital Camera (352x288, 25 or 30 fps) | |
11 | via a 9 pin connector ( 4-wire SDATA, 2-wire i2c, SCLK, VCC, GND). | |
12 | @@ -31,8 +31,9 @@ | |
13 | #include <linux/errno.h> | |
14 | #include <linux/slab.h> | |
15 | ||
16 | -#include "id.h" | |
17 | #include "audiochip.h" | |
18 | +#include "id.h" | |
19 | +#include "i2c-compat.h" | |
20 | #include "bttv.h" | |
21 | #include "bt832.h" | |
22 | ||
23 | @@ -184,7 +185,7 @@ | |
24 | return -ENOMEM; | |
25 | memset(t,0,sizeof(*t)); | |
26 | t->client = client_template; | |
27 | - t->client.data = t; | |
28 | + i2c_set_clientdata(&t->client, t); | |
29 | i2c_attach_client(&t->client); | |
30 | ||
31 | MOD_INC_USE_COUNT; | |
32 | @@ -198,30 +199,19 @@ | |
33 | ||
34 | static int bt832_probe(struct i2c_adapter *adap) | |
35 | { | |
36 | - int rc; | |
37 | - | |
38 | - printk("bt832_probe\n"); | |
39 | - | |
40 | - switch (adap->id) { | |
41 | - case I2C_ALGO_BIT | I2C_HW_B_BT848: | |
42 | - case I2C_ALGO_BIT | I2C_HW_B_RIVA: | |
43 | - case I2C_ALGO_SAA7134: | |
44 | - printk("bt832: probing %s i2c adapter [id=0x%x]\n", | |
45 | - adap->name,adap->id); | |
46 | - rc = i2c_probe(adap, &addr_data, bt832_attach); | |
47 | - break; | |
48 | - default: | |
49 | - printk("bt832: ignoring %s i2c adapter [id=0x%x]\n", | |
50 | - adap->name,adap->id); | |
51 | - rc = 0; | |
52 | - /* nothing */ | |
53 | - } | |
54 | - return rc; | |
55 | +#ifdef I2C_ADAP_CLASS_TV_ANALOG | |
56 | + if (adap->class & I2C_ADAP_CLASS_TV_ANALOG) | |
57 | + return i2c_probe(adap, &addr_data, bt832_attach); | |
58 | +#else | |
59 | + if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) | |
60 | + return i2c_probe(adap, &addr_data, bt832_attach); | |
61 | +#endif | |
62 | + return 0; | |
63 | } | |
64 | ||
65 | static int bt832_detach(struct i2c_client *client) | |
66 | { | |
67 | - struct bt832 *t = (struct bt832*)client->data; | |
68 | + struct bt832 *t = i2c_get_clientdata(client); | |
69 | ||
70 | printk("bt832: detach.\n"); | |
71 | i2c_detach_client(client); | |
72 | @@ -233,7 +223,7 @@ | |
73 | static int | |
74 | bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) | |
75 | { | |
76 | - struct bt832 *t = (struct bt832*)client->data; | |
77 | + struct bt832 *t = i2c_get_clientdata(client); | |
78 | ||
79 | printk("bt832: command %x\n",cmd); | |
80 | ||
81 | @@ -266,9 +256,9 @@ | |
82 | }; | |
83 | static struct i2c_client client_template = | |
84 | { | |
85 | - .name = "bt832", | |
86 | - .flags = I2C_CLIENT_ALLOW_USE, | |
87 | - .driver = &driver, | |
88 | + I2C_DEVNAME("bt832"), | |
89 | + .flags = I2C_CLIENT_ALLOW_USE, | |
90 | + .driver = &driver, | |
91 | }; | |
92 | ||
93 | ||
94 | @@ -286,3 +276,10 @@ | |
95 | module_init(bt832_init_module); | |
96 | module_exit(bt832_cleanup_module); | |
97 | ||
98 | +/* | |
99 | + * Overrides for Emacs so that we follow Linus's tabbing style. | |
100 | + * --------------------------------------------------------------------------- | |
101 | + * Local variables: | |
102 | + * c-basic-offset: 8 | |
103 | + * End: | |
104 | + */ | |
105 | diff -u linux-2.4.23-pre7/drivers/media/video/bt832.h linux/drivers/media/video/bt832.h | |
106 | --- linux-2.4.23-pre7/drivers/media/video/bt832.h 2003-10-10 13:36:28.454246091 +0200 | |
107 | +++ linux/drivers/media/video/bt832.h 2003-10-10 15:04:24.031085552 +0200 | |
108 | @@ -4,7 +4,7 @@ | |
109 | color digital camera directly to video capture devices via an 8-bit, | |
110 | 4:2:2 YUV or YCrCb video interface. | |
111 | ||
112 | - i2c adresses: 0x88 or 0x8a | |
113 | + i2c addresses: 0x88 or 0x8a | |
114 | */ | |
115 | ||
116 | /* The 64 registers: */ |