8 #ifndef __SOC_MIPI_DSI_H__
9 #define __SOC_MIPI_DSI_H__
17 #define MIPI_DSI_MSG_REQ_ACK BIT(0)
19 #define MIPI_DSI_MSG_USE_LPM BIT(1)
80 #define MIPI_DSI_MODE_VIDEO BIT(0)
82 #define MIPI_DSI_MODE_VIDEO_BURST BIT(1)
84 #define MIPI_DSI_MODE_VIDEO_SYNC_PULSE BIT(2)
86 #define MIPI_DSI_MODE_VIDEO_AUTO_VERT BIT(3)
88 #define MIPI_DSI_MODE_VIDEO_HSE BIT(4)
90 #define MIPI_DSI_MODE_VIDEO_HFP BIT(5)
92 #define MIPI_DSI_MODE_VIDEO_HBP BIT(6)
94 #define MIPI_DSI_MODE_VIDEO_HSA BIT(7)
96 #define MIPI_DSI_MODE_VSYNC_FLUSH BIT(8)
98 #define MIPI_DSI_MODE_EOT_PACKET BIT(9)
100 #define MIPI_DSI_CLOCK_NON_CONTINUOUS BIT(10)
156 #define MIPI_DSI_DCS_POWER_MODE_DISPLAY (1 << 2)
157 #define MIPI_DSI_DCS_POWER_MODE_NORMAL (1 << 3)
158 #define MIPI_DSI_DCS_POWER_MODE_SLEEP (1 << 4)
159 #define MIPI_DSI_DCS_POWER_MODE_PARTIAL (1 << 5)
160 #define MIPI_DSI_DCS_POWER_MODE_IDLE (1 << 6)
163 const void *data,
size_t len);
171 bool reverse_page_address,
172 bool reverse_col_address,
173 bool reverse_page_col_address,
174 bool refresh_from_bottom,
176 bool latch_right_to_left,
177 bool flip_horizontal,
183 #define MIPI_CAL_CTRL 0x00
184 #define MIPI_CAL_CTRL_NOISE_FILTER(x) (((x) & 0xf) << 26)
185 #define MIPI_CAL_CTRL_PRESCALE(x) (((x) & 0x3) << 24)
186 #define MIPI_CAL_CTRL_CLKEN_OVR (1 << 4)
187 #define MIPI_CAL_CTRL_START (1 << 0)
189 #define MIPI_CAL_AUTOCAL_CTRL 0x01
191 #define MIPI_CAL_STATUS 0x02
192 #define MIPI_CAL_STATUS_DONE (1 << 16)
193 #define MIPI_CAL_STATUS_ACTIVE (1 << 0)
195 #define MIPI_CAL_CONFIG_CSIA 0x05
196 #define MIPI_CAL_CONFIG_CSIB 0x06
197 #define MIPI_CAL_CONFIG_CSIC 0x07
198 #define MIPI_CAL_CONFIG_CSID 0x08
199 #define MIPI_CAL_CONFIG_CSIE 0x09
200 #define MIPI_CAL_CONFIG_CSIF 0x0a
201 #define MIPI_CAL_CONFIG_DSIA 0x0e
202 #define MIPI_CAL_CONFIG_DSIB 0x0f
203 #define MIPI_CAL_CONFIG_DSIC 0x10
204 #define MIPI_CAL_CONFIG_DSID 0x11
206 #define MIPI_CAL_CONFIG_DSIA_CLK 0x19
207 #define MIPI_CAL_CONFIG_DSIB_CLK 0x1a
208 #define MIPI_CAL_CONFIG_CSIAB_CLK 0x1b
209 #define MIPI_CAL_CONFIG_DSIC_CLK 0x1c
210 #define MIPI_CAL_CONFIG_CSICD_CLK 0x1c
211 #define MIPI_CAL_CONFIG_DSID_CLK 0x1d
212 #define MIPI_CAL_CONFIG_CSIE_CLK 0x1d
215 #define MIPI_CAL_CONFIG_SELECT (1 << 21)
218 #define MIPI_CAL_CONFIG_HSPDOS(x) (((x) & 0x1f) << 16)
219 #define MIPI_CAL_CONFIG_HSPUOS(x) (((x) & 0x1f) << 8)
220 #define MIPI_CAL_CONFIG_TERMOS(x) (((x) & 0x1f) << 0)
223 #define MIPI_CAL_CONFIG_HSCLKPDOSD(x) (((x) & 0x1f) << 8)
224 #define MIPI_CAL_CONFIG_HSCLKPUOSD(x) (((x) & 0x1f) << 0)
226 #define MIPI_CAL_BIAS_PAD_CFG0 0x16
227 #define MIPI_CAL_BIAS_PAD_PDVCLAMP (1 << 1)
228 #define MIPI_CAL_BIAS_PAD_E_VCLAMP_REF (1 << 0)
230 #define MIPI_CAL_BIAS_PAD_CFG1 0x17
231 #define MIPI_CAL_BIAS_PAD_DRV_DN_REF(x) (((x) & 0x7) << 16)
232 #define MIPI_CAL_BIAS_PAD_DRV_UP_REF(x) (((x) & 0x7) << 8)
234 #define MIPI_CAL_BIAS_PAD_CFG2 0x18
235 #define MIPI_CAL_BIAS_PAD_VCLAMP(x) (((x) & 0x7) << 16)
236 #define MIPI_CAL_BIAS_PAD_VAUXP(x) (((x) & 0x7) << 4)
237 #define MIPI_CAL_BIAS_PAD_PDVREG (1 << 1)
int mipi_dsi_enslave(struct mipi_dsi_device *master, struct mipi_dsi_device *slave)
mipi_dsi_enslave() - use a MIPI DSI peripheral as slave for dual-channel operation
int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, enum mipi_dsi_dcs_tear_mode mode)
mipi_dsi_dcs_set_tear_on() - turn on the display module's Tearing Effect output signal on the TE sign...
int mipi_dsi_liberate(struct mipi_dsi_device *master, struct mipi_dsi_device *slave)
mipi_dsi_liberate() - stop using a MIPI DSI peripheral as slave for dual- channel operation
int mipi_dsi_dcs_exit_sleep_mode(struct mipi_dsi_device *dsi)
mipi_dsi_dcs_exit_sleep_mode() - enable all blocks inside the display module
@ MIPI_DSI_FMT_RGB666_PACKED
int mipi_dsi_dcs_set_display_on(struct mipi_dsi_device *dsi)
mipi_dsi_dcs_set_display_on() - start displaying the image data on the display device
int mipi_dsi_dcs_set_page_address(struct mipi_dsi_device *dsi, u16 start, u16 end)
mipi_dsi_dcs_set_page_address() - define the page extent of the frame memory accessed by the host pro...
int mipi_dsi_host_register(struct mipi_dsi_host *host)
int mipi_dsi_detach(struct mipi_dsi_device *dsi)
mipi_dsi_detach - detach a DSI device from its DSI host
int tegra_mipi_calibrate(struct tegra_mipi_device *device)
int mipi_dsi_dcs_set_pixel_format(struct mipi_dsi_device *dsi, u8 format)
mipi_dsi_dcs_set_pixel_format() - sets the pixel format for the RGB image data used by the interface
int mipi_dsi_dcs_set_address_mode(struct mipi_dsi_device *dsi, bool reverse_page_address, bool reverse_col_address, bool reverse_page_col_address, bool refresh_from_bottom, bool reverse_rgb, bool latch_right_to_left, bool flip_horizontal, bool flip_vertical)
mipi_dsi_dcs_set_address_mode() - sets the data order for forward transfers from the host to the peri...
struct tegra_mipi_device * tegra_mipi_request(struct tegra_mipi_device *device, int device_index)
int mipi_dsi_attach(struct mipi_dsi_device *dsi)
mipi_dsi_attach - attach a DSI device to its DSI host
@ MIPI_DSI_DCS_TEAR_MODE_VHBLANK
The TE output line consists of both V-Blanking and H-Blanking information.
@ MIPI_DSI_DCS_TEAR_MODE_VBLANK
mipi_dsi_dcs_tear_mode - Tearing Effect Output Line modeThe TE output line consists of V-Blanking inf...
int mipi_dsi_dcs_set_column_address(struct mipi_dsi_device *dsi, u16 start, u16 end)
mipi_dsi_dcs_set_column_address() - define the column extent of the frame memory accessed by the host...
ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, u8 cmd, const void *data, size_t len)
mipi_dsi_dcs_write() - send DCS write command
static struct spi_slave slave
mipi_dsi_device - DSI peripheral device
struct mipi_dsi_device * slave
slave interface for dual-channel peripherals
enum mipi_dsi_pixel_format format
pixel format for video mode
struct mipi_dsi_host * host
DSI host for this peripheral.
const struct mipi_dsi_master_ops * ops
callbacks for master/slave setup
unsigned int channel
virtual channel assigned to the peripheral
unsigned long mode_flags
DSI operation mode related flags.
struct mipi_dsi_device * master
master interface for dual-channel peripherals
unsigned int lanes
number of active data lanes
ssize_t(* transfer)(struct mipi_dsi_host *host, const struct mipi_dsi_msg *msg)
transmit a DSI packet
int(* detach)(struct mipi_dsi_host *host, struct mipi_dsi_device *dsi)
detach DSI device from DSI host
int(* attach)(struct mipi_dsi_host *host, struct mipi_dsi_device *dsi)
mipi_dsi_host_ops - DSI bus operationsattach DSI device to DSI host
mipi_dsi_host - DSI host device
void * dev
driver model device node for this DSI host
const struct mipi_dsi_host_ops * ops
DSI host operations.
int(* enslave)(struct mipi_dsi_device *master, struct mipi_dsi_device *slave)
int(* liberate)(struct mipi_dsi_device *master, struct mipi_dsi_device *slave)
mipi_dsi_msg - read/write DSI buffer
u16 flags
flags controlling this message transmission
size_t tx_len
length of tx_buf
const void * tx_buf
data to be written
void * rx_buf
data to be read, or NULL
size_t rx_len
length of rx_buf
u8 channel
virtual channel id
const struct tegra_mipi_pad * pads
int clock_enable_override
const struct tegra_mipi_soc * soc