2
0

168-media-atmel-atmel-isc-add-RLP-to-register-offsets.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From b432a8b0fc88de5b49236482053d8d372c68ee55 Mon Sep 17 00:00:00 2001
  2. From: Eugen Hristev <[email protected]>
  3. Date: Tue, 13 Apr 2021 12:57:10 +0200
  4. Subject: [PATCH 168/247] media: atmel: atmel-isc: add RLP to register offsets
  5. The RLP submodule is a part of the atmel-isc pipeline, and stands for
  6. Rounding,Limiting and Packaging. It used to extract specific data from the
  7. ISC pipeline. For example if we want to output greyscale 8 bit, we would
  8. use limiting to 8 bits, and packaging to Luma component only.
  9. Add rlp to the reg offsets struct.
  10. This will allow different products to have a different reg offset for this
  11. particular module.
  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 | 2 ++
  18. drivers/media/platform/atmel/atmel-isc.h | 2 ++
  19. drivers/media/platform/atmel/atmel-sama5d2-isc.c | 1 +
  20. 4 files changed, 7 insertions(+), 2 deletions(-)
  21. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  22. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  23. @@ -726,8 +726,8 @@ static int isc_configure(struct isc_devi
  24. regmap_update_bits(regmap, ISC_PFE_CFG0, mask, pfe_cfg0);
  25. - regmap_update_bits(regmap, ISC_RLP_CFG, ISC_RLP_CFG_MODE_MASK,
  26. - rlp_mode);
  27. + regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp,
  28. + ISC_RLP_CFG_MODE_MASK, rlp_mode);
  29. regmap_write(regmap, ISC_DCFG, dcfg);
  30. --- a/drivers/media/platform/atmel/atmel-isc-regs.h
  31. +++ b/drivers/media/platform/atmel/atmel-isc-regs.h
  32. @@ -204,6 +204,8 @@
  33. /* Subsampling 4:2:2 to 4:2:0 Control Register */
  34. #define ISC_SUB420_CTRL 0x000003cc
  35. +/* Offset for RLP register specific to sama5d2 product */
  36. +#define ISC_SAMA5D2_RLP_OFFSET 0
  37. /* Rounding, Limiting and Packing Configuration Register */
  38. #define ISC_RLP_CFG 0x000003d0
  39. --- a/drivers/media/platform/atmel/atmel-isc.h
  40. +++ b/drivers/media/platform/atmel/atmel-isc.h
  41. @@ -149,12 +149,14 @@ struct isc_ctrls {
  42. * @cbc: Offset for the CBC register
  43. * @sub422: Offset for the SUB422 register
  44. * @sub420: Offset for the SUB420 register
  45. + * @rlp: Offset for the RLP register
  46. */
  47. struct isc_reg_offsets {
  48. u32 csc;
  49. u32 cbc;
  50. u32 sub422;
  51. u32 sub420;
  52. + u32 rlp;
  53. };
  54. /*
  55. --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  56. +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  57. @@ -255,6 +255,7 @@ static int atmel_isc_probe(struct platfo
  58. isc->offsets.cbc = ISC_SAMA5D2_CBC_OFFSET;
  59. isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET;
  60. isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET;
  61. + isc->offsets.rlp = ISC_SAMA5D2_RLP_OFFSET;
  62. /* sama5d2-isc - 8 bits per beat */
  63. isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;