diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-08 04:03:37 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:29 -0500 |
commit | ac40b1fae5e8ac831298351ff8291944d1ff0354 (patch) | |
tree | 5f7e29f3260ae0072f072ba298fbf54321c71db2 /drivers/media/video/gspca/ov519.c | |
parent | 917118745a610765e98621c4a81d7744806e4954 (diff) |
V4L/DVB (9561): gspca: Cleanup the source of ov519.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/ov519.c')
-rw-r--r-- | drivers/media/video/gspca/ov519.c | 148 |
1 files changed, 64 insertions, 84 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index ca671194679e..8f9df2db6f1d 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -40,22 +40,18 @@ struct sd { | |||
40 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 40 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
41 | 41 | ||
42 | /* Determined by sensor type */ | 42 | /* Determined by sensor type */ |
43 | char sif; | 43 | __u8 sif; |
44 | 44 | ||
45 | unsigned char primary_i2c_slave; /* I2C write id of sensor */ | 45 | __u8 brightness; |
46 | 46 | __u8 contrast; | |
47 | unsigned char brightness; | 47 | __u8 colors; |
48 | unsigned char contrast; | ||
49 | unsigned char colors; | ||
50 | __u8 hflip; | 48 | __u8 hflip; |
51 | __u8 vflip; | 49 | __u8 vflip; |
52 | 50 | ||
53 | char compress; /* Should the next frame be compressed? */ | 51 | __u8 stopped; /* Streaming is temporarily paused */ |
54 | char compress_inited; /* Are compression params uploaded? */ | ||
55 | char stopped; /* Streaming is temporarily paused */ | ||
56 | 52 | ||
57 | char frame_rate; /* current Framerate (OV519 only) */ | 53 | __u8 frame_rate; /* current Framerate (OV519 only) */ |
58 | char clockdiv; /* clockdiv override for OV519 only */ | 54 | __u8 clockdiv; /* clockdiv override for OV519 only */ |
59 | 55 | ||
60 | char sensor; /* Type of image sensor chip (SEN_*) */ | 56 | char sensor; /* Type of image sensor chip (SEN_*) */ |
61 | #define SEN_UNKNOWN 0 | 57 | #define SEN_UNKNOWN 0 |
@@ -67,7 +63,6 @@ struct sd { | |||
67 | #define SEN_OV7670 6 | 63 | #define SEN_OV7670 6 |
68 | #define SEN_OV76BE 7 | 64 | #define SEN_OV76BE 7 |
69 | #define SEN_OV8610 8 | 65 | #define SEN_OV8610 8 |
70 | |||
71 | }; | 66 | }; |
72 | 67 | ||
73 | /* V4L2 controls supported by the driver */ | 68 | /* V4L2 controls supported by the driver */ |
@@ -184,15 +179,15 @@ static struct v4l2_pix_format sif_mode[] = { | |||
184 | }; | 179 | }; |
185 | 180 | ||
186 | /* OV519 Camera interface register numbers */ | 181 | /* OV519 Camera interface register numbers */ |
187 | #define OV519_CAM_H_SIZE 0x10 | 182 | #define OV519_R10_H_SIZE 0x10 |
188 | #define OV519_CAM_V_SIZE 0x11 | 183 | #define OV519_R11_V_SIZE 0x11 |
189 | #define OV519_CAM_X_OFFSETL 0x12 | 184 | #define OV519_R12_X_OFFSETL 0x12 |
190 | #define OV519_CAM_X_OFFSETH 0x13 | 185 | #define OV519_R13_X_OFFSETH 0x13 |
191 | #define OV519_CAM_Y_OFFSETL 0x14 | 186 | #define OV519_R14_Y_OFFSETL 0x14 |
192 | #define OV519_CAM_Y_OFFSETH 0x15 | 187 | #define OV519_R15_Y_OFFSETH 0x15 |
193 | #define OV519_CAM_DIVIDER 0x16 | 188 | #define OV519_R16_DIVIDER 0x16 |
194 | #define OV519_CAM_DFR 0x20 | 189 | #define OV519_R20_DFR 0x20 |
195 | #define OV519_CAM_FORMAT 0x25 | 190 | #define OV519_R25_FORMAT 0x25 |
196 | 191 | ||
197 | /* OV519 System Controller register numbers */ | 192 | /* OV519 System Controller register numbers */ |
198 | #define OV519_SYS_RESET1 0x51 | 193 | #define OV519_SYS_RESET1 0x51 |
@@ -562,8 +557,8 @@ static const struct ov_i2c_regvals norm_7670[] = { | |||
562 | { OV7670_REG_VSTOP, 0x7a }, | 557 | { OV7670_REG_VSTOP, 0x7a }, |
563 | { OV7670_REG_VREF, 0x0a }, | 558 | { OV7670_REG_VREF, 0x0a }, |
564 | 559 | ||
565 | { OV7670_REG_COM3, 0 }, | 560 | { OV7670_REG_COM3, 0x00 }, |
566 | { OV7670_REG_COM14, 0 }, | 561 | { OV7670_REG_COM14, 0x00 }, |
567 | /* Mystery scaling numbers */ | 562 | /* Mystery scaling numbers */ |
568 | { 0x70, 0x3a }, | 563 | { 0x70, 0x3a }, |
569 | { 0x71, 0x35 }, | 564 | { 0x71, 0x35 }, |
@@ -595,8 +590,8 @@ static const struct ov_i2c_regvals norm_7670[] = { | |||
595 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC | 590 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC |
596 | | OV7670_COM8_AECSTEP | 591 | | OV7670_COM8_AECSTEP |
597 | | OV7670_COM8_BFILT }, | 592 | | OV7670_COM8_BFILT }, |
598 | { OV7670_REG_GAIN, 0 }, | 593 | { OV7670_REG_GAIN, 0x00 }, |
599 | { OV7670_REG_AECH, 0 }, | 594 | { OV7670_REG_AECH, 0x00 }, |
600 | { OV7670_REG_COM4, 0x40 }, /* magic reserved bit */ | 595 | { OV7670_REG_COM4, 0x40 }, /* magic reserved bit */ |
601 | { OV7670_REG_COM9, 0x18 }, /* 4x gain + magic rsvd bit */ | 596 | { OV7670_REG_COM9, 0x18 }, /* 4x gain + magic rsvd bit */ |
602 | { OV7670_REG_BD50MAX, 0x05 }, | 597 | { OV7670_REG_BD50MAX, 0x05 }, |
@@ -634,16 +629,16 @@ static const struct ov_i2c_regvals norm_7670[] = { | |||
634 | { OV7670_REG_COM12, 0x78 }, | 629 | { OV7670_REG_COM12, 0x78 }, |
635 | { 0x4d, 0x40 }, | 630 | { 0x4d, 0x40 }, |
636 | { 0x4e, 0x20 }, | 631 | { 0x4e, 0x20 }, |
637 | { OV7670_REG_GFIX, 0 }, | 632 | { OV7670_REG_GFIX, 0x00 }, |
638 | { 0x6b, 0x4a }, | 633 | { 0x6b, 0x4a }, |
639 | { 0x74, 0x10 }, | 634 | { 0x74, 0x10 }, |
640 | { 0x8d, 0x4f }, | 635 | { 0x8d, 0x4f }, |
641 | { 0x8e, 0 }, | 636 | { 0x8e, 0x00 }, |
642 | { 0x8f, 0 }, | 637 | { 0x8f, 0x00 }, |
643 | { 0x90, 0 }, | 638 | { 0x90, 0x00 }, |
644 | { 0x91, 0 }, | 639 | { 0x91, 0x00 }, |
645 | { 0x96, 0 }, | 640 | { 0x96, 0x00 }, |
646 | { 0x9a, 0 }, | 641 | { 0x9a, 0x00 }, |
647 | { 0xb0, 0x84 }, | 642 | { 0xb0, 0x84 }, |
648 | { 0xb1, 0x0c }, | 643 | { 0xb1, 0x0c }, |
649 | { 0xb2, 0x0e }, | 644 | { 0xb2, 0x0e }, |
@@ -681,17 +676,17 @@ static const struct ov_i2c_regvals norm_7670[] = { | |||
681 | /* Matrix coefficients */ | 676 | /* Matrix coefficients */ |
682 | { 0x4f, 0x80 }, | 677 | { 0x4f, 0x80 }, |
683 | { 0x50, 0x80 }, | 678 | { 0x50, 0x80 }, |
684 | { 0x51, 0 }, | 679 | { 0x51, 0x00 }, |
685 | { 0x52, 0x22 }, | 680 | { 0x52, 0x22 }, |
686 | { 0x53, 0x5e }, | 681 | { 0x53, 0x5e }, |
687 | { 0x54, 0x80 }, | 682 | { 0x54, 0x80 }, |
688 | { 0x58, 0x9e }, | 683 | { 0x58, 0x9e }, |
689 | 684 | ||
690 | { OV7670_REG_COM16, OV7670_COM16_AWBGAIN }, | 685 | { OV7670_REG_COM16, OV7670_COM16_AWBGAIN }, |
691 | { OV7670_REG_EDGE, 0 }, | 686 | { OV7670_REG_EDGE, 0x00 }, |
692 | { 0x75, 0x05 }, | 687 | { 0x75, 0x05 }, |
693 | { 0x76, 0xe1 }, | 688 | { 0x76, 0xe1 }, |
694 | { 0x4c, 0 }, | 689 | { 0x4c, 0x00 }, |
695 | { 0x77, 0x01 }, | 690 | { 0x77, 0x01 }, |
696 | { OV7670_REG_COM13, OV7670_COM13_GAMMA | 691 | { OV7670_REG_COM13, OV7670_COM13_GAMMA |
697 | | OV7670_COM13_UVSAT | 692 | | OV7670_COM13_UVSAT |
@@ -704,7 +699,7 @@ static const struct ov_i2c_regvals norm_7670[] = { | |||
704 | { 0x34, 0x11 }, | 699 | { 0x34, 0x11 }, |
705 | { OV7670_REG_COM11, OV7670_COM11_EXP|OV7670_COM11_HZAUTO }, | 700 | { OV7670_REG_COM11, OV7670_COM11_EXP|OV7670_COM11_HZAUTO }, |
706 | { 0xa4, 0x88 }, | 701 | { 0xa4, 0x88 }, |
707 | { 0x96, 0 }, | 702 | { 0x96, 0x00 }, |
708 | { 0x97, 0x30 }, | 703 | { 0x97, 0x30 }, |
709 | { 0x98, 0x20 }, | 704 | { 0x98, 0x20 }, |
710 | { 0x99, 0x30 }, | 705 | { 0x99, 0x30 }, |
@@ -942,11 +937,11 @@ static int i2c_w(struct sd *sd, | |||
942 | 937 | ||
943 | /* Initiate 3-byte write cycle */ | 938 | /* Initiate 3-byte write cycle */ |
944 | rc = reg_w(sd, R518_I2C_CTL, 0x01); | 939 | rc = reg_w(sd, R518_I2C_CTL, 0x01); |
940 | if (rc < 0) | ||
941 | return rc; | ||
945 | 942 | ||
946 | /* wait for write complete */ | 943 | /* wait for write complete */ |
947 | msleep(4); | 944 | msleep(4); |
948 | if (rc < 0) | ||
949 | return rc; | ||
950 | return reg_r8(sd, R518_I2C_CTL); | 945 | return reg_r8(sd, R518_I2C_CTL); |
951 | } | 946 | } |
952 | 947 | ||
@@ -1029,7 +1024,7 @@ static inline int ov51x_restart(struct sd *sd) | |||
1029 | */ | 1024 | */ |
1030 | static int init_ov_sensor(struct sd *sd) | 1025 | static int init_ov_sensor(struct sd *sd) |
1031 | { | 1026 | { |
1032 | int i, success; | 1027 | int i; |
1033 | 1028 | ||
1034 | /* Reset the sensor */ | 1029 | /* Reset the sensor */ |
1035 | if (i2c_w(sd, 0x12, 0x80) < 0) | 1030 | if (i2c_w(sd, 0x12, 0x80) < 0) |
@@ -1038,11 +1033,11 @@ static int init_ov_sensor(struct sd *sd) | |||
1038 | /* Wait for it to initialize */ | 1033 | /* Wait for it to initialize */ |
1039 | msleep(150); | 1034 | msleep(150); |
1040 | 1035 | ||
1041 | for (i = 0, success = 0; i < i2c_detect_tries && !success; i++) { | 1036 | for (i = 0; i < i2c_detect_tries; i++) { |
1042 | if (i2c_r(sd, OV7610_REG_ID_HIGH) == 0x7f && | 1037 | if (i2c_r(sd, OV7610_REG_ID_HIGH) == 0x7f && |
1043 | i2c_r(sd, OV7610_REG_ID_LOW) == 0xa2) { | 1038 | i2c_r(sd, OV7610_REG_ID_LOW) == 0xa2) { |
1044 | success = 1; | 1039 | PDEBUG(D_PROBE, "I2C synced in %d attempt(s)", i); |
1045 | continue; | 1040 | return 0; |
1046 | } | 1041 | } |
1047 | 1042 | ||
1048 | /* Reset the sensor */ | 1043 | /* Reset the sensor */ |
@@ -1054,10 +1049,7 @@ static int init_ov_sensor(struct sd *sd) | |||
1054 | if (i2c_r(sd, 0x00) < 0) | 1049 | if (i2c_r(sd, 0x00) < 0) |
1055 | return -EIO; | 1050 | return -EIO; |
1056 | } | 1051 | } |
1057 | if (!success) | 1052 | return -EIO; |
1058 | return -EIO; | ||
1059 | PDEBUG(D_PROBE, "I2C synced in %d attempt(s)", i); | ||
1060 | return 0; | ||
1061 | } | 1053 | } |
1062 | 1054 | ||
1063 | /* Set the read and write slave IDs. The "slave" argument is the write slave, | 1055 | /* Set the read and write slave IDs. The "slave" argument is the write slave, |
@@ -1073,7 +1065,6 @@ static int ov51x_set_slave_ids(struct sd *sd, | |||
1073 | rc = reg_w(sd, R51x_I2C_W_SID, slave); | 1065 | rc = reg_w(sd, R51x_I2C_W_SID, slave); |
1074 | if (rc < 0) | 1066 | if (rc < 0) |
1075 | return rc; | 1067 | return rc; |
1076 | sd->primary_i2c_slave = slave; | ||
1077 | return reg_w(sd, R51x_I2C_R_SID, slave + 1); | 1068 | return reg_w(sd, R51x_I2C_R_SID, slave + 1); |
1078 | } | 1069 | } |
1079 | 1070 | ||
@@ -1285,7 +1276,6 @@ static int ov6xx0_configure(struct sd *sd) | |||
1285 | /* Turns on or off the LED. Only has an effect with OV511+/OV518(+)/OV519 */ | 1276 | /* Turns on or off the LED. Only has an effect with OV511+/OV518(+)/OV519 */ |
1286 | static void ov51x_led_control(struct sd *sd, int on) | 1277 | static void ov51x_led_control(struct sd *sd, int on) |
1287 | { | 1278 | { |
1288 | /* PDEBUG(D_STREAM, "LED (%s)", on ? "on" : "off"); */ | ||
1289 | reg_w_mask(sd, OV519_GPIO_DATA_OUT0, !on, 1); /* 0 / 1 */ | 1279 | reg_w_mask(sd, OV519_GPIO_DATA_OUT0, !on, 1); /* 0 / 1 */ |
1290 | } | 1280 | } |
1291 | 1281 | ||
@@ -1352,7 +1342,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1352 | } | 1342 | } |
1353 | if (ov8xx0_configure(sd) < 0) { | 1343 | if (ov8xx0_configure(sd) < 0) { |
1354 | PDEBUG(D_ERR, | 1344 | PDEBUG(D_ERR, |
1355 | "Failed to configure OV8xx0 sensor"); | 1345 | "Failed to configure OV8xx0 sensor"); |
1356 | goto error; | 1346 | goto error; |
1357 | } | 1347 | } |
1358 | } | 1348 | } |
@@ -1482,7 +1472,7 @@ static int ov519_mode_init_regs(struct sd *sd) | |||
1482 | return -EIO; | 1472 | return -EIO; |
1483 | if (sd->sensor == SEN_OV7640) { | 1473 | if (sd->sensor == SEN_OV7640) { |
1484 | /* Select 8-bit input mode */ | 1474 | /* Select 8-bit input mode */ |
1485 | reg_w_mask(sd, OV519_CAM_DFR, 0x10, 0x10); | 1475 | reg_w_mask(sd, OV519_R20_DFR, 0x10, 0x10); |
1486 | } | 1476 | } |
1487 | } else { | 1477 | } else { |
1488 | if (write_regvals(sd, mode_init_519_ov7670, | 1478 | if (write_regvals(sd, mode_init_519_ov7670, |
@@ -1490,14 +1480,14 @@ static int ov519_mode_init_regs(struct sd *sd) | |||
1490 | return -EIO; | 1480 | return -EIO; |
1491 | } | 1481 | } |
1492 | 1482 | ||
1493 | reg_w(sd, OV519_CAM_H_SIZE, sd->gspca_dev.width >> 4); | 1483 | reg_w(sd, OV519_R10_H_SIZE, sd->gspca_dev.width >> 4); |
1494 | reg_w(sd, OV519_CAM_V_SIZE, sd->gspca_dev.height >> 3); | 1484 | reg_w(sd, OV519_R11_V_SIZE, sd->gspca_dev.height >> 3); |
1495 | reg_w(sd, OV519_CAM_X_OFFSETL, 0x00); | 1485 | reg_w(sd, OV519_R12_X_OFFSETL, 0x00); |
1496 | reg_w(sd, OV519_CAM_X_OFFSETH, 0x00); | 1486 | reg_w(sd, OV519_R13_X_OFFSETH, 0x00); |
1497 | reg_w(sd, OV519_CAM_Y_OFFSETL, 0x00); | 1487 | reg_w(sd, OV519_R14_Y_OFFSETL, 0x00); |
1498 | reg_w(sd, OV519_CAM_Y_OFFSETH, 0x00); | 1488 | reg_w(sd, OV519_R15_Y_OFFSETH, 0x00); |
1499 | reg_w(sd, OV519_CAM_DIVIDER, 0x00); | 1489 | reg_w(sd, OV519_R16_DIVIDER, 0x00); |
1500 | reg_w(sd, OV519_CAM_FORMAT, 0x03); /* YUV422 */ | 1490 | reg_w(sd, OV519_R25_FORMAT, 0x03); /* YUV422 */ |
1501 | reg_w(sd, 0x26, 0x00); /* Undocumented */ | 1491 | reg_w(sd, 0x26, 0x00); /* Undocumented */ |
1502 | 1492 | ||
1503 | /******** Set the framerate ********/ | 1493 | /******** Set the framerate ********/ |
@@ -1576,7 +1566,6 @@ static int ov519_mode_init_regs(struct sd *sd) | |||
1576 | } | 1566 | } |
1577 | break; | 1567 | break; |
1578 | } | 1568 | } |
1579 | |||
1580 | return 0; | 1569 | return 0; |
1581 | } | 1570 | } |
1582 | 1571 | ||
@@ -1667,7 +1656,7 @@ static int mode_init_ov_sensor_regs(struct sd *sd) | |||
1667 | * the gain or the contrast. The "reserved" bits seem | 1656 | * the gain or the contrast. The "reserved" bits seem |
1668 | * to have some effect in this case. */ | 1657 | * to have some effect in this case. */ |
1669 | i2c_w(sd, 0x2d, 0x85); | 1658 | i2c_w(sd, 0x2d, 0x85); |
1670 | } else if (sd->clockdiv >= 0) { | 1659 | } else { |
1671 | i2c_w(sd, 0x11, sd->clockdiv); | 1660 | i2c_w(sd, 0x11, sd->clockdiv); |
1672 | } | 1661 | } |
1673 | 1662 | ||
@@ -1869,7 +1858,6 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1869 | ret = ov51x_restart(sd); | 1858 | ret = ov51x_restart(sd); |
1870 | if (ret < 0) | 1859 | if (ret < 0) |
1871 | goto out; | 1860 | goto out; |
1872 | PDEBUG(D_STREAM, "camera started alt: 0x%02x", gspca_dev->alt); | ||
1873 | ov51x_led_control(sd, 1); | 1861 | ov51x_led_control(sd, 1); |
1874 | return 0; | 1862 | return 0; |
1875 | out: | 1863 | out: |
@@ -1879,8 +1867,10 @@ out: | |||
1879 | 1867 | ||
1880 | static void sd_stopN(struct gspca_dev *gspca_dev) | 1868 | static void sd_stopN(struct gspca_dev *gspca_dev) |
1881 | { | 1869 | { |
1882 | ov51x_stop((struct sd *) gspca_dev); | 1870 | struct sd *sd = (struct sd *) gspca_dev; |
1883 | ov51x_led_control((struct sd *) gspca_dev, 0); | 1871 | |
1872 | ov51x_stop(sd); | ||
1873 | ov51x_led_control(sd, 0); | ||
1884 | } | 1874 | } |
1885 | 1875 | ||
1886 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1876 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
@@ -1935,9 +1925,6 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
1935 | int val; | 1925 | int val; |
1936 | 1926 | ||
1937 | val = sd->brightness; | 1927 | val = sd->brightness; |
1938 | PDEBUG(D_CONF, "brightness:%d", val); | ||
1939 | /* if (gspca_dev->streaming) | ||
1940 | * ov51x_stop(sd); */ | ||
1941 | switch (sd->sensor) { | 1928 | switch (sd->sensor) { |
1942 | case SEN_OV8610: | 1929 | case SEN_OV8610: |
1943 | case SEN_OV7610: | 1930 | case SEN_OV7610: |
@@ -1959,8 +1946,6 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
1959 | i2c_w(sd, OV7670_REG_BRIGHT, ov7670_abs_to_sm(val)); | 1946 | i2c_w(sd, OV7670_REG_BRIGHT, ov7670_abs_to_sm(val)); |
1960 | break; | 1947 | break; |
1961 | } | 1948 | } |
1962 | /* if (gspca_dev->streaming) | ||
1963 | * ov51x_restart(sd); */ | ||
1964 | } | 1949 | } |
1965 | 1950 | ||
1966 | static void setcontrast(struct gspca_dev *gspca_dev) | 1951 | static void setcontrast(struct gspca_dev *gspca_dev) |
@@ -1969,9 +1954,6 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
1969 | int val; | 1954 | int val; |
1970 | 1955 | ||
1971 | val = sd->contrast; | 1956 | val = sd->contrast; |
1972 | PDEBUG(D_CONF, "contrast:%d", val); | ||
1973 | /* if (gspca_dev->streaming) | ||
1974 | ov51x_stop(sd); */ | ||
1975 | switch (sd->sensor) { | 1957 | switch (sd->sensor) { |
1976 | case SEN_OV7610: | 1958 | case SEN_OV7610: |
1977 | case SEN_OV6620: | 1959 | case SEN_OV6620: |
@@ -2007,8 +1989,6 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
2007 | i2c_w(sd, OV7670_REG_CONTRAS, val >> 1); | 1989 | i2c_w(sd, OV7670_REG_CONTRAS, val >> 1); |
2008 | break; | 1990 | break; |
2009 | } | 1991 | } |
2010 | /* if (gspca_dev->streaming) | ||
2011 | ov51x_restart(sd); */ | ||
2012 | } | 1992 | } |
2013 | 1993 | ||
2014 | static void setcolors(struct gspca_dev *gspca_dev) | 1994 | static void setcolors(struct gspca_dev *gspca_dev) |
@@ -2017,9 +1997,6 @@ static void setcolors(struct gspca_dev *gspca_dev) | |||
2017 | int val; | 1997 | int val; |
2018 | 1998 | ||
2019 | val = sd->colors; | 1999 | val = sd->colors; |
2020 | PDEBUG(D_CONF, "saturation:%d", val); | ||
2021 | /* if (gspca_dev->streaming) | ||
2022 | ov51x_stop(sd); */ | ||
2023 | switch (sd->sensor) { | 2000 | switch (sd->sensor) { |
2024 | case SEN_OV8610: | 2001 | case SEN_OV8610: |
2025 | case SEN_OV7610: | 2002 | case SEN_OV7610: |
@@ -2044,8 +2021,6 @@ static void setcolors(struct gspca_dev *gspca_dev) | |||
2044 | /* set REG_COM13 values for UV sat auto mode */ | 2021 | /* set REG_COM13 values for UV sat auto mode */ |
2045 | break; | 2022 | break; |
2046 | } | 2023 | } |
2047 | /* if (gspca_dev->streaming) | ||
2048 | ov51x_restart(sd); */ | ||
2049 | } | 2024 | } |
2050 | 2025 | ||
2051 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | 2026 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) |
@@ -2053,7 +2028,8 @@ static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | |||
2053 | struct sd *sd = (struct sd *) gspca_dev; | 2028 | struct sd *sd = (struct sd *) gspca_dev; |
2054 | 2029 | ||
2055 | sd->brightness = val; | 2030 | sd->brightness = val; |
2056 | setbrightness(gspca_dev); | 2031 | if (gspca_dev->streaming) |
2032 | setbrightness(gspca_dev); | ||
2057 | return 0; | 2033 | return 0; |
2058 | } | 2034 | } |
2059 | 2035 | ||
@@ -2070,7 +2046,8 @@ static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val) | |||
2070 | struct sd *sd = (struct sd *) gspca_dev; | 2046 | struct sd *sd = (struct sd *) gspca_dev; |
2071 | 2047 | ||
2072 | sd->contrast = val; | 2048 | sd->contrast = val; |
2073 | setcontrast(gspca_dev); | 2049 | if (gspca_dev->streaming) |
2050 | setcontrast(gspca_dev); | ||
2074 | return 0; | 2051 | return 0; |
2075 | } | 2052 | } |
2076 | 2053 | ||
@@ -2087,7 +2064,8 @@ static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val) | |||
2087 | struct sd *sd = (struct sd *) gspca_dev; | 2064 | struct sd *sd = (struct sd *) gspca_dev; |
2088 | 2065 | ||
2089 | sd->colors = val; | 2066 | sd->colors = val; |
2090 | setcolors(gspca_dev); | 2067 | if (gspca_dev->streaming) |
2068 | setcolors(gspca_dev); | ||
2091 | return 0; | 2069 | return 0; |
2092 | } | 2070 | } |
2093 | 2071 | ||
@@ -2104,7 +2082,8 @@ static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val) | |||
2104 | struct sd *sd = (struct sd *) gspca_dev; | 2082 | struct sd *sd = (struct sd *) gspca_dev; |
2105 | 2083 | ||
2106 | sd->hflip = val; | 2084 | sd->hflip = val; |
2107 | sethvflip(sd); | 2085 | if (gspca_dev->streaming) |
2086 | sethvflip(sd); | ||
2108 | return 0; | 2087 | return 0; |
2109 | } | 2088 | } |
2110 | 2089 | ||
@@ -2121,7 +2100,8 @@ static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val) | |||
2121 | struct sd *sd = (struct sd *) gspca_dev; | 2100 | struct sd *sd = (struct sd *) gspca_dev; |
2122 | 2101 | ||
2123 | sd->vflip = val; | 2102 | sd->vflip = val; |
2124 | sethvflip(sd); | 2103 | if (gspca_dev->streaming) |
2104 | sethvflip(sd); | ||
2125 | return 0; | 2105 | return 0; |
2126 | } | 2106 | } |
2127 | 2107 | ||
@@ -2162,7 +2142,7 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2162 | {USB_DEVICE(0x05a9, 0x8519)}, | 2142 | {USB_DEVICE(0x05a9, 0x8519)}, |
2163 | {} | 2143 | {} |
2164 | }; | 2144 | }; |
2165 | #undef DVNAME | 2145 | |
2166 | MODULE_DEVICE_TABLE(usb, device_table); | 2146 | MODULE_DEVICE_TABLE(usb, device_table); |
2167 | 2147 | ||
2168 | /* -- device connect -- */ | 2148 | /* -- device connect -- */ |