Lines Matching refs:ctx

37 	int (*init_func)(struct s6d7aa0 *ctx);
38 int (*off_func)(struct s6d7aa0 *ctx);
57 static void s6d7aa0_reset(struct s6d7aa0 *ctx)
59 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
61 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
65 static int s6d7aa0_lock(struct s6d7aa0 *ctx, bool lock)
67 struct mipi_dsi_device *dsi = ctx->dsi;
72 if (ctx->desc->use_passwd3)
77 if (ctx->desc->use_passwd3)
84 static int s6d7aa0_on(struct s6d7aa0 *ctx)
86 struct mipi_dsi_device *dsi = ctx->dsi;
90 ret = ctx->desc->init_func(ctx);
93 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
106 static int s6d7aa0_off(struct s6d7aa0 *ctx)
108 struct mipi_dsi_device *dsi = ctx->dsi;
112 ret = ctx->desc->off_func(ctx);
137 struct s6d7aa0 *ctx = panel_to_s6d7aa0(panel);
138 struct device *dev = &ctx->dsi->dev;
141 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
147 s6d7aa0_reset(ctx);
149 ret = s6d7aa0_on(ctx);
152 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
161 struct s6d7aa0 *ctx = panel_to_s6d7aa0(panel);
162 struct device *dev = &ctx->dsi->dev;
165 ret = s6d7aa0_off(ctx);
174 struct s6d7aa0 *ctx = panel_to_s6d7aa0(panel);
176 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
177 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
231 static int s6d7aa0_lsl080al02_init(struct s6d7aa0 *ctx)
233 struct mipi_dsi_device *dsi = ctx->dsi;
239 ret = s6d7aa0_lock(ctx, false);
267 ret = s6d7aa0_lock(ctx, true);
282 static int s6d7aa0_lsl080al02_off(struct s6d7aa0 *ctx)
284 struct mipi_dsi_device *dsi = ctx->dsi;
320 static int s6d7aa0_lsl080al03_init(struct s6d7aa0 *ctx)
322 struct mipi_dsi_device *dsi = ctx->dsi;
328 ret = s6d7aa0_lock(ctx, false);
334 if (ctx->desc->panel_type == S6D7AA0_PANEL_LSL080AL03) {
341 } else if (ctx->desc->panel_type == S6D7AA0_PANEL_LTL101AT01) {
371 ret = s6d7aa0_lock(ctx, true);
386 static int s6d7aa0_lsl080al03_off(struct s6d7aa0 *ctx)
388 struct mipi_dsi_device *dsi = ctx->dsi;
453 struct s6d7aa0 *ctx;
455 ctx = container_of(panel, struct s6d7aa0, panel);
456 if (!ctx)
459 mode = drm_mode_duplicate(connector->dev, ctx->desc->drm_mode);
468 connector->display_info.bus_flags = ctx->desc->bus_flags;
484 struct s6d7aa0 *ctx;
487 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
488 if (!ctx)
491 ctx->desc = of_device_get_match_data(dev);
492 if (!ctx->desc)
495 ctx->supplies[0].supply = "power";
496 ctx->supplies[1].supply = "vmipi";
497 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
498 ctx->supplies);
502 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
503 if (IS_ERR(ctx->reset_gpio))
504 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
507 ctx->dsi = dsi;
508 mipi_dsi_set_drvdata(dsi, ctx);
513 | ctx->desc->mode_flags;
515 drm_panel_init(&ctx->panel, dev, &s6d7aa0_panel_funcs,
517 ctx->panel.prepare_prev_first = true;
519 ret = drm_panel_of_backlight(&ctx->panel);
524 if (ctx->desc->has_backlight && !ctx->panel.backlight) {
525 ctx->panel.backlight = s6d7aa0_create_backlight(dsi);
526 if (IS_ERR(ctx->panel.backlight))
527 return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
531 drm_panel_add(&ctx->panel);
536 drm_panel_remove(&ctx->panel);
545 struct s6d7aa0 *ctx = mipi_dsi_get_drvdata(dsi);
552 drm_panel_remove(&ctx->panel);