diff options
Diffstat (limited to 'drivers/media/video/sn9c102/sn9c102_ov7630.c')
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_ov7630.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/media/video/sn9c102/sn9c102_ov7630.c b/drivers/media/video/sn9c102/sn9c102_ov7630.c index 31b6080b0615..e6832347894f 100644 --- a/drivers/media/video/sn9c102/sn9c102_ov7630.c +++ b/drivers/media/video/sn9c102/sn9c102_ov7630.c | |||
@@ -29,9 +29,8 @@ static int ov7630_init(struct sn9c102_device* cam) | |||
29 | switch (sn9c102_get_bridge(cam)) { | 29 | switch (sn9c102_get_bridge(cam)) { |
30 | case BRIDGE_SN9C101: | 30 | case BRIDGE_SN9C101: |
31 | case BRIDGE_SN9C102: | 31 | case BRIDGE_SN9C102: |
32 | err = sn9c102_write_const_regs(cam, {0x00, 0x14}, | 32 | err = sn9c102_write_const_regs(cam, {0x00, 0x14}, {0x60, 0x17}, |
33 | {0x60, 0x17}, {0x0f, 0x18}, | 33 | {0x0f, 0x18}, {0x50, 0x19}); |
34 | {0x50, 0x19}); | ||
35 | 34 | ||
36 | err += sn9c102_i2c_write(cam, 0x12, 0x8d); | 35 | err += sn9c102_i2c_write(cam, 0x12, 0x8d); |
37 | err += sn9c102_i2c_write(cam, 0x12, 0x0d); | 36 | err += sn9c102_i2c_write(cam, 0x12, 0x0d); |
@@ -61,7 +60,6 @@ static int ov7630_init(struct sn9c102_device* cam) | |||
61 | err += sn9c102_i2c_write(cam, 0x71, 0x00); | 60 | err += sn9c102_i2c_write(cam, 0x71, 0x00); |
62 | err += sn9c102_i2c_write(cam, 0x74, 0x21); | 61 | err += sn9c102_i2c_write(cam, 0x74, 0x21); |
63 | err += sn9c102_i2c_write(cam, 0x7d, 0xf7); | 62 | err += sn9c102_i2c_write(cam, 0x7d, 0xf7); |
64 | |||
65 | break; | 63 | break; |
66 | case BRIDGE_SN9C103: | 64 | case BRIDGE_SN9C103: |
67 | err = sn9c102_write_const_regs(cam, {0x00, 0x02}, {0x00, 0x03}, | 65 | err = sn9c102_write_const_regs(cam, {0x00, 0x02}, {0x00, 0x03}, |
@@ -253,7 +251,7 @@ static int ov7630_set_pix_format(struct sn9c102_device* cam, | |||
253 | } | 251 | } |
254 | 252 | ||
255 | 253 | ||
256 | static struct sn9c102_sensor ov7630 = { | 254 | static const struct sn9c102_sensor ov7630 = { |
257 | .name = "OV7630", | 255 | .name = "OV7630", |
258 | .maintainer = "Luca Risolia <luca.risolia@studio.unibo.it>", | 256 | .maintainer = "Luca Risolia <luca.risolia@studio.unibo.it>", |
259 | .supported_bridge = BRIDGE_SN9C101 | BRIDGE_SN9C102 | BRIDGE_SN9C103, | 257 | .supported_bridge = BRIDGE_SN9C101 | BRIDGE_SN9C102 | BRIDGE_SN9C103, |
@@ -408,19 +406,16 @@ int sn9c102_probe_ov7630(struct sn9c102_device* cam) | |||
408 | switch (sn9c102_get_bridge(cam)) { | 406 | switch (sn9c102_get_bridge(cam)) { |
409 | case BRIDGE_SN9C101: | 407 | case BRIDGE_SN9C101: |
410 | case BRIDGE_SN9C102: | 408 | case BRIDGE_SN9C102: |
411 | err = sn9c102_write_const_regs(cam, {0x01, 0x01}, | 409 | err = sn9c102_write_const_regs(cam, {0x01, 0x01}, {0x00, 0x01}, |
412 | {0x00, 0x01}, {0x28, 0x17}); | 410 | {0x28, 0x17}); |
413 | |||
414 | break; | 411 | break; |
415 | case BRIDGE_SN9C103: /* do _not_ change anything! */ | 412 | case BRIDGE_SN9C103: /* do _not_ change anything! */ |
416 | err = sn9c102_write_const_regs(cam, {0x09, 0x01}, | 413 | err = sn9c102_write_const_regs(cam, {0x09, 0x01}, {0x42, 0x01}, |
417 | {0x42, 0x01}, {0x28, 0x17}, | 414 | {0x28, 0x17}, {0x44, 0x02}); |
418 | {0x44, 0x02}); | ||
419 | pid = sn9c102_i2c_try_read(cam, &ov7630, 0x0a); | 415 | pid = sn9c102_i2c_try_read(cam, &ov7630, 0x0a); |
420 | if (err || pid < 0) { /* try a different initialization */ | 416 | if (err || pid < 0) /* try a different initialization */ |
421 | err = sn9c102_write_reg(cam, 0x01, 0x01); | 417 | err += sn9c102_write_const_regs(cam, {0x01, 0x01}, |
422 | err += sn9c102_write_reg(cam, 0x00, 0x01); | 418 | {0x00, 0x01}); |
423 | } | ||
424 | break; | 419 | break; |
425 | default: | 420 | default: |
426 | break; | 421 | break; |