Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/aspeed: Update INTR_STS handling

Add interrupt clear register define for further chip support.

Signed-off-by: Tommy Haung <tommy_huang@aspeedtech.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://patchwork.freedesktop.org/patch/msgid/20220302024930.18758-4-tommy_huang@aspeedtech.com

authored by

Tommy Haung and committed by
Joel Stanley
5e2421ce 9ae2ac4d

+6 -1
+1
drivers/gpu/drm/aspeed/aspeed_gfx.h
··· 12 12 struct regmap *scu; 13 13 14 14 u32 dac_reg; 15 + u32 int_clr_reg; 15 16 u32 vga_scratch_reg; 16 17 u32 throd_val; 17 18 u32 scan_line_max;
+5 -1
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
··· 61 61 62 62 struct aspeed_gfx_config { 63 63 u32 dac_reg; /* DAC register in SCU */ 64 + u32 int_clear_reg; /* Interrupt clear register */ 64 65 u32 vga_scratch_reg; /* VGA scratch register in SCU */ 65 66 u32 throd_val; /* Default Threshold Seting */ 66 67 u32 scan_line_max; /* Max memory size of one scan line */ ··· 69 68 70 69 static const struct aspeed_gfx_config ast2400_config = { 71 70 .dac_reg = 0x2c, 71 + .int_clear_reg = 0x60, 72 72 .vga_scratch_reg = 0x50, 73 73 .throd_val = CRT_THROD_LOW(0x1e) | CRT_THROD_HIGH(0x12), 74 74 .scan_line_max = 64, ··· 77 75 78 76 static const struct aspeed_gfx_config ast2500_config = { 79 77 .dac_reg = 0x2c, 78 + .int_clear_reg = 0x60, 80 79 .vga_scratch_reg = 0x50, 81 80 .throd_val = CRT_THROD_LOW(0x24) | CRT_THROD_HIGH(0x3c), 82 81 .scan_line_max = 128, ··· 123 120 124 121 if (reg & CRT_CTRL_VERTICAL_INTR_STS) { 125 122 drm_crtc_handle_vblank(&priv->pipe.crtc); 126 - writel(reg, priv->base + CRT_CTRL1); 123 + writel(reg, priv->base + priv->int_clr_reg); 127 124 return IRQ_HANDLED; 128 125 } 129 126 ··· 151 148 config = match->data; 152 149 153 150 priv->dac_reg = config->dac_reg; 151 + priv->int_clr_reg = config->int_clear_reg; 154 152 priv->vga_scratch_reg = config->vga_scratch_reg; 155 153 priv->throd_val = config->throd_val; 156 154 priv->scan_line_max = config->scan_line_max;