aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorErik Andrén <erik.andren@gmail.com>2008-11-26 02:12:59 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:39:52 -0500
commitfce65f6515f049dea9451afaa0e85af01aecd190 (patch)
tree0074863f9aa4dd8951e51decaaf90d353e1e61d3 /drivers/media
parent6dc4cff0c391c691dae56486f854534658fdfea8 (diff)
V4L/DVB (10014): gspca - m5602: Remove all sensor specific write functions.
Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_mt9m111.c44
-rw-r--r--drivers/media/video/gspca/m5602/m5602_mt9m111.h3
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c44
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.h2
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.c42
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.h2
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.c44
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.h2
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k83a.c44
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k83a.h3
10 files changed, 0 insertions, 230 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c
index 0dedd3102a5..ae3b62ab452 100644
--- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c
+++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c
@@ -266,50 +266,6 @@ out:
266 return err; 266 return err;
267} 267}
268 268
269int mt9m111_write_sensor(struct sd *sd, const u8 address,
270 u8 *i2c_data, const u8 len)
271{
272 int err, i;
273 u8 *p;
274 struct usb_device *udev = sd->gspca_dev.dev;
275 __u8 *buf = sd->gspca_dev.usb_buf;
276
277 /* No sensor with a data width larger
278 than 16 bits has yet been seen, nor with 0 :p*/
279 if (len > 2 || !len)
280 return -EINVAL;
281
282 memcpy(buf, sensor_urb_skeleton,
283 sizeof(sensor_urb_skeleton));
284
285 buf[11] = sd->sensor->i2c_slave_id;
286 buf[15] = address;
287
288 p = buf + 16;
289
290 /* Copy a four byte write sequence for each byte to be written to */
291 for (i = 0; i < len; i++) {
292 memcpy(p, sensor_urb_skeleton + 16, 4);
293 p[3] = i2c_data[i];
294 p += 4;
295 PDEBUG(D_CONF, "Writing sensor register 0x%x with 0x%x",
296 address, i2c_data[i]);
297 }
298
299 /* Copy the tailer */
300 memcpy(p, sensor_urb_skeleton + 20, 4);
301
302 /* Set the total length */
303 p[3] = 0x10 + len;
304
305 err = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
306 0x04, 0x40, 0x19,
307 0x0000, buf,
308 20 + len * 4, M5602_URB_MSG_TIMEOUT);
309
310 return (err < 0) ? err : 0;
311}
312
313static void mt9m111_dump_registers(struct sd *sd) 269static void mt9m111_dump_registers(struct sd *sd)
314{ 270{
315 u8 address, value[2] = {0x00, 0x00}; 271 u8 address, value[2] = {0x00, 0x00};
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.h b/drivers/media/video/gspca/m5602/m5602_mt9m111.h
index 2c7b2a49c44..763b17ee617 100644
--- a/drivers/media/video/gspca/m5602/m5602_mt9m111.h
+++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.h
@@ -90,9 +90,6 @@ int mt9m111_power_down(struct sd *sd);
90int mt9m111_read_sensor(struct sd *sd, const u8 address, 90int mt9m111_read_sensor(struct sd *sd, const u8 address,
91 u8 *i2c_data, const u8 len); 91 u8 *i2c_data, const u8 len);
92 92
93int mt9m111_write_sensor(struct sd *sd, const u8 address,
94 u8 *i2c_data, const u8 len);
95
96int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val); 93int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
97int mt9m111_get_vflip(struct gspca_dev *gspca_dev, __s32 *val); 94int mt9m111_get_vflip(struct gspca_dev *gspca_dev, __s32 *val);
98int mt9m111_get_hflip(struct gspca_dev *gspca_dev, __s32 *val); 95int mt9m111_get_hflip(struct gspca_dev *gspca_dev, __s32 *val);
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 5324397daf8..197a2026ec5 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -102,50 +102,6 @@ out:
102 return (err < 0) ? err : 0; 102 return (err < 0) ? err : 0;
103} 103}
104 104
105int ov9650_write_sensor(struct sd *sd, const u8 address,
106 u8 *i2c_data, const u8 len)
107{
108 int err, i;
109 u8 *p;
110 struct usb_device *udev = sd->gspca_dev.dev;
111 __u8 *buf = sd->gspca_dev.usb_buf;
112
113 /* The ov9650 only supports one byte writes */
114 if (len > 1 || !len)
115 return -EINVAL;
116
117 memcpy(buf, sensor_urb_skeleton,
118 sizeof(sensor_urb_skeleton));
119
120 buf[11] = sd->sensor->i2c_slave_id;
121 buf[15] = address;
122
123 /* Special case larger sensor writes */
124 p = buf + 16;
125
126 /* Copy a four byte sequence for each byte to write over the I2C bus */
127 for (i = 0; i < len; i++) {
128 memcpy(p, sensor_urb_skeleton + 16, 4);
129 p[3] = i2c_data[i];
130 p += 4;
131 PDEBUG(D_CONF, "Writing sensor register 0x%x with 0x%x",
132 address, i2c_data[i]);
133 }
134
135 /* Copy the tailer */
136 memcpy(p, sensor_urb_skeleton + 20, 4);
137
138 /* Set the total length */
139 p[3] = 0x10 + len;
140
141 err = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
142 0x04, 0x40, 0x19,
143 0x0000, buf,
144 20 + len * 4, M5602_URB_MSG_TIMEOUT);
145
146 return (err < 0) ? err : 0;
147}
148
149int ov9650_probe(struct sd *sd) 105int ov9650_probe(struct sd *sd)
150{ 106{
151 u8 prod_id = 0, ver_id = 0, i; 107 u8 prod_id = 0, ver_id = 0, i;
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.h b/drivers/media/video/gspca/m5602/m5602_ov9650.h
index 293be3f7f76..1f33a7b8d6b 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.h
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.h
@@ -128,8 +128,6 @@ int ov9650_power_down(struct sd *sd);
128 128
129int ov9650_read_sensor(struct sd *sd, const u8 address, 129int ov9650_read_sensor(struct sd *sd, const u8 address,
130 u8 *i2c_data, const u8 len); 130 u8 *i2c_data, const u8 len);
131int ov9650_write_sensor(struct sd *sd, const u8 address,
132 u8 *i2c_data, const u8 len);
133 131
134int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val); 132int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val);
135int ov9650_get_exposure(struct gspca_dev *gspca_dev, __s32 *val); 133int ov9650_get_exposure(struct gspca_dev *gspca_dev, __s32 *val);
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.c b/drivers/media/video/gspca/m5602/m5602_po1030.c
index 2c65f0c37ff..f52a3cd3343 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.c
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.c
@@ -99,48 +99,6 @@ out:
99 return err; 99 return err;
100} 100}
101 101
102int po1030_write_sensor(struct sd *sd, const u8 address,
103 u8 *i2c_data, const u8 len)
104{
105 int err, i;
106 u8 *p;
107 struct usb_device *udev = sd->gspca_dev.dev;
108 __u8 *buf = sd->gspca_dev.usb_buf;
109
110 /* The po1030 only supports one byte writes */
111 if (len > 1 || !len)
112 return -EINVAL;
113
114 memcpy(buf, sensor_urb_skeleton, sizeof(sensor_urb_skeleton));
115
116 buf[11] = sd->sensor->i2c_slave_id;
117 buf[15] = address;
118
119 p = buf + 16;
120
121 /* Copy a four byte write sequence for each byte to be written to */
122 for (i = 0; i < len; i++) {
123 memcpy(p, sensor_urb_skeleton + 16, 4);
124 p[3] = i2c_data[i];
125 p += 4;
126 PDEBUG(D_CONF, "Writing sensor register 0x%x with 0x%x",
127 address, i2c_data[i]);
128 }
129
130 /* Copy the footer */
131 memcpy(p, sensor_urb_skeleton + 20, 4);
132
133 /* Set the total length */
134 p[3] = 0x10 + len;
135
136 err = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
137 0x04, 0x40, 0x19,
138 0x0000, buf,
139 20 + len * 4, M5602_URB_MSG_TIMEOUT);
140
141 return (err < 0) ? err : 0;
142}
143
144int po1030_init(struct sd *sd) 102int po1030_init(struct sd *sd)
145{ 103{
146 int i, err = 0; 104 int i, err = 0;
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.h b/drivers/media/video/gspca/m5602/m5602_po1030.h
index 3a49d15bd35..c4dad64496c 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.h
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.h
@@ -130,8 +130,6 @@ int po1030_power_down(struct sd *sd);
130 130
131int po1030_read_sensor(struct sd *sd, const u8 address, 131int po1030_read_sensor(struct sd *sd, const u8 address,
132 u8 *i2c_data, const u8 len); 132 u8 *i2c_data, const u8 len);
133int po1030_write_sensor(struct sd *sd, const u8 address,
134 u8 *i2c_data, const u8 len);
135 133
136int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val); 134int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val);
137int po1030_set_exposure(struct gspca_dev *gspca_dev, __s32 val); 135int po1030_set_exposure(struct gspca_dev *gspca_dev, __s32 val);
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index 1c85453463c..acc0514f6ed 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -159,50 +159,6 @@ out:
159 return err; 159 return err;
160} 160}
161 161
162int s5k4aa_write_sensor(struct sd *sd, const u8 address,
163 u8 *i2c_data, const u8 len)
164{
165 int err, i;
166 u8 *p;
167 struct usb_device *udev = sd->gspca_dev.dev;
168 __u8 *buf = sd->gspca_dev.usb_buf;
169
170 /* No sensor with a data width larger than 16 bits has yet been seen */
171 if (len > 2 || !len)
172 return -EINVAL;
173
174 memcpy(buf, sensor_urb_skeleton,
175 sizeof(sensor_urb_skeleton));
176
177 buf[11] = sd->sensor->i2c_slave_id;
178 buf[15] = address;
179
180 /* Special case larger sensor writes */
181 p = buf + 16;
182
183 /* Copy a four byte write sequence for each byte to be written to */
184 for (i = 0; i < len; i++) {
185 memcpy(p, sensor_urb_skeleton + 16, 4);
186 p[3] = i2c_data[i];
187 p += 4;
188 PDEBUG(D_CONF, "Writing sensor register 0x%x with 0x%x",
189 address, i2c_data[i]);
190 }
191
192 /* Copy the tailer */
193 memcpy(p, sensor_urb_skeleton + 20, 4);
194
195 /* Set the total length */
196 p[3] = 0x10 + len;
197
198 err = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
199 0x04, 0x40, 0x19,
200 0x0000, buf,
201 20 + len * 4, M5602_URB_MSG_TIMEOUT);
202
203 return (err < 0) ? err : 0;
204}
205
206int s5k4aa_init(struct sd *sd) 162int s5k4aa_init(struct sd *sd)
207{ 163{
208 int i, err = 0; 164 int i, err = 0;
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
index 3d04ff9b264..a38103a88e1 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
@@ -69,8 +69,6 @@ int s5k4aa_power_down(struct sd *sd);
69 69
70int s5k4aa_read_sensor(struct sd *sd, const u8 address, 70int s5k4aa_read_sensor(struct sd *sd, const u8 address,
71 u8 *i2c_data, const u8 len); 71 u8 *i2c_data, const u8 len);
72int s5k4aa_write_sensor(struct sd *sd, const u8 address,
73 u8 *i2c_data, const u8 len);
74 72
75int s5k4aa_get_exposure(struct gspca_dev *gspca_dev, __s32 *val); 73int s5k4aa_get_exposure(struct gspca_dev *gspca_dev, __s32 *val);
76int s5k4aa_set_exposure(struct gspca_dev *gspca_dev, __s32 val); 74int s5k4aa_set_exposure(struct gspca_dev *gspca_dev, __s32 val);
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c
index 84a648d707c..3723030744f 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k83a.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k83a.c
@@ -107,50 +107,6 @@ out:
107 return err; 107 return err;
108} 108}
109 109
110int s5k83a_write_sensor(struct sd *sd, const u8 address,
111 u8 *i2c_data, const u8 len)
112{
113 int err, i;
114 u8 *p;
115 struct usb_device *udev = sd->gspca_dev.dev;
116 __u8 *buf = sd->gspca_dev.usb_buf;
117
118 /* No sensor with a data width larger than 16 bits has yet been seen */
119 if (len > 2 || !len)
120 return -EINVAL;
121
122 memcpy(buf, sensor_urb_skeleton,
123 sizeof(sensor_urb_skeleton));
124
125 buf[11] = sd->sensor->i2c_slave_id;
126 buf[15] = address;
127
128 /* Special case larger sensor writes */
129 p = buf + 16;
130
131 /* Copy a four byte write sequence for each byte to be written to */
132 for (i = 0; i < len; i++) {
133 memcpy(p, sensor_urb_skeleton + 16, 4);
134 p[3] = i2c_data[i];
135 p += 4;
136 PDEBUG(D_CONF, "Writing sensor register 0x%x with 0x%x",
137 address, i2c_data[i]);
138 }
139
140 /* Copy the tailer */
141 memcpy(p, sensor_urb_skeleton + 20, 4);
142
143 /* Set the total length */
144 p[3] = 0x10 + len;
145
146 err = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
147 0x04, 0x40, 0x19,
148 0x0000, buf,
149 20 + len * 4, M5602_URB_MSG_TIMEOUT);
150
151 return (err < 0) ? err : 0;
152}
153
154int s5k83a_init(struct sd *sd) 110int s5k83a_init(struct sd *sd)
155{ 111{
156 int i, err = 0; 112 int i, err = 0;
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.h b/drivers/media/video/gspca/m5602/m5602_s5k83a.h
index 6a884d73ee7..73570112796 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k83a.h
+++ b/drivers/media/video/gspca/m5602/m5602_s5k83a.h
@@ -48,8 +48,6 @@ int s5k83a_power_down(struct sd *sd);
48 48
49int s5k83a_read_sensor(struct sd *sd, const u8 address, 49int s5k83a_read_sensor(struct sd *sd, const u8 address,
50 u8 *i2c_data, const u8 len); 50 u8 *i2c_data, const u8 len);
51int s5k83a_write_sensor(struct sd *sd, const u8 address,
52 u8 *i2c_data, const u8 len);
53 51
54int s5k83a_set_brightness(struct gspca_dev *gspca_dev, __s32 val); 52int s5k83a_set_brightness(struct gspca_dev *gspca_dev, __s32 val);
55int s5k83a_get_brightness(struct gspca_dev *gspca_dev, __s32 *val); 53int s5k83a_get_brightness(struct gspca_dev *gspca_dev, __s32 *val);
@@ -62,7 +60,6 @@ int s5k83a_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
62int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val); 60int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val);
63int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val); 61int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
64 62
65
66static struct m5602_sensor s5k83a = { 63static struct m5602_sensor s5k83a = {
67 .name = "S5K83A", 64 .name = "S5K83A",
68 .probe = s5k83a_probe, 65 .probe = s5k83a_probe,