xref: /openbmc/u-boot/drivers/video/exynos/exynos_mipi_dsi_lowlevel.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
208a7aa1eSSimon Glass /*
308a7aa1eSSimon Glass  * Copyright (C) 2012 Samsung Electronics
408a7aa1eSSimon Glass  *
508a7aa1eSSimon Glass  * Author: InKi Dae <inki.dae@samsung.com>
608a7aa1eSSimon Glass  * Author: Donghwa Lee <dh09.lee@samsung.com>
708a7aa1eSSimon Glass  */
808a7aa1eSSimon Glass 
908a7aa1eSSimon Glass #ifndef _EXYNOS_MIPI_DSI_LOWLEVEL_H
1008a7aa1eSSimon Glass #define _EXYNOS_MIPI_DSI_LOWLEVEL_H
1108a7aa1eSSimon Glass 
1208a7aa1eSSimon Glass void exynos_mipi_dsi_register(struct mipi_dsim_device *dsim);
1308a7aa1eSSimon Glass void exynos_mipi_dsi_func_reset(struct mipi_dsim_device *dsim);
1408a7aa1eSSimon Glass void exynos_mipi_dsi_sw_reset(struct mipi_dsim_device *dsim);
1508a7aa1eSSimon Glass void exynos_mipi_dsi_sw_release(struct mipi_dsim_device *dsim);
1608a7aa1eSSimon Glass void exynos_mipi_dsi_set_interrupt_mask(struct mipi_dsim_device *dsim,
1708a7aa1eSSimon Glass 	unsigned int mode, unsigned int mask);
1808a7aa1eSSimon Glass void exynos_mipi_dsi_set_data_lane_number(struct mipi_dsim_device *dsim,
1908a7aa1eSSimon Glass 					unsigned int count);
2008a7aa1eSSimon Glass void exynos_mipi_dsi_init_fifo_pointer(struct mipi_dsim_device *dsim,
2108a7aa1eSSimon Glass 					unsigned int cfg);
2208a7aa1eSSimon Glass void exynos_mipi_dsi_set_phy_tunning(struct mipi_dsim_device *dsim,
2308a7aa1eSSimon Glass 				unsigned int value);
2408a7aa1eSSimon Glass void exynos_mipi_dsi_set_phy_tunning(struct mipi_dsim_device *dsim,
2508a7aa1eSSimon Glass 				unsigned int value);
2608a7aa1eSSimon Glass void exynos_mipi_dsi_set_main_disp_resol(struct mipi_dsim_device *dsim,
2708a7aa1eSSimon Glass 		unsigned int width_resol, unsigned int height_resol);
2808a7aa1eSSimon Glass void exynos_mipi_dsi_set_main_disp_vporch(struct mipi_dsim_device *dsim,
2908a7aa1eSSimon Glass 	unsigned int cmd_allow, unsigned int vfront, unsigned int vback);
3008a7aa1eSSimon Glass void exynos_mipi_dsi_set_main_disp_hporch(struct mipi_dsim_device *dsim,
3108a7aa1eSSimon Glass 			unsigned int front, unsigned int back);
3208a7aa1eSSimon Glass void exynos_mipi_dsi_set_main_disp_sync_area(struct mipi_dsim_device *dsim,
3308a7aa1eSSimon Glass 				unsigned int vert, unsigned int hori);
3408a7aa1eSSimon Glass void exynos_mipi_dsi_set_sub_disp_resol(struct mipi_dsim_device *dsim,
3508a7aa1eSSimon Glass 				unsigned int vert, unsigned int hori);
3608a7aa1eSSimon Glass void exynos_mipi_dsi_init_config(struct mipi_dsim_device *dsim);
3708a7aa1eSSimon Glass void exynos_mipi_dsi_display_config(struct mipi_dsim_device *dsim,
3808a7aa1eSSimon Glass 				struct mipi_dsim_config *dsim_config);
3908a7aa1eSSimon Glass void exynos_mipi_dsi_set_data_lane_number(struct mipi_dsim_device *dsim,
4008a7aa1eSSimon Glass 				unsigned int count);
4108a7aa1eSSimon Glass void exynos_mipi_dsi_enable_lane(struct mipi_dsim_device *dsim,
4208a7aa1eSSimon Glass 			unsigned int lane, unsigned int enable);
4308a7aa1eSSimon Glass void exynos_mipi_dsi_enable_afc(struct mipi_dsim_device *dsim,
4408a7aa1eSSimon Glass 			unsigned int enable, unsigned int afc_code);
4508a7aa1eSSimon Glass void exynos_mipi_dsi_enable_pll_bypass(struct mipi_dsim_device *dsim,
4608a7aa1eSSimon Glass 				unsigned int enable);
4708a7aa1eSSimon Glass void exynos_mipi_dsi_pll_freq_band(struct mipi_dsim_device *dsim,
4808a7aa1eSSimon Glass 				unsigned int freq_band);
4908a7aa1eSSimon Glass void exynos_mipi_dsi_pll_freq(struct mipi_dsim_device *dsim,
5008a7aa1eSSimon Glass 			unsigned int pre_divider, unsigned int main_divider,
5108a7aa1eSSimon Glass 			unsigned int scaler);
5208a7aa1eSSimon Glass void exynos_mipi_dsi_pll_stable_time(struct mipi_dsim_device *dsim,
5308a7aa1eSSimon Glass 			unsigned int lock_time);
5408a7aa1eSSimon Glass void exynos_mipi_dsi_enable_pll(struct mipi_dsim_device *dsim,
5508a7aa1eSSimon Glass 					unsigned int enable);
5608a7aa1eSSimon Glass void exynos_mipi_dsi_set_byte_clock_src(struct mipi_dsim_device *dsim,
5708a7aa1eSSimon Glass 					unsigned int src);
5808a7aa1eSSimon Glass void exynos_mipi_dsi_enable_byte_clock(struct mipi_dsim_device *dsim,
5908a7aa1eSSimon Glass 					unsigned int enable);
6008a7aa1eSSimon Glass void exynos_mipi_dsi_set_esc_clk_prs(struct mipi_dsim_device *dsim,
6108a7aa1eSSimon Glass 				unsigned int enable, unsigned int prs_val);
6208a7aa1eSSimon Glass void exynos_mipi_dsi_enable_esc_clk_on_lane(struct mipi_dsim_device *dsim,
6308a7aa1eSSimon Glass 				unsigned int lane_sel, unsigned int enable);
6408a7aa1eSSimon Glass void exynos_mipi_dsi_force_dphy_stop_state(struct mipi_dsim_device *dsim,
6508a7aa1eSSimon Glass 				unsigned int enable);
6608a7aa1eSSimon Glass unsigned int exynos_mipi_dsi_is_lane_state(struct mipi_dsim_device *dsim);
6708a7aa1eSSimon Glass void exynos_mipi_dsi_set_stop_state_counter(struct mipi_dsim_device *dsim,
6808a7aa1eSSimon Glass 				unsigned int cnt_val);
6908a7aa1eSSimon Glass void exynos_mipi_dsi_set_bta_timeout(struct mipi_dsim_device *dsim,
7008a7aa1eSSimon Glass 				unsigned int timeout);
7108a7aa1eSSimon Glass void exynos_mipi_dsi_set_lpdr_timeout(struct mipi_dsim_device *dsim,
7208a7aa1eSSimon Glass 				unsigned int timeout);
7308a7aa1eSSimon Glass void exynos_mipi_dsi_set_lcdc_transfer_mode(struct mipi_dsim_device *dsim,
7408a7aa1eSSimon Glass 					unsigned int lp);
7508a7aa1eSSimon Glass void exynos_mipi_dsi_set_cpu_transfer_mode(struct mipi_dsim_device *dsim,
7608a7aa1eSSimon Glass 					unsigned int lp);
7708a7aa1eSSimon Glass void exynos_mipi_dsi_enable_hs_clock(struct mipi_dsim_device *dsim,
7808a7aa1eSSimon Glass 				unsigned int enable);
7908a7aa1eSSimon Glass void exynos_mipi_dsi_dp_dn_swap(struct mipi_dsim_device *dsim,
8008a7aa1eSSimon Glass 				unsigned int swap_en);
8108a7aa1eSSimon Glass void exynos_mipi_dsi_hs_zero_ctrl(struct mipi_dsim_device *dsim,
8208a7aa1eSSimon Glass 				unsigned int hs_zero);
8308a7aa1eSSimon Glass void exynos_mipi_dsi_prep_ctrl(struct mipi_dsim_device *dsim,
8408a7aa1eSSimon Glass 				unsigned int prep);
8508a7aa1eSSimon Glass void exynos_mipi_dsi_clear_interrupt(struct mipi_dsim_device *dsim);
8608a7aa1eSSimon Glass void exynos_mipi_dsi_clear_all_interrupt(struct mipi_dsim_device *dsim);
8708a7aa1eSSimon Glass unsigned int exynos_mipi_dsi_is_pll_stable(struct mipi_dsim_device *dsim);
8808a7aa1eSSimon Glass unsigned int exynos_mipi_dsi_get_fifo_state(struct mipi_dsim_device *dsim);
8908a7aa1eSSimon Glass unsigned int _exynos_mipi_dsi_get_frame_done_status(struct mipi_dsim_device
9008a7aa1eSSimon Glass 						*dsim);
9108a7aa1eSSimon Glass void _exynos_mipi_dsi_clear_frame_done(struct mipi_dsim_device *dsim);
9208a7aa1eSSimon Glass void exynos_mipi_dsi_wr_tx_header(struct mipi_dsim_device *dsim,
9308a7aa1eSSimon Glass 		unsigned int di, const unsigned char data0, const unsigned char data1);
9408a7aa1eSSimon Glass void exynos_mipi_dsi_wr_tx_data(struct mipi_dsim_device *dsim,
9508a7aa1eSSimon Glass 		unsigned int tx_data);
9608a7aa1eSSimon Glass 
9708a7aa1eSSimon Glass #endif /* _EXYNOS_MIPI_DSI_LOWLEVEL_H */
98