1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef _ARCPGU_H_
18#define _ARCPGU_H_
19
20struct arcpgu_drm_private {
21 void __iomem *regs;
22 struct clk *clk;
23 struct drm_fbdev_cma *fbdev;
24 struct drm_framebuffer *fb;
25 struct drm_crtc crtc;
26 struct drm_plane *plane;
27};
28
29#define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)
30
31static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
32 unsigned int reg, u32 value)
33{
34 iowrite32(value, arcpgu->regs + reg);
35}
36
37static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
38 unsigned int reg)
39{
40 return ioread32(arcpgu->regs + reg);
41}
42
43int arc_pgu_setup_crtc(struct drm_device *dev);
44int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
45int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np);
46struct drm_fbdev_cma *arcpgu_fbdev_cma_init(struct drm_device *dev,
47 unsigned int preferred_bpp, unsigned int num_crtc,
48 unsigned int max_conn_count);
49
50#endif
51