csc.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2013 Texas Instruments Inc.
  3. *
  4. * David Griego, <dagriego@biglakesoftware.com>
  5. * Dale Farnsworth, <dale@farnsworth.org>
  6. * Archit Taneja, <archit@ti.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License version 2 as published by
  10. * the Free Software Foundation.
  11. */
  12. #ifndef TI_CSC_H
  13. #define TI_CSC_H
  14. /* VPE color space converter regs */
  15. #define CSC_CSC00 0x00
  16. #define CSC_A0_MASK 0x1fff
  17. #define CSC_A0_SHIFT 0
  18. #define CSC_B0_MASK 0x1fff
  19. #define CSC_B0_SHIFT 16
  20. #define CSC_CSC01 0x04
  21. #define CSC_C0_MASK 0x1fff
  22. #define CSC_C0_SHIFT 0
  23. #define CSC_A1_MASK 0x1fff
  24. #define CSC_A1_SHIFT 16
  25. #define CSC_CSC02 0x08
  26. #define CSC_B1_MASK 0x1fff
  27. #define CSC_B1_SHIFT 0
  28. #define CSC_C1_MASK 0x1fff
  29. #define CSC_C1_SHIFT 16
  30. #define CSC_CSC03 0x0c
  31. #define CSC_A2_MASK 0x1fff
  32. #define CSC_A2_SHIFT 0
  33. #define CSC_B2_MASK 0x1fff
  34. #define CSC_B2_SHIFT 16
  35. #define CSC_CSC04 0x10
  36. #define CSC_C2_MASK 0x1fff
  37. #define CSC_C2_SHIFT 0
  38. #define CSC_D0_MASK 0x0fff
  39. #define CSC_D0_SHIFT 16
  40. #define CSC_CSC05 0x14
  41. #define CSC_D1_MASK 0x0fff
  42. #define CSC_D1_SHIFT 0
  43. #define CSC_D2_MASK 0x0fff
  44. #define CSC_D2_SHIFT 16
  45. #define CSC_BYPASS (1 << 28)
  46. struct csc_data {
  47. void __iomem *base;
  48. struct resource *res;
  49. struct platform_device *pdev;
  50. };
  51. void csc_dump_regs(struct csc_data *csc);
  52. void csc_set_coeff_bypass(struct csc_data *csc, u32 *csc_reg5);
  53. void csc_set_coeff(struct csc_data *csc, u32 *csc_reg0,
  54. enum v4l2_colorspace src_colorspace,
  55. enum v4l2_colorspace dst_colorspace);
  56. struct csc_data *csc_create(struct platform_device *pdev);
  57. #endif