src/graphics/display/drivers/dsi-dw/dsi-dw.cc
// MIPI DSI Functions as implemented by DWC IP
MIPI DSI Functions as implemented by DWC IP
MIPI DSI Functions as implemented by DWC IP
zx_status_t DsiDw::GenWriteShort(const mipi_dsi_cmd_t& cmd) {
  if ((cmd.pld_data_count > 2) || (cmd.pld_data_count > 0 && cmd.pld_data_list == nullptr) ||
      (cmd.dsi_data_type & MIPI_DSI_DT_GEN_SHORT_WRITE_0) != MIPI_DSI_DT_GEN_SHORT_WRITE_0) {
    DSI_ERROR("Invalid Gen short cmd sent\n");
    return ZX_ERR_INVALID_ARGS;
  }
  uint32_t regVal = 0;
  regVal |= GEN_HDR_DT(cmd.dsi_data_type);
  regVal |= GEN_HDR_VC(cmd.virt_chn_id);
  if (cmd.pld_data_count >= 1) {
    regVal |= GEN_HDR_WC_LSB(cmd.pld_data_list[0]);
  }
  if (cmd.pld_data_count == 2) {
    regVal |= GEN_HDR_WC_MSB(cmd.pld_data_list[1]);
  }
  return GenericHdrWrite(regVal);
}
zx_status_t DsiDw :: GenWriteShort ( const mipi_dsi_cmd_t & cmd ) { if ( ( cmd . pld_data_count > 2 ) || ( cmd . pld_data_count > 0 && cmd . pld_data_list == nullptr ) || ( cmd . dsi_data_type & MIPI_DSI_DT_GEN_SHORT_WRITE_0 ) != MIPI_DSI_DT_GEN_SHORT_WRITE_0 ) { DSI_ERROR ( " \n " ) ; return ZX_ERR_INVALID_ARGS ; } uint32_t regVal = 0 ; regVal |= GEN_HDR_DT ( cmd . dsi_data_type ) ; regVal |= GEN_HDR_VC ( cmd . virt_chn_id ) ; if ( cmd . pld_data_count >= 1 ) { regVal |= GEN_HDR_WC_LSB ( cmd . pld_data_list [ 0 ] ) ; } if ( cmd . pld_data_count == 2 ) { regVal |= GEN_HDR_WC_MSB ( cmd . pld_data_list [ 1 ] ) ; } return GenericHdrWrite ( regVal ) ; }
MIPI DSI Functions as implemented by DWC IP
MIPI DSI Functions as implemented by DWC IP
// Sanity check payload data and size