Skip to content

Commit b9d2d18

Browse files
Lee Jacksonpelwell
Lee Jackson
authored andcommitted
media: i2c: arducam_64mp: Add PDAF support
Enable PDAF output for all modes, and also need to modify Embedded Line Width to 11560 * 3 (two lines of Embedded Data + one line of PDAF). Signed-off-by: Lee Jackson <[email protected]>
1 parent 7b3d012 commit b9d2d18

File tree

1 file changed

+61
-3
lines changed

1 file changed

+61
-3
lines changed

drivers/media/i2c/arducam_64mp.c

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
#define ARDUCAM_64MP_TEST_PATTERN_GB_DEFAULT 0
9696

9797
/* Embedded metadata stream structure */
98-
#define ARDUCAM_64MP_EMBEDDED_LINE_WIDTH 16384
98+
#define ARDUCAM_64MP_EMBEDDED_LINE_WIDTH (11560 * 3)
9999
#define ARDUCAM_64MP_NUM_EMBEDDED_LINES 1
100100

101101
enum pad_types {
@@ -144,6 +144,7 @@ struct arducam_64mp_mode {
144144
};
145145

146146
static const struct arducam_64mp_reg mode_common_regs[] = {
147+
{0x0100, 0x00},
147148
{0x0136, 0x18},
148149
{0x0137, 0x00},
149150
{0x33F0, 0x01},
@@ -788,6 +789,7 @@ static const struct arducam_64mp_reg mode_common_regs[] = {
788789
{0x3092, 0x01},
789790
{0x3093, 0x00},
790791
{0x0350, 0x00},
792+
{0x3419, 0x00},
791793
};
792794

793795
/* 64 mpix 2.7fps */
@@ -847,6 +849,14 @@ static const struct arducam_64mp_reg mode_9152x6944_regs[] = {
847849
{0x0205, 0x00},
848850
{0x020e, 0x01},
849851
{0x020f, 0x00},
852+
{0x341a, 0x00},
853+
{0x341b, 0x00},
854+
{0x341c, 0x00},
855+
{0x341d, 0x00},
856+
{0x341e, 0x02},
857+
{0x341f, 0x3c},
858+
{0x3420, 0x02},
859+
{0x3421, 0x42},
850860
};
851861

852862
/* 48 mpix 3.0fps */
@@ -906,6 +916,14 @@ static const struct arducam_64mp_reg mode_8000x6000_regs[] = {
906916
{0x0205, 0x00},
907917
{0x020e, 0x01},
908918
{0x020f, 0x00},
919+
{0x341a, 0x00},
920+
{0x341b, 0x00},
921+
{0x341c, 0x00},
922+
{0x341d, 0x00},
923+
{0x341e, 0x01},
924+
{0x341f, 0xf4},
925+
{0x3420, 0x01},
926+
{0x3421, 0xf4},
909927
};
910928

911929
/* 16 mpix 10fps */
@@ -959,6 +977,14 @@ static const struct arducam_64mp_reg mode_4624x3472_regs[] = {
959977
{0x98d8, 0x8c},
960978
{0x98d9, 0x0a},
961979
{0x99c4, 0x16},
980+
{0x341a, 0x00},
981+
{0x341b, 0x00},
982+
{0x341c, 0x00},
983+
{0x341d, 0x00},
984+
{0x341e, 0x01},
985+
{0x341f, 0x21},
986+
{0x3420, 0x01},
987+
{0x3421, 0x21},
962988
};
963989

964990
/* 4k 20fps mode */
@@ -1012,6 +1038,14 @@ static const struct arducam_64mp_reg mode_3840x2160_regs[] = {
10121038
{0x98d8, 0x8c},
10131039
{0x98d9, 0x0a},
10141040
{0x99c4, 0x16},
1041+
{0x341a, 0x00},
1042+
{0x341b, 0x00},
1043+
{0x341c, 0x00},
1044+
{0x341d, 0x00},
1045+
{0x341e, 0x00},
1046+
{0x341f, 0xf0},
1047+
{0x3420, 0x00},
1048+
{0x3421, 0xb4},
10151049
};
10161050

10171051
/* 4x4 binned 30fps mode */
@@ -1031,7 +1065,7 @@ static const struct arducam_64mp_reg mode_2312x1736_regs[] = {
10311065
{0x0900, 0x01},
10321066
{0x0901, 0x44},
10331067
{0x0902, 0x08},
1034-
{0x30d8, 0x00},
1068+
{0x30d8, 0x04},
10351069
{0x3200, 0x43},
10361070
{0x3201, 0x43},
10371071
{0x0408, 0x00},
@@ -1046,7 +1080,7 @@ static const struct arducam_64mp_reg mode_2312x1736_regs[] = {
10461080
{0x034d, 0x08},
10471081
{0x034e, 0x06},
10481082
{0x034f, 0xc8},
1049-
{0x30d9, 0x01},
1083+
{0x30d9, 0x00},
10501084
{0x32d5, 0x00},
10511085
{0x32d6, 0x00},
10521086
{0x401e, 0x00},
@@ -1065,6 +1099,14 @@ static const struct arducam_64mp_reg mode_2312x1736_regs[] = {
10651099
{0x98d8, 0x8c},
10661100
{0x98d9, 0x0a},
10671101
{0x99c4, 0x16},
1102+
{0x341a, 0x00},
1103+
{0x341b, 0x00},
1104+
{0x341c, 0x00},
1105+
{0x341d, 0x00},
1106+
{0x341e, 0x00},
1107+
{0x341f, 0x90},
1108+
{0x3420, 0x00},
1109+
{0x3421, 0x90},
10681110
};
10691111

10701112
/* 1080p 60fps mode */
@@ -1118,6 +1160,14 @@ static const struct arducam_64mp_reg mode_1920x1080_regs[] = {
11181160
{0x98d8, 0x8c},
11191161
{0x98d9, 0x0a},
11201162
{0x99c4, 0x16},
1163+
{0x341a, 0x00},
1164+
{0x341b, 0x00},
1165+
{0x341c, 0x00},
1166+
{0x341d, 0x00},
1167+
{0x341e, 0x00},
1168+
{0x341f, 0x78},
1169+
{0x3420, 0x00},
1170+
{0x3421, 0x5a},
11211171
};
11221172

11231173
/* 720p 120fps mode */
@@ -1171,6 +1221,14 @@ static const struct arducam_64mp_reg mode_1280x720_regs[] = {
11711221
{0x98d8, 0x8c},
11721222
{0x98d9, 0x0a},
11731223
{0x99c4, 0x16},
1224+
{0x341a, 0x00},
1225+
{0x341b, 0x00},
1226+
{0x341c, 0x00},
1227+
{0x341d, 0x00},
1228+
{0x341e, 0x00},
1229+
{0x341f, 0x50},
1230+
{0x3420, 0x00},
1231+
{0x3421, 0x3c},
11741232
};
11751233

11761234
/* Mode configs */

0 commit comments

Comments
 (0)