174-media-atmel-atmel-isc-extend-pipeline-with-extra-mod.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. From 58a6cc3c7eecd16208cd16b92b4eaf8385e69696 Mon Sep 17 00:00:00 2001
  2. From: Eugen Hristev <[email protected]>
  3. Date: Tue, 13 Apr 2021 12:57:16 +0200
  4. Subject: [PATCH 174/247] media: atmel: atmel-isc: extend pipeline with extra
  5. modules
  6. Newer ISC pipelines have the additional modules of
  7. Defective Pixel Correction -> DPC itself,
  8. Defective Pixel Correction -> Green Disparity Correction (DPC_GDC)
  9. Defective Pixel Correction -> Black Level Correction (DPC_BLC)
  10. Vertical and Horizontal Scaler -> VHXS
  11. Some products have this full pipeline (sama7g5), other products do not (sama5d2)
  12. Add the modules to the isc base, and also extend the register range to include
  13. the modules.
  14. Signed-off-by: Eugen Hristev <[email protected]>
  15. Signed-off-by: Hans Verkuil <[email protected]>
  16. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  17. ---
  18. drivers/media/platform/atmel/atmel-isc-base.c | 11 ++++++--
  19. drivers/media/platform/atmel/atmel-isc.h | 28 +++++++++++--------
  20. 2 files changed, 25 insertions(+), 14 deletions(-)
  21. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  22. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  23. @@ -2324,8 +2324,14 @@ int isc_pipeline_init(struct isc_device
  24. struct regmap_field *regs;
  25. unsigned int i;
  26. - /* WB-->CFA-->CC-->GAM-->CSC-->CBC-->SUB422-->SUB420 */
  27. + /*
  28. + * DPCEN-->GDCEN-->BLCEN-->WB-->CFA-->CC-->
  29. + * GAM-->VHXS-->CSC-->CBC-->SUB422-->SUB420
  30. + */
  31. const struct reg_field regfields[ISC_PIPE_LINE_NODE_NUM] = {
  32. + REG_FIELD(ISC_DPC_CTRL, 0, 0),
  33. + REG_FIELD(ISC_DPC_CTRL, 1, 1),
  34. + REG_FIELD(ISC_DPC_CTRL, 2, 2),
  35. REG_FIELD(ISC_WB_CTRL, 0, 0),
  36. REG_FIELD(ISC_CFA_CTRL, 0, 0),
  37. REG_FIELD(ISC_CC_CTRL, 0, 0),
  38. @@ -2333,6 +2339,7 @@ int isc_pipeline_init(struct isc_device
  39. REG_FIELD(ISC_GAM_CTRL, 1, 1),
  40. REG_FIELD(ISC_GAM_CTRL, 2, 2),
  41. REG_FIELD(ISC_GAM_CTRL, 3, 3),
  42. + REG_FIELD(ISC_VHXS_CTRL, 0, 0),
  43. REG_FIELD(ISC_CSC_CTRL + isc->offsets.csc, 0, 0),
  44. REG_FIELD(ISC_CBC_CTRL + isc->offsets.cbc, 0, 0),
  45. REG_FIELD(ISC_SUB422_CTRL + isc->offsets.sub422, 0, 0),
  46. @@ -2351,7 +2358,7 @@ int isc_pipeline_init(struct isc_device
  47. }
  48. /* regmap configuration */
  49. -#define ATMEL_ISC_REG_MAX 0xbfc
  50. +#define ATMEL_ISC_REG_MAX 0xd5c
  51. const struct regmap_config isc_regmap_config = {
  52. .reg_bits = 32,
  53. .reg_stride = 4,
  54. --- a/drivers/media/platform/atmel/atmel-isc.h
  55. +++ b/drivers/media/platform/atmel/atmel-isc.h
  56. @@ -67,17 +67,21 @@ struct isc_format {
  57. };
  58. /* Pipeline bitmap */
  59. -#define WB_ENABLE BIT(0)
  60. -#define CFA_ENABLE BIT(1)
  61. -#define CC_ENABLE BIT(2)
  62. -#define GAM_ENABLE BIT(3)
  63. -#define GAM_BENABLE BIT(4)
  64. -#define GAM_GENABLE BIT(5)
  65. -#define GAM_RENABLE BIT(6)
  66. -#define CSC_ENABLE BIT(7)
  67. -#define CBC_ENABLE BIT(8)
  68. -#define SUB422_ENABLE BIT(9)
  69. -#define SUB420_ENABLE BIT(10)
  70. +#define DPC_DPCENABLE BIT(0)
  71. +#define DPC_GDCENABLE BIT(1)
  72. +#define DPC_BLCENABLE BIT(2)
  73. +#define WB_ENABLE BIT(3)
  74. +#define CFA_ENABLE BIT(4)
  75. +#define CC_ENABLE BIT(5)
  76. +#define GAM_ENABLE BIT(6)
  77. +#define GAM_BENABLE BIT(7)
  78. +#define GAM_GENABLE BIT(8)
  79. +#define GAM_RENABLE BIT(9)
  80. +#define VHXS_ENABLE BIT(10)
  81. +#define CSC_ENABLE BIT(11)
  82. +#define CBC_ENABLE BIT(12)
  83. +#define SUB422_ENABLE BIT(13)
  84. +#define SUB420_ENABLE BIT(14)
  85. #define GAM_ENABLES (GAM_RENABLE | GAM_GENABLE | GAM_BENABLE | GAM_ENABLE)
  86. @@ -141,7 +145,7 @@ struct isc_ctrls {
  87. u32 hist_minmax[HIST_BAYER][2];
  88. };
  89. -#define ISC_PIPE_LINE_NODE_NUM 11
  90. +#define ISC_PIPE_LINE_NODE_NUM 15
  91. /*
  92. * struct isc_reg_offsets - ISC device register offsets