mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-21 00:42:16 +00:00
V4L/DVB (10353): gspca - some subdrivers: Don't get the control values from the webcam.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
b3f5dbd0e1
commit
8789d810f1
@ -472,19 +472,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
|
||||
reg_w_val(gspca_dev, ET_O_RED + i, brightness);
|
||||
}
|
||||
|
||||
static void getbrightness(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
int i;
|
||||
int brightness = 0;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
reg_r(gspca_dev, ET_O_RED + i, 1);
|
||||
brightness += gspca_dev->usb_buf[0];
|
||||
}
|
||||
sd->brightness = brightness >> 3;
|
||||
}
|
||||
|
||||
static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -495,19 +482,6 @@ static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
reg_w(gspca_dev, ET_G_RED, RGBG, 6);
|
||||
}
|
||||
|
||||
static void getcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
int i;
|
||||
int contrast = 0;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
reg_r(gspca_dev, ET_G_RED + i, 1);
|
||||
contrast += gspca_dev->usb_buf[0];
|
||||
}
|
||||
sd->contrast = contrast >> 2;
|
||||
}
|
||||
|
||||
static void setcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -820,7 +794,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getbrightness(gspca_dev);
|
||||
*val = sd->brightness;
|
||||
return 0;
|
||||
}
|
||||
@ -839,7 +812,6 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcontrast(gspca_dev);
|
||||
*val = sd->contrast;
|
||||
return 0;
|
||||
}
|
||||
@ -858,7 +830,6 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcolors(gspca_dev);
|
||||
*val = sd->colors;
|
||||
return 0;
|
||||
}
|
||||
|
@ -935,16 +935,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
|
||||
(__u8) (sd->brightness - 128));
|
||||
}
|
||||
|
||||
static void getbrightness(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
int ret;
|
||||
|
||||
ret = reg_r_12(gspca_dev, 0x00, 0x8167, 1);
|
||||
if (ret >= 0)
|
||||
sd->brightness = ret + 128;
|
||||
}
|
||||
|
||||
static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -952,16 +942,6 @@ static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
reg_w(gspca_dev, 0x00, 0x8168, sd->contrast);
|
||||
}
|
||||
|
||||
static void getcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
int ret;
|
||||
|
||||
ret = reg_r_12(gspca_dev, 0x0, 0x8168, 1);
|
||||
if (ret >= 0)
|
||||
sd->contrast = ret;
|
||||
}
|
||||
|
||||
static void setcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -969,16 +949,6 @@ static void setcolors(struct gspca_dev *gspca_dev)
|
||||
reg_w(gspca_dev, 0x00, 0x8169, sd->colors);
|
||||
}
|
||||
|
||||
static void getcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
int ret;
|
||||
|
||||
ret = reg_r_12(gspca_dev, 0x0, 0x8169, 1);
|
||||
if (ret >= 0)
|
||||
sd->colors = ret;
|
||||
}
|
||||
|
||||
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -993,7 +963,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getbrightness(gspca_dev);
|
||||
*val = sd->brightness;
|
||||
return 0;
|
||||
}
|
||||
@ -1012,7 +981,6 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcontrast(gspca_dev);
|
||||
*val = sd->contrast;
|
||||
return 0;
|
||||
}
|
||||
@ -1031,7 +999,6 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcolors(gspca_dev);
|
||||
*val = sd->colors;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1883,10 +1883,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
|
||||
reg_write(gspca_dev->dev, SPCA501_REG_CCDSP, 0x12, sd->brightness);
|
||||
}
|
||||
|
||||
static void getbrightness(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
}
|
||||
|
||||
static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -1897,10 +1893,6 @@ static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
sd->contrast & 0xff);
|
||||
}
|
||||
|
||||
static void getcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
}
|
||||
|
||||
static void setcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -1908,10 +1900,6 @@ static void setcolors(struct gspca_dev *gspca_dev)
|
||||
reg_write(gspca_dev->dev, SPCA501_REG_CCDSP, 0x0c, sd->colors);
|
||||
}
|
||||
|
||||
static void getcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
}
|
||||
|
||||
static void setblue_balance(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -2083,7 +2071,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getbrightness(gspca_dev);
|
||||
*val = sd->brightness;
|
||||
return 0;
|
||||
}
|
||||
@ -2102,7 +2089,6 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcontrast(gspca_dev);
|
||||
*val = sd->contrast;
|
||||
return 0;
|
||||
}
|
||||
@ -2121,7 +2107,6 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcolors(gspca_dev);
|
||||
*val = sd->colors;
|
||||
return 0;
|
||||
}
|
||||
|
@ -790,14 +790,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
|
||||
reg_write(gspca_dev->dev, 5, 0x01, (255 - brightness) << 2);
|
||||
|
||||
}
|
||||
static void getbrightness(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
sd->brightness = 255
|
||||
- ((reg_read(gspca_dev, 5, 0x01, 1) >> 2)
|
||||
+ (reg_read(gspca_dev, 5, 0x0, 1) << 6));
|
||||
}
|
||||
|
||||
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
|
||||
{
|
||||
@ -813,7 +805,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getbrightness(gspca_dev);
|
||||
*val = sd->brightness;
|
||||
return 0;
|
||||
}
|
||||
|
@ -193,24 +193,6 @@ static void spca506_WriteI2c(struct gspca_dev *gspca_dev, __u16 valeur,
|
||||
}
|
||||
}
|
||||
|
||||
static int spca506_ReadI2c(struct gspca_dev *gspca_dev, __u16 reg)
|
||||
{
|
||||
int retry = 60;
|
||||
|
||||
reg_w(gspca_dev->dev, 0x07, SAA7113_I2C_BASE_WRITE, 0x0004);
|
||||
reg_w(gspca_dev->dev, 0x07, reg, 0x0001);
|
||||
reg_w(gspca_dev->dev, 0x07, 0x01, 0x0002);
|
||||
while (--retry) {
|
||||
reg_r(gspca_dev, 0x07, 0x0003, 2);
|
||||
if ((gspca_dev->usb_buf[0] | gspca_dev->usb_buf[1]) == 0x00)
|
||||
break;
|
||||
}
|
||||
if (retry == 0)
|
||||
return -1;
|
||||
reg_r(gspca_dev, 0x07, 0x0000, 1);
|
||||
return gspca_dev->usb_buf[0];
|
||||
}
|
||||
|
||||
static void spca506_SetNormeInput(struct gspca_dev *gspca_dev,
|
||||
__u16 norme,
|
||||
__u16 channel)
|
||||
@ -595,13 +577,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
|
||||
spca506_WriteI2c(gspca_dev, 0x01, 0x09);
|
||||
}
|
||||
|
||||
static void getbrightness(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
sd->brightness = spca506_ReadI2c(gspca_dev, SAA7113_bright);
|
||||
}
|
||||
|
||||
static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -611,13 +586,6 @@ static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
spca506_WriteI2c(gspca_dev, 0x01, 0x09);
|
||||
}
|
||||
|
||||
static void getcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
sd->contrast = spca506_ReadI2c(gspca_dev, SAA7113_contrast);
|
||||
}
|
||||
|
||||
static void setcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -627,13 +595,6 @@ static void setcolors(struct gspca_dev *gspca_dev)
|
||||
spca506_WriteI2c(gspca_dev, 0x01, 0x09);
|
||||
}
|
||||
|
||||
static void getcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
sd->colors = spca506_ReadI2c(gspca_dev, SAA7113_saturation);
|
||||
}
|
||||
|
||||
static void sethue(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -643,13 +604,6 @@ static void sethue(struct gspca_dev *gspca_dev)
|
||||
spca506_WriteI2c(gspca_dev, 0x01, 0x09);
|
||||
}
|
||||
|
||||
static void gethue(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
sd->hue = spca506_ReadI2c(gspca_dev, SAA7113_hue);
|
||||
}
|
||||
|
||||
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -664,7 +618,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getbrightness(gspca_dev);
|
||||
*val = sd->brightness;
|
||||
return 0;
|
||||
}
|
||||
@ -683,7 +636,6 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcontrast(gspca_dev);
|
||||
*val = sd->contrast;
|
||||
return 0;
|
||||
}
|
||||
@ -702,7 +654,6 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcolors(gspca_dev);
|
||||
*val = sd->colors;
|
||||
return 0;
|
||||
}
|
||||
@ -721,7 +672,6 @@ static int sd_gethue(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
gethue(gspca_dev);
|
||||
*val = sd->hue;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1590,13 +1590,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
|
||||
reg_write(gspca_dev->dev, 0x8654, brightness);
|
||||
}
|
||||
|
||||
static void getbrightness(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
sd->brightness = reg_read(gspca_dev, 0x8651);
|
||||
}
|
||||
|
||||
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -1611,7 +1604,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getbrightness(gspca_dev);
|
||||
*val = sd->brightness;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1194,26 +1194,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void getbrightness(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
__u16 brightness = 0;
|
||||
|
||||
switch (sd->bridge) {
|
||||
default:
|
||||
/* case BRIDGE_SPCA533: */
|
||||
/* case BRIDGE_SPCA504B: */
|
||||
/* case BRIDGE_SPCA504: */
|
||||
/* case BRIDGE_SPCA504C: */
|
||||
brightness = reg_r_12(gspca_dev, 0x00, 0x21a7, 2);
|
||||
break;
|
||||
case BRIDGE_SPCA536:
|
||||
brightness = reg_r_12(gspca_dev, 0x00, 0x20f0, 2);
|
||||
break;
|
||||
}
|
||||
sd->brightness = ((brightness & 0xff) - 128) % 255;
|
||||
}
|
||||
|
||||
static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -1233,24 +1213,6 @@ static void setcontrast(struct gspca_dev *gspca_dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void getcontrast(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
switch (sd->bridge) {
|
||||
default:
|
||||
/* case BRIDGE_SPCA533: */
|
||||
/* case BRIDGE_SPCA504B: */
|
||||
/* case BRIDGE_SPCA504: */
|
||||
/* case BRIDGE_SPCA504C: */
|
||||
sd->contrast = reg_r_12(gspca_dev, 0x00, 0x21a8, 2);
|
||||
break;
|
||||
case BRIDGE_SPCA536:
|
||||
sd->contrast = reg_r_12(gspca_dev, 0x00, 0x20f1, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void setcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -1270,24 +1232,6 @@ static void setcolors(struct gspca_dev *gspca_dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void getcolors(struct gspca_dev *gspca_dev)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
switch (sd->bridge) {
|
||||
default:
|
||||
/* case BRIDGE_SPCA533: */
|
||||
/* case BRIDGE_SPCA504B: */
|
||||
/* case BRIDGE_SPCA504: */
|
||||
/* case BRIDGE_SPCA504C: */
|
||||
sd->colors = reg_r_12(gspca_dev, 0x00, 0x21ae, 2) >> 1;
|
||||
break;
|
||||
case BRIDGE_SPCA536:
|
||||
sd->colors = reg_r_12(gspca_dev, 0x00, 0x20f6, 2) >> 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
@ -1302,7 +1246,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getbrightness(gspca_dev);
|
||||
*val = sd->brightness;
|
||||
return 0;
|
||||
}
|
||||
@ -1321,7 +1264,6 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcontrast(gspca_dev);
|
||||
*val = sd->contrast;
|
||||
return 0;
|
||||
}
|
||||
@ -1340,7 +1282,6 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val)
|
||||
{
|
||||
struct sd *sd = (struct sd *) gspca_dev;
|
||||
|
||||
getcolors(gspca_dev);
|
||||
*val = sd->colors;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user