• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * ARC PGU DRM driver.
4  *
5  * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
6  */
7 
8 #ifndef _ARCPGU_H_
9 #define _ARCPGU_H_
10 
11 struct arcpgu_drm_private {
12 	void __iomem		*regs;
13 	struct clk		*clk;
14 	struct drm_framebuffer	*fb;
15 	struct drm_crtc		crtc;
16 	struct drm_plane	*plane;
17 };
18 
19 #define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)
20 
arc_pgu_write(struct arcpgu_drm_private * arcpgu,unsigned int reg,u32 value)21 static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
22 				 unsigned int reg, u32 value)
23 {
24 	iowrite32(value, arcpgu->regs + reg);
25 }
26 
arc_pgu_read(struct arcpgu_drm_private * arcpgu,unsigned int reg)27 static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
28 			       unsigned int reg)
29 {
30 	return ioread32(arcpgu->regs + reg);
31 }
32 
33 int arc_pgu_setup_crtc(struct drm_device *dev);
34 int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
35 int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np);
36 
37 #endif
38