1 /* 2 * (C) Copyright 2020 Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 * Author: Wenping Zhang <wenping.zhang@rock-chips.com> 6 */ 7 8 #ifndef RK_EBC_H 9 #define RK_EBC_H 10 11 #include "epdlut/epd_lut.h" 12 13 struct ebc_panel { 14 u32 width; 15 u32 height; 16 u32 vir_width; 17 u32 vir_height; 18 u32 width_mm; 19 u32 height_mm; 20 21 u32 sdck; 22 u32 lsl; 23 u32 lbl; 24 u32 ldl; 25 u32 lel; 26 u32 gdck_sta; 27 u32 lgonl; 28 u32 fsl; 29 u32 fbl; 30 u32 fdl; 31 u32 fel; 32 u32 panel_16bit; 33 u32 panel_color; 34 u32 mirror; 35 u32 rearrange; 36 u32 disp_pbuf; 37 u32 disp_pbuf_size; 38 u32 *lut_pbuf; 39 u32 lut_pbuf_size; 40 struct epd_lut_data lut_data; 41 struct epd_lut_ops lut_ops; 42 }; 43 44 struct rk_ebc_tcon_ops { 45 int (*enable)(struct udevice *dev, struct ebc_panel *panel); 46 int (*disable)(struct udevice *dev); 47 int (*dsp_mode_set)(struct udevice *dev, int update_mode, 48 int display_mode, int three_win_mode, 49 int eink_mode); 50 int (*image_addr_set)(struct udevice *dev, u32 pre_image_addr, 51 u32 cur_image_addr); 52 int (*frame_addr_set)(struct udevice *dev, u32 frame_addr); 53 int (*lut_data_set)(struct udevice *dev, unsigned int *lut_data, 54 int frame_count, int lut_32); 55 int (*frame_start)(struct udevice *dev, int frame_total); 56 int (*wait_for_last_frame_complete)(struct udevice *dev); 57 }; 58 59 #define ebc_tcon_get_ops(dev) ((struct rk_ebc_tcon_ops *)(dev)->driver->ops) 60 61 /* 62 *interface for ebc power control 63 */ 64 struct rk_ebc_pwr_ops { 65 int (*power_on)(struct udevice *dev); 66 int (*power_down)(struct udevice *dev); 67 int (*temp_get)(struct udevice *dev, u32 *temp); 68 int (*vcom_set)(struct udevice *dev, u32 vcom); 69 }; 70 71 #define ebc_pwr_get_ops(dev) ((struct rk_ebc_pwr_ops *)(dev)->driver->ops) 72 73 //display mode define 74 #define DIRECT_MODE 0 75 #define LUT_MODE 1 76 #define THREE_WIN_MODE 1 77 #define EINK_MODE 1 78 79 #endif 80