0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef _LTDC_H_
0012 #define _LTDC_H_
0013
0014 struct ltdc_caps {
0015 u32 hw_version;
0016 u32 nb_layers;
0017 u32 layer_ofs;
0018 const u32 *layer_regs;
0019 u32 bus_width;
0020 const u32 *pix_fmt_hw;
0021 const u32 *pix_fmt_drm;
0022 int pix_fmt_nb;
0023 bool pix_fmt_flex;
0024 bool non_alpha_only_l1;
0025 int pad_max_freq_hz;
0026 int nb_irq;
0027 bool ycbcr_input;
0028 bool ycbcr_output;
0029 bool plane_reg_shadow;
0030 bool crc;
0031 bool dynamic_zorder;
0032 bool plane_rotation;
0033 bool fifo_threshold;
0034 };
0035
0036 #define LTDC_MAX_LAYER 4
0037
0038 struct fps_info {
0039 unsigned int counter;
0040 ktime_t last_timestamp;
0041 };
0042
0043 struct ltdc_device {
0044 void __iomem *regs;
0045 struct regmap *regmap;
0046 struct clk *pixel_clk;
0047 struct mutex err_lock;
0048 struct ltdc_caps caps;
0049 u32 irq_status;
0050 u32 fifo_err;
0051 u32 fifo_warn;
0052 u32 fifo_threshold;
0053 u32 transfer_err;
0054 struct fps_info plane_fpsi[LTDC_MAX_LAYER];
0055 struct drm_atomic_state *suspend_state;
0056 int crc_skip_count;
0057 bool crc_active;
0058 };
0059
0060 int ltdc_load(struct drm_device *ddev);
0061 void ltdc_unload(struct drm_device *ddev);
0062 void ltdc_suspend(struct drm_device *ddev);
0063 int ltdc_resume(struct drm_device *ddev);
0064
0065 #endif