diff options
author | Erik Andrén <erik.andren@gmail.com> | 2008-11-26 02:12:59 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:39:52 -0500 |
commit | fce65f6515f049dea9451afaa0e85af01aecd190 (patch) | |
tree | 0074863f9aa4dd8951e51decaaf90d353e1e61d3 /drivers/media/video/gspca/m5602/m5602_s5k83a.c | |
parent | 6dc4cff0c391c691dae56486f854534658fdfea8 (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/video/gspca/m5602/m5602_s5k83a.c')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_s5k83a.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c index 84a648d707c8..3723030744f4 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 | ||
110 | int 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 | |||
154 | int s5k83a_init(struct sd *sd) | 110 | int s5k83a_init(struct sd *sd) |
155 | { | 111 | { |
156 | int i, err = 0; | 112 | int i, err = 0; |