197fb5e8dSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2d248b61fSHai Li /* 3d248b61fSHai Li * Copyright (c) 2015, The Linux Foundation. All rights reserved. 4d248b61fSHai Li */ 5d248b61fSHai Li 6d248b61fSHai Li #ifndef __MSM_DSI_CFG_H__ 7d248b61fSHai Li #define __MSM_DSI_CFG_H__ 8d248b61fSHai Li 9d248b61fSHai Li #include "dsi.h" 10d248b61fSHai Li 11d248b61fSHai Li #define MSM_DSI_VER_MAJOR_V2 0x02 12d248b61fSHai Li #define MSM_DSI_VER_MAJOR_6G 0x03 13d248b61fSHai Li #define MSM_DSI_6G_VER_MINOR_V1_0 0x10000000 14d248b61fSHai Li #define MSM_DSI_6G_VER_MINOR_V1_0_2 0x10000002 15d248b61fSHai Li #define MSM_DSI_6G_VER_MINOR_V1_1 0x10010000 16d248b61fSHai Li #define MSM_DSI_6G_VER_MINOR_V1_1_1 0x10010001 17d248b61fSHai Li #define MSM_DSI_6G_VER_MINOR_V1_2 0x10020000 18d248b61fSHai Li #define MSM_DSI_6G_VER_MINOR_V1_3 0x10030000 193a3ff88aSArchit Taneja #define MSM_DSI_6G_VER_MINOR_V1_3_1 0x10030001 203f3c8affSAngeloGioacchino Del Regno #define MSM_DSI_6G_VER_MINOR_V1_4_1 0x10040001 21033f47f7SKonrad Dybcio #define MSM_DSI_6G_VER_MINOR_V1_4_2 0x10040002 227b8c9e20SJeffrey Hugo #define MSM_DSI_6G_VER_MINOR_V2_1_0 0x20010000 2302f7a6caSArchit Taneja #define MSM_DSI_6G_VER_MINOR_V2_2_0 0x20000000 2411550636SJonathan Marek #define MSM_DSI_6G_VER_MINOR_V2_2_1 0x20020001 2511550636SJonathan Marek #define MSM_DSI_6G_VER_MINOR_V2_3_0 0x20030000 266125bd32SHarigovindan P #define MSM_DSI_6G_VER_MINOR_V2_4_0 0x20040000 2765c391b3SRajeev Nandan #define MSM_DSI_6G_VER_MINOR_V2_4_1 0x20040001 28c332881cSDmitry Baryshkov #define MSM_DSI_6G_VER_MINOR_V2_5_0 0x20050000 299d0118f0SNeil Armstrong #define MSM_DSI_6G_VER_MINOR_V2_6_0 0x20060000 30d248b61fSHai Li #define MSM_DSI_6G_VER_MINOR_V2_7_0 0x20070000 31cea65dbdSArchit Taneja 32cea65dbdSArchit Taneja #define MSM_DSI_V2_VER_MINOR_8064 0x0 33d248b61fSHai Li 34d248b61fSHai Li #define DSI_6G_REG_SHIFT 4 35*ff83e76bSKonrad Dybcio 36*ff83e76bSKonrad Dybcio /* Maximum number of configurations matched against the same hw revision */ 37*ff83e76bSKonrad Dybcio #define VARIANTS_MAX 2 38d248b61fSHai Li 39d248b61fSHai Li struct msm_dsi_config { 40d8810a66SDouglas Anderson u32 io_offset; 41d8810a66SDouglas Anderson const struct regulator_bulk_data *regulator_data; 426e0eb52eSArchit Taneja int num_regulators; 436e0eb52eSArchit Taneja const char * const *bus_clk_names; 44*ff83e76bSKonrad Dybcio const int num_bus_clks; 45d248b61fSHai Li const resource_size_t io_start[VARIANTS_MAX][DSI_MAX]; 46d248b61fSHai Li }; 47e18177ccSSibi Sankar 486b16f05aSRob Clark struct msm_dsi_host_cfg_ops { 49e18177ccSSibi Sankar int (*link_clk_set_rate)(struct msm_dsi_host *msm_host); 50e18177ccSSibi Sankar int (*link_clk_enable)(struct msm_dsi_host *msm_host); 51e18177ccSSibi Sankar void (*link_clk_disable)(struct msm_dsi_host *msm_host); 52e18177ccSSibi Sankar int (*clk_init_ver)(struct msm_dsi_host *msm_host); 53e18177ccSSibi Sankar int (*tx_buf_alloc)(struct msm_dsi_host *msm_host, int size); 54e18177ccSSibi Sankar void* (*tx_buf_get)(struct msm_dsi_host *msm_host); 55e18177ccSSibi Sankar void (*tx_buf_put)(struct msm_dsi_host *msm_host); 566183606dSDmitry Baryshkov int (*dma_base_get)(struct msm_dsi_host *msm_host, uint64_t *iova); 57e18177ccSSibi Sankar int (*calc_clk_rate)(struct msm_dsi_host *msm_host, bool is_bonded_dsi); 58e18177ccSSibi Sankar }; 59d248b61fSHai Li 60d248b61fSHai Li struct msm_dsi_cfg_handler { 61d248b61fSHai Li u32 major; 62d248b61fSHai Li u32 minor; 63e18177ccSSibi Sankar const struct msm_dsi_config *cfg; 64d248b61fSHai Li const struct msm_dsi_host_cfg_ops *ops; 65d248b61fSHai Li }; 66d248b61fSHai Li 67d248b61fSHai Li const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor); 68d248b61fSHai Li 69d248b61fSHai Li #endif /* __MSM_DSI_CFG_H__ */ 70 71