aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2017-10-09 23:20:05 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-10-11 03:53:41 -0400
commitc4a9aec3dfe5203363c6c2f9fc62353f4898225e (patch)
tree003080f246fe5c1d1e10ef9cf489f32cfbb78317
parent939d749ad6649c4123daf63a8bc053ea97ad2218 (diff)
drm/sun4i: hdmi: Add A31 specific DDC register definitions
The DDC block for the HDMI controller is different on the A31. This patch adds the register definitions. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-9-wens@csie.org
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_hdmi.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi.h b/drivers/gpu/drm/sun4i/sun4i_hdmi.h
index 3057e31219f6..ee42ae7e5a21 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi.h
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi.h
@@ -153,6 +153,37 @@
153 153
154#define SUN4I_HDMI_DDC_FIFO_SIZE 16 154#define SUN4I_HDMI_DDC_FIFO_SIZE 16
155 155
156/* A31 specific */
157#define SUN6I_HDMI_DDC_CTRL_REG 0x500
158#define SUN6I_HDMI_DDC_CTRL_RESET BIT(31)
159#define SUN6I_HDMI_DDC_CTRL_START_CMD BIT(27)
160#define SUN6I_HDMI_DDC_CTRL_SDA_ENABLE BIT(6)
161#define SUN6I_HDMI_DDC_CTRL_SCL_ENABLE BIT(4)
162#define SUN6I_HDMI_DDC_CTRL_ENABLE BIT(0)
163
164#define SUN6I_HDMI_DDC_CMD_REG 0x508
165#define SUN6I_HDMI_DDC_CMD_BYTE_COUNT(count) ((count) << 16)
166/* command types in lower 3 bits are the same as sun4i */
167
168#define SUN6I_HDMI_DDC_ADDR_REG 0x50c
169#define SUN6I_HDMI_DDC_ADDR_SEGMENT(seg) (((seg) & 0xff) << 24)
170#define SUN6I_HDMI_DDC_ADDR_EDDC(addr) (((addr) & 0xff) << 16)
171#define SUN6I_HDMI_DDC_ADDR_OFFSET(off) (((off) & 0xff) << 8)
172#define SUN6I_HDMI_DDC_ADDR_SLAVE(addr) (((addr) & 0xff) << 1)
173
174#define SUN6I_HDMI_DDC_INT_STATUS_REG 0x514
175#define SUN6I_HDMI_DDC_INT_STATUS_TIMEOUT BIT(8)
176/* lower 8 bits are the same as sun4i */
177
178#define SUN6I_HDMI_DDC_FIFO_CTRL_REG 0x518
179#define SUN6I_HDMI_DDC_FIFO_CTRL_CLEAR BIT(15)
180/* lower 9 bits are the same as sun4i */
181
182#define SUN6I_HDMI_DDC_CLK_REG 0x520
183/* DDC CLK bit fields are the same, but the formula is not */
184
185#define SUN6I_HDMI_DDC_FIFO_DATA_REG 0x580
186
156enum sun4i_hdmi_pkt_type { 187enum sun4i_hdmi_pkt_type {
157 SUN4I_HDMI_PKT_AVI = 2, 188 SUN4I_HDMI_PKT_AVI = 2,
158 SUN4I_HDMI_PKT_END = 15, 189 SUN4I_HDMI_PKT_END = 15,