mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
video: dw_mipi_dsi: Sync driver with Linux
Just a simple update of code from Linux driver, where this driver was copied from originally. Signed-off-by: Ondrej Jirman <megi@xff.cz>
This commit is contained in:
@@ -86,6 +86,7 @@
|
||||
#define VID_MODE_TYPE_NON_BURST_SYNC_EVENTS 0x1
|
||||
#define VID_MODE_TYPE_BURST 0x2
|
||||
#define VID_MODE_TYPE_MASK 0x3
|
||||
#define ENABLE_LOW_POWER_CMD BIT(15)
|
||||
|
||||
#define DSI_VID_PKT_SIZE 0x3c
|
||||
#define VID_PKT_SIZE(p) ((p) & 0x3fff)
|
||||
@@ -294,13 +295,28 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi,
|
||||
bool lpm = msg->flags & MIPI_DSI_MSG_USE_LPM;
|
||||
u32 val = 0;
|
||||
|
||||
/*
|
||||
* TODO dw drv improvements
|
||||
* largest packet sizes during hfp or during vsa/vpb/vfp
|
||||
* should be computed according to byte lane, lane number and only
|
||||
* if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
|
||||
*/
|
||||
dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(16)
|
||||
| INVACT_LPCMD_TIME(4));
|
||||
|
||||
if (msg->flags & MIPI_DSI_MSG_REQ_ACK)
|
||||
val |= ACK_RQST_EN;
|
||||
if (lpm)
|
||||
val |= CMD_MODE_ALL_LP;
|
||||
|
||||
dsi_write(dsi, DSI_LPCLK_CTRL, lpm ? 0 : PHY_TXREQUESTCLKHS);
|
||||
dsi_write(dsi, DSI_CMD_MODE_CFG, val);
|
||||
|
||||
val = dsi_read(dsi, DSI_VID_MODE_CFG);
|
||||
if (lpm)
|
||||
val |= ENABLE_LOW_POWER_CMD;
|
||||
else
|
||||
val &= ~ENABLE_LOW_POWER_CMD;
|
||||
dsi_write(dsi, DSI_VID_MODE_CFG, val);
|
||||
}
|
||||
|
||||
static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val)
|
||||
@@ -464,17 +480,22 @@ static void dw_mipi_dsi_set_mode(struct dw_mipi_dsi *dsi,
|
||||
unsigned long mode_flags)
|
||||
{
|
||||
const struct mipi_dsi_phy_ops *phy_ops = dsi->phy_ops;
|
||||
u32 val;
|
||||
|
||||
dsi_write(dsi, DSI_PWR_UP, RESET);
|
||||
|
||||
if (mode_flags & MIPI_DSI_MODE_VIDEO) {
|
||||
dsi_write(dsi, DSI_MODE_CFG, ENABLE_VIDEO_MODE);
|
||||
dw_mipi_dsi_video_mode_config(dsi);
|
||||
dsi_write(dsi, DSI_LPCLK_CTRL, PHY_TXREQUESTCLKHS);
|
||||
} else {
|
||||
dsi_write(dsi, DSI_MODE_CFG, ENABLE_CMD_MODE);
|
||||
}
|
||||
|
||||
val = PHY_TXREQUESTCLKHS;
|
||||
if (mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)
|
||||
val |= AUTO_CLKLANE_CTRL;
|
||||
dsi_write(dsi, DSI_LPCLK_CTRL, val);
|
||||
|
||||
if (phy_ops->post_set_mode)
|
||||
phy_ops->post_set_mode(dsi->device, mode_flags);
|
||||
|
||||
@@ -545,14 +566,6 @@ static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi,
|
||||
dsi_write(dsi, DSI_DPI_VCID, DPI_VCID(dsi->channel));
|
||||
dsi_write(dsi, DSI_DPI_COLOR_CODING, color);
|
||||
dsi_write(dsi, DSI_DPI_CFG_POL, val);
|
||||
/*
|
||||
* TODO dw drv improvements
|
||||
* largest packet sizes during hfp or during vsa/vpb/vfp
|
||||
* should be computed according to byte lane, lane number and only
|
||||
* if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
|
||||
*/
|
||||
dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(4)
|
||||
| INVACT_LPCMD_TIME(4));
|
||||
}
|
||||
|
||||
static void dw_mipi_dsi_packet_handler_config(struct dw_mipi_dsi *dsi)
|
||||
|
Reference in New Issue
Block a user