18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2015, The Linux Foundation. All rights reserved.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef __MSM_DSI_CFG_H__
78c2ecf20Sopenharmony_ci#define __MSM_DSI_CFG_H__
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include "dsi.h"
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define MSM_DSI_VER_MAJOR_V2	0x02
128c2ecf20Sopenharmony_ci#define MSM_DSI_VER_MAJOR_6G	0x03
138c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_0	0x10000000
148c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_1	0x10010000
158c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_1_1	0x10010001
168c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_2	0x10020000
178c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_3	0x10030000
188c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_3_1	0x10030001
198c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_4_1	0x10040001
208c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V1_4_2	0x10040002
218c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V2_1_0	0x20010000
228c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V2_2_0	0x20000000
238c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V2_2_1	0x20020001
248c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V2_3_0	0x20030000
258c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V2_4_0	0x20040000
268c2ecf20Sopenharmony_ci#define MSM_DSI_6G_VER_MINOR_V2_4_1	0x20040001
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define MSM_DSI_V2_VER_MINOR_8064	0x0
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define DSI_6G_REG_SHIFT	4
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_cistruct msm_dsi_config {
338c2ecf20Sopenharmony_ci	u32 io_offset;
348c2ecf20Sopenharmony_ci	struct dsi_reg_config reg_cfg;
358c2ecf20Sopenharmony_ci	const char * const *bus_clk_names;
368c2ecf20Sopenharmony_ci	const int num_bus_clks;
378c2ecf20Sopenharmony_ci	const resource_size_t io_start[DSI_MAX];
388c2ecf20Sopenharmony_ci	const int num_dsi;
398c2ecf20Sopenharmony_ci};
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistruct msm_dsi_host_cfg_ops {
428c2ecf20Sopenharmony_ci	int (*link_clk_set_rate)(struct msm_dsi_host *msm_host);
438c2ecf20Sopenharmony_ci	int (*link_clk_enable)(struct msm_dsi_host *msm_host);
448c2ecf20Sopenharmony_ci	void (*link_clk_disable)(struct msm_dsi_host *msm_host);
458c2ecf20Sopenharmony_ci	int (*clk_init_ver)(struct msm_dsi_host *msm_host);
468c2ecf20Sopenharmony_ci	int (*tx_buf_alloc)(struct msm_dsi_host *msm_host, int size);
478c2ecf20Sopenharmony_ci	void* (*tx_buf_get)(struct msm_dsi_host *msm_host);
488c2ecf20Sopenharmony_ci	void (*tx_buf_put)(struct msm_dsi_host *msm_host);
498c2ecf20Sopenharmony_ci	int (*dma_base_get)(struct msm_dsi_host *msm_host, uint64_t *iova);
508c2ecf20Sopenharmony_ci	int (*calc_clk_rate)(struct msm_dsi_host *msm_host, bool is_dual_dsi);
518c2ecf20Sopenharmony_ci};
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_cistruct msm_dsi_cfg_handler {
548c2ecf20Sopenharmony_ci	u32 major;
558c2ecf20Sopenharmony_ci	u32 minor;
568c2ecf20Sopenharmony_ci	const struct msm_dsi_config *cfg;
578c2ecf20Sopenharmony_ci	const struct msm_dsi_host_cfg_ops *ops;
588c2ecf20Sopenharmony_ci};
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciconst struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor);
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#endif /* __MSM_DSI_CFG_H__ */
638c2ecf20Sopenharmony_ci
64