.. | .. |
---|
31 | 31 | #define SCREEN_DUAL_LVDS_10BIT 12 |
---|
32 | 32 | #define SCREEN_DP 13 |
---|
33 | 33 | |
---|
34 | | -#ifdef CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ |
---|
| 34 | +#define DMCFREQ_TABLE_END ~1u |
---|
| 35 | + |
---|
| 36 | +struct freq_map_table { |
---|
| 37 | + unsigned int min; |
---|
| 38 | + unsigned int max; |
---|
| 39 | + unsigned long freq; |
---|
| 40 | +}; |
---|
| 41 | + |
---|
| 42 | +struct rl_map_table { |
---|
| 43 | + unsigned int pn; /* panel number */ |
---|
| 44 | + unsigned int rl; /* readlatency */ |
---|
| 45 | +}; |
---|
| 46 | + |
---|
| 47 | +struct dmcfreq_common_info { |
---|
| 48 | + struct device *dev; |
---|
| 49 | + struct devfreq *devfreq; |
---|
| 50 | + struct freq_map_table *vop_bw_tbl; |
---|
| 51 | + struct freq_map_table *vop_frame_bw_tbl; |
---|
| 52 | + struct rl_map_table *vop_pn_rl_tbl; |
---|
| 53 | + struct delayed_work msch_rl_work; |
---|
| 54 | + unsigned long vop_4k_rate; |
---|
| 55 | + unsigned long vop_req_rate; |
---|
| 56 | + unsigned int read_latency; |
---|
| 57 | + unsigned int auto_freq_en; |
---|
| 58 | + unsigned int stall_time_ns; |
---|
| 59 | + bool is_msch_rl_work_started; |
---|
| 60 | + int (*set_msch_readlatency)(unsigned int rl); |
---|
| 61 | +}; |
---|
| 62 | + |
---|
| 63 | +struct dmcfreq_vop_info { |
---|
| 64 | + unsigned int line_bw_mbyte; |
---|
| 65 | + unsigned int frame_bw_mbyte; |
---|
| 66 | + unsigned int plane_num; |
---|
| 67 | + unsigned int plane_num_4k; |
---|
| 68 | +}; |
---|
| 69 | + |
---|
| 70 | +#if IS_REACHABLE(CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ) |
---|
35 | 71 | void rockchip_dmcfreq_lock(void); |
---|
36 | 72 | void rockchip_dmcfreq_lock_nested(void); |
---|
37 | 73 | void rockchip_dmcfreq_unlock(void); |
---|
| 74 | +int rockchip_dmcfreq_write_trylock(void); |
---|
| 75 | +void rockchip_dmcfreq_write_unlock(void); |
---|
38 | 76 | int rockchip_dmcfreq_wait_complete(void); |
---|
39 | | -int rockchip_dmcfreq_vop_bandwidth_request(struct devfreq *devfreq, |
---|
40 | | - unsigned int bw_mbyte); |
---|
41 | | -void rockchip_dmcfreq_vop_bandwidth_update(struct devfreq *devfreq, |
---|
42 | | - unsigned int line_bw_mbyte, |
---|
43 | | - unsigned int frame_bw_mbyte, |
---|
44 | | - unsigned int plane_num); |
---|
| 77 | +int rockchip_dmcfreq_vop_bandwidth_init(struct dmcfreq_common_info *info); |
---|
| 78 | +int rockchip_dmcfreq_vop_bandwidth_request(struct dmcfreq_vop_info *vop_info); |
---|
| 79 | +void rockchip_dmcfreq_vop_bandwidth_update(struct dmcfreq_vop_info *vop_info); |
---|
| 80 | +unsigned int rockchip_dmcfreq_get_stall_time_ns(void); |
---|
45 | 81 | #else |
---|
46 | 82 | static inline void rockchip_dmcfreq_lock(void) |
---|
47 | 83 | { |
---|
.. | .. |
---|
55 | 91 | { |
---|
56 | 92 | } |
---|
57 | 93 | |
---|
| 94 | +static inline int rockchip_dmcfreq_write_trylock(void) |
---|
| 95 | +{ |
---|
| 96 | + return 0; |
---|
| 97 | +} |
---|
| 98 | + |
---|
| 99 | +static inline void rockchip_dmcfreq_write_unlock(void) |
---|
| 100 | +{ |
---|
| 101 | +} |
---|
| 102 | + |
---|
58 | 103 | static inline int rockchip_dmcfreq_wait_complete(void) |
---|
59 | 104 | { |
---|
60 | 105 | return 0; |
---|
61 | 106 | } |
---|
62 | 107 | |
---|
63 | 108 | static inline int |
---|
64 | | -rockchip_dmcfreq_vop_bandwidth_request(struct devfreq *devfreq, |
---|
65 | | - unsigned int bw_mbyte) |
---|
| 109 | +rockchip_dmcfreq_vop_bandwidth_request(struct dmcfreq_vop_info *vop_info) |
---|
66 | 110 | { |
---|
67 | 111 | return 0; |
---|
68 | 112 | } |
---|
69 | 113 | |
---|
70 | 114 | static inline void |
---|
71 | | -rockchip_dmcfreq_vop_bandwidth_update(struct devfreq *devfreq, |
---|
72 | | - unsigned int line_bw_mbyte, |
---|
73 | | - unsigned int frame_bw_mbyte, |
---|
74 | | - unsigned int plane_num) |
---|
| 115 | +rockchip_dmcfreq_vop_bandwidth_update(struct dmcfreq_vop_info *vop_info) |
---|
75 | 116 | { |
---|
76 | 117 | } |
---|
| 118 | + |
---|
| 119 | +static inline void |
---|
| 120 | +rockchip_dmcfreq_vop_bandwidth_init(struct dmcfreq_common_info *info) |
---|
| 121 | +{ |
---|
| 122 | +} |
---|
| 123 | + |
---|
| 124 | +static inline unsigned int |
---|
| 125 | +rockchip_dmcfreq_get_stall_time_ns(void) |
---|
| 126 | +{ |
---|
| 127 | + return 0; |
---|
| 128 | +} |
---|
77 | 129 | #endif |
---|
78 | 130 | |
---|
79 | 131 | #endif |
---|