177-media-atmel-atmel-isc-create-callback-for-DPC-submod.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From d53eb90044c19ba22b51978fcb007d9b5200b83a Mon Sep 17 00:00:00 2001
  2. From: Eugen Hristev <[email protected]>
  3. Date: Tue, 13 Apr 2021 12:57:19 +0200
  4. Subject: [PATCH 177/247] media: atmel: atmel-isc: create callback for DPC
  5. submodule product specific
  6. The DPC submodule is a part of the atmel-isc pipeline, and stands for
  7. Defective Pixel Correction. Its purpose is to detect defective pixels and
  8. correct them if possible with the help of adjacent pixels.
  9. Create a product specific callback for initializing the DPC submodule
  10. of the pipeline.
  11. For sama5d2 product, this module does not exist, thus this function is a noop.
  12. [hverkuil: made isc_sama5d2_config_dpc 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 8ed8b8a4840c..777a5dc19d6e 100644
  23. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  24. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  25. @@ -659,6 +659,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)
  26. regmap_bulk_write(regmap, ISC_GAM_GENTRY, gamma, GAMMA_ENTRIES);
  27. regmap_bulk_write(regmap, ISC_GAM_RENTRY, gamma, GAMMA_ENTRIES);
  28. + isc->config_dpc(isc);
  29. isc->config_csc(isc);
  30. isc->config_cbc(isc);
  31. isc->config_cc(isc);
  32. diff --git a/drivers/media/platform/atmel/atmel-isc.h b/drivers/media/platform/atmel/atmel-isc.h
  33. index 428419d5a07d..2f093dc968cd 100644
  34. --- a/drivers/media/platform/atmel/atmel-isc.h
  35. +++ b/drivers/media/platform/atmel/atmel-isc.h
  36. @@ -220,6 +220,8 @@ struct isc_reg_offsets {
  37. * @max_width: maximum frame width, dependent on the internal RAM
  38. * @max_height: maximum frame height, dependent on the internal RAM
  39. *
  40. + * @config_dpc: pointer to a function that initializes product
  41. + * specific DPC module
  42. * @config_csc: pointer to a function that initializes product
  43. * specific CSC module
  44. * @config_cbc: pointer to a function that initializes product
  45. @@ -299,6 +301,7 @@ struct isc_device {
  46. u32 max_height;
  47. struct {
  48. + void (*config_dpc)(struct isc_device *isc);
  49. void (*config_csc)(struct isc_device *isc);
  50. void (*config_cbc)(struct isc_device *isc);
  51. void (*config_cc)(struct isc_device *isc);
  52. diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  53. index 7512012cd9f3..84d1bf3305f2 100644
  54. --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  55. +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  56. @@ -107,6 +107,11 @@ static void isc_sama5d2_config_ctrls(struct isc_device *isc,
  57. v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, -2048, 2047, 1, 256);
  58. }
  59. +static void isc_sama5d2_config_dpc(struct isc_device *isc)
  60. +{
  61. + /* This module is not present on sama5d2 pipeline */
  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. @@ -273,6 +278,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
  68. isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
  69. isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
  70. + isc->config_dpc = isc_sama5d2_config_dpc;
  71. isc->config_csc = isc_sama5d2_config_csc;
  72. isc->config_cbc = isc_sama5d2_config_cbc;
  73. isc->config_cc = isc_sama5d2_config_cc;
  74. --
  75. 2.32.0