sun8i_csc.h 972 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) Jernej Skrabec <jernej.skrabec@siol.net>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. */
  9. #ifndef _SUN8I_CSC_H_
  10. #define _SUN8I_CSC_H_
  11. struct sun8i_mixer;
  12. /* VI channel CSC units offsets */
  13. #define CCSC00_OFFSET 0xAA050
  14. #define CCSC01_OFFSET 0xFA000
  15. #define CCSC10_OFFSET 0xA0000
  16. #define CCSC11_OFFSET 0xF0000
  17. #define SUN8I_CSC_CTRL(base) (base + 0x0)
  18. #define SUN8I_CSC_COEFF(base, i) (base + 0x10 + 4 * i)
  19. #define SUN8I_CSC_CTRL_EN BIT(0)
  20. enum sun8i_csc_mode {
  21. SUN8I_CSC_MODE_OFF,
  22. SUN8I_CSC_MODE_YUV2RGB,
  23. SUN8I_CSC_MODE_YVU2RGB,
  24. };
  25. void sun8i_csc_set_ccsc_coefficients(struct sun8i_mixer *mixer, int layer,
  26. enum sun8i_csc_mode mode);
  27. void sun8i_csc_enable_ccsc(struct sun8i_mixer *mixer, int layer, bool enable);
  28. #endif