177b55e8cSThomas Abraham /*
277b55e8cSThomas Abraham * Copyright (C) 2012 Samsung Electronics
377b55e8cSThomas Abraham *
477b55e8cSThomas Abraham * Author: InKi Dae <inki.dae@samsung.com>
577b55e8cSThomas Abraham * Author: Donghwa Lee <dh09.lee@samsung.com>
677b55e8cSThomas Abraham *
777b55e8cSThomas Abraham * SPDX-License-Identifier: GPL-2.0+
877b55e8cSThomas Abraham */
977b55e8cSThomas Abraham
1077b55e8cSThomas Abraham #ifndef _DSIM_H
1177b55e8cSThomas Abraham #define _DSIM_H
1277b55e8cSThomas Abraham
1377b55e8cSThomas Abraham #include <linux/list.h>
1477b55e8cSThomas Abraham #include <linux/fb.h>
1577b55e8cSThomas Abraham #include <lcd.h>
1677b55e8cSThomas Abraham
1777b55e8cSThomas Abraham #define PANEL_NAME_SIZE (32)
1877b55e8cSThomas Abraham
1977b55e8cSThomas Abraham enum mipi_dsim_interface_type {
2077b55e8cSThomas Abraham DSIM_COMMAND,
2177b55e8cSThomas Abraham DSIM_VIDEO
2277b55e8cSThomas Abraham };
2377b55e8cSThomas Abraham
2477b55e8cSThomas Abraham enum mipi_dsim_virtual_ch_no {
2577b55e8cSThomas Abraham DSIM_VIRTUAL_CH_0,
2677b55e8cSThomas Abraham DSIM_VIRTUAL_CH_1,
2777b55e8cSThomas Abraham DSIM_VIRTUAL_CH_2,
2877b55e8cSThomas Abraham DSIM_VIRTUAL_CH_3
2977b55e8cSThomas Abraham };
3077b55e8cSThomas Abraham
3177b55e8cSThomas Abraham enum mipi_dsim_burst_mode_type {
3277b55e8cSThomas Abraham DSIM_NON_BURST_SYNC_EVENT,
3377b55e8cSThomas Abraham DSIM_BURST_SYNC_EVENT,
3477b55e8cSThomas Abraham DSIM_NON_BURST_SYNC_PULSE,
3577b55e8cSThomas Abraham DSIM_BURST,
3677b55e8cSThomas Abraham DSIM_NON_VIDEO_MODE
3777b55e8cSThomas Abraham };
3877b55e8cSThomas Abraham
3977b55e8cSThomas Abraham enum mipi_dsim_no_of_data_lane {
4077b55e8cSThomas Abraham DSIM_DATA_LANE_1,
4177b55e8cSThomas Abraham DSIM_DATA_LANE_2,
4277b55e8cSThomas Abraham DSIM_DATA_LANE_3,
4377b55e8cSThomas Abraham DSIM_DATA_LANE_4
4477b55e8cSThomas Abraham };
4577b55e8cSThomas Abraham
4677b55e8cSThomas Abraham enum mipi_dsim_byte_clk_src {
4777b55e8cSThomas Abraham DSIM_PLL_OUT_DIV8,
4877b55e8cSThomas Abraham DSIM_EXT_CLK_DIV8,
4977b55e8cSThomas Abraham DSIM_EXT_CLK_BYPASS
5077b55e8cSThomas Abraham };
5177b55e8cSThomas Abraham
5277b55e8cSThomas Abraham enum mipi_dsim_pixel_format {
5377b55e8cSThomas Abraham DSIM_CMD_3BPP,
5477b55e8cSThomas Abraham DSIM_CMD_8BPP,
5577b55e8cSThomas Abraham DSIM_CMD_12BPP,
5677b55e8cSThomas Abraham DSIM_CMD_16BPP,
5777b55e8cSThomas Abraham DSIM_VID_16BPP_565,
5877b55e8cSThomas Abraham DSIM_VID_18BPP_666PACKED,
5977b55e8cSThomas Abraham DSIM_18BPP_666LOOSELYPACKED,
6077b55e8cSThomas Abraham DSIM_24BPP_888
6177b55e8cSThomas Abraham };
6277b55e8cSThomas Abraham
6377b55e8cSThomas Abraham /* MIPI DSI Processor-to-Peripheral transaction types */
6477b55e8cSThomas Abraham enum {
6577b55e8cSThomas Abraham MIPI_DSI_V_SYNC_START = 0x01,
6677b55e8cSThomas Abraham MIPI_DSI_V_SYNC_END = 0x11,
6777b55e8cSThomas Abraham MIPI_DSI_H_SYNC_START = 0x21,
6877b55e8cSThomas Abraham MIPI_DSI_H_SYNC_END = 0x31,
6977b55e8cSThomas Abraham
7077b55e8cSThomas Abraham MIPI_DSI_COLOR_MODE_OFF = 0x02,
7177b55e8cSThomas Abraham MIPI_DSI_COLOR_MODE_ON = 0x12,
7277b55e8cSThomas Abraham MIPI_DSI_SHUTDOWN_PERIPHERAL = 0x22,
7377b55e8cSThomas Abraham MIPI_DSI_TURN_ON_PERIPHERAL = 0x32,
7477b55e8cSThomas Abraham
7577b55e8cSThomas Abraham MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM = 0x03,
7677b55e8cSThomas Abraham MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM = 0x13,
7777b55e8cSThomas Abraham MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM = 0x23,
7877b55e8cSThomas Abraham
7977b55e8cSThomas Abraham MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM = 0x04,
8077b55e8cSThomas Abraham MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM = 0x14,
8177b55e8cSThomas Abraham MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM = 0x24,
8277b55e8cSThomas Abraham
8377b55e8cSThomas Abraham MIPI_DSI_DCS_SHORT_WRITE = 0x05,
8477b55e8cSThomas Abraham MIPI_DSI_DCS_SHORT_WRITE_PARAM = 0x15,
8577b55e8cSThomas Abraham
8677b55e8cSThomas Abraham MIPI_DSI_DCS_READ = 0x06,
8777b55e8cSThomas Abraham
8877b55e8cSThomas Abraham MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE = 0x37,
8977b55e8cSThomas Abraham
9077b55e8cSThomas Abraham MIPI_DSI_END_OF_TRANSMISSION = 0x08,
9177b55e8cSThomas Abraham
9277b55e8cSThomas Abraham MIPI_DSI_NULL_PACKET = 0x09,
9377b55e8cSThomas Abraham MIPI_DSI_BLANKING_PACKET = 0x19,
9477b55e8cSThomas Abraham MIPI_DSI_GENERIC_LONG_WRITE = 0x29,
9577b55e8cSThomas Abraham MIPI_DSI_DCS_LONG_WRITE = 0x39,
9677b55e8cSThomas Abraham
9777b55e8cSThomas Abraham MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20 = 0x0c,
9877b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24 = 0x1c,
9977b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16 = 0x2c,
10077b55e8cSThomas Abraham
10177b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_30 = 0x0d,
10277b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_36 = 0x1d,
10377b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12 = 0x3d,
10477b55e8cSThomas Abraham
10577b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_16 = 0x0e,
10677b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_18 = 0x1e,
10777b55e8cSThomas Abraham MIPI_DSI_PIXEL_STREAM_3BYTE_18 = 0x2e,
10877b55e8cSThomas Abraham MIPI_DSI_PACKED_PIXEL_STREAM_24 = 0x3e,
10977b55e8cSThomas Abraham };
11077b55e8cSThomas Abraham
11177b55e8cSThomas Abraham /*
11277b55e8cSThomas Abraham * struct mipi_dsim_config - interface for configuring mipi-dsi controller.
11377b55e8cSThomas Abraham *
11477b55e8cSThomas Abraham * @auto_flush: enable or disable Auto flush of MD FIFO using VSYNC pulse.
11577b55e8cSThomas Abraham * @eot_disable: enable or disable EoT packet in HS mode.
11677b55e8cSThomas Abraham * @auto_vertical_cnt: specifies auto vertical count mode.
11777b55e8cSThomas Abraham * in Video mode, the vertical line transition uses line counter
11877b55e8cSThomas Abraham * configured by VSA, VBP, and Vertical resolution.
11977b55e8cSThomas Abraham * If this bit is set to '1', the line counter does not use VSA and VBP
12077b55e8cSThomas Abraham * registers.(in command mode, this variable is ignored)
12177b55e8cSThomas Abraham * @hse: set horizontal sync event mode.
12277b55e8cSThomas Abraham * In VSYNC pulse and Vporch area, MIPI DSI master transfers only HSYNC
12377b55e8cSThomas Abraham * start packet to MIPI DSI slave at MIPI DSI spec1.1r02.
12477b55e8cSThomas Abraham * this bit transfers HSYNC end packet in VSYNC pulse and Vporch area
12577b55e8cSThomas Abraham * (in mommand mode, this variable is ignored)
12677b55e8cSThomas Abraham * @hfp: specifies HFP disable mode.
12777b55e8cSThomas Abraham * if this variable is set, DSI master ignores HFP area in VIDEO mode.
12877b55e8cSThomas Abraham * (in command mode, this variable is ignored)
12977b55e8cSThomas Abraham * @hbp: specifies HBP disable mode.
13077b55e8cSThomas Abraham * if this variable is set, DSI master ignores HBP area in VIDEO mode.
13177b55e8cSThomas Abraham * (in command mode, this variable is ignored)
13277b55e8cSThomas Abraham * @hsa: specifies HSA disable mode.
13377b55e8cSThomas Abraham * if this variable is set, DSI master ignores HSA area in VIDEO mode.
13477b55e8cSThomas Abraham * (in command mode, this variable is ignored)
13577b55e8cSThomas Abraham * @e_interface: specifies interface to be used.(CPU or RGB interface)
13677b55e8cSThomas Abraham * @e_virtual_ch: specifies virtual channel number that main or
13777b55e8cSThomas Abraham * sub diaplsy uses.
13877b55e8cSThomas Abraham * @e_pixel_format: specifies pixel stream format for main or sub display.
13977b55e8cSThomas Abraham * @e_burst_mode: selects Burst mode in Video mode.
14077b55e8cSThomas Abraham * in Non-burst mode, RGB data area is filled with RGB data and NULL
14177b55e8cSThomas Abraham * packets, according to input bandwidth of RGB interface.
14277b55e8cSThomas Abraham * In Burst mode, RGB data area is filled with RGB data only.
14377b55e8cSThomas Abraham * @e_no_data_lane: specifies data lane count to be used by Master.
14477b55e8cSThomas Abraham * @e_byte_clk: select byte clock source. (it must be DSIM_PLL_OUT_DIV8)
14577b55e8cSThomas Abraham * DSIM_EXT_CLK_DIV8 and DSIM_EXT_CLK_BYPASSS are not supported.
14677b55e8cSThomas Abraham * @pll_stable_time: specifies the PLL Timer for stability of the ganerated
14777b55e8cSThomas Abraham * clock(System clock cycle base)
14877b55e8cSThomas Abraham * if the timer value goes to 0x00000000, the clock stable bit of status
14977b55e8cSThomas Abraham * and interrupt register is set.
15077b55e8cSThomas Abraham * @esc_clk: specifies escape clock frequency for getting the escape clock
15177b55e8cSThomas Abraham * prescaler value.
15277b55e8cSThomas Abraham * @stop_holding_cnt: specifies the interval value between transmitting
15377b55e8cSThomas Abraham * read packet(or write "set_tear_on" command) and BTA request.
15477b55e8cSThomas Abraham * after transmitting read packet or write "set_tear_on" command,
15577b55e8cSThomas Abraham * BTA requests to D-PHY automatically. this counter value specifies
15677b55e8cSThomas Abraham * the interval between them.
15777b55e8cSThomas Abraham * @bta_timeout: specifies the timer for BTA.
15877b55e8cSThomas Abraham * this register specifies time out from BTA request to change
15977b55e8cSThomas Abraham * the direction with respect to Tx escape clock.
16077b55e8cSThomas Abraham * @rx_timeout: specifies the timer for LP Rx mode timeout.
16177b55e8cSThomas Abraham * this register specifies time out on how long RxValid deasserts,
16277b55e8cSThomas Abraham * after RxLpdt asserts with respect to Tx escape clock.
16377b55e8cSThomas Abraham * - RxValid specifies Rx data valid indicator.
16477b55e8cSThomas Abraham * - RxLpdt specifies an indicator that D-PHY is under RxLpdt mode.
16577b55e8cSThomas Abraham * - RxValid and RxLpdt specifies signal from D-PHY.
16677b55e8cSThomas Abraham */
16777b55e8cSThomas Abraham struct mipi_dsim_config {
16877b55e8cSThomas Abraham unsigned char auto_flush;
16977b55e8cSThomas Abraham unsigned char eot_disable;
17077b55e8cSThomas Abraham
17177b55e8cSThomas Abraham unsigned char auto_vertical_cnt;
17277b55e8cSThomas Abraham unsigned char hse;
17377b55e8cSThomas Abraham unsigned char hfp;
17477b55e8cSThomas Abraham unsigned char hbp;
17577b55e8cSThomas Abraham unsigned char hsa;
17677b55e8cSThomas Abraham
17777b55e8cSThomas Abraham enum mipi_dsim_interface_type e_interface;
17877b55e8cSThomas Abraham enum mipi_dsim_virtual_ch_no e_virtual_ch;
17977b55e8cSThomas Abraham enum mipi_dsim_pixel_format e_pixel_format;
18077b55e8cSThomas Abraham enum mipi_dsim_burst_mode_type e_burst_mode;
18177b55e8cSThomas Abraham enum mipi_dsim_no_of_data_lane e_no_data_lane;
18277b55e8cSThomas Abraham enum mipi_dsim_byte_clk_src e_byte_clk;
18377b55e8cSThomas Abraham
18477b55e8cSThomas Abraham /*
18577b55e8cSThomas Abraham * ===========================================
18677b55e8cSThomas Abraham * | P | M | S | MHz |
18777b55e8cSThomas Abraham * -------------------------------------------
18877b55e8cSThomas Abraham * | 3 | 100 | 3 | 100 |
18977b55e8cSThomas Abraham * | 3 | 100 | 2 | 200 |
19077b55e8cSThomas Abraham * | 3 | 63 | 1 | 252 |
19177b55e8cSThomas Abraham * | 4 | 100 | 1 | 300 |
19277b55e8cSThomas Abraham * | 4 | 110 | 1 | 330 |
19377b55e8cSThomas Abraham * | 12 | 350 | 1 | 350 |
19477b55e8cSThomas Abraham * | 3 | 100 | 1 | 400 |
19577b55e8cSThomas Abraham * | 4 | 150 | 1 | 450 |
19677b55e8cSThomas Abraham * | 6 | 118 | 1 | 472 |
19777b55e8cSThomas Abraham * | 3 | 120 | 1 | 480 |
19877b55e8cSThomas Abraham * | 12 | 250 | 0 | 500 |
19977b55e8cSThomas Abraham * | 4 | 100 | 0 | 600 |
20077b55e8cSThomas Abraham * | 3 | 81 | 0 | 648 |
20177b55e8cSThomas Abraham * | 3 | 88 | 0 | 704 |
20277b55e8cSThomas Abraham * | 3 | 90 | 0 | 720 |
20377b55e8cSThomas Abraham * | 3 | 100 | 0 | 800 |
20477b55e8cSThomas Abraham * | 12 | 425 | 0 | 850 |
20577b55e8cSThomas Abraham * | 4 | 150 | 0 | 900 |
20677b55e8cSThomas Abraham * | 12 | 475 | 0 | 950 |
20777b55e8cSThomas Abraham * | 6 | 250 | 0 | 1000 |
20877b55e8cSThomas Abraham * -------------------------------------------
20977b55e8cSThomas Abraham */
21077b55e8cSThomas Abraham
21177b55e8cSThomas Abraham /*
21277b55e8cSThomas Abraham * pms could be calculated as the following.
21377b55e8cSThomas Abraham * M * 24 / P * 2 ^ S = MHz
21477b55e8cSThomas Abraham */
21577b55e8cSThomas Abraham unsigned char p;
21677b55e8cSThomas Abraham unsigned short m;
21777b55e8cSThomas Abraham unsigned char s;
21877b55e8cSThomas Abraham
21977b55e8cSThomas Abraham unsigned int pll_stable_time;
22077b55e8cSThomas Abraham unsigned long esc_clk;
22177b55e8cSThomas Abraham
22277b55e8cSThomas Abraham unsigned short stop_holding_cnt;
22377b55e8cSThomas Abraham unsigned char bta_timeout;
22477b55e8cSThomas Abraham unsigned short rx_timeout;
22577b55e8cSThomas Abraham };
22677b55e8cSThomas Abraham
22777b55e8cSThomas Abraham /*
22877b55e8cSThomas Abraham * struct mipi_dsim_device - global interface for mipi-dsi driver.
22977b55e8cSThomas Abraham *
23077b55e8cSThomas Abraham * @dsim_config: infomation for configuring mipi-dsi controller.
23177b55e8cSThomas Abraham * @master_ops: callbacks to mipi-dsi operations.
23277b55e8cSThomas Abraham * @dsim_lcd_dev: pointer to activated ddi device.
23377b55e8cSThomas Abraham * (it would be registered by mipi-dsi driver.)
23477b55e8cSThomas Abraham * @dsim_lcd_drv: pointer to activated_ddi driver.
23577b55e8cSThomas Abraham * (it would be registered by mipi-dsi driver.)
23677b55e8cSThomas Abraham * @state: specifies status of MIPI-DSI controller.
23777b55e8cSThomas Abraham * the status could be RESET, INIT, STOP, HSCLKEN and ULPS.
23877b55e8cSThomas Abraham * @data_lane: specifiec enabled data lane number.
23977b55e8cSThomas Abraham * this variable would be set by driver according to e_no_data_lane
24077b55e8cSThomas Abraham * automatically.
24177b55e8cSThomas Abraham * @e_clk_src: select byte clock source.
24277b55e8cSThomas Abraham * @pd: pointer to MIPI-DSI driver platform data.
24377b55e8cSThomas Abraham */
24477b55e8cSThomas Abraham struct mipi_dsim_device {
24577b55e8cSThomas Abraham struct mipi_dsim_config *dsim_config;
24677b55e8cSThomas Abraham struct mipi_dsim_master_ops *master_ops;
24777b55e8cSThomas Abraham struct mipi_dsim_lcd_device *dsim_lcd_dev;
24877b55e8cSThomas Abraham struct mipi_dsim_lcd_driver *dsim_lcd_drv;
24977b55e8cSThomas Abraham
25077b55e8cSThomas Abraham unsigned int state;
25177b55e8cSThomas Abraham unsigned int data_lane;
25277b55e8cSThomas Abraham enum mipi_dsim_byte_clk_src e_clk_src;
25377b55e8cSThomas Abraham
25477b55e8cSThomas Abraham struct exynos_platform_mipi_dsim *pd;
25577b55e8cSThomas Abraham };
25677b55e8cSThomas Abraham
25777b55e8cSThomas Abraham /*
25877b55e8cSThomas Abraham * struct exynos_platform_mipi_dsim - interface to platform data
25977b55e8cSThomas Abraham * for mipi-dsi driver.
26077b55e8cSThomas Abraham *
26177b55e8cSThomas Abraham * @lcd_panel_name: specifies lcd panel name registered to mipi-dsi driver.
26277b55e8cSThomas Abraham * lcd panel driver searched would be actived.
26377b55e8cSThomas Abraham * @dsim_config: pointer of structure for configuring mipi-dsi controller.
26477b55e8cSThomas Abraham * @lcd_panel_info: pointer for lcd panel specific structure.
26577b55e8cSThomas Abraham * this structure specifies width, height, timing and polarity and so on.
26677b55e8cSThomas Abraham * @lcd_power: callback pointer for enabling or disabling lcd power.
26777b55e8cSThomas Abraham * @mipi_power: callback pointer for enabling or disabling mipi power.
26877b55e8cSThomas Abraham * @phy_enable: pointer to a callback controlling D-PHY enable/reset
26977b55e8cSThomas Abraham */
27077b55e8cSThomas Abraham struct exynos_platform_mipi_dsim {
27177b55e8cSThomas Abraham char lcd_panel_name[PANEL_NAME_SIZE];
27277b55e8cSThomas Abraham
27377b55e8cSThomas Abraham struct mipi_dsim_config *dsim_config;
27477b55e8cSThomas Abraham void *lcd_panel_info;
27577b55e8cSThomas Abraham
27677b55e8cSThomas Abraham int (*lcd_power)(void);
27777b55e8cSThomas Abraham int (*mipi_power)(void);
27877b55e8cSThomas Abraham void (*phy_enable)(unsigned int dev_index, unsigned int enable);
27977b55e8cSThomas Abraham };
28077b55e8cSThomas Abraham
28177b55e8cSThomas Abraham /*
28277b55e8cSThomas Abraham * struct mipi_dsim_master_ops - callbacks to mipi-dsi operations.
28377b55e8cSThomas Abraham *
28477b55e8cSThomas Abraham * @cmd_write: transfer command to lcd panel at LP mode.
28577b55e8cSThomas Abraham * @cmd_read: read command from rx register.
28677b55e8cSThomas Abraham * @get_dsim_frame_done: get the status that all screen data have been
28777b55e8cSThomas Abraham * transferred to mipi-dsi.
28877b55e8cSThomas Abraham * @clear_dsim_frame_done: clear frame done status.
28977b55e8cSThomas Abraham * @get_fb_frame_done: get frame done status of display controller.
29077b55e8cSThomas Abraham * @trigger: trigger display controller.
29177b55e8cSThomas Abraham * - this one would be used only in case of CPU mode.
29277b55e8cSThomas Abraham */
29377b55e8cSThomas Abraham struct mipi_dsim_master_ops {
29477b55e8cSThomas Abraham int (*cmd_write)(struct mipi_dsim_device *dsim, unsigned int data_id,
29577b55e8cSThomas Abraham const unsigned char *data0, unsigned int data1);
29677b55e8cSThomas Abraham int (*cmd_read)(struct mipi_dsim_device *dsim, unsigned int data_id,
29777b55e8cSThomas Abraham unsigned int data0, unsigned int data1);
29877b55e8cSThomas Abraham int (*get_dsim_frame_done)(struct mipi_dsim_device *dsim);
29977b55e8cSThomas Abraham int (*clear_dsim_frame_done)(struct mipi_dsim_device *dsim);
30077b55e8cSThomas Abraham
30177b55e8cSThomas Abraham int (*get_fb_frame_done)(void);
30277b55e8cSThomas Abraham void (*trigger)(struct fb_info *info);
30377b55e8cSThomas Abraham };
30477b55e8cSThomas Abraham
30577b55e8cSThomas Abraham /*
30677b55e8cSThomas Abraham * device structure for mipi-dsi based lcd panel.
30777b55e8cSThomas Abraham *
30877b55e8cSThomas Abraham * @name: name of the device to use with this device, or an
30977b55e8cSThomas Abraham * alias for that name.
31077b55e8cSThomas Abraham * @id: id of device to be registered.
31177b55e8cSThomas Abraham * @bus_id: bus id for identifing connected bus
31277b55e8cSThomas Abraham * and this bus id should be same as id of mipi_dsim_device.
31377b55e8cSThomas Abraham * @master: pointer to mipi-dsi master device object.
31477b55e8cSThomas Abraham * @platform_data: lcd panel specific platform data.
31577b55e8cSThomas Abraham */
31677b55e8cSThomas Abraham struct mipi_dsim_lcd_device {
31777b55e8cSThomas Abraham char *name;
31877b55e8cSThomas Abraham int id;
31977b55e8cSThomas Abraham int bus_id;
32077b55e8cSThomas Abraham int reverse_panel;
32177b55e8cSThomas Abraham
32277b55e8cSThomas Abraham struct mipi_dsim_device *master;
323*37ea446bSSimon Glass struct exynos_platform_mipi_dsim *platform_data;
32477b55e8cSThomas Abraham };
32577b55e8cSThomas Abraham
32677b55e8cSThomas Abraham /*
32777b55e8cSThomas Abraham * driver structure for mipi-dsi based lcd panel.
32877b55e8cSThomas Abraham *
32977b55e8cSThomas Abraham * this structure should be registered by lcd panel driver.
33077b55e8cSThomas Abraham * mipi-dsi driver seeks lcd panel registered through name field
33177b55e8cSThomas Abraham * and calls these callback functions in appropriate time.
33277b55e8cSThomas Abraham *
33377b55e8cSThomas Abraham * @name: name of the driver to use with this device, or an
33477b55e8cSThomas Abraham * alias for that name.
33577b55e8cSThomas Abraham * @id: id of driver to be registered.
33677b55e8cSThomas Abraham * this id would be used for finding device object registered.
33777b55e8cSThomas Abraham * @mipi_panel_init: callback pointer for initializing lcd panel based on mipi
33877b55e8cSThomas Abraham * dsi interface.
33977b55e8cSThomas Abraham * @mipi_display_on: callback pointer for lcd panel display on.
34077b55e8cSThomas Abraham */
34177b55e8cSThomas Abraham struct mipi_dsim_lcd_driver {
34277b55e8cSThomas Abraham char *name;
34377b55e8cSThomas Abraham int id;
34477b55e8cSThomas Abraham
34577b55e8cSThomas Abraham int (*mipi_panel_init)(struct mipi_dsim_device *dsim_dev);
34677b55e8cSThomas Abraham void (*mipi_display_on)(struct mipi_dsim_device *dsim_dev);
34777b55e8cSThomas Abraham };
34877b55e8cSThomas Abraham
34977b55e8cSThomas Abraham #ifdef CONFIG_EXYNOS_MIPI_DSIM
350652d15c0SSimon Glass int exynos_mipi_dsi_init(struct exynos_platform_mipi_dsim *dsim_pd);
35177b55e8cSThomas Abraham #else
exynos_mipi_dsi_init(struct exynos_platform_mipi_dsim * dsim_pd)352652d15c0SSimon Glass static inline int exynos_mipi_dsi_init(
353652d15c0SSimon Glass struct exynos_platform_mipi_dsim *dsim_pd)
35477b55e8cSThomas Abraham {
35577b55e8cSThomas Abraham return 0;
35677b55e8cSThomas Abraham }
35777b55e8cSThomas Abraham #endif
35877b55e8cSThomas Abraham
35977b55e8cSThomas Abraham /*
36077b55e8cSThomas Abraham * register mipi_dsim_lcd_driver object defined by lcd panel driver
36177b55e8cSThomas Abraham * to mipi-dsi driver.
36277b55e8cSThomas Abraham */
36377b55e8cSThomas Abraham int exynos_mipi_dsi_register_lcd_driver(struct mipi_dsim_lcd_driver
36477b55e8cSThomas Abraham *lcd_drv);
36577b55e8cSThomas Abraham
36677b55e8cSThomas Abraham /*
36777b55e8cSThomas Abraham * register mipi_dsim_lcd_device to mipi-dsi master.
36877b55e8cSThomas Abraham */
36977b55e8cSThomas Abraham int exynos_mipi_dsi_register_lcd_device(struct mipi_dsim_lcd_device
37077b55e8cSThomas Abraham *lcd_dev);
37177b55e8cSThomas Abraham
37277b55e8cSThomas Abraham void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
373aaca5b19SSimon Glass struct vidinfo;
374aaca5b19SSimon Glass void exynos_init_dsim_platform_data(struct vidinfo *vid);
37577b55e8cSThomas Abraham
37677b55e8cSThomas Abraham /* panel driver init based on mipi dsi interface */
37777b55e8cSThomas Abraham void s6e8ax0_init(void);
37877b55e8cSThomas Abraham
37977b55e8cSThomas Abraham extern int mipi_power(void);
38077b55e8cSThomas Abraham #endif /* _DSIM_H */
381