@@ -83,8 +83,10 @@ struct sd {
/* V4L2 controls supported by the driver */
static int pac7302_sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
static int pac7302_sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
-static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
-static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
+static int pac7302_sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
+static int pac7311_sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
+static int pac7302_sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
+static int pac7311_sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
static int pac7302_sd_setcolors(struct gspca_dev *gspca_dev, __s32 val);
static int pac7302_sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val);
static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val);
@@ -128,8 +130,8 @@ static struct ctrl pac7302_sd_ctrls[] =
#define CONTRAST_DEF 127
.default_value = CONTRAST_DEF,
},
- .set = sd_setcontrast,
- .get = sd_getcontrast,
+ .set = pac7302_sd_setcontrast,
+ .get = pac7302_sd_getcontrast,
},
/* This control is pac7302 only */
{
@@ -238,8 +240,8 @@ static struct ctrl pac7311_sd_ctrls[] =
#define CONTRAST_DEF 127
.default_value = CONTRAST_DEF,
},
- .set = sd_setcontrast,
- .get = sd_getcontrast,
+ .set = pac7311_sd_setcontrast,
+ .get = pac7311_sd_getcontrast,
},
/* All controls below are for both the 7302 and the 7311 */
{
@@ -1130,21 +1132,37 @@ static int pac7302_sd_getbrightness(stru
return 0;
}
-static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
+static int pac7302_sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
{
struct sd *sd = (struct sd *) gspca_dev;
sd->contrast = val;
if (gspca_dev->streaming) {
- if (sd->sensor == SENSOR_PAC7302)
- pac7302_setbrightcont(gspca_dev);
- else
- pac7311_setcontrast(gspca_dev);
+ pac7302_setbrightcont(gspca_dev);
+ }
+ return 0;
+}
+
+static int pac7311_sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ sd->contrast = val;
+ if (gspca_dev->streaming) {
+ pac7311_setcontrast(gspca_dev);
}
return 0;
}
-static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
+static int pac7302_sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ *val = sd->contrast;
+ return 0;
+}
+
+static int pac7311_sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
{
struct sd *sd = (struct sd *) gspca_dev;