#ifndef __PANEL_DSI86_H__
#define __PANEL_DSI86_H__

/* Register addresses */

#define DSI86_SOFT_RESET		    0x09
#define DSI86_CORE_PLL			    0x0A
#define DSI86_PLL_EN			    0x0D
#define DSI86_PX_FREQ_LO                    0x0E
#define DSI86_PX_FREQ_HI                    0x0F
#define DSI86_DSI_CFG			    0x10
#define DSI86_DSI_EQ			    0x11
#define DSI86_CHA_DSI_CLK_RNG       0x12
#define DSI86_CHB_DSI_CLK_RNG       0x13

/* Video Registers */
#define DSI86_CHA_LINE_LEN_LO		0x20
#define DSI86_CHA_LINE_LEN_HI		0x21
#define DSI86_CHB_LINE_LEN_LO		0x22
#define DSI86_CHB_LINE_LEN_HI		0x23
#define DSI86_CHA_VERT_LINES_LO		0x24
#define DSI86_CHA_VERT_LINES_HI		0x25
#define DSI86_CHA_SYNC_DELAY_LO		0x28
#define DSI86_CHA_SYNC_DELAY_HI		0x29
#define DSI86_CHA_HSYNC_WIDTH_LO	0x2C
#define DSI86_CHA_HSYNC_WIDTH_HI	0x2D
#define DSI86_CHA_VSYNC_WIDTH_LO	0x30
#define DSI86_CHA_VSYNC_WIDTH_HI	0x31
#define DSI86_CHA_HORZ_BACKPORCH	0x34
#define DSI86_CHA_VERT_BACKPORCH	0x36
#define DSI86_CHA_HORZ_FRONTPORCH	0x38
#define DSI86_CHA_VERT_FRONTPORCH	0x3A
#define DSI86_COLOR_BAR	       		0x3C
#define DSI86_ADEN	       		    0x3F


/* DisplayPort Registers */
#define DSI86_TU_SIZE                  0x58
#define DSI86_ML_LN_ASSIGN             0x59
#define DSI86_ML_POLR                  0x5A
#define DSI86_DP_COLOR_BPP             0x5B
#define DSI86_HPD                      0x5C
#define DSI86_GPIO_CTRL                0x5F

/* Native and I2C-over-aux Registers */
#define DSI86_I2C_ADDR_CLAIM1          0x60
#define DSI86_AUX_WDATA0               0x64
#define DSI86_AUXADDR_HI               0x74
#define DSI86_AUXADDR_MID              0x75
#define DSI86_AUXADDR_LO               0x76
#define DSI86_AUXLEN                   0x77
#define DSI86_AUX_CMD_SEND             0x78
#define DSI86_AUX_RDATA0               0x79


/* Link Training Registers */
#define DSI86_DP_NUM_LANES             0x93
#define DSI86_DP_DATARATE              0x94
#define DSI86_POST_CURSOR2             0x95
#define DSI86_ML_TX_MODE               0x96

#define DSI86_PWM_PRE_DIV              0xA0
#define DSI86_BACKLIGHT_SCALE_LOW      0xA1
#define DSI86_BACKLIGHT_SCALE_HIGH     0xA2
#define DSI86_BACKLIGHT_LOW            0xA3
#define DSI86_BACKLIGHT_HIGH           0xA4
#define DSI86_PWM                      0xA5



#define DSI86_CHA_STATUS1              0xF0
#define DSI86_CHA_STATUS2              0xF1
#define DSI86_CHB_STATUS1              0xF2
#define DSI86_CHB_STATUS2              0xF3
#define DSI86_AUX_STATUS               0xF4
#define DSI86_HPD_STATUS               0xF5
#define DSI86_LT_STATUS                0xF8
#define DSI86_PAGESELECT               0xFF


#define DSI86_VODLEVEL_MAX             0x2
#define DSI86_VODL0_EMP_MAX            0x3
#define DSI86_VODL1_EMP_MAX            0x2
#define DSI86_VODL2_EMP_MAX            0x1
#define DSI86_VODL3_EMP_MAX            0x0

#define DSI86_STRENGTH_MANUAL          0x00
#define DSI86_DRC_IN_LOW               0x01
#define DSI86_DRC_IN_HIGH              0x02
#define DSI86_AMBIENT_LGT_LOW          0x05
#define DSI86_AMBIENT_LGT_HIGH         0x06
#define DSI86_START_CALC               0x07
#define DSI86_STRENGTH_OUT             0x08
#define DSI86_DRC_OUT_LOW              0x09
#define DSI86_DRC_OUT_HIGH             0x0A

#define DSI86_STRENGTH_LIMIT           0x10
#define DSI86_CAL_A_LOW                0x11
#define DSI86_CAL_A_HIGH               0x12
#define DSI86_CAL_B_LOW                0x13
#define DSI86_CAL_B_HIGH               0x14
#define DSI86_CAL_C_LOW                0x15
#define DSI86_CAL_C_HIGH               0x16
#define DSI86_CAL_D_LOW                0x17
#define DSI86_CAL_D_HIGH               0x18
#define DSI86_OPTION_SELECT            0x19
#define DSI86_T_FILTER_CONTROL         0x1A
#define DSI86_BACKLIGHT_MIN_LOW        0x1B
#define DSI86_BACKLIGHT_MIN_HIGH       0x1C
#define DSI86_BACKLIGHT_MAX_LOW        0x1D
#define DSI86_BACKLIGHT_MAX_HIGH       0x1E
#define DSI86_AMBIENT_LGT_MIN_LOW      0x21
#define DSI86_AMBIENT_LGT_MIN_HIGH     0x22
#define DSI86_FILTER_A_LOW             0x23
#define DSI86_FILTER_A_HIGH            0x24
#define DSI86_FILTER_B                 0x25
#define DSI86_IRIDIX                   0x27
#define DSI86_LIMIT_AMPL               0x2E

#define DSI86_FRAME_WIDTH_LO           0x34
#define DSI86_FRAME_WIDTH_HI           0x35
#define DSI86_FRAME_HEIGHT_LO          0x36
#define DSI86_FRAME_HEIGHT_HI          0x37
#define DSI86_DITHER                   0x3A
#define DSI86_GAMMA                    0x3B
#define DSI86_BACKLIGHT_OUT_LOW        0x0B
#define DSI86_BACKLIGHT_OUT_HIGH       0x0C


#define DSI86_CALC_INTERVAL            0xF0


#define HPD_NOCHANGE                   0
#define HPD_IRQ                        1
#define HPD_INSERT                     2
#define HPD_REMOVE                     4
#define HPD_REPLUG                     8

#define ODD_EVEN_PIXELS                (0<<7)
#define LEFT_RIGHT_PIXELS              (1<<7)
#define DUAL_CHANNE_DSI                (0<<5)
#define SINGLE_CHANNEL_DSI             (1<<5)
#define DSI_A_LANES_1                  (3<<3)
#define DSI_A_LANES_2                  (2<<3)
#define DSI_A_LANES_3                  (1<<3)
#define DSI_A_LANES_4                  (0<<3)

#endif
