Lines Matching +full:tulip +full:- +full:truly +full:- +full:nt35521

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree:
46 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in truly_nt35521_reset()
48 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in truly_nt35521_reset()
50 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in truly_nt35521_reset()
56 struct mipi_dsi_device *dsi = ctx->dsi; in truly_nt35521_on()
57 struct device *dev = &dsi->dev; in truly_nt35521_on()
60 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in truly_nt35521_on()
278 struct mipi_dsi_device *dsi = ctx->dsi; in truly_nt35521_off()
279 struct device *dev = &dsi->dev; in truly_nt35521_off()
282 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in truly_nt35521_off()
304 struct device *dev = &ctx->dsi->dev; in truly_nt35521_prepare()
307 if (ctx->prepared) in truly_nt35521_prepare()
310 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in truly_nt35521_prepare()
321 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in truly_nt35521_prepare()
325 ctx->prepared = true; in truly_nt35521_prepare()
332 struct device *dev = &ctx->dsi->dev; in truly_nt35521_unprepare()
335 if (!ctx->prepared) in truly_nt35521_unprepare()
340 dev_err(dev, "Failed to un-initialize panel: %d\n", ret); in truly_nt35521_unprepare()
342 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in truly_nt35521_unprepare()
343 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), in truly_nt35521_unprepare()
344 ctx->supplies); in truly_nt35521_unprepare()
346 ctx->prepared = false; in truly_nt35521_unprepare()
354 if (ctx->enabled) in truly_nt35521_enable()
357 gpiod_set_value_cansleep(ctx->blen_gpio, 1); in truly_nt35521_enable()
359 ctx->enabled = true; in truly_nt35521_enable()
367 if (!ctx->enabled) in truly_nt35521_disable()
370 gpiod_set_value_cansleep(ctx->blen_gpio, 0); in truly_nt35521_disable()
372 ctx->enabled = false; in truly_nt35521_disable()
395 mode = drm_mode_duplicate(connector->dev, &truly_nt35521_mode); in truly_nt35521_get_modes()
397 return -ENOMEM; in truly_nt35521_get_modes()
401 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in truly_nt35521_get_modes()
402 connector->display_info.width_mm = mode->width_mm; in truly_nt35521_get_modes()
403 connector->display_info.height_mm = mode->height_mm; in truly_nt35521_get_modes()
451 struct device *dev = &dsi->dev; in truly_nt35521_create_backlight()
464 struct device *dev = &dsi->dev; in truly_nt35521_probe()
470 return -ENOMEM; in truly_nt35521_probe()
472 ctx->supplies[0].supply = "positive5"; in truly_nt35521_probe()
473 ctx->supplies[1].supply = "negative5"; in truly_nt35521_probe()
474 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), in truly_nt35521_probe()
475 ctx->supplies); in truly_nt35521_probe()
481 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in truly_nt35521_probe()
482 if (IS_ERR(ctx->reset_gpio)) in truly_nt35521_probe()
483 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in truly_nt35521_probe()
484 "Failed to get reset-gpios\n"); in truly_nt35521_probe()
486 ctx->blen_gpio = devm_gpiod_get(dev, "backlight", GPIOD_OUT_LOW); in truly_nt35521_probe()
487 if (IS_ERR(ctx->blen_gpio)) in truly_nt35521_probe()
488 return dev_err_probe(dev, PTR_ERR(ctx->blen_gpio), in truly_nt35521_probe()
489 "Failed to get backlight-gpios\n"); in truly_nt35521_probe()
491 ctx->dsi = dsi; in truly_nt35521_probe()
494 dsi->lanes = 4; in truly_nt35521_probe()
495 dsi->format = MIPI_DSI_FMT_RGB888; in truly_nt35521_probe()
496 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in truly_nt35521_probe()
500 drm_panel_init(&ctx->panel, dev, &truly_nt35521_panel_funcs, in truly_nt35521_probe()
503 ctx->panel.backlight = truly_nt35521_create_backlight(dsi); in truly_nt35521_probe()
504 if (IS_ERR(ctx->panel.backlight)) in truly_nt35521_probe()
505 return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), in truly_nt35521_probe()
508 drm_panel_add(&ctx->panel); in truly_nt35521_probe()
513 drm_panel_remove(&ctx->panel); in truly_nt35521_probe()
527 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in truly_nt35521_remove()
529 drm_panel_remove(&ctx->panel); in truly_nt35521_remove()
533 { .compatible = "sony,tulip-truly-nt35521" },
542 .name = "panel-truly-nt35521",
549 MODULE_DESCRIPTION("DRM driver for Sony Tulip Truly NT35521 panel");