1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
8 #include <linux/types.h>
9 #include <linux/list.h>
10 #include <linux/atomic.h>
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
*);
25 * struct dpu_hw_blk - definition of hardware block object
26 * @list: list of hardware blocks
27 * @type: hardware block type
29 * @refcount: reference/usage count
32 struct list_head list
;
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 */