Lines Matching refs:ctx

71 static int xpp055c272_init_sequence(struct xpp055c272 *ctx)
73 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
74 struct device *dev = ctx->dev;
143 struct xpp055c272 *ctx = panel_to_xpp055c272(panel);
144 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
147 if (!ctx->prepared)
152 dev_err(ctx->dev, "failed to set display off: %d\n", ret);
156 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret);
160 regulator_disable(ctx->iovcc);
161 regulator_disable(ctx->vci);
163 ctx->prepared = false;
170 struct xpp055c272 *ctx = panel_to_xpp055c272(panel);
171 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
174 if (ctx->prepared)
177 dev_dbg(ctx->dev, "Resetting the panel\n");
178 ret = regulator_enable(ctx->vci);
180 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret);
183 ret = regulator_enable(ctx->iovcc);
185 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
189 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
192 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
197 ret = xpp055c272_init_sequence(ctx);
199 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret);
205 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
214 dev_err(ctx->dev, "Failed to set display on: %d\n", ret);
220 ctx->prepared = true;
225 regulator_disable(ctx->iovcc);
227 regulator_disable(ctx->vci);
248 struct xpp055c272 *ctx = panel_to_xpp055c272(panel);
253 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
278 struct xpp055c272 *ctx;
281 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
282 if (!ctx)
285 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
286 if (IS_ERR(ctx->reset_gpio)) {
288 return PTR_ERR(ctx->reset_gpio);
291 ctx->vci = devm_regulator_get(dev, "vci");
292 if (IS_ERR(ctx->vci)) {
293 ret = PTR_ERR(ctx->vci);
299 ctx->iovcc = devm_regulator_get(dev, "iovcc");
300 if (IS_ERR(ctx->iovcc)) {
301 ret = PTR_ERR(ctx->iovcc);
307 mipi_dsi_set_drvdata(dsi, ctx);
309 ctx->dev = dev;
316 drm_panel_init(&ctx->panel, &dsi->dev, &xpp055c272_funcs,
319 ret = drm_panel_of_backlight(&ctx->panel);
323 drm_panel_add(&ctx->panel);
328 drm_panel_remove(&ctx->panel);
337 struct xpp055c272 *ctx = mipi_dsi_get_drvdata(dsi);
340 ret = drm_panel_unprepare(&ctx->panel);
344 ret = drm_panel_disable(&ctx->panel);
351 struct xpp055c272 *ctx = mipi_dsi_get_drvdata(dsi);
360 drm_panel_remove(&ctx->panel);