Lines Matching refs:ctx

72 	int (*init_sequence)(struct st7703 *ctx);
80 static int jh057n_init_sequence(struct st7703 *ctx)
82 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
161 static int xbd599_init_sequence(struct st7703 *ctx)
163 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
344 static int rg353v2_init_sequence(struct st7703 *ctx)
346 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
438 struct st7703 *ctx = panel_to_st7703(panel);
439 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
442 ret = ctx->desc->init_sequence(ctx);
444 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret);
452 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
463 dev_dbg(ctx->dev, "Panel init sequence done\n");
470 struct st7703 *ctx = panel_to_st7703(panel);
471 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
476 dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret);
480 dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret);
487 struct st7703 *ctx = panel_to_st7703(panel);
489 if (!ctx->prepared)
492 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
493 regulator_disable(ctx->iovcc);
494 regulator_disable(ctx->vcc);
495 ctx->prepared = false;
502 struct st7703 *ctx = panel_to_st7703(panel);
505 if (ctx->prepared)
508 dev_dbg(ctx->dev, "Resetting the panel\n");
509 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
511 ret = regulator_enable(ctx->iovcc);
513 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
517 ret = regulator_enable(ctx->vcc);
519 dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret);
520 regulator_disable(ctx->iovcc);
527 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
530 ctx->prepared = true;
542 struct st7703 *ctx = panel_to_st7703(panel);
545 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
547 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
548 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
549 drm_mode_vrefresh(ctx->desc->mode));
577 struct st7703 *ctx = data;
578 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
580 dev_dbg(ctx->dev, "Setting all pixels on\n");
584 drm_panel_disable(&ctx->panel);
585 drm_panel_unprepare(&ctx->panel);
586 drm_panel_prepare(&ctx->panel);
587 drm_panel_enable(&ctx->panel);
595 static void st7703_debugfs_init(struct st7703 *ctx)
597 ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
599 debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
603 static void st7703_debugfs_remove(struct st7703 *ctx)
605 debugfs_remove_recursive(ctx->debugfs);
606 ctx->debugfs = NULL;
612 struct st7703 *ctx;
615 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
616 if (!ctx)
619 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
620 if (IS_ERR(ctx->reset_gpio))
621 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset gpio\n");
623 mipi_dsi_set_drvdata(dsi, ctx);
625 ctx->dev = dev;
626 ctx->desc = of_device_get_match_data(dev);
628 dsi->mode_flags = ctx->desc->mode_flags;
629 dsi->format = ctx->desc->format;
630 dsi->lanes = ctx->desc->lanes;
632 ctx->vcc = devm_regulator_get(dev, "vcc");
633 if (IS_ERR(ctx->vcc))
634 return dev_err_probe(dev, PTR_ERR(ctx->vcc), "Failed to request vcc regulator\n");
636 ctx->iovcc = devm_regulator_get(dev, "iovcc");
637 if (IS_ERR(ctx->iovcc))
638 return dev_err_probe(dev, PTR_ERR(ctx->iovcc),
641 drm_panel_init(&ctx->panel, dev, &st7703_drm_funcs,
644 ret = drm_panel_of_backlight(&ctx->panel);
648 drm_panel_add(&ctx->panel);
653 drm_panel_remove(&ctx->panel);
658 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
659 drm_mode_vrefresh(ctx->desc->mode),
662 st7703_debugfs_init(ctx);
668 struct st7703 *ctx = mipi_dsi_get_drvdata(dsi);
671 ret = drm_panel_unprepare(&ctx->panel);
675 ret = drm_panel_disable(&ctx->panel);
682 struct st7703 *ctx = mipi_dsi_get_drvdata(dsi);
691 drm_panel_remove(&ctx->panel);
693 st7703_debugfs_remove(ctx);