2 * rcar_du_drv.h -- R-Car Display Unit DRM driver
4 * Copyright (C) 2013 Renesas Corporation
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
14 #ifndef __RCAR_DU_DRV_H__
15 #define __RCAR_DU_DRV_H__
17 #include <linux/kernel.h>
18 #include <linux/mutex.h>
19 #include <linux/platform_data/rcar-du.h>
21 #include "rcar_du_crtc.h"
22 #include "rcar_du_plane.h"
28 struct rcar_du_device {
30 const struct rcar_du_platform_data *pdata;
34 unsigned int use_count;
36 struct drm_device *ddev;
38 struct rcar_du_crtc crtcs[2];
39 unsigned int used_crtcs;
40 unsigned int num_crtcs;
43 struct rcar_du_plane planes[RCAR_DU_NUM_SW_PLANES];
47 struct drm_property *alpha;
48 struct drm_property *colorkey;
49 struct drm_property *zpos;
53 int rcar_du_get(struct rcar_du_device *rcdu);
54 void rcar_du_put(struct rcar_du_device *rcdu);
56 static inline u32 rcar_du_read(struct rcar_du_device *rcdu, u32 reg)
58 return ioread32(rcdu->mmio + reg);
61 static inline void rcar_du_write(struct rcar_du_device *rcdu, u32 reg, u32 data)
63 iowrite32(data, rcdu->mmio + reg);
66 #endif /* __RCAR_DU_DRV_H__ */