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

drm/sun4i: Add support for D1 TCON TOP

D1 has a TCON TOP with TCON TV0 and DSI, but no TCON TV1. This puts the
DSI clock name at index 1 in clock-output-names. Support this by only
incrementing the index for clocks that are actually supported.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-13-samuel@sholland.org

authored by

Samuel Holland and committed by
Maxime Ripard
a359beb4 30d334ce

+12 -3
+12 -3
drivers/gpu/drm/sun4i/sun8i_tcon_top.c
··· 189 189 * if TVE is active on each TCON TV. If it is, mux should be switched 190 190 * to TVE clock parent. 191 191 */ 192 + i = 0; 192 193 clk_data->hws[CLK_TCON_TOP_TV0] = 193 194 sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs, 194 195 &tcon_top->reg_lock, 195 - TCON_TOP_TCON_TV0_GATE, 0); 196 + TCON_TOP_TCON_TV0_GATE, i++); 196 197 197 198 if (quirks->has_tcon_tv1) 198 199 clk_data->hws[CLK_TCON_TOP_TV1] = 199 200 sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs, 200 201 &tcon_top->reg_lock, 201 - TCON_TOP_TCON_TV1_GATE, 1); 202 + TCON_TOP_TCON_TV1_GATE, i++); 202 203 203 204 if (quirks->has_dsi) 204 205 clk_data->hws[CLK_TCON_TOP_DSI] = 205 206 sun8i_tcon_top_register_gate(dev, "dsi", regs, 206 207 &tcon_top->reg_lock, 207 - TCON_TOP_TCON_DSI_GATE, 2); 208 + TCON_TOP_TCON_DSI_GATE, i++); 208 209 209 210 for (i = 0; i < CLK_NUM; i++) 210 211 if (IS_ERR(clk_data->hws[i])) { ··· 273 272 .has_dsi = true, 274 273 }; 275 274 275 + static const struct sun8i_tcon_top_quirks sun20i_d1_tcon_top_quirks = { 276 + .has_dsi = true, 277 + }; 278 + 276 279 static const struct sun8i_tcon_top_quirks sun50i_h6_tcon_top_quirks = { 277 280 /* Nothing special */ 278 281 }; ··· 286 281 { 287 282 .compatible = "allwinner,sun8i-r40-tcon-top", 288 283 .data = &sun8i_r40_tcon_top_quirks 284 + }, 285 + { 286 + .compatible = "allwinner,sun20i-d1-tcon-top", 287 + .data = &sun20i_d1_tcon_top_quirks 289 288 }, 290 289 { 291 290 .compatible = "allwinner,sun50i-h6-tcon-top",