diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2009-01-20 12:48:16 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:35 -0400 |
commit | 5a41c9f6b784a9ef7e27a8a27bdb6d541c28b076 (patch) | |
tree | 6932a3be7bfd7af7f4473613a1930afff2e339c2 /drivers/media/video/gspca/m5602/m5602_mt9m111.c | |
parent | 039efb68626593c70b759d5ece4d87b4afc05379 (diff) |
V4L/DVB (11546): gspca - m5602-mt9m111: Endianness fixes.
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/m5602/m5602_mt9m111.c')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_mt9m111.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c index e7fec46ac459..241108c786c3 100644 --- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c | |||
@@ -400,7 +400,7 @@ static int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val) | |||
400 | if (err < 0) | 400 | if (err < 0) |
401 | return err; | 401 | return err; |
402 | 402 | ||
403 | data[0] = (data[0] & 0xfe) | val; | 403 | data[1] = (data[1] & 0xfe) | val; |
404 | err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, | 404 | err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, |
405 | data, 2); | 405 | data, 2); |
406 | return err; | 406 | return err; |
@@ -436,7 +436,7 @@ static int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
436 | if (err < 0) | 436 | if (err < 0) |
437 | return err; | 437 | return err; |
438 | 438 | ||
439 | data[0] = (data[0] & 0xfd) | ((val << 1) & 0x02); | 439 | data[1] = (data[1] & 0xfd) | ((val << 1) & 0x02); |
440 | err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, | 440 | err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, |
441 | data, 2); | 441 | data, 2); |
442 | return err; | 442 | return err; |
@@ -466,7 +466,7 @@ static int mt9m111_set_auto_white_balance(struct gspca_dev *gspca_dev, | |||
466 | return err; | 466 | return err; |
467 | 467 | ||
468 | sensor_settings[AUTO_WHITE_BALANCE_IDX] = val & 0x01; | 468 | sensor_settings[AUTO_WHITE_BALANCE_IDX] = val & 0x01; |
469 | data[0] = ((data[0] & 0xfd) | ((val & 0x01) << 1)); | 469 | data[1] = ((data[1] & 0xfd) | ((val & 0x01) << 1)); |
470 | 470 | ||
471 | err = m5602_write_sensor(sd, MT9M111_CP_OPERATING_MODE_CTL, data, 2); | 471 | err = m5602_write_sensor(sd, MT9M111_CP_OPERATING_MODE_CTL, data, 2); |
472 | 472 | ||
@@ -514,8 +514,8 @@ static int mt9m111_set_gain(struct gspca_dev *gspca_dev, __s32 val) | |||
514 | else | 514 | else |
515 | tmp = val; | 515 | tmp = val; |
516 | 516 | ||
517 | data[1] = (tmp & 0xff00) >> 8; | 517 | data[1] = (tmp & 0xff); |
518 | data[0] = (tmp & 0xff); | 518 | data[0] = (tmp & 0xff00) >> 8; |
519 | PDEBUG(D_V4L2, "tmp=%d, data[1]=%d, data[0]=%d", tmp, | 519 | PDEBUG(D_V4L2, "tmp=%d, data[1]=%d, data[0]=%d", tmp, |
520 | data[1], data[0]); | 520 | data[1], data[0]); |
521 | 521 | ||
@@ -533,8 +533,8 @@ static int mt9m111_set_green_balance(struct gspca_dev *gspca_dev, __s32 val) | |||
533 | s32 *sensor_settings = sd->sensor_priv; | 533 | s32 *sensor_settings = sd->sensor_priv; |
534 | 534 | ||
535 | sensor_settings[GREEN_BALANCE_IDX] = val; | 535 | sensor_settings[GREEN_BALANCE_IDX] = val; |
536 | data[0] = (val & 0xff); | 536 | data[1] = (val & 0xff); |
537 | data[1] = (val & 0xff00) >> 8; | 537 | data[0] = (val & 0xff00) >> 8; |
538 | 538 | ||
539 | PDEBUG(D_V4L2, "Set green balance %d", val); | 539 | PDEBUG(D_V4L2, "Set green balance %d", val); |
540 | err = m5602_write_sensor(sd, MT9M111_SC_GREEN_1_GAIN, | 540 | err = m5602_write_sensor(sd, MT9M111_SC_GREEN_1_GAIN, |
@@ -563,8 +563,8 @@ static int mt9m111_set_blue_balance(struct gspca_dev *gspca_dev, __s32 val) | |||
563 | s32 *sensor_settings = sd->sensor_priv; | 563 | s32 *sensor_settings = sd->sensor_priv; |
564 | 564 | ||
565 | sensor_settings[BLUE_BALANCE_IDX] = val; | 565 | sensor_settings[BLUE_BALANCE_IDX] = val; |
566 | data[0] = (val & 0xff); | 566 | data[1] = (val & 0xff); |
567 | data[1] = (val & 0xff00) >> 8; | 567 | data[0] = (val & 0xff00) >> 8; |
568 | 568 | ||
569 | PDEBUG(D_V4L2, "Set blue balance %d", val); | 569 | PDEBUG(D_V4L2, "Set blue balance %d", val); |
570 | 570 | ||
@@ -589,8 +589,8 @@ static int mt9m111_set_red_balance(struct gspca_dev *gspca_dev, __s32 val) | |||
589 | s32 *sensor_settings = sd->sensor_priv; | 589 | s32 *sensor_settings = sd->sensor_priv; |
590 | 590 | ||
591 | sensor_settings[RED_BALANCE_IDX] = val; | 591 | sensor_settings[RED_BALANCE_IDX] = val; |
592 | data[0] = (val & 0xff); | 592 | data[1] = (val & 0xff); |
593 | data[1] = (val & 0xff00) >> 8; | 593 | data[0] = (val & 0xff00) >> 8; |
594 | 594 | ||
595 | PDEBUG(D_V4L2, "Set red balance %d", val); | 595 | PDEBUG(D_V4L2, "Set red balance %d", val); |
596 | 596 | ||