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"
11 #include "dpu_hw_blk.h"
15 /* intf timing settings */
16 struct intf_timing_params {
17 u32 width; /* active width */
18 u32 height; /* active height */
19 u32 xres; /* Display panel width */
20 u32 yres; /* Display panel height */
26 u32 hsync_pulse_width;
27 u32 vsync_pulse_width;
35 struct intf_prog_fetch {
37 /* vsync counter for the front porch pixel line */
42 u8 is_en; /* interface timing engine is enabled or not */
43 u32 frame_count; /* frame count since timing engine enabled */
44 u32 line_count; /* current line count including blanking */
48 * struct dpu_hw_intf_ops : Interface to the interface Hw driver functions
49 * Assumption is these functions will be called after clocks are enabled
50 * @ setup_timing_gen : programs the timing engine
51 * @ setup_prog_fetch : enables/disables the programmable fetch logic
52 * @ enable_timing: enable/disable timing engine
53 * @ get_status: returns if timing engine is enabled or not
54 * @ get_line_count: reads current vertical line counter
55 * @bind_pingpong_blk: enable/disable the connection with pingpong which will
56 * feed pixels to this interface
58 struct dpu_hw_intf_ops {
59 void (*setup_timing_gen)(struct dpu_hw_intf *intf,
60 const struct intf_timing_params *p,
61 const struct dpu_format *fmt);
63 void (*setup_prg_fetch)(struct dpu_hw_intf *intf,
64 const struct intf_prog_fetch *fetch);
66 void (*enable_timing)(struct dpu_hw_intf *intf,
69 void (*get_status)(struct dpu_hw_intf *intf,
70 struct intf_status *status);
72 u32 (*get_line_count)(struct dpu_hw_intf *intf);
74 void (*bind_pingpong_blk)(struct dpu_hw_intf *intf,
76 const enum dpu_pingpong pp);
80 struct dpu_hw_blk base;
81 struct dpu_hw_blk_reg_map hw;
85 const struct dpu_intf_cfg *cap;
86 const struct dpu_mdss_cfg *mdss;
89 struct dpu_hw_intf_ops ops;
93 * to_dpu_hw_intf - convert base object dpu_hw_base to container
94 * @hw: Pointer to base hardware block
95 * return: Pointer to hardware block container
97 static inline struct dpu_hw_intf *to_dpu_hw_intf(struct dpu_hw_blk *hw)
99 return container_of(hw, struct dpu_hw_intf, base);
103 * dpu_hw_intf_init(): Initializes the intf driver for the passed
105 * @idx: interface index for which driver object is required
106 * @addr: mapped register io address of MDP
107 * @m : pointer to mdss catalog data
109 struct dpu_hw_intf *dpu_hw_intf_init(enum dpu_intf idx,
111 const struct dpu_mdss_cfg *m);
114 * dpu_hw_intf_destroy(): Destroys INTF driver context
115 * @intf: Pointer to INTF driver context
117 void dpu_hw_intf_destroy(struct dpu_hw_intf *intf);
119 #endif /*_DPU_HW_INTF_H */