summaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-6.1/950-0802-media-i2c-arducam_64mp-Add-PDAF-support.patch
blob: 8f96b33baa6729e07025657c0a3f62ba731796d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
From b9d2d1862aa5b798cecb87a95d970ad34a4aebc0 Mon Sep 17 00:00:00 2001
From: Lee Jackson <lee.jackson@arducam.com>
Date: Tue, 30 May 2023 15:50:05 +0800
Subject: [PATCH] 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 <lee.jackson@arducam.com>
---
 drivers/media/i2c/arducam_64mp.c | 64 ++++++++++++++++++++++++++++++--
 1 file changed, 61 insertions(+), 3 deletions(-)

--- a/drivers/media/i2c/arducam_64mp.c
+++ b/drivers/media/i2c/arducam_64mp.c
@@ -95,7 +95,7 @@
 #define ARDUCAM_64MP_TEST_PATTERN_GB_DEFAULT	0
 
 /* Embedded metadata stream structure */
-#define ARDUCAM_64MP_EMBEDDED_LINE_WIDTH 16384
+#define ARDUCAM_64MP_EMBEDDED_LINE_WIDTH (11560 * 3)
 #define ARDUCAM_64MP_NUM_EMBEDDED_LINES 1
 
 enum pad_types {
@@ -144,6 +144,7 @@ struct arducam_64mp_mode {
 };
 
 static const struct arducam_64mp_reg mode_common_regs[] = {
+	{0x0100, 0x00},
 	{0x0136, 0x18},
 	{0x0137, 0x00},
 	{0x33F0, 0x01},
@@ -788,6 +789,7 @@ static const struct arducam_64mp_reg mod
 	{0x3092, 0x01},
 	{0x3093, 0x00},
 	{0x0350, 0x00},
+	{0x3419, 0x00},
 };
 
 /* 64 mpix 2.7fps */
@@ -847,6 +849,14 @@ static const struct arducam_64mp_reg mod
 	{0x0205, 0x00},
 	{0x020e, 0x01},
 	{0x020f, 0x00},
+	{0x341a, 0x00},
+	{0x341b, 0x00},
+	{0x341c, 0x00},
+	{0x341d, 0x00},
+	{0x341e, 0x02},
+	{0x341f, 0x3c},
+	{0x3420, 0x02},
+	{0x3421, 0x42},
 };
 
 /* 48 mpix 3.0fps */
@@ -906,6 +916,14 @@ static const struct arducam_64mp_reg mod
 	{0x0205, 0x00},
 	{0x020e, 0x01},
 	{0x020f, 0x00},
+	{0x341a, 0x00},
+	{0x341b, 0x00},
+	{0x341c, 0x00},
+	{0x341d, 0x00},
+	{0x341e, 0x01},
+	{0x341f, 0xf4},
+	{0x3420, 0x01},
+	{0x3421, 0xf4},
 };
 
 /* 16 mpix 10fps */
@@ -959,6 +977,14 @@ static const struct arducam_64mp_reg mod
 	{0x98d8, 0x8c},
 	{0x98d9, 0x0a},
 	{0x99c4, 0x16},
+	{0x341a, 0x00},
+	{0x341b, 0x00},
+	{0x341c, 0x00},
+	{0x341d, 0x00},
+	{0x341e, 0x01},
+	{0x341f, 0x21},
+	{0x3420, 0x01},
+	{0x3421, 0x21},
 };
 
 /* 4k 20fps mode */
@@ -1012,6 +1038,14 @@ static const struct arducam_64mp_reg mod
 	{0x98d8, 0x8c},
 	{0x98d9, 0x0a},
 	{0x99c4, 0x16},
+	{0x341a, 0x00},
+	{0x341b, 0x00},
+	{0x341c, 0x00},
+	{0x341d, 0x00},
+	{0x341e, 0x00},
+	{0x341f, 0xf0},
+	{0x3420, 0x00},
+	{0x3421, 0xb4},
 };
 
 /* 4x4 binned 30fps mode */
@@ -1031,7 +1065,7 @@ static const struct arducam_64mp_reg mod
 	{0x0900, 0x01},
 	{0x0901, 0x44},
 	{0x0902, 0x08},
-	{0x30d8, 0x00},
+	{0x30d8, 0x04},
 	{0x3200, 0x43},
 	{0x3201, 0x43},
 	{0x0408, 0x00},
@@ -1046,7 +1080,7 @@ static const struct arducam_64mp_reg mod
 	{0x034d, 0x08},
 	{0x034e, 0x06},
 	{0x034f, 0xc8},
-	{0x30d9, 0x01},
+	{0x30d9, 0x00},
 	{0x32d5, 0x00},
 	{0x32d6, 0x00},
 	{0x401e, 0x00},
@@ -1065,6 +1099,14 @@ static const struct arducam_64mp_reg mod
 	{0x98d8, 0x8c},
 	{0x98d9, 0x0a},
 	{0x99c4, 0x16},
+	{0x341a, 0x00},
+	{0x341b, 0x00},
+	{0x341c, 0x00},
+	{0x341d, 0x00},
+	{0x341e, 0x00},
+	{0x341f, 0x90},
+	{0x3420, 0x00},
+	{0x3421, 0x90},
 };
 
 /* 1080p 60fps mode */
@@ -1118,6 +1160,14 @@ static const struct arducam_64mp_reg mod
 	{0x98d8, 0x8c},
 	{0x98d9, 0x0a},
 	{0x99c4, 0x16},
+	{0x341a, 0x00},
+	{0x341b, 0x00},
+	{0x341c, 0x00},
+	{0x341d, 0x00},
+	{0x341e, 0x00},
+	{0x341f, 0x78},
+	{0x3420, 0x00},
+	{0x3421, 0x5a},
 };
 
 /* 720p 120fps mode */
@@ -1171,6 +1221,14 @@ static const struct arducam_64mp_reg mod
 	{0x98d8, 0x8c},
 	{0x98d9, 0x0a},
 	{0x99c4, 0x16},
+	{0x341a, 0x00},
+	{0x341b, 0x00},
+	{0x341c, 0x00},
+	{0x341d, 0x00},
+	{0x341e, 0x00},
+	{0x341f, 0x50},
+	{0x3420, 0x00},
+	{0x3421, 0x3c},
 };
 
 /* Mode configs */