Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / msm / disp / dpu1 / dpu_hw_blk.h
blob2bf737f8dd1b80432144640774ea75a95a456794
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
3 */
5 #ifndef _DPU_HW_BLK_H
6 #define _DPU_HW_BLK_H
8 #include <linux/types.h>
9 #include <linux/list.h>
10 #include <linux/atomic.h>
12 struct dpu_hw_blk;
14 /**
15 * struct dpu_hw_blk_ops - common hardware block operations
16 * @start: start operation on first get
17 * @stop: stop operation on last put
19 struct dpu_hw_blk_ops {
20 int (*start)(struct dpu_hw_blk *);
21 void (*stop)(struct dpu_hw_blk *);
24 /**
25 * struct dpu_hw_blk - definition of hardware block object
26 * @list: list of hardware blocks
27 * @type: hardware block type
28 * @id: instance id
29 * @refcount: reference/usage count
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;
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);
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 /*_DPU_HW_BLK_H */