Lines Matching refs:ctx

30 static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
34 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
43 gpiod_set_value(ctx->reset_gpio, 1);
45 gpiod_set_value(ctx->reset_gpio, 0);
47 gpiod_set_value(ctx->reset_gpio, 1);
53 static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
55 gpiod_set_value(ctx->reset_gpio, 0);
57 return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
62 struct visionox_rm69299 *ctx = panel_to_ctx(panel);
65 ctx->dsi->mode_flags = 0;
67 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
69 dev_err(ctx->panel.dev, "set_display_off cmd failed ret = %d\n", ret);
74 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0);
76 dev_err(ctx->panel.dev, "enter_sleep cmd failed ret = %d\n", ret);
79 ret = visionox_rm69299_power_off(ctx);
86 struct visionox_rm69299 *ctx = panel_to_ctx(panel);
89 ret = visionox_rm69299_power_on(ctx);
93 ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
95 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xfe, 0x00 }, 2);
97 dev_err(ctx->panel.dev, "cmd set tx 0 failed, ret = %d\n", ret);
101 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xc2, 0x08 }, 2);
103 dev_err(ctx->panel.dev, "cmd set tx 1 failed, ret = %d\n", ret);
107 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x35, 0x00 }, 2);
109 dev_err(ctx->panel.dev, "cmd set tx 2 failed, ret = %d\n", ret);
113 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x51, 0xff }, 2);
115 dev_err(ctx->panel.dev, "cmd set tx 3 failed, ret = %d\n", ret);
119 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0);
121 dev_err(ctx->panel.dev, "exit_sleep_mode cmd failed ret = %d\n", ret);
128 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0);
130 dev_err(ctx->panel.dev, "set_display_on cmd failed ret = %d\n", ret);
160 struct visionox_rm69299 *ctx = panel_to_ctx(panel);
166 dev_err(ctx->panel.dev, "failed to create a new display mode\n");
187 struct visionox_rm69299 *ctx;
190 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
191 if (!ctx)
194 mipi_dsi_set_drvdata(dsi, ctx);
196 ctx->panel.dev = dev;
197 ctx->dsi = dsi;
199 ctx->supplies[0].supply = "vdda";
200 ctx->supplies[1].supply = "vdd3p3";
202 ret = devm_regulator_bulk_get(ctx->panel.dev, ARRAY_SIZE(ctx->supplies),
203 ctx->supplies);
207 ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev,
209 if (IS_ERR(ctx->reset_gpio)) {
210 dev_err(dev, "cannot get reset gpio %ld\n", PTR_ERR(ctx->reset_gpio));
211 return PTR_ERR(ctx->reset_gpio);
214 drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs,
216 ctx->panel.dev = dev;
217 ctx->panel.funcs = &visionox_rm69299_drm_funcs;
218 drm_panel_add(&ctx->panel);
230 ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
236 ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
247 drm_panel_remove(&ctx->panel);
253 struct visionox_rm69299 *ctx = mipi_dsi_get_drvdata(dsi);
255 mipi_dsi_detach(ctx->dsi);
256 drm_panel_remove(&ctx->panel);