179-media-atmel-atmel-isc-create-callback-for-RLP-submod.patch 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. From ece1d7059731e31875e6eb464da4fb4a16465305 Mon Sep 17 00:00:00 2001
  2. From: Eugen Hristev <[email protected]>
  3. Date: Tue, 13 Apr 2021 12:57:21 +0200
  4. Subject: [PATCH 179/247] media: atmel: atmel-isc: create callback for RLP
  5. submodule product specific
  6. The RLP submodule is a part of the atmel-isc pipeline, and stands for
  7. Rounding,Limiting and Packaging. It used to extract specific data from the
  8. ISC pipeline. For example if we want to output greyscale 8 bit, we would
  9. use limiting to 8 bits, and packaging to Luma component only.
  10. Create a product specific callback for initializing the RLP submodule
  11. of the pipeline
  12. [hverkuil: made isc_sama5d2_config_rlp static]
  13. Signed-off-by: Eugen Hristev <[email protected]>
  14. Signed-off-by: Hans Verkuil <[email protected]>
  15. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  16. ---
  17. drivers/media/platform/atmel/atmel-isc-base.c | 6 ++----
  18. drivers/media/platform/atmel/atmel-isc.h | 3 +++
  19. drivers/media/platform/atmel/atmel-sama5d2-isc.c | 10 ++++++++++
  20. 3 files changed, 15 insertions(+), 4 deletions(-)
  21. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  22. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  23. @@ -719,11 +719,10 @@ static void isc_set_histogram(struct isc
  24. static int isc_configure(struct isc_device *isc)
  25. {
  26. struct regmap *regmap = isc->regmap;
  27. - u32 pfe_cfg0, rlp_mode, dcfg, mask, pipeline;
  28. + u32 pfe_cfg0, dcfg, mask, pipeline;
  29. struct isc_subdev_entity *subdev = isc->current_subdev;
  30. pfe_cfg0 = isc->config.sd_format->pfe_cfg0_bps;
  31. - rlp_mode = isc->config.rlp_cfg_mode;
  32. pipeline = isc->config.bits_pipeline;
  33. dcfg = isc->config.dcfg_imode | isc->dcfg;
  34. @@ -736,8 +735,7 @@ static int isc_configure(struct isc_devi
  35. regmap_update_bits(regmap, ISC_PFE_CFG0, mask, pfe_cfg0);
  36. - regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp,
  37. - ISC_RLP_CFG_MODE_MASK, rlp_mode);
  38. + isc->config_rlp(isc);
  39. regmap_write(regmap, ISC_DCFG + isc->offsets.dma, dcfg);
  40. --- a/drivers/media/platform/atmel/atmel-isc.h
  41. +++ b/drivers/media/platform/atmel/atmel-isc.h
  42. @@ -230,6 +230,8 @@ struct isc_reg_offsets {
  43. * specific CC module
  44. * @config_gam: pointer to a function that initializes product
  45. * specific GAMMA module
  46. + * @config_rlp: pointer to a function that initializes product
  47. + * specific RLP module
  48. * @config_ctrls: pointer to a functoin that initializes product
  49. * specific v4l2 controls.
  50. *
  51. @@ -308,6 +310,7 @@ struct isc_device {
  52. void (*config_cbc)(struct isc_device *isc);
  53. void (*config_cc)(struct isc_device *isc);
  54. void (*config_gam)(struct isc_device *isc);
  55. + void (*config_rlp)(struct isc_device *isc);
  56. void (*config_ctrls)(struct isc_device *isc,
  57. const struct v4l2_ctrl_ops *ops);
  58. --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  59. +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  60. @@ -117,6 +117,15 @@ static void isc_sama5d2_config_gam(struc
  61. /* No specific gamma configuration */
  62. }
  63. +static void isc_sama5d2_config_rlp(struct isc_device *isc)
  64. +{
  65. + struct regmap *regmap = isc->regmap;
  66. + u32 rlp_mode = isc->config.rlp_cfg_mode;
  67. +
  68. + regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp,
  69. + ISC_RLP_CFG_MODE_MASK, rlp_mode);
  70. +}
  71. +
  72. /* Gamma table with gamma 1/2.2 */
  73. static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = {
  74. /* 0 --> gamma 1/1.8 */
  75. @@ -288,6 +297,7 @@ static int atmel_isc_probe(struct platfo
  76. isc->config_cbc = isc_sama5d2_config_cbc;
  77. isc->config_cc = isc_sama5d2_config_cc;
  78. isc->config_gam = isc_sama5d2_config_gam;
  79. + isc->config_rlp = isc_sama5d2_config_rlp;
  80. isc->config_ctrls = isc_sama5d2_config_ctrls;
  81. isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;