2
0

167-media-atmel-atmel-isc-add-SUB422-and-SUB420-to-regis.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From aebb741058a63c3493f4139d11d6f290d5691e9b Mon Sep 17 00:00:00 2001
  2. From: Eugen Hristev <[email protected]>
  3. Date: Tue, 13 Apr 2021 12:57:09 +0200
  4. Subject: [PATCH 167/247] media: atmel: atmel-isc: add SUB422 and SUB420 to
  5. register offsets
  6. The SUB submodules are a part of the atmel-isc pipeline, and stand for
  7. Subsampling. They are used to subsample the original YUV 4:4:4 pixel ratio
  8. aspect to either 4:2:2 or 4:2:0.
  9. Add sub420 and sub422 to the reg offsets struct.
  10. This will allow different products to have a different reg offset for these
  11. particular modules.
  12. Signed-off-by: Eugen Hristev <[email protected]>
  13. Signed-off-by: Hans Verkuil <[email protected]>
  14. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  15. ---
  16. drivers/media/platform/atmel/atmel-isc-base.c | 4 ++--
  17. drivers/media/platform/atmel/atmel-isc-regs.h | 4 ++++
  18. drivers/media/platform/atmel/atmel-isc.h | 4 ++++
  19. drivers/media/platform/atmel/atmel-sama5d2-isc.c | 2 ++
  20. 4 files changed, 12 insertions(+), 2 deletions(-)
  21. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  22. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  23. @@ -2326,8 +2326,8 @@ int isc_pipeline_init(struct isc_device
  24. REG_FIELD(ISC_GAM_CTRL, 3, 3),
  25. REG_FIELD(ISC_CSC_CTRL + isc->offsets.csc, 0, 0),
  26. REG_FIELD(ISC_CBC_CTRL + isc->offsets.cbc, 0, 0),
  27. - REG_FIELD(ISC_SUB422_CTRL, 0, 0),
  28. - REG_FIELD(ISC_SUB420_CTRL, 0, 0),
  29. + REG_FIELD(ISC_SUB422_CTRL + isc->offsets.sub422, 0, 0),
  30. + REG_FIELD(ISC_SUB420_CTRL + isc->offsets.sub420, 0, 0),
  31. };
  32. for (i = 0; i < ISC_PIPE_LINE_NODE_NUM; i++) {
  33. --- a/drivers/media/platform/atmel/atmel-isc-regs.h
  34. +++ b/drivers/media/platform/atmel/atmel-isc-regs.h
  35. @@ -194,9 +194,13 @@
  36. #define ISC_CBC_CONTRAST 0x000003c0
  37. #define ISC_CBC_CONTRAST_MASK GENMASK(11, 0)
  38. +/* Offset for SUB422 register specific to sama5d2 product */
  39. +#define ISC_SAMA5D2_SUB422_OFFSET 0
  40. /* Subsampling 4:4:4 to 4:2:2 Control Register */
  41. #define ISC_SUB422_CTRL 0x000003c4
  42. +/* Offset for SUB420 register specific to sama5d2 product */
  43. +#define ISC_SAMA5D2_SUB420_OFFSET 0
  44. /* Subsampling 4:2:2 to 4:2:0 Control Register */
  45. #define ISC_SUB420_CTRL 0x000003cc
  46. --- a/drivers/media/platform/atmel/atmel-isc.h
  47. +++ b/drivers/media/platform/atmel/atmel-isc.h
  48. @@ -147,10 +147,14 @@ struct isc_ctrls {
  49. * struct isc_reg_offsets - ISC device register offsets
  50. * @csc: Offset for the CSC register
  51. * @cbc: Offset for the CBC register
  52. + * @sub422: Offset for the SUB422 register
  53. + * @sub420: Offset for the SUB420 register
  54. */
  55. struct isc_reg_offsets {
  56. u32 csc;
  57. u32 cbc;
  58. + u32 sub422;
  59. + u32 sub420;
  60. };
  61. /*
  62. --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  63. +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  64. @@ -253,6 +253,8 @@ static int atmel_isc_probe(struct platfo
  65. isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;
  66. isc->offsets.cbc = ISC_SAMA5D2_CBC_OFFSET;
  67. + isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET;
  68. + isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET;
  69. /* sama5d2-isc - 8 bits per beat */
  70. isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;