bcm27xx: update 6.1 patches to latest version
[openwrt/staging/svanheule.git] / target / linux / bcm27xx / patches-6.1 / 950-0802-media-i2c-arducam_64mp-Add-PDAF-support.patch
1 From b9d2d1862aa5b798cecb87a95d970ad34a4aebc0 Mon Sep 17 00:00:00 2001
2 From: Lee Jackson <lee.jackson@arducam.com>
3 Date: Tue, 30 May 2023 15:50:05 +0800
4 Subject: [PATCH] media: i2c: arducam_64mp: Add PDAF support
5
6 Enable PDAF output for all modes, and also need to modify Embedded Line
7 Width to 11560 * 3 (two lines of Embedded Data + one line of PDAF).
8
9 Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
10 ---
11 drivers/media/i2c/arducam_64mp.c | 64 ++++++++++++++++++++++++++++++--
12 1 file changed, 61 insertions(+), 3 deletions(-)
13
14 --- a/drivers/media/i2c/arducam_64mp.c
15 +++ b/drivers/media/i2c/arducam_64mp.c
16 @@ -95,7 +95,7 @@
17 #define ARDUCAM_64MP_TEST_PATTERN_GB_DEFAULT 0
18
19 /* Embedded metadata stream structure */
20 -#define ARDUCAM_64MP_EMBEDDED_LINE_WIDTH 16384
21 +#define ARDUCAM_64MP_EMBEDDED_LINE_WIDTH (11560 * 3)
22 #define ARDUCAM_64MP_NUM_EMBEDDED_LINES 1
23
24 enum pad_types {
25 @@ -144,6 +144,7 @@ struct arducam_64mp_mode {
26 };
27
28 static const struct arducam_64mp_reg mode_common_regs[] = {
29 + {0x0100, 0x00},
30 {0x0136, 0x18},
31 {0x0137, 0x00},
32 {0x33F0, 0x01},
33 @@ -788,6 +789,7 @@ static const struct arducam_64mp_reg mod
34 {0x3092, 0x01},
35 {0x3093, 0x00},
36 {0x0350, 0x00},
37 + {0x3419, 0x00},
38 };
39
40 /* 64 mpix 2.7fps */
41 @@ -847,6 +849,14 @@ static const struct arducam_64mp_reg mod
42 {0x0205, 0x00},
43 {0x020e, 0x01},
44 {0x020f, 0x00},
45 + {0x341a, 0x00},
46 + {0x341b, 0x00},
47 + {0x341c, 0x00},
48 + {0x341d, 0x00},
49 + {0x341e, 0x02},
50 + {0x341f, 0x3c},
51 + {0x3420, 0x02},
52 + {0x3421, 0x42},
53 };
54
55 /* 48 mpix 3.0fps */
56 @@ -906,6 +916,14 @@ static const struct arducam_64mp_reg mod
57 {0x0205, 0x00},
58 {0x020e, 0x01},
59 {0x020f, 0x00},
60 + {0x341a, 0x00},
61 + {0x341b, 0x00},
62 + {0x341c, 0x00},
63 + {0x341d, 0x00},
64 + {0x341e, 0x01},
65 + {0x341f, 0xf4},
66 + {0x3420, 0x01},
67 + {0x3421, 0xf4},
68 };
69
70 /* 16 mpix 10fps */
71 @@ -959,6 +977,14 @@ static const struct arducam_64mp_reg mod
72 {0x98d8, 0x8c},
73 {0x98d9, 0x0a},
74 {0x99c4, 0x16},
75 + {0x341a, 0x00},
76 + {0x341b, 0x00},
77 + {0x341c, 0x00},
78 + {0x341d, 0x00},
79 + {0x341e, 0x01},
80 + {0x341f, 0x21},
81 + {0x3420, 0x01},
82 + {0x3421, 0x21},
83 };
84
85 /* 4k 20fps mode */
86 @@ -1012,6 +1038,14 @@ static const struct arducam_64mp_reg mod
87 {0x98d8, 0x8c},
88 {0x98d9, 0x0a},
89 {0x99c4, 0x16},
90 + {0x341a, 0x00},
91 + {0x341b, 0x00},
92 + {0x341c, 0x00},
93 + {0x341d, 0x00},
94 + {0x341e, 0x00},
95 + {0x341f, 0xf0},
96 + {0x3420, 0x00},
97 + {0x3421, 0xb4},
98 };
99
100 /* 4x4 binned 30fps mode */
101 @@ -1031,7 +1065,7 @@ static const struct arducam_64mp_reg mod
102 {0x0900, 0x01},
103 {0x0901, 0x44},
104 {0x0902, 0x08},
105 - {0x30d8, 0x00},
106 + {0x30d8, 0x04},
107 {0x3200, 0x43},
108 {0x3201, 0x43},
109 {0x0408, 0x00},
110 @@ -1046,7 +1080,7 @@ static const struct arducam_64mp_reg mod
111 {0x034d, 0x08},
112 {0x034e, 0x06},
113 {0x034f, 0xc8},
114 - {0x30d9, 0x01},
115 + {0x30d9, 0x00},
116 {0x32d5, 0x00},
117 {0x32d6, 0x00},
118 {0x401e, 0x00},
119 @@ -1065,6 +1099,14 @@ static const struct arducam_64mp_reg mod
120 {0x98d8, 0x8c},
121 {0x98d9, 0x0a},
122 {0x99c4, 0x16},
123 + {0x341a, 0x00},
124 + {0x341b, 0x00},
125 + {0x341c, 0x00},
126 + {0x341d, 0x00},
127 + {0x341e, 0x00},
128 + {0x341f, 0x90},
129 + {0x3420, 0x00},
130 + {0x3421, 0x90},
131 };
132
133 /* 1080p 60fps mode */
134 @@ -1118,6 +1160,14 @@ static const struct arducam_64mp_reg mod
135 {0x98d8, 0x8c},
136 {0x98d9, 0x0a},
137 {0x99c4, 0x16},
138 + {0x341a, 0x00},
139 + {0x341b, 0x00},
140 + {0x341c, 0x00},
141 + {0x341d, 0x00},
142 + {0x341e, 0x00},
143 + {0x341f, 0x78},
144 + {0x3420, 0x00},
145 + {0x3421, 0x5a},
146 };
147
148 /* 720p 120fps mode */
149 @@ -1171,6 +1221,14 @@ static const struct arducam_64mp_reg mod
150 {0x98d8, 0x8c},
151 {0x98d9, 0x0a},
152 {0x99c4, 0x16},
153 + {0x341a, 0x00},
154 + {0x341b, 0x00},
155 + {0x341c, 0x00},
156 + {0x341d, 0x00},
157 + {0x341e, 0x00},
158 + {0x341f, 0x50},
159 + {0x3420, 0x00},
160 + {0x3421, 0x3c},
161 };
162
163 /* Mode configs */