178-media-atmel-atmel-isc-create-callback-for-GAM-submod.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From 96936a6753a13dea5a8f66de949e6594dd82ce22 Mon Sep 17 00:00:00 2001
  2. From: Eugen Hristev <[email protected]>
  3. Date: Tue, 13 Apr 2021 12:57:20 +0200
  4. Subject: [PATCH 178/247] media: atmel: atmel-isc: create callback for GAM
  5. submodule product specific
  6. The GAM submodule is a part of the atmel-isc pipeline, and stands for
  7. Gamma Correction. It is used to apply the gamma curve to the incoming pixels.
  8. Create a product specific callback for initializing the GAM submodule
  9. of the pipeline.
  10. For sama5d2 product, there is no special configuration at this moment,
  11. thus this function is a noop.
  12. [hverkuil: made isc_sama5d2_config_gam 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 | 1 +
  18. drivers/media/platform/atmel/atmel-isc.h | 3 +++
  19. drivers/media/platform/atmel/atmel-sama5d2-isc.c | 6 ++++++
  20. 3 files changed, 10 insertions(+)
  21. diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c
  22. index 777a5dc19d6e..aef0d6570d39 100644
  23. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  24. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  25. @@ -663,6 +663,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)
  26. isc->config_csc(isc);
  27. isc->config_cbc(isc);
  28. isc->config_cc(isc);
  29. + isc->config_gam(isc);
  30. }
  31. static int isc_update_profile(struct isc_device *isc)
  32. diff --git a/drivers/media/platform/atmel/atmel-isc.h b/drivers/media/platform/atmel/atmel-isc.h
  33. index 2f093dc968cd..151997c11f56 100644
  34. --- a/drivers/media/platform/atmel/atmel-isc.h
  35. +++ b/drivers/media/platform/atmel/atmel-isc.h
  36. @@ -228,6 +228,8 @@ struct isc_reg_offsets {
  37. * specific CBC module
  38. * @config_cc: pointer to a function that initializes product
  39. * specific CC module
  40. + * @config_gam: pointer to a function that initializes product
  41. + * specific GAMMA module
  42. * @config_ctrls: pointer to a functoin that initializes product
  43. * specific v4l2 controls.
  44. *
  45. @@ -305,6 +307,7 @@ struct isc_device {
  46. void (*config_csc)(struct isc_device *isc);
  47. void (*config_cbc)(struct isc_device *isc);
  48. void (*config_cc)(struct isc_device *isc);
  49. + void (*config_gam)(struct isc_device *isc);
  50. void (*config_ctrls)(struct isc_device *isc,
  51. const struct v4l2_ctrl_ops *ops);
  52. diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  53. index 84d1bf3305f2..b99849ecb8a1 100644
  54. --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  55. +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  56. @@ -112,6 +112,11 @@ static void isc_sama5d2_config_dpc(struct isc_device *isc)
  57. /* This module is not present on sama5d2 pipeline */
  58. }
  59. +static void isc_sama5d2_config_gam(struct isc_device *isc)
  60. +{
  61. + /* No specific gamma configuration */
  62. +}
  63. +
  64. /* Gamma table with gamma 1/2.2 */
  65. static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = {
  66. /* 0 --> gamma 1/1.8 */
  67. @@ -282,6 +287,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
  68. isc->config_csc = isc_sama5d2_config_csc;
  69. isc->config_cbc = isc_sama5d2_config_cbc;
  70. isc->config_cc = isc_sama5d2_config_cc;
  71. + isc->config_gam = isc_sama5d2_config_gam;
  72. isc->config_ctrls = isc_sama5d2_config_ctrls;
  73. isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;
  74. --
  75. 2.32.0