Lines Matching refs:ctx

34 static void sofef00_panel_reset(struct sofef00_panel *ctx)
36 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
38 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
40 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
44 static int sofef00_panel_on(struct sofef00_panel *ctx)
46 struct mipi_dsi_device *dsi = ctx->dsi;
84 static int sofef00_panel_off(struct sofef00_panel *ctx)
86 struct mipi_dsi_device *dsi = ctx->dsi;
111 struct sofef00_panel *ctx = to_sofef00_panel(panel);
112 struct device *dev = &ctx->dsi->dev;
115 ret = regulator_enable(ctx->supply);
121 sofef00_panel_reset(ctx);
123 ret = sofef00_panel_on(ctx);
126 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
135 struct sofef00_panel *ctx = to_sofef00_panel(panel);
136 struct device *dev = &ctx->dsi->dev;
139 ret = sofef00_panel_off(ctx);
143 regulator_disable(ctx->supply);
179 struct sofef00_panel *ctx = to_sofef00_panel(panel);
181 mode = drm_mode_duplicate(connector->dev, ctx->mode);
235 struct sofef00_panel *ctx;
238 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
239 if (!ctx)
242 ctx->mode = of_device_get_match_data(dev);
244 if (!ctx->mode) {
249 ctx->supply = devm_regulator_get(dev, "vddio");
250 if (IS_ERR(ctx->supply))
251 return dev_err_probe(dev, PTR_ERR(ctx->supply),
254 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
255 if (IS_ERR(ctx->reset_gpio))
256 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
259 ctx->dsi = dsi;
260 mipi_dsi_set_drvdata(dsi, ctx);
265 drm_panel_init(&ctx->panel, dev, &sofef00_panel_panel_funcs,
268 ctx->panel.backlight = sofef00_create_backlight(dsi);
269 if (IS_ERR(ctx->panel.backlight))
270 return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
273 drm_panel_add(&ctx->panel);
278 drm_panel_remove(&ctx->panel);
287 struct sofef00_panel *ctx = mipi_dsi_get_drvdata(dsi);
294 drm_panel_remove(&ctx->panel);