static void s6e8aa0_dcs_write(struct s6e8aa0 *ctx, const void *data, size_t len) { struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); int ret; if (ctx->error < 0) return; ret = mipi_dsi_dcs_write(dsi, dsi->channel, data, len); if (ret < 0) { dev_err(ctx->dev, "error %d writing dcs seq: %*ph\n", ret, len, data); ctx->error = ret; } }
int panel_jdi_prepare(struct panel_jdi *jdi) { int ret; u8 data; if (jdi->enabled) return 0; ret = mipi_dsi_dcs_set_column_address(jdi->dsi, 0, jdi->mode->xres / 2 - 1); // 2560/2 if (ret < 0) printk(BIOS_ERR, "failed to set column address: %d\n", ret); ret = mipi_dsi_dcs_set_column_address(jdi->dsi->slave, 0, jdi->mode->xres / 2 - 1); if (ret < 0) printk(BIOS_ERR, "failed to set column address: %d\n", ret); ret = mipi_dsi_dcs_set_page_address(jdi->dsi, 0, jdi->mode->yres - 1); if (ret < 0) printk(BIOS_ERR, "failed to set page address: %d\n", ret); ret = mipi_dsi_dcs_set_page_address(jdi->dsi->slave, 0, jdi->mode->yres - 1); if (ret < 0) printk(BIOS_ERR, "failed to set page address: %d\n", ret); ret = mipi_dsi_dcs_set_tear_on(jdi->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); if (ret < 0) printk(BIOS_ERR, "failed to set tear on: %d\n", ret); ret = mipi_dsi_dcs_set_tear_on(jdi->dsi->slave, MIPI_DSI_DCS_TEAR_MODE_VBLANK); if (ret < 0) printk(BIOS_ERR, "failed to set tear on: %d\n", ret); ret = mipi_dsi_dcs_set_address_mode(jdi->dsi, false, false, false, false, false, false, false, false); if (ret < 0) printk(BIOS_ERR, "failed to set address mode: %d\n", ret); ret = mipi_dsi_dcs_set_address_mode(jdi->dsi->slave, false, false, false, false, false, false, false, false); if (ret < 0) printk(BIOS_ERR, "failed to set address mode: %d\n", ret); ret = mipi_dsi_dcs_set_pixel_format(jdi->dsi, 0x77); if (ret < 0) printk(BIOS_ERR, "failed to set pixel format: %d\n", ret); ret = mipi_dsi_dcs_set_pixel_format(jdi->dsi->slave, 0x77); if (ret < 0) printk(BIOS_ERR, "failed to set pixel format: %d\n", ret); data = 0xFF; ret = mipi_dsi_dcs_write(jdi->dsi, 0x51, &data, 1); if (ret < 0) printk(BIOS_ERR, "failed to set 0x51: %d\n", ret); data = 0xFF; ret = mipi_dsi_dcs_write(jdi->dsi->slave, 0x51, &data, 1); if (ret < 0) printk(BIOS_ERR, "failed to set 0x51: %d\n", ret); data = 0x24; ret = mipi_dsi_dcs_write(jdi->dsi, 0x53, &data, 1); if (ret < 0) printk(BIOS_ERR, "failed to set 0x53: %d\n", ret); data = 0x24; ret = mipi_dsi_dcs_write(jdi->dsi->slave, 0x53, &data, 1); if (ret < 0) printk(BIOS_ERR, "failed to set 0x53: %d\n", ret); data = 0x00; ret = mipi_dsi_dcs_write(jdi->dsi, 0x55, &data, 1); if (ret < 0) printk(BIOS_ERR, "failed to set 0x55: %d\n", ret); data = 0x00; ret = mipi_dsi_dcs_write(jdi->dsi->slave, 0x55, &data, 1); if (ret < 0) printk(BIOS_ERR, "failed to set 0x55: %d\n", ret); ret = mipi_dsi_dcs_exit_sleep_mode(jdi->dsi); if (ret < 0) printk(BIOS_ERR, "failed to exit sleep mode: %d\n", ret); ret = mipi_dsi_dcs_exit_sleep_mode(jdi->dsi->slave); if (ret < 0) printk(BIOS_ERR, "failed to exit sleep mode: %d\n", ret); mdelay(150); ret = mipi_dsi_dcs_set_display_on(jdi->dsi); if (ret < 0) printk(BIOS_ERR, "failed to set display on: %d\n", ret); ret = mipi_dsi_dcs_set_display_on(jdi->dsi->slave); if (ret < 0) printk(BIOS_ERR, "failed to set display on: %d\n", ret); mdelay(50); jdi->enabled = true; return 0; }