2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 19:23:57 +08:00

V4L/DVB (10005): m5602: Cleanup the s5k4aa error handling, cull some comments

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Erik Andrén 2008-11-20 04:02:44 -03:00 committed by Mauro Carvalho Chehab
parent 7b9f246738
commit 32500701e5
2 changed files with 14 additions and 14 deletions

View File

@ -108,6 +108,7 @@ int s5k4aa_probe(struct sd *sd)
return -ENODEV;
else
info("Detected a s5k4aa sensor");
sensor_found:
sd->gspca_dev.cam.cam_mode = s5k4aa.modes;
sd->gspca_dev.cam.nmodes = s5k4aa.nmodes;
@ -154,7 +155,7 @@ int s5k4aa_read_sensor(struct sd *sd, const u8 address,
"0x%x containing 0x%x ", address, *i2c_data);
}
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_write_sensor(struct sd *sd, const u8 address,
@ -283,7 +284,7 @@ int s5k4aa_get_exposure(struct gspca_dev *gspca_dev, __s32 *val)
*val |= data;
PDEBUG(D_V4L2, "Read exposure %d", *val);
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
@ -303,7 +304,7 @@ int s5k4aa_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
data = val & 0xff;
err = s5k4aa_write_sensor(sd, S5K4AA_EXPOSURE_LO, &data, 1);
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_get_vflip(struct gspca_dev *gspca_dev, __s32 *val)
@ -321,7 +322,7 @@ int s5k4aa_get_vflip(struct gspca_dev *gspca_dev, __s32 *val)
PDEBUG(D_V4L2, "Read vertical flip %d", *val);
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
@ -359,7 +360,7 @@ int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
err = s5k4aa_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1);
}
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_get_hflip(struct gspca_dev *gspca_dev, __s32 *val)
@ -376,7 +377,7 @@ int s5k4aa_get_hflip(struct gspca_dev *gspca_dev, __s32 *val)
*val = (data & S5K4AA_RM_H_FLIP) >> 6;
PDEBUG(D_V4L2, "Read horizontal flip %d", *val);
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
@ -415,7 +416,7 @@ int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
err = s5k4aa_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1);
}
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_get_gain(struct gspca_dev *gspca_dev, __s32 *val)
@ -433,7 +434,7 @@ int s5k4aa_get_gain(struct gspca_dev *gspca_dev, __s32 *val)
PDEBUG(D_V4L2, "Read gain %d", *val);
out:
return (err < 0) ? err : 0;
return err;
}
int s5k4aa_set_gain(struct gspca_dev *gspca_dev, __s32 val)
@ -451,7 +452,7 @@ int s5k4aa_set_gain(struct gspca_dev *gspca_dev, __s32 val)
err = s5k4aa_write_sensor(sd, S5K4AA_GAIN_2, &data, 1);
out:
return (err < 0) ? err : 0;
return err;
}
void s5k4aa_dump_registers(struct sd *sd)

View File

@ -41,11 +41,10 @@
#define S5K4AA_WINDOW_HEIGHT_LO 0x09
#define S5K4AA_WINDOW_WIDTH_HI 0x0a
#define S5K4AA_WINDOW_WIDTH_LO 0x0b
#define S5K4AA_GLOBAL_GAIN__ 0x0f /* Only a guess ATM !!! */
#define S5K4AA_H_BLANK_HI__ 0x1d /* Only a guess ATM !!! sync lost
if too low, reduces frame rate
if too high */
#define S5K4AA_H_BLANK_LO__ 0x1e /* Only a guess ATM !!! */
#define S5K4AA_GLOBAL_GAIN__ 0x0f
/* sync lost, if too low, reduces frame rate if too high */
#define S5K4AA_H_BLANK_HI__ 0x1d
#define S5K4AA_H_BLANK_LO__ 0x1e
#define S5K4AA_EXPOSURE_HI 0x17
#define S5K4AA_EXPOSURE_LO 0x18
#define S5K4AA_GAIN_1 0x1f /* (digital?) gain : 5 bits */