diff options
Diffstat (limited to 'drivers/media/video/gspca/sonixj.c')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 0d4677688c9..e657b8ba6db 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -116,6 +116,7 @@ static struct ctrl sd_ctrls[] = { | |||
116 | .set = sd_setcolors, | 116 | .set = sd_setcolors, |
117 | .get = sd_getcolors, | 117 | .get = sd_getcolors, |
118 | }, | 118 | }, |
119 | #define AUTOGAIN_IDX 3 | ||
119 | { | 120 | { |
120 | { | 121 | { |
121 | .id = V4L2_CID_AUTOGAIN, | 122 | .id = V4L2_CID_AUTOGAIN, |
@@ -936,6 +937,14 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
936 | sd->autogain = AUTOGAIN_DEF; | 937 | sd->autogain = AUTOGAIN_DEF; |
937 | sd->ag_cnt = -1; | 938 | sd->ag_cnt = -1; |
938 | 939 | ||
940 | switch (sd->sensor) { | ||
941 | case SENSOR_OV7630: | ||
942 | case SENSOR_OV7648: | ||
943 | case SENSOR_OV7660: | ||
944 | gspca_dev->ctrl_dis = (1 << AUTOGAIN_IDX); | ||
945 | break; | ||
946 | } | ||
947 | |||
939 | return 0; | 948 | return 0; |
940 | } | 949 | } |
941 | 950 | ||
@@ -1150,16 +1159,12 @@ static void setautogain(struct gspca_dev *gspca_dev) | |||
1150 | { | 1159 | { |
1151 | struct sd *sd = (struct sd *) gspca_dev; | 1160 | struct sd *sd = (struct sd *) gspca_dev; |
1152 | 1161 | ||
1153 | switch (sd->sensor) { | 1162 | if (gspca_dev->ctrl_dis & (1 << AUTOGAIN_IDX)) |
1154 | case SENSOR_HV7131R: | 1163 | return; |
1155 | case SENSOR_MO4000: | 1164 | if (sd->autogain) |
1156 | case SENSOR_MI0360: | 1165 | sd->ag_cnt = AG_CNT_START; |
1157 | if (sd->autogain) | 1166 | else |
1158 | sd->ag_cnt = AG_CNT_START; | 1167 | sd->ag_cnt = -1; |
1159 | else | ||
1160 | sd->ag_cnt = -1; | ||
1161 | break; | ||
1162 | } | ||
1163 | } | 1168 | } |
1164 | 1169 | ||
1165 | /* -- start the camera -- */ | 1170 | /* -- start the camera -- */ |