Lines Matching refs:ctx
48 static int mantix_init_sequence(struct mantix *ctx)
50 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
51 struct device *dev = ctx->dev;
76 struct mantix *ctx = panel_to_mantix(panel);
77 struct device *dev = ctx->dev;
81 ret = mantix_init_sequence(ctx);
83 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret);
110 struct mantix *ctx = panel_to_mantix(panel);
111 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
116 dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret);
120 dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret);
128 struct mantix *ctx = panel_to_mantix(panel);
130 gpiod_set_value_cansleep(ctx->tp_rstn_gpio, 1);
132 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
134 regulator_disable(ctx->avee);
135 regulator_disable(ctx->avdd);
138 regulator_disable(ctx->vddi);
147 struct mantix *ctx = panel_to_mantix(panel);
151 dev_dbg(ctx->dev, "Resetting the panel\n");
152 ret = regulator_enable(ctx->vddi);
154 dev_err(ctx->dev, "Failed to enable vddi supply: %d\n", ret);
161 ret = regulator_enable(ctx->avdd);
163 dev_err(ctx->dev, "Failed to enable avdd supply: %d\n", ret);
169 ret = regulator_enable(ctx->avee);
171 dev_err(ctx->dev, "Failed to enable avee supply: %d\n", ret);
177 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
178 gpiod_set_value_cansleep(ctx->tp_rstn_gpio, 0);
223 struct mantix *ctx = panel_to_mantix(panel);
226 mode = drm_mode_duplicate(connector->dev, ctx->default_mode);
228 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
229 ctx->default_mode->hdisplay, ctx->default_mode->vdisplay,
230 drm_mode_vrefresh(ctx->default_mode));
259 struct mantix *ctx;
262 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
263 if (!ctx)
265 ctx->default_mode = of_device_get_match_data(dev);
267 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
268 if (IS_ERR(ctx->reset_gpio)) {
270 return PTR_ERR(ctx->reset_gpio);
273 ctx->tp_rstn_gpio = devm_gpiod_get(dev, "mantix,tp-rstn", GPIOD_OUT_HIGH);
274 if (IS_ERR(ctx->tp_rstn_gpio)) {
276 return PTR_ERR(ctx->tp_rstn_gpio);
279 mipi_dsi_set_drvdata(dsi, ctx);
280 ctx->dev = dev;
287 ctx->avdd = devm_regulator_get(dev, "avdd");
288 if (IS_ERR(ctx->avdd))
289 return dev_err_probe(dev, PTR_ERR(ctx->avdd), "Failed to request avdd regulator\n");
291 ctx->avee = devm_regulator_get(dev, "avee");
292 if (IS_ERR(ctx->avee))
293 return dev_err_probe(dev, PTR_ERR(ctx->avee), "Failed to request avee regulator\n");
295 ctx->vddi = devm_regulator_get(dev, "vddi");
296 if (IS_ERR(ctx->vddi))
297 return dev_err_probe(dev, PTR_ERR(ctx->vddi), "Failed to request vddi regulator\n");
299 drm_panel_init(&ctx->panel, dev, &mantix_drm_funcs,
302 ret = drm_panel_of_backlight(&ctx->panel);
306 drm_panel_add(&ctx->panel);
311 drm_panel_remove(&ctx->panel);
316 ctx->default_mode->hdisplay, ctx->default_mode->vdisplay,
317 drm_mode_vrefresh(ctx->default_mode),
325 struct mantix *ctx = mipi_dsi_get_drvdata(dsi);
327 drm_panel_unprepare(&ctx->panel);
328 drm_panel_disable(&ctx->panel);
333 struct mantix *ctx = mipi_dsi_get_drvdata(dsi);
338 drm_panel_remove(&ctx->panel);