linux/drivers/gpu/drm/rockchip/rockchip_lvds.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
 * Author:
 *      Sandy Huang <[email protected]>
 *      Mark Yao <[email protected]>
 */

#ifndef _ROCKCHIP_LVDS_
#define _ROCKCHIP_LVDS_

#define RK3288_LVDS_CH0_REG0
#define RK3288_LVDS_CH0_REG0_LVDS_EN
#define RK3288_LVDS_CH0_REG0_TTL_EN
#define RK3288_LVDS_CH0_REG0_LANECK_EN
#define RK3288_LVDS_CH0_REG0_LANE4_EN
#define RK3288_LVDS_CH0_REG0_LANE3_EN
#define RK3288_LVDS_CH0_REG0_LANE2_EN
#define RK3288_LVDS_CH0_REG0_LANE1_EN
#define RK3288_LVDS_CH0_REG0_LANE0_EN

#define RK3288_LVDS_CH0_REG1
#define RK3288_LVDS_CH0_REG1_LANECK_BIAS
#define RK3288_LVDS_CH0_REG1_LANE4_BIAS
#define RK3288_LVDS_CH0_REG1_LANE3_BIAS
#define RK3288_LVDS_CH0_REG1_LANE2_BIAS
#define RK3288_LVDS_CH0_REG1_LANE1_BIAS
#define RK3288_LVDS_CH0_REG1_LANE0_BIAS

#define RK3288_LVDS_CH0_REG2
#define RK3288_LVDS_CH0_REG2_RESERVE_ON
#define RK3288_LVDS_CH0_REG2_LANECK_LVDS_MODE
#define RK3288_LVDS_CH0_REG2_LANE4_LVDS_MODE
#define RK3288_LVDS_CH0_REG2_LANE3_LVDS_MODE
#define RK3288_LVDS_CH0_REG2_LANE2_LVDS_MODE
#define RK3288_LVDS_CH0_REG2_LANE1_LVDS_MODE
#define RK3288_LVDS_CH0_REG2_LANE0_LVDS_MODE
#define RK3288_LVDS_CH0_REG2_PLL_FBDIV8

#define RK3288_LVDS_CH0_REG3
#define RK3288_LVDS_CH0_REG3_PLL_FBDIV_MASK

#define RK3288_LVDS_CH0_REG4
#define RK3288_LVDS_CH0_REG4_LANECK_TTL_MODE
#define RK3288_LVDS_CH0_REG4_LANE4_TTL_MODE
#define RK3288_LVDS_CH0_REG4_LANE3_TTL_MODE
#define RK3288_LVDS_CH0_REG4_LANE2_TTL_MODE
#define RK3288_LVDS_CH0_REG4_LANE1_TTL_MODE
#define RK3288_LVDS_CH0_REG4_LANE0_TTL_MODE

#define RK3288_LVDS_CH0_REG5
#define RK3288_LVDS_CH0_REG5_LANECK_TTL_DATA
#define RK3288_LVDS_CH0_REG5_LANE4_TTL_DATA
#define RK3288_LVDS_CH0_REG5_LANE3_TTL_DATA
#define RK3288_LVDS_CH0_REG5_LANE2_TTL_DATA
#define RK3288_LVDS_CH0_REG5_LANE1_TTL_DATA
#define RK3288_LVDS_CH0_REG5_LANE0_TTL_DATA

#define RK3288_LVDS_CFG_REGC
#define RK3288_LVDS_CFG_REGC_PLL_ENABLE
#define RK3288_LVDS_CFG_REGC_PLL_DISABLE

#define RK3288_LVDS_CH0_REGD
#define RK3288_LVDS_CH0_REGD_PLL_PREDIV_MASK

#define RK3288_LVDS_CH0_REG20
#define RK3288_LVDS_CH0_REG20_MSB
#define RK3288_LVDS_CH0_REG20_LSB

#define RK3288_LVDS_CFG_REG21
#define RK3288_LVDS_CFG_REG21_TX_ENABLE
#define RK3288_LVDS_CFG_REG21_TX_DISABLE
#define RK3288_LVDS_CH1_OFFSET

#define RK3288_LVDS_GRF_SOC_CON6
#define RK3288_LVDS_GRF_SOC_CON7

/* fbdiv value is split over 2 registers, with bit8 in reg2 */
#define RK3288_LVDS_PLL_FBDIV_REG2(_fbd)
#define RK3288_LVDS_PLL_FBDIV_REG3(_fbd)
#define RK3288_LVDS_PLL_PREDIV_REGD(_pd)

#define RK3288_LVDS_SOC_CON6_SEL_VOP_LIT

#define LVDS_FMT_MASK
#define LVDS_MSB
#define LVDS_DUAL
#define LVDS_FMT_1
#define LVDS_TTL_EN
#define LVDS_START_PHASE_RST_1
#define LVDS_DCLK_INV
#define LVDS_CH0_EN
#define LVDS_CH1_EN
#define LVDS_PWRDN

#define LVDS_24BIT
#define LVDS_18BIT
#define LVDS_FORMAT_VESA
#define LVDS_FORMAT_JEIDA

#define LVDS_VESA_24
#define LVDS_JEIDA_24
#define LVDS_VESA_18
#define LVDS_JEIDA_18

#define HIWORD_UPDATE(v, h, l)

#define PX30_LVDS_GRF_PD_VO_CON0
#define PX30_LVDS_TIE_CLKS(val)
#define PX30_LVDS_INVERT_CLKS(val)
#define PX30_LVDS_INVERT_DCLK(val)

#define PX30_LVDS_GRF_PD_VO_CON1
#define PX30_LVDS_FORMAT(val)
#define PX30_LVDS_MODE_EN(val)
#define PX30_LVDS_MSBSEL(val)
#define PX30_LVDS_P2S_EN(val)
#define PX30_LVDS_VOP_SEL(val)

#endif /* _ROCKCHIP_LVDS_ */