2
0

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  22. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  23. @@ -659,6 +659,7 @@ static void isc_set_pipeline(struct isc_
  24. regmap_bulk_write(regmap, ISC_GAM_GENTRY, gamma, GAMMA_ENTRIES);
  25. regmap_bulk_write(regmap, ISC_GAM_RENTRY, gamma, GAMMA_ENTRIES);
  26. + isc->config_dpc(isc);
  27. isc->config_csc(isc);
  28. isc->config_cbc(isc);
  29. isc->config_cc(isc);
  30. --- a/drivers/media/platform/atmel/atmel-isc.h
  31. +++ b/drivers/media/platform/atmel/atmel-isc.h
  32. @@ -220,6 +220,8 @@ struct isc_reg_offsets {
  33. * @max_width: maximum frame width, dependent on the internal RAM
  34. * @max_height: maximum frame height, dependent on the internal RAM
  35. *
  36. + * @config_dpc: pointer to a function that initializes product
  37. + * specific DPC module
  38. * @config_csc: pointer to a function that initializes product
  39. * specific CSC module
  40. * @config_cbc: pointer to a function that initializes product
  41. @@ -299,6 +301,7 @@ struct isc_device {
  42. u32 max_height;
  43. struct {
  44. + void (*config_dpc)(struct isc_device *isc);
  45. void (*config_csc)(struct isc_device *isc);
  46. void (*config_cbc)(struct isc_device *isc);
  47. void (*config_cc)(struct isc_device *isc);
  48. --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  49. +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  50. @@ -107,6 +107,11 @@ static void isc_sama5d2_config_ctrls(str
  51. v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, -2048, 2047, 1, 256);
  52. }
  53. +static void isc_sama5d2_config_dpc(struct isc_device *isc)
  54. +{
  55. + /* This module is not present on sama5d2 pipeline */
  56. +}
  57. +
  58. /* Gamma table with gamma 1/2.2 */
  59. static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = {
  60. /* 0 --> gamma 1/1.8 */
  61. @@ -273,6 +278,7 @@ static int atmel_isc_probe(struct platfo
  62. isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
  63. isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
  64. + isc->config_dpc = isc_sama5d2_config_dpc;
  65. isc->config_csc = isc_sama5d2_config_csc;
  66. isc->config_cbc = isc_sama5d2_config_cbc;
  67. isc->config_cc = isc_sama5d2_config_cc;