| .. | .. |
|---|
| 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_req_rate; |
|---|
| 55 | + unsigned int read_latency; |
|---|
| 56 | + unsigned int auto_freq_en; |
|---|
| 57 | + bool is_msch_rl_work_started; |
|---|
| 58 | + int (*set_msch_readlatency)(unsigned int rl); |
|---|
| 59 | +}; |
|---|
| 60 | + |
|---|
| 61 | +struct dmcfreq_vop_info { |
|---|
| 62 | + unsigned int line_bw_mbyte; |
|---|
| 63 | + unsigned int frame_bw_mbyte; |
|---|
| 64 | + unsigned int plane_num; |
|---|
| 65 | +}; |
|---|
| 66 | + |
|---|
| 67 | +#if IS_REACHABLE(CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ) |
|---|
| 35 | 68 | void rockchip_dmcfreq_lock(void); |
|---|
| 36 | 69 | void rockchip_dmcfreq_lock_nested(void); |
|---|
| 37 | 70 | void rockchip_dmcfreq_unlock(void); |
|---|
| 71 | +int rockchip_dmcfreq_write_trylock(void); |
|---|
| 72 | +void rockchip_dmcfreq_write_unlock(void); |
|---|
| 38 | 73 | 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); |
|---|
| 74 | +int rockchip_dmcfreq_vop_bandwidth_init(struct dmcfreq_common_info *info); |
|---|
| 75 | +int rockchip_dmcfreq_vop_bandwidth_request(struct dmcfreq_vop_info *vop_info); |
|---|
| 76 | +void rockchip_dmcfreq_vop_bandwidth_update(struct dmcfreq_vop_info *vop_info); |
|---|
| 45 | 77 | #else |
|---|
| 46 | 78 | static inline void rockchip_dmcfreq_lock(void) |
|---|
| 47 | 79 | { |
|---|
| .. | .. |
|---|
| 55 | 87 | { |
|---|
| 56 | 88 | } |
|---|
| 57 | 89 | |
|---|
| 90 | +static inline int rockchip_dmcfreq_write_trylock(void) |
|---|
| 91 | +{ |
|---|
| 92 | + return 0; |
|---|
| 93 | +} |
|---|
| 94 | + |
|---|
| 95 | +static inline void rockchip_dmcfreq_write_unlock(void) |
|---|
| 96 | +{ |
|---|
| 97 | +} |
|---|
| 98 | + |
|---|
| 58 | 99 | static inline int rockchip_dmcfreq_wait_complete(void) |
|---|
| 59 | 100 | { |
|---|
| 60 | 101 | return 0; |
|---|
| 61 | 102 | } |
|---|
| 62 | 103 | |
|---|
| 63 | 104 | static inline int |
|---|
| 64 | | -rockchip_dmcfreq_vop_bandwidth_request(struct devfreq *devfreq, |
|---|
| 65 | | - unsigned int bw_mbyte) |
|---|
| 105 | +rockchip_dmcfreq_vop_bandwidth_request(struct dmcfreq_vop_info *vop_info) |
|---|
| 66 | 106 | { |
|---|
| 67 | 107 | return 0; |
|---|
| 68 | 108 | } |
|---|
| 69 | 109 | |
|---|
| 70 | 110 | 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) |
|---|
| 111 | +rockchip_dmcfreq_vop_bandwidth_update(struct dmcfreq_vop_info *vop_info) |
|---|
| 112 | +{ |
|---|
| 113 | +} |
|---|
| 114 | + |
|---|
| 115 | +static inline void |
|---|
| 116 | +rockchip_dmcfreq_vop_bandwidth_init(struct dmcfreq_common_info *info) |
|---|
| 75 | 117 | { |
|---|
| 76 | 118 | } |
|---|
| 77 | 119 | #endif |
|---|