Lines Matching refs:ctx
39 static void s6e88a0_ams452ef01_reset(struct s6e88a0_ams452ef01 *ctx)
41 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
43 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
45 gpiod_set_value_cansleep(ctx->reset_gpio, 1);
49 static int s6e88a0_ams452ef01_on(struct s6e88a0_ams452ef01 *ctx)
51 struct mipi_dsi_device *dsi = ctx->dsi;
95 static int s6e88a0_ams452ef01_off(struct s6e88a0_ams452ef01 *ctx)
97 struct mipi_dsi_device *dsi = ctx->dsi;
122 struct s6e88a0_ams452ef01 *ctx = to_s6e88a0_ams452ef01(panel);
123 struct device *dev = &ctx->dsi->dev;
126 if (ctx->prepared)
129 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
135 s6e88a0_ams452ef01_reset(ctx);
137 ret = s6e88a0_ams452ef01_on(ctx);
140 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
141 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies),
142 ctx->supplies);
146 ctx->prepared = true;
152 struct s6e88a0_ams452ef01 *ctx = to_s6e88a0_ams452ef01(panel);
153 struct device *dev = &ctx->dsi->dev;
156 if (!ctx->prepared)
159 ret = s6e88a0_ams452ef01_off(ctx);
163 gpiod_set_value_cansleep(ctx->reset_gpio, 0);
164 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
166 ctx->prepared = false;
212 struct s6e88a0_ams452ef01 *ctx;
215 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
216 if (!ctx)
219 ctx->supplies[0].supply = "vdd3";
220 ctx->supplies[1].supply = "vci";
221 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
222 ctx->supplies);
228 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
229 if (IS_ERR(ctx->reset_gpio)) {
230 ret = PTR_ERR(ctx->reset_gpio);
235 ctx->dsi = dsi;
236 mipi_dsi_set_drvdata(dsi, ctx);
242 drm_panel_init(&ctx->panel, dev, &s6e88a0_ams452ef01_panel_funcs,
245 drm_panel_add(&ctx->panel);
258 struct s6e88a0_ams452ef01 *ctx = mipi_dsi_get_drvdata(dsi);
265 drm_panel_remove(&ctx->panel);