static int32_t sprdfb_dsi_dcs_read(uint8_t command, uint8_t bytes_to_read, uint8_t *read_buffer) { uint16_t result; uint32_t reg_val, reg_val_1, reg_val_2; result = mipi_dsih_dcs_rd_cmd(&(dsi_ctx.dsi_inst), 0, command, bytes_to_read, read_buffer); reg_val = dispc_glb_read(SPRD_MIPI_DSIC_BASE + R_DSI_HOST_PHY_STATUS); #ifdef FB_DSIH_VERSION_1P21A reg_val_1 = dispc_glb_read(SPRD_MIPI_DSIC_BASE + R_DSI_HOST_INT_ST0); reg_val_2 = dispc_glb_read(SPRD_MIPI_DSIC_BASE + R_DSI_HOST_INT_ST1); #else reg_val_1 = dispc_glb_read(SPRD_MIPI_DSIC_BASE + R_DSI_HOST_ERROR_ST0); reg_val_2 = dispc_glb_read(SPRD_MIPI_DSIC_BASE + R_DSI_HOST_ERROR_ST1); #endif if(0 != (reg_val & 0x2)){ printk("sprdfb: [%s] mipi read hang (0x%x)!\n", __FUNCTION__, reg_val); dsi_ctx.status = 2; result = 0; } if(0 != (reg_val_1 & 0x701)){ printk("sprdfb: [%s] mipi read status error!(0x%x, 0x%x)\n", __FUNCTION__, reg_val_1, reg_val_2); result = 0; } if(0 == result){ printk(KERN_ERR "sprdfb: [%s] return error (%d)\n", __FUNCTION__, result); return -1; } return 0; }
static int32_t sprdfb_dsi_dcs_read(uint8_t command, uint8_t bytes_to_read, uint8_t *read_buffer) { uint16_t result; result = mipi_dsih_dcs_rd_cmd(&(dsi_ctx.dsi_inst), 0, command, bytes_to_read, read_buffer); if(0 == result){ FB_PRINT("sprdfb: [%s] error (%d)\n", __FUNCTION__, result); return -1; } return 0; }