David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * ARC PGU DRM driver. |
| 4 | * |
| 5 | * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com) |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef _ARCPGU_H_ |
| 9 | #define _ARCPGU_H_ |
| 10 | |
| 11 | struct arcpgu_drm_private { |
| 12 | void __iomem *regs; |
| 13 | struct clk *clk; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | |
| 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 | |
| 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); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 36 | |
| 37 | #endif |