161-media-atmel-atmel-isc-specialize-dma-cfg.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From c42305f52560a1be6fc25a2f23579c7b323de654 Mon Sep 17 00:00:00 2001
  2. From: Eugen Hristev <[email protected]>
  3. Date: Tue, 13 Apr 2021 12:57:03 +0200
  4. Subject: [PATCH 161/247] media: atmel: atmel-isc: specialize dma cfg
  5. The dma configuration (DCFG) is specific to the product.
  6. Move this configuration in the product specific driver, and add the
  7. field inside the driver struct.
  8. Signed-off-by: Eugen Hristev <[email protected]>
  9. Signed-off-by: Hans Verkuil <[email protected]>
  10. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  11. ---
  12. drivers/media/platform/atmel/atmel-isc-base.c | 3 +--
  13. drivers/media/platform/atmel/atmel-isc.h | 2 ++
  14. drivers/media/platform/atmel/atmel-sama5d2-isc.c | 3 +++
  15. 3 files changed, 6 insertions(+), 2 deletions(-)
  16. --- a/drivers/media/platform/atmel/atmel-isc-base.c
  17. +++ b/drivers/media/platform/atmel/atmel-isc-base.c
  18. @@ -724,8 +724,7 @@ static int isc_configure(struct isc_devi
  19. rlp_mode = isc->config.rlp_cfg_mode;
  20. pipeline = isc->config.bits_pipeline;
  21. - dcfg = isc->config.dcfg_imode |
  22. - ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;
  23. + dcfg = isc->config.dcfg_imode | isc->dcfg;
  24. pfe_cfg0 |= subdev->pfe_cfg0 | ISC_PFE_CFG0_MODE_PROGRESSIVE;
  25. mask = ISC_PFE_CFG0_BPS_MASK | ISC_PFE_CFG0_HPOL_LOW |
  26. --- a/drivers/media/platform/atmel/atmel-isc.h
  27. +++ b/drivers/media/platform/atmel/atmel-isc.h
  28. @@ -149,6 +149,7 @@ struct isc_ctrls {
  29. * @hclock: Hclock clock input (refer datasheet)
  30. * @ispck: iscpck clock (refer datasheet)
  31. * @isc_clks: ISC clocks
  32. + * @dcfg: DMA master configuration, architecture dependent
  33. *
  34. * @dev: Registered device driver
  35. * @v4l2_dev: v4l2 registered device
  36. @@ -196,6 +197,7 @@ struct isc_device {
  37. struct clk *hclock;
  38. struct clk *ispck;
  39. struct isc_clk isc_clks[2];
  40. + u32 dcfg;
  41. struct device *dev;
  42. struct v4l2_device v4l2_dev;
  43. --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  44. +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
  45. @@ -219,6 +219,9 @@ static int atmel_isc_probe(struct platfo
  46. isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
  47. isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
  48. + /* sama5d2-isc - 8 bits per beat */
  49. + isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;
  50. +
  51. ret = isc_pipeline_init(isc);
  52. if (ret)
  53. return ret;