1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2012 Russell King
8 #include <drm/drm_crtc.h>
10 struct armada_gem_object
;
18 #define armada_reg_queue_mod(_r, _i, _v, _m, _o) \
20 struct armada_regs *__reg = _r; \
21 __reg[_i].offset = _o; \
22 __reg[_i].mask = ~(_m); \
27 #define armada_reg_queue_set(_r, _i, _v, _o) \
28 armada_reg_queue_mod(_r, _i, _v, ~0, _o)
30 #define armada_reg_queue_end(_r, _i) \
31 armada_reg_queue_mod(_r, _i, 0, 0, ~0)
34 struct armada_variant
;
38 const struct armada_variant
*variant
;
44 uint32_t spu_v_h_total
;
51 struct armada_gem_object
*cursor_obj
;
54 uint32_t cursor_hw_pos
;
55 uint32_t cursor_hw_sz
;
59 uint32_t cfg_dumb_ctrl
;
60 uint32_t spu_iopad_ctrl
;
66 struct drm_pending_vblank_event
*event
;
67 struct armada_regs atomic_regs
[32];
68 struct armada_regs
*regs
;
69 unsigned int regs_idx
;
71 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)
73 void armada_drm_crtc_update_regs(struct armada_crtc
*, struct armada_regs
*);
75 struct armada_clocking_params
{
76 unsigned long permillage_min
;
77 unsigned long permillage_max
;
82 struct armada_clk_result
{
83 unsigned long desired_clk_hz
;
88 int armada_crtc_select_clock(struct armada_crtc
*dcrtc
,
89 struct armada_clk_result
*res
,
90 const struct armada_clocking_params
*params
,
91 struct clk
*clks
[], size_t num_clks
,
92 unsigned long desired_khz
);
94 extern struct platform_driver armada_lcd_platform_driver
;