1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * vsp1.h -- R-Car VSP1 Driver
5 * Copyright (C) 2013-2014 Renesas Electronics Corporation
7 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
13 #include <linux/list.h>
14 #include <linux/mutex.h>
16 #include <media/media-device.h>
17 #include <media/v4l2-device.h>
18 #include <media/v4l2-subdev.h>
20 #include "vsp1_regs.h"
24 struct rcar_fcp_device;
29 struct vsp1_platform_data;
42 #define VSP1_MAX_LIF 2
43 #define VSP1_MAX_RPF 5
44 #define VSP1_MAX_UDS 3
45 #define VSP1_MAX_UIF 2
46 #define VSP1_MAX_WPF 4
48 #define VSP1_HAS_LUT BIT(1)
49 #define VSP1_HAS_SRU BIT(2)
50 #define VSP1_HAS_BRU BIT(3)
51 #define VSP1_HAS_CLU BIT(4)
52 #define VSP1_HAS_WPF_VFLIP BIT(5)
53 #define VSP1_HAS_WPF_HFLIP BIT(6)
54 #define VSP1_HAS_HGO BIT(7)
55 #define VSP1_HAS_HGT BIT(8)
56 #define VSP1_HAS_BRS BIT(9)
57 #define VSP1_HAS_EXT_DL BIT(10)
58 #define VSP1_HAS_NON_ZERO_LBA BIT(11)
60 struct vsp1_device_info {
64 unsigned int features;
65 unsigned int lif_count;
66 unsigned int rpf_count;
67 unsigned int uds_count;
68 unsigned int uif_count;
69 unsigned int wpf_count;
70 unsigned int num_bru_inputs;
75 #define vsp1_feature(vsp1, f) ((vsp1)->info->features & (f))
79 const struct vsp1_device_info *info;
83 struct rcar_fcp_device *fcp;
84 struct device *bus_master;
85 struct reset_control *rstc;
92 struct vsp1_hsit *hsi;
93 struct vsp1_hsit *hst;
94 struct vsp1_lif *lif[VSP1_MAX_LIF];
96 struct vsp1_rwpf *rpf[VSP1_MAX_RPF];
98 struct vsp1_uds *uds[VSP1_MAX_UDS];
99 struct vsp1_uif *uif[VSP1_MAX_UIF];
100 struct vsp1_rwpf *wpf[VSP1_MAX_WPF];
102 struct list_head entities;
103 struct list_head videos;
105 struct v4l2_device v4l2_dev;
106 struct media_device media_dev;
107 struct media_entity_operations media_ops;
109 struct vsp1_drm *drm;
112 int vsp1_device_get(struct vsp1_device *vsp1);
113 void vsp1_device_put(struct vsp1_device *vsp1);
115 int vsp1_reset_wpf(struct vsp1_device *vsp1, unsigned int index);
117 static inline u32 vsp1_read(struct vsp1_device *vsp1, u32 reg)
119 return ioread32(vsp1->mmio + reg);
122 static inline void vsp1_write(struct vsp1_device *vsp1, u32 reg, u32 data)
124 iowrite32(data, vsp1->mmio + reg);
127 #endif /* __VSP1_H__ */