1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
8 #include "dpu_hw_catalog.h"
9 #include "dpu_hw_mdss.h"
10 #include "dpu_hw_util.h"
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
{
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
);
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
,
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
);
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
,
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
);
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
);
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
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
);
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
);
98 struct dpu_hw_blk_reg_map hw
;
102 const struct dpu_vbif_cfg
*cap
;
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
,
116 const struct dpu_mdss_cfg
*m
);
118 void dpu_hw_vbif_destroy(struct dpu_hw_vbif
*vbif
);
120 #endif /*_DPU_HW_VBIF_H */