Lines Matching refs:ctx

27 static void tm5p5_nt35596_reset(struct tm5p5_nt35596 *ctx)
29 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
31 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
33 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
37 static int tm5p5_nt35596_on(struct tm5p5_nt35596 *ctx)
39 struct mipi_dsi_device *dsi = ctx->dsi;
85 static int tm5p5_nt35596_off(struct tm5p5_nt35596 *ctx)
87 struct mipi_dsi_device *dsi = ctx->dsi;
111 struct tm5p5_nt35596 *ctx = to_tm5p5_nt35596(panel);
112 struct device *dev = &ctx->dsi->dev;
115 if (ctx->prepared)
118 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
124 tm5p5_nt35596_reset(ctx);
126 ret = tm5p5_nt35596_on(ctx);
129 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
130 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies),
131 ctx->supplies);
135 ctx->prepared = true;
141 struct tm5p5_nt35596 *ctx = to_tm5p5_nt35596(panel);
142 struct device *dev = &ctx->dsi->dev;
145 if (!ctx->prepared)
148 ret = tm5p5_nt35596_off(ctx);
152 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
153 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies),
154 ctx->supplies);
156 ctx->prepared = false;
255 struct tm5p5_nt35596 *ctx;
258 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
259 if (!ctx)
262 ctx->supplies[0].supply = "vdd";
263 ctx->supplies[1].supply = "vddio";
264 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
265 ctx->supplies);
271 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
272 if (IS_ERR(ctx->reset_gpio)) {
273 ret = PTR_ERR(ctx->reset_gpio);
278 ctx->dsi = dsi;
279 mipi_dsi_set_drvdata(dsi, ctx);
287 drm_panel_init(&ctx->panel, dev, &tm5p5_nt35596_panel_funcs,
290 ctx->panel.backlight = tm5p5_nt35596_create_backlight(dsi);
291 if (IS_ERR(ctx->panel.backlight)) {
292 ret = PTR_ERR(ctx->panel.backlight);
297 drm_panel_add(&ctx->panel);
310 struct tm5p5_nt35596 *ctx = mipi_dsi_get_drvdata(dsi);
318 drm_panel_remove(&ctx->panel);