Lines Matching +full:clock +full:- +full:lane

4  * SPDX-License-Identifier: Apache-2.0
20 /* Max output frequency of DPHY bit clock */
56 * bit clock for a given target frequency, such that the DPHY clock in dsi_mcux_best_clock()
59 * configure the DPHY to output the closest realizable clock frequency in dsi_mcux_best_clock()
114 cm = (vco_freq + (refclk_cn_freq - 1)) / refclk_cn_freq; in dsi_mcux_best_clock()
138 if ((cand_freq - target_freq) < best_diff) { in dsi_mcux_best_clock()
140 best_diff = (cand_freq - target_freq); in dsi_mcux_best_clock()
161 const struct display_mcux_mipi_dsi_config *config = dev->config; in dsi_mcux_attach()
169 dsi_config.numLanes = mdev->data_lanes; in dsi_mcux_attach()
170 dsi_config.autoInsertEoTp = config->auto_insert_eotp; in dsi_mcux_attach()
173 DSI_Init((MIPI_DSI_Type *)&config->base, &dsi_config); in dsi_mcux_attach()
177 * The DPHY bit clock must be fast enough to send out the pixels, it should be in dsi_mcux_attach()
180 * (Pixel clock * bit per output pixel) / number of MIPI data lane in dsi_mcux_attach()
183 /* Find the best realizable clock value for the MIPI DSI */ in dsi_mcux_attach()
185 dsi_mcux_best_clock(mipi_dsi_dphy_ref_clk_hz, config->phy_clock); in dsi_mcux_attach()
187 LOG_ERR("DPHY cannot support requested PHY clock"); in dsi_mcux_attach()
188 return -ENOTSUP; in dsi_mcux_attach()
190 /* Cap clock value to max frequency */ in dsi_mcux_attach()
198 mipi_dsi_dphy_bit_clk_hz = DSI_InitDphy((MIPI_DSI_Type *)&config->base, in dsi_mcux_attach()
201 LOG_DBG("DPHY clock set to %u", mipi_dsi_dphy_bit_clk_hz); in dsi_mcux_attach()
208 if (mdev->mode_flags & MIPI_DSI_MODE_VIDEO) { in dsi_mcux_attach()
210 DSI_SetDpiConfig((MIPI_DSI_Type *)&config->base, in dsi_mcux_attach()
211 &config->dpi_config, mdev->data_lanes, in dsi_mcux_attach()
223 const struct display_mcux_mipi_dsi_config *config = dev->config; in dsi_mcux_transfer()
228 dsi_xfer.txDataSize = msg->tx_len; in dsi_mcux_transfer()
229 dsi_xfer.txData = msg->tx_buf; in dsi_mcux_transfer()
230 dsi_xfer.rxDataSize = msg->rx_len; in dsi_mcux_transfer()
231 dsi_xfer.rxData = msg->rx_buf; in dsi_mcux_transfer()
233 switch (msg->type) { in dsi_mcux_transfer()
237 return -ENOTSUP; in dsi_mcux_transfer()
240 dsi_xfer.dscCmd = msg->cmd; in dsi_mcux_transfer()
245 dsi_xfer.dscCmd = msg->cmd; in dsi_mcux_transfer()
250 dsi_xfer.dscCmd = msg->cmd; in dsi_mcux_transfer()
260 (DSI_TX_MAX_PAYLOAD_BYTE - 6)); in dsi_mcux_transfer()
280 return -ENOTSUP; in dsi_mcux_transfer()
282 LOG_ERR("Unsupported message type (%d)", msg->type); in dsi_mcux_transfer()
283 return -ENOTSUP; in dsi_mcux_transfer()
286 status = DSI_TransferBlocking(&config->base, &dsi_xfer); in dsi_mcux_transfer()
290 return -EIO; in dsi_mcux_transfer()
293 if (msg->rx_len != 0) { in dsi_mcux_transfer()