950-0802-media-i2c-arducam_64mp-Add-PDAF-support.patch 3.6 KB

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