Lines Matching +full:mipi +full:- +full:max +full:- +full:frequency
4 * SPDX-License-Identifier: Apache-2.0
20 /* Max output frequency of DPHY bit clock */
38 /* MAX DSI TX payload */
56 * bit clock for a given target frequency, such that the DPHY clock in dsi_mcux_best_clock()
57 * is faster than the target frequency. MCUX SDK implements a similar in dsi_mcux_best_clock()
59 * configure the DPHY to output the closest realizable clock frequency in dsi_mcux_best_clock()
61 * the output frequency is less than the requested one. in dsi_mcux_best_clock()
69 * The formula for the DPHY output frequency is: in dsi_mcux_best_clock()
75 /* Determine VCO output frequency before CO divider */ in dsi_mcux_best_clock()
78 /* If desired VCO output frequency is too low, try next CO shift */ in dsi_mcux_best_clock()
83 /* If desired VCO output frequency is too high, no point in in dsi_mcux_best_clock()
90 /* Search the best CN and CM values for desired VCO frequency */ in dsi_mcux_best_clock()
94 /* If the frequency after input divider is too high, in dsi_mcux_best_clock()
101 /* If the frequency after input divider is too low, in dsi_mcux_best_clock()
108 /* Get the closest CM value for this vco frequency in dsi_mcux_best_clock()
114 cm = (vco_freq + (refclk_cn_freq - 1)) / refclk_cn_freq; in dsi_mcux_best_clock()
128 /* Calculate candidate frequency */ in dsi_mcux_best_clock()
132 /* SKIP frequencies less than target frequency. 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()
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()
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()
203 * If nxp,lcdif node is present, then the MIPI DSI driver will in dsi_mcux_attach()
206 * constantly refresh the MIPI panel. 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()