Lines Matching +full:panel +full:- +full:dsi
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree.
21 struct drm_panel panel; member
22 struct mipi_dsi_device *dsi; member
28 static inline struct rm692e5_panel *to_rm692e5_panel(struct drm_panel *panel) in to_rm692e5_panel() argument
30 return container_of(panel, struct rm692e5_panel, panel); in to_rm692e5_panel()
35 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in rm692e5_reset()
37 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in rm692e5_reset()
39 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in rm692e5_reset()
45 dsi_ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM; in rm692e5_on()
121 static int rm692e5_disable(struct drm_panel *panel) in rm692e5_disable() argument
123 struct rm692e5_panel *ctx = to_rm692e5_panel(panel); in rm692e5_disable()
124 struct mipi_dsi_device *dsi = ctx->dsi; in rm692e5_disable() local
125 struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; in rm692e5_disable()
127 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in rm692e5_disable()
140 static int rm692e5_prepare(struct drm_panel *panel) in rm692e5_prepare() argument
142 struct rm692e5_panel *ctx = to_rm692e5_panel(panel); in rm692e5_prepare()
144 struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi }; in rm692e5_prepare()
146 dsi_ctx.accum_err = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in rm692e5_prepare()
154 drm_dsc_pps_payload_pack(&pps, &ctx->dsc); in rm692e5_prepare()
162 /* 0x05 -> 90Hz, 0x00 -> 60Hz */ in rm692e5_prepare()
168 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in rm692e5_prepare()
169 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in rm692e5_prepare()
175 static int rm692e5_unprepare(struct drm_panel *panel) in rm692e5_unprepare() argument
177 struct rm692e5_panel *ctx = to_rm692e5_panel(panel); in rm692e5_unprepare()
179 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in rm692e5_unprepare()
180 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in rm692e5_unprepare()
199 static int rm692e5_get_modes(struct drm_panel *panel, in rm692e5_get_modes() argument
204 mode = drm_mode_duplicate(connector->dev, &rm692e5_mode); in rm692e5_get_modes()
206 return -ENOMEM; in rm692e5_get_modes()
210 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in rm692e5_get_modes()
211 connector->display_info.width_mm = mode->width_mm; in rm692e5_get_modes()
212 connector->display_info.height_mm = mode->height_mm; in rm692e5_get_modes()
227 struct mipi_dsi_device *dsi = bl_get_data(bl); in rm692e5_bl_update_status() local
231 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in rm692e5_bl_update_status()
233 ret = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness); in rm692e5_bl_update_status()
237 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in rm692e5_bl_update_status()
244 struct mipi_dsi_device *dsi = bl_get_data(bl); in rm692e5_bl_get_brightness() local
248 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in rm692e5_bl_get_brightness()
250 ret = mipi_dsi_dcs_get_display_brightness_large(dsi, &brightness); in rm692e5_bl_get_brightness()
254 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in rm692e5_bl_get_brightness()
265 rm692e5_create_backlight(struct mipi_dsi_device *dsi) in rm692e5_create_backlight() argument
267 struct device *dev = &dsi->dev; in rm692e5_create_backlight()
274 return devm_backlight_device_register(dev, dev_name(dev), dev, dsi, in rm692e5_create_backlight()
278 static int rm692e5_probe(struct mipi_dsi_device *dsi) in rm692e5_probe() argument
280 struct device *dev = &dsi->dev; in rm692e5_probe()
286 return -ENOMEM; in rm692e5_probe()
288 ctx->supplies[0].supply = "vddio"; in rm692e5_probe()
289 ctx->supplies[1].supply = "dvdd"; in rm692e5_probe()
290 ctx->supplies[2].supply = "vci"; in rm692e5_probe()
291 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), in rm692e5_probe()
292 ctx->supplies); in rm692e5_probe()
296 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in rm692e5_probe()
297 if (IS_ERR(ctx->reset_gpio)) in rm692e5_probe()
298 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in rm692e5_probe()
299 "Failed to get reset-gpios\n"); in rm692e5_probe()
301 ctx->dsi = dsi; in rm692e5_probe()
302 mipi_dsi_set_drvdata(dsi, ctx); in rm692e5_probe()
304 dsi->lanes = 4; in rm692e5_probe()
305 dsi->format = MIPI_DSI_FMT_RGB888; in rm692e5_probe()
306 dsi->mode_flags = MIPI_DSI_MODE_NO_EOT_PACKET | in rm692e5_probe()
309 drm_panel_init(&ctx->panel, dev, &rm692e5_panel_funcs, in rm692e5_probe()
311 ctx->panel.prepare_prev_first = true; in rm692e5_probe()
313 ctx->panel.backlight = rm692e5_create_backlight(dsi); in rm692e5_probe()
314 if (IS_ERR(ctx->panel.backlight)) in rm692e5_probe()
315 return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), in rm692e5_probe()
318 drm_panel_add(&ctx->panel); in rm692e5_probe()
320 /* This panel only supports DSC; unconditionally enable it */ in rm692e5_probe()
321 dsi->dsc = &ctx->dsc; in rm692e5_probe()
324 ctx->dsc.dsc_version_major = 1; in rm692e5_probe()
325 ctx->dsc.dsc_version_minor = 1; in rm692e5_probe()
326 ctx->dsc.slice_height = 60; in rm692e5_probe()
327 ctx->dsc.slice_width = 1224; in rm692e5_probe()
329 ctx->dsc.slice_count = 1224 / ctx->dsc.slice_width; in rm692e5_probe()
330 ctx->dsc.bits_per_component = 8; in rm692e5_probe()
331 ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */ in rm692e5_probe()
332 ctx->dsc.block_pred_enable = true; in rm692e5_probe()
334 ret = mipi_dsi_attach(dsi); in rm692e5_probe()
336 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in rm692e5_probe()
337 drm_panel_remove(&ctx->panel); in rm692e5_probe()
344 static void rm692e5_remove(struct mipi_dsi_device *dsi) in rm692e5_remove() argument
346 struct rm692e5_panel *ctx = mipi_dsi_get_drvdata(dsi); in rm692e5_remove()
349 ret = mipi_dsi_detach(dsi); in rm692e5_remove()
351 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in rm692e5_remove()
353 drm_panel_remove(&ctx->panel); in rm692e5_remove()
357 { .compatible = "fairphone,fp5-rm692e5-boe" },
366 .name = "panel-rm692e5-boe-amoled",
372 MODULE_DESCRIPTION("DRM driver for rm692e5-equipped DSI panels");