aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/sn9c102/sn9c102_pas106b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/sn9c102/sn9c102_pas106b.c')
-rw-r--r--drivers/media/video/sn9c102/sn9c102_pas106b.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/media/video/sn9c102/sn9c102_pas106b.c b/drivers/media/video/sn9c102/sn9c102_pas106b.c
index 67151964801f..360f2a848bc0 100644
--- a/drivers/media/video/sn9c102/sn9c102_pas106b.c
+++ b/drivers/media/video/sn9c102/sn9c102_pas106b.c
@@ -163,7 +163,7 @@ static int pas106b_set_pix_format(struct sn9c102_device* cam,
163} 163}
164 164
165 165
166static struct sn9c102_sensor pas106b = { 166static const struct sn9c102_sensor pas106b = {
167 .name = "PAS106B", 167 .name = "PAS106B",
168 .maintainer = "Luca Risolia <luca.risolia@studio.unibo.it>", 168 .maintainer = "Luca Risolia <luca.risolia@studio.unibo.it>",
169 .supported_bridge = BRIDGE_SN9C101 | BRIDGE_SN9C102, 169 .supported_bridge = BRIDGE_SN9C101 | BRIDGE_SN9C102,
@@ -273,23 +273,21 @@ static struct sn9c102_sensor pas106b = {
273 273
274int sn9c102_probe_pas106b(struct sn9c102_device* cam) 274int sn9c102_probe_pas106b(struct sn9c102_device* cam)
275{ 275{
276 int r0 = 0, r1 = 0, err; 276 int r0 = 0, r1 = 0;
277 unsigned int pid = 0; 277 unsigned int pid = 0;
278 278
279 /* 279 /*
280 Minimal initialization to enable the I2C communication 280 Minimal initialization to enable the I2C communication
281 NOTE: do NOT change the values! 281 NOTE: do NOT change the values!
282 */ 282 */
283 err = sn9c102_write_const_regs(cam, 283 if (sn9c102_write_const_regs(cam,
284 {0x01, 0x01}, /* sensor power down */ 284 {0x01, 0x01}, /* sensor power down */
285 {0x00, 0x01}, /* sensor power on */ 285 {0x00, 0x01}, /* sensor power on */
286 {0x28, 0x17});/* sensor clock 24 MHz */ 286 {0x28, 0x17})) /* sensor clock at 24 MHz */
287 if (err)
288 return -EIO; 287 return -EIO;
289 288
290 r0 = sn9c102_i2c_try_read(cam, &pas106b, 0x00); 289 r0 = sn9c102_i2c_try_read(cam, &pas106b, 0x00);
291 r1 = sn9c102_i2c_try_read(cam, &pas106b, 0x01); 290 r1 = sn9c102_i2c_try_read(cam, &pas106b, 0x01);
292
293 if (r0 < 0 || r1 < 0) 291 if (r0 < 0 || r1 < 0)
294 return -EIO; 292 return -EIO;
295 293