summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-01-03 00:02:04 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-02-08 10:24:33 +0300
commit1c08b2faa88fbcf813a700120ffe89bc2c8c567c (patch)
treec55fb87c1fe12518ae9c8a41955faa9443789886
parent76f39e721e29a0ea7a503da1ed10d4ebefa49e0a (diff)
downloadlinux-1c08b2faa88fbcf813a700120ffe89bc2c8c567c.tar.xz
media: atomisp: ov2680: Fix window settings and enable window for all resolutions
By default the ov2680 automatically sets the window to match the outputsize and automatically adjusts it to keep the bayer pattern stable when enabling hflip/vflip. This does not work for the 1616x1216 mode because there is no room to adjust the window there. To make flipping work in the 1616 wide modes the register lists for those modes set bit 0 of 0x5708 (manual_win_en) to 1 and ov2680_set_bayer_order() updates the bayer-order on the pad to match. But ov2680_set_bayer_order() is always called, so when enabling flipping on modes with a width of less then 1616 now results in the wrong bayer order being reported on the pad since the sensor is auto-adjusting the window in this case. Specify the correct (== output-size) window-size in all resolutions register-list and always set the manual_win_en bit, so that the bayer order is changed on hflip/vflip enable on all resolutions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
-rw-r--r--drivers/staging/media/atomisp/i2c/ov2680.h76
1 files changed, 38 insertions, 38 deletions
diff --git a/drivers/staging/media/atomisp/i2c/ov2680.h b/drivers/staging/media/atomisp/i2c/ov2680.h
index 4d1fa054fcf3..d753919be095 100644
--- a/drivers/staging/media/atomisp/i2c/ov2680.h
+++ b/drivers/staging/media/atomisp/i2c/ov2680.h
@@ -318,11 +318,11 @@ static struct ov2680_reg const ov2680_QCIF_30fps[] = {
{0x4008, 0x00},
{0x4009, 0x03},
{0x5081, 0x41},
- {0x5708, 0x00}, //add for full size flip off and mirror off 2014/09/11
- {0x5704, 0x10},
- {0x5705, 0xa0},
- {0x5706, 0x0c},
- {0x5707, 0x78},
+ {0x5708, 0x01}, //add for full size flip off and mirror off 2014/09/11
+ {0x5704, 0x00},
+ {0x5705, 0xc0},
+ {0x5706, 0x00},
+ {0x5707, 0xa0},
{0x3820, 0xc2},
{0x3821, 0x01},
// {0x5090, 0x0c},
@@ -357,11 +357,11 @@ static struct ov2680_reg const ov2680_CIF_30fps[] = {
{0x4008, 0x00},
{0x4009, 0x03},
{0x5081, 0x41},
- {0x5708, 0x00}, //add for full size flip off and mirror off 2014/09/11
- {0x5704, 0x10},
- {0x5705, 0xa0},
- {0x5706, 0x0c},
- {0x5707, 0x78},
+ {0x5708, 0x01}, //add for full size flip off and mirror off 2014/09/11
+ {0x5704, 0x01},
+ {0x5705, 0x70},
+ {0x5706, 0x01},
+ {0x5707, 0x30},
{0x3820, 0xc2},
{0x3821, 0x01},
// {0x5090, 0x0c},
@@ -396,11 +396,11 @@ static struct ov2680_reg const ov2680_QVGA_30fps[] = {
{0x4008, 0x00},
{0x4009, 0x03},
{0x5081, 0x41},
- {0x5708, 0x00}, //add for full size flip off and mirror off 2014/09/11
- {0x5704, 0x10},
- {0x5705, 0xa0},
- {0x5706, 0x0c},
- {0x5707, 0x78},
+ {0x5708, 0x01}, //add for full size flip off and mirror off 2014/09/11
+ {0x5704, 0x01},
+ {0x5705, 0x50},
+ {0x5706, 0x01},
+ {0x5707, 0x00},
{0x3820, 0xc2},
{0x3821, 0x01},
// {0x5090, 0x0c},
@@ -435,11 +435,11 @@ static struct ov2680_reg const ov2680_656x496_30fps[] = {
{0x4008, 0x00},
{0x4009, 0x03},
{0x5081, 0x41},
- {0x5708, 0x00}, //add for full size flip off and mirror off 2014/09/11
- {0x5704, 0x10},
- {0x5705, 0xa0},
- {0x5706, 0x0c},
- {0x5707, 0x78},
+ {0x5708, 0x01}, //add for full size flip off and mirror off 2014/09/11
+ {0x5704, 0x02},
+ {0x5705, 0x90},
+ {0x5706, 0x01},
+ {0x5707, 0xf0},
{0x3820, 0xc2},
{0x3821, 0x01},
// {0x5090, 0x0c},
@@ -473,7 +473,7 @@ static struct ov2680_reg const ov2680_720x592_30fps[] = {
{0x3815, 0x31},
{0x4008, 0x00},
{0x4009, 0x03},
- {0x5708, 0x00},
+ {0x5708, 0x01},
{0x5704, 0x02},
{0x5705, 0xd0}, // X_WIN;
{0x5706, 0x02},
@@ -512,7 +512,7 @@ static struct ov2680_reg const ov2680_800x600_30fps[] = {
{0x3813, 0x00},
{0x3814, 0x31},
{0x3815, 0x31},
- {0x5708, 0x00},
+ {0x5708, 0x01},
{0x5704, 0x03},
{0x5705, 0x20},
{0x5706, 0x02},
@@ -554,11 +554,11 @@ static struct ov2680_reg const ov2680_720p_30fps[] = {
{0x4008, 0x02},
{0x4009, 0x09},
{0x5081, 0x41},
- {0x5708, 0x00}, //add for full size flip off and mirror off 2014/09/11
- {0x5704, 0x10},
- {0x5705, 0xa0},
- {0x5706, 0x0c},
- {0x5707, 0x78},
+ {0x5708, 0x01}, //add for full size flip off and mirror off 2014/09/11
+ {0x5704, 0x05},
+ {0x5705, 0x10},
+ {0x5706, 0x02},
+ {0x5707, 0xe0},
{0x3820, 0xc0},
{0x3821, 0x00},
// {0x5090, 0x0c},
@@ -593,11 +593,11 @@ static struct ov2680_reg const ov2680_1296x976_30fps[] = {
{0x4008, 0x02},
{0x4009, 0x09},
{0x5081, 0x41},
- {0x5708, 0x00}, //add for full size flip off and mirror off 2014/09/11
- {0x5704, 0x10},
- {0x5705, 0xa0},
- {0x5706, 0x0c},
- {0x5707, 0x78},
+ {0x5708, 0x01}, //add for full size flip off and mirror off 2014/09/11
+ {0x5704, 0x05},
+ {0x5705, 0x10},
+ {0x5706, 0x03},
+ {0x5707, 0xd0},
{0x3820, 0xc0},
{0x3821, 0x00}, //mirror/flip
// {0x5090, 0x0c},
@@ -632,11 +632,11 @@ static struct ov2680_reg const ov2680_1456x1096_30fps[] = {
{0x4008, 0x02},
{0x4009, 0x09},
{0x5081, 0x41},
- {0x5708, 0x00}, //add for full size flip off and mirror off 2014/09/11
- {0x5704, 0x10},
- {0x5705, 0xa0},
- {0x5706, 0x0c},
- {0x5707, 0x78},
+ {0x5708, 0x01}, //add for full size flip off and mirror off 2014/09/11
+ {0x5704, 0x05},
+ {0x5705, 0xb0},
+ {0x5706, 0x04},
+ {0x5707, 0x48},
{0x3820, 0xc0},
{0x3821, 0x00},
// {0x5090, 0x0c},
@@ -754,7 +754,7 @@ static struct ov2680_reg const ov2680_1616x1216_30fps[] = {
{0x5704, 0x06},
{0x5705, 0x50},
{0x5706, 0x04},
- {0x5707, 0xcc},
+ {0x5707, 0xc0},
{0x3820, 0xc0},
{0x3821, 0x00},
// {0x5090, 0x0C},