]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/gpu/drm/zte/zx_drm_drv.h
Linux 4.10-rc8
[karo-tx-linux.git] / drivers / gpu / drm / zte / zx_drm_drv.h
1 /*
2  * Copyright 2016 Linaro Ltd.
3  * Copyright 2016 ZTE Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  */
10
11 #ifndef __ZX_DRM_DRV_H__
12 #define __ZX_DRM_DRV_H__
13
14 extern struct platform_driver zx_crtc_driver;
15 extern struct platform_driver zx_hdmi_driver;
16
17 static inline u32 zx_readl(void __iomem *reg)
18 {
19         return readl_relaxed(reg);
20 }
21
22 static inline void zx_writel(void __iomem *reg, u32 val)
23 {
24         writel_relaxed(val, reg);
25 }
26
27 static inline void zx_writel_mask(void __iomem *reg, u32 mask, u32 val)
28 {
29         u32 tmp;
30
31         tmp = zx_readl(reg);
32         tmp = (tmp & ~mask) | (val & mask);
33         zx_writel(reg, tmp);
34 }
35
36 #endif /* __ZX_DRM_DRV_H__ */