1
2
3
4
5 #ifndef _DPU_HW_BLK_H
6 #define _DPU_HW_BLK_H
7
8 #include <linux/types.h>
9 #include <linux/list.h>
10 #include <linux/atomic.h>
11
12 struct dpu_hw_blk;
13
14
15
16
17
18
19 struct dpu_hw_blk_ops {
20 int (*start)(struct dpu_hw_blk *);
21 void (*stop)(struct dpu_hw_blk *);
22 };
23
24
25
26
27
28
29
30
31 struct dpu_hw_blk {
32 struct list_head list;
33 u32 type;
34 int id;
35 atomic_t refcount;
36 struct dpu_hw_blk_ops ops;
37 };
38
39 void dpu_hw_blk_init(struct dpu_hw_blk *hw_blk, u32 type, int id,
40 struct dpu_hw_blk_ops *ops);
41 void dpu_hw_blk_destroy(struct dpu_hw_blk *hw_blk);
42
43 struct dpu_hw_blk *dpu_hw_blk_get(struct dpu_hw_blk *hw_blk, u32 type, int id);
44 void dpu_hw_blk_put(struct dpu_hw_blk *hw_blk);
45 #endif