diff options
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_po1030.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.c b/drivers/media/video/gspca/m5602/m5602_po1030.c index f9932a16fbd7..2e7fb91673cf 100644 --- a/drivers/media/video/gspca/m5602/m5602_po1030.c +++ b/drivers/media/video/gspca/m5602/m5602_po1030.c | |||
@@ -184,12 +184,16 @@ int po1030_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
184 | int err; | 184 | int err; |
185 | 185 | ||
186 | PDEBUG(D_V4L2, "Set hflip %d", val); | 186 | PDEBUG(D_V4L2, "Set hflip %d", val); |
187 | err = m5602_read_sensor(sd, PO1030_REG_CONTROL2, &i2c_data, 1); | ||
188 | if (err < 0) | ||
189 | goto out; | ||
187 | 190 | ||
188 | i2c_data = (val & 0x01) << 7; | 191 | i2c_data = (0x7f & i2c_data) | ((val & 0x01) << 7); |
189 | 192 | ||
190 | err = m5602_write_sensor(sd, PO1030_REG_CONTROL2, | 193 | err = m5602_write_sensor(sd, PO1030_REG_CONTROL2, |
191 | &i2c_data, 1); | 194 | &i2c_data, 1); |
192 | 195 | ||
196 | out: | ||
193 | return err; | 197 | return err; |
194 | } | 198 | } |
195 | 199 | ||
@@ -216,12 +220,16 @@ int po1030_set_vflip(struct gspca_dev *gspca_dev, __s32 val) | |||
216 | int err; | 220 | int err; |
217 | 221 | ||
218 | PDEBUG(D_V4L2, "Set vflip %d", val); | 222 | PDEBUG(D_V4L2, "Set vflip %d", val); |
223 | err = m5602_read_sensor(sd, PO1030_REG_CONTROL2, &i2c_data, 1); | ||
224 | if (err < 0) | ||
225 | goto out; | ||
219 | 226 | ||
220 | i2c_data = (val & 0x01) << 6; | 227 | i2c_data = (i2c_data & 0xbf) | ((val & 0x01) << 6); |
221 | 228 | ||
222 | err = m5602_write_sensor(sd, PO1030_REG_CONTROL2, | 229 | err = m5602_write_sensor(sd, PO1030_REG_CONTROL2, |
223 | &i2c_data, 1); | 230 | &i2c_data, 1); |
224 | 231 | ||
232 | out: | ||
225 | return err; | 233 | return err; |
226 | } | 234 | } |
227 | 235 | ||