regs-mixer.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
  3. * http://www.samsung.com/
  4. *
  5. * Mixer register header file for Samsung Mixer driver
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef SAMSUNG_REGS_MIXER_H
  12. #define SAMSUNG_REGS_MIXER_H
  13. /*
  14. * Register part
  15. */
  16. #define MXR_STATUS 0x0000
  17. #define MXR_CFG 0x0004
  18. #define MXR_INT_EN 0x0008
  19. #define MXR_INT_STATUS 0x000C
  20. #define MXR_LAYER_CFG 0x0010
  21. #define MXR_VIDEO_CFG 0x0014
  22. #define MXR_GRAPHIC0_CFG 0x0020
  23. #define MXR_GRAPHIC0_BASE 0x0024
  24. #define MXR_GRAPHIC0_SPAN 0x0028
  25. #define MXR_GRAPHIC0_SXY 0x002C
  26. #define MXR_GRAPHIC0_WH 0x0030
  27. #define MXR_GRAPHIC0_DXY 0x0034
  28. #define MXR_GRAPHIC0_BLANK 0x0038
  29. #define MXR_GRAPHIC1_CFG 0x0040
  30. #define MXR_GRAPHIC1_BASE 0x0044
  31. #define MXR_GRAPHIC1_SPAN 0x0048
  32. #define MXR_GRAPHIC1_SXY 0x004C
  33. #define MXR_GRAPHIC1_WH 0x0050
  34. #define MXR_GRAPHIC1_DXY 0x0054
  35. #define MXR_GRAPHIC1_BLANK 0x0058
  36. #define MXR_BG_CFG 0x0060
  37. #define MXR_BG_COLOR0 0x0064
  38. #define MXR_BG_COLOR1 0x0068
  39. #define MXR_BG_COLOR2 0x006C
  40. /* for parametrized access to layer registers */
  41. #define MXR_GRAPHIC_CFG(i) (0x0020 + (i) * 0x20)
  42. #define MXR_GRAPHIC_BASE(i) (0x0024 + (i) * 0x20)
  43. #define MXR_GRAPHIC_SPAN(i) (0x0028 + (i) * 0x20)
  44. #define MXR_GRAPHIC_SXY(i) (0x002C + (i) * 0x20)
  45. #define MXR_GRAPHIC_WH(i) (0x0030 + (i) * 0x20)
  46. #define MXR_GRAPHIC_DXY(i) (0x0034 + (i) * 0x20)
  47. /*
  48. * Bit definition part
  49. */
  50. /* generates mask for range of bits */
  51. #define MXR_MASK(high_bit, low_bit) \
  52. (((2 << ((high_bit) - (low_bit))) - 1) << (low_bit))
  53. #define MXR_MASK_VAL(val, high_bit, low_bit) \
  54. (((val) << (low_bit)) & MXR_MASK(high_bit, low_bit))
  55. /* bits for MXR_STATUS */
  56. #define MXR_STATUS_16_BURST (1 << 7)
  57. #define MXR_STATUS_BURST_MASK (1 << 7)
  58. #define MXR_STATUS_SYNC_ENABLE (1 << 2)
  59. #define MXR_STATUS_REG_RUN (1 << 0)
  60. /* bits for MXR_CFG */
  61. #define MXR_CFG_OUT_YUV444 (0 << 8)
  62. #define MXR_CFG_OUT_RGB888 (1 << 8)
  63. #define MXR_CFG_OUT_MASK (1 << 8)
  64. #define MXR_CFG_DST_SDO (0 << 7)
  65. #define MXR_CFG_DST_HDMI (1 << 7)
  66. #define MXR_CFG_DST_MASK (1 << 7)
  67. #define MXR_CFG_SCAN_HD_720 (0 << 6)
  68. #define MXR_CFG_SCAN_HD_1080 (1 << 6)
  69. #define MXR_CFG_GRP1_ENABLE (1 << 5)
  70. #define MXR_CFG_GRP0_ENABLE (1 << 4)
  71. #define MXR_CFG_VP_ENABLE (1 << 3)
  72. #define MXR_CFG_SCAN_INTERLACE (0 << 2)
  73. #define MXR_CFG_SCAN_PROGRASSIVE (1 << 2)
  74. #define MXR_CFG_SCAN_NTSC (0 << 1)
  75. #define MXR_CFG_SCAN_PAL (1 << 1)
  76. #define MXR_CFG_SCAN_SD (0 << 0)
  77. #define MXR_CFG_SCAN_HD (1 << 0)
  78. #define MXR_CFG_SCAN_MASK 0x47
  79. /* bits for MXR_GRAPHICn_CFG */
  80. #define MXR_GRP_CFG_COLOR_KEY_DISABLE (1 << 21)
  81. #define MXR_GRP_CFG_BLEND_PRE_MUL (1 << 20)
  82. #define MXR_GRP_CFG_FORMAT_VAL(x) MXR_MASK_VAL(x, 11, 8)
  83. #define MXR_GRP_CFG_FORMAT_MASK MXR_GRP_CFG_FORMAT_VAL(~0)
  84. #define MXR_GRP_CFG_ALPHA_VAL(x) MXR_MASK_VAL(x, 7, 0)
  85. /* bits for MXR_GRAPHICn_WH */
  86. #define MXR_GRP_WH_H_SCALE(x) MXR_MASK_VAL(x, 28, 28)
  87. #define MXR_GRP_WH_V_SCALE(x) MXR_MASK_VAL(x, 12, 12)
  88. #define MXR_GRP_WH_WIDTH(x) MXR_MASK_VAL(x, 26, 16)
  89. #define MXR_GRP_WH_HEIGHT(x) MXR_MASK_VAL(x, 10, 0)
  90. /* bits for MXR_GRAPHICn_SXY */
  91. #define MXR_GRP_SXY_SX(x) MXR_MASK_VAL(x, 26, 16)
  92. #define MXR_GRP_SXY_SY(x) MXR_MASK_VAL(x, 10, 0)
  93. /* bits for MXR_GRAPHICn_DXY */
  94. #define MXR_GRP_DXY_DX(x) MXR_MASK_VAL(x, 26, 16)
  95. #define MXR_GRP_DXY_DY(x) MXR_MASK_VAL(x, 10, 0)
  96. /* bits for MXR_INT_EN */
  97. #define MXR_INT_EN_VSYNC (1 << 11)
  98. #define MXR_INT_EN_ALL (0x0f << 8)
  99. /* bit for MXR_INT_STATUS */
  100. #define MXR_INT_CLEAR_VSYNC (1 << 11)
  101. #define MXR_INT_STATUS_VSYNC (1 << 0)
  102. /* bit for MXR_LAYER_CFG */
  103. #define MXR_LAYER_CFG_GRP1_VAL(x) MXR_MASK_VAL(x, 11, 8)
  104. #define MXR_LAYER_CFG_GRP0_VAL(x) MXR_MASK_VAL(x, 7, 4)
  105. #define MXR_LAYER_CFG_VP_VAL(x) MXR_MASK_VAL(x, 3, 0)
  106. #endif /* SAMSUNG_REGS_MIXER_H */