treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / gpu / drm / msm / disp / dpu1 / dpu_hw_vbif.h
blob6417aa28d32c336287e2d6f425113aa36c03619f
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
3 */
5 #ifndef _DPU_HW_VBIF_H
6 #define _DPU_HW_VBIF_H
8 #include "dpu_hw_catalog.h"
9 #include "dpu_hw_mdss.h"
10 #include "dpu_hw_util.h"
12 struct dpu_hw_vbif;
14 /**
15 * struct dpu_hw_vbif_ops : Interface to the VBIF hardware driver functions
16 * Assumption is these functions will be called after clocks are enabled
18 struct dpu_hw_vbif_ops {
19 /**
20 * set_limit_conf - set transaction limit config
21 * @vbif: vbif context driver
22 * @xin_id: client interface identifier
23 * @rd: true for read limit; false for write limit
24 * @limit: outstanding transaction limit
26 void (*set_limit_conf)(struct dpu_hw_vbif *vbif,
27 u32 xin_id, bool rd, u32 limit);
29 /**
30 * get_limit_conf - get transaction limit config
31 * @vbif: vbif context driver
32 * @xin_id: client interface identifier
33 * @rd: true for read limit; false for write limit
34 * @return: outstanding transaction limit
36 u32 (*get_limit_conf)(struct dpu_hw_vbif *vbif,
37 u32 xin_id, bool rd);
39 /**
40 * set_halt_ctrl - set halt control
41 * @vbif: vbif context driver
42 * @xin_id: client interface identifier
43 * @enable: halt control enable
45 void (*set_halt_ctrl)(struct dpu_hw_vbif *vbif,
46 u32 xin_id, bool enable);
48 /**
49 * get_halt_ctrl - get halt control
50 * @vbif: vbif context driver
51 * @xin_id: client interface identifier
52 * @return: halt control enable
54 bool (*get_halt_ctrl)(struct dpu_hw_vbif *vbif,
55 u32 xin_id);
57 /**
58 * set_qos_remap - set QoS priority remap
59 * @vbif: vbif context driver
60 * @xin_id: client interface identifier
61 * @level: priority level
62 * @remap_level: remapped level
64 void (*set_qos_remap)(struct dpu_hw_vbif *vbif,
65 u32 xin_id, u32 level, u32 remap_level);
67 /**
68 * set_mem_type - set memory type
69 * @vbif: vbif context driver
70 * @xin_id: client interface identifier
71 * @value: memory type value
73 void (*set_mem_type)(struct dpu_hw_vbif *vbif,
74 u32 xin_id, u32 value);
76 /**
77 * clear_errors - clear any vbif errors
78 * This function clears any detected pending/source errors
79 * on the VBIF interface, and optionally returns the detected
80 * error mask(s).
81 * @vbif: vbif context driver
82 * @pnd_errors: pointer to pending error reporting variable
83 * @src_errors: pointer to source error reporting variable
85 void (*clear_errors)(struct dpu_hw_vbif *vbif,
86 u32 *pnd_errors, u32 *src_errors);
88 /**
89 * set_write_gather_en - set write_gather enable
90 * @vbif: vbif context driver
91 * @xin_id: client interface identifier
93 void (*set_write_gather_en)(struct dpu_hw_vbif *vbif, u32 xin_id);
96 struct dpu_hw_vbif {
97 /* base */
98 struct dpu_hw_blk_reg_map hw;
100 /* vbif */
101 enum dpu_vbif idx;
102 const struct dpu_vbif_cfg *cap;
104 /* ops */
105 struct dpu_hw_vbif_ops ops;
109 * dpu_hw_vbif_init - initializes the vbif driver for the passed interface idx
110 * @idx: Interface index for which driver object is required
111 * @addr: Mapped register io address of MDSS
112 * @m: Pointer to mdss catalog data
114 struct dpu_hw_vbif *dpu_hw_vbif_init(enum dpu_vbif idx,
115 void __iomem *addr,
116 const struct dpu_mdss_cfg *m);
118 void dpu_hw_vbif_destroy(struct dpu_hw_vbif *vbif);
120 #endif /*_DPU_HW_VBIF_H */