Lines Matching +full:panel +full:- +full:dsi

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Generated using linux-mdss-dsi-panel-driver-generator from Lineage OS device tree:
6 …com/LineageOS/android_kernel_xiaomi_msm8996/blob/lineage-18.1/arch/arm/boot/dts/qcom/a1-msm8996-mt…
21 struct drm_panel panel; member
22 struct mipi_dsi_device *dsi; member
26 static inline struct jdi_fhd_r63452 *to_jdi_fhd_r63452(struct drm_panel *panel) in to_jdi_fhd_r63452() argument
28 return container_of(panel, struct jdi_fhd_r63452, panel); in to_jdi_fhd_r63452()
33 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in jdi_fhd_r63452_reset()
35 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in jdi_fhd_r63452_reset()
37 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in jdi_fhd_r63452_reset()
43 struct mipi_dsi_device *dsi = ctx->dsi; in jdi_fhd_r63452_on() local
44 struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; in jdi_fhd_r63452_on()
46 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in jdi_fhd_r63452_on()
85 struct mipi_dsi_device *dsi = ctx->dsi; in jdi_fhd_r63452_off() local
86 struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; in jdi_fhd_r63452_off()
88 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in jdi_fhd_r63452_off()
103 static int jdi_fhd_r63452_prepare(struct drm_panel *panel) in jdi_fhd_r63452_prepare() argument
105 struct jdi_fhd_r63452 *ctx = to_jdi_fhd_r63452(panel); in jdi_fhd_r63452_prepare()
112 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in jdi_fhd_r63452_prepare()
117 static int jdi_fhd_r63452_unprepare(struct drm_panel *panel) in jdi_fhd_r63452_unprepare() argument
119 struct jdi_fhd_r63452 *ctx = to_jdi_fhd_r63452(panel); in jdi_fhd_r63452_unprepare()
122 * NOTE: We don't return an error here as while the panel won't have in jdi_fhd_r63452_unprepare()
128 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in jdi_fhd_r63452_unprepare()
147 static int jdi_fhd_r63452_get_modes(struct drm_panel *panel, in jdi_fhd_r63452_get_modes() argument
152 mode = drm_mode_duplicate(connector->dev, &jdi_fhd_r63452_mode); in jdi_fhd_r63452_get_modes()
154 return -ENOMEM; in jdi_fhd_r63452_get_modes()
158 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in jdi_fhd_r63452_get_modes()
159 connector->display_info.width_mm = mode->width_mm; in jdi_fhd_r63452_get_modes()
160 connector->display_info.height_mm = mode->height_mm; in jdi_fhd_r63452_get_modes()
172 static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi) in jdi_fhd_r63452_probe() argument
174 struct device *dev = &dsi->dev; in jdi_fhd_r63452_probe()
180 return -ENOMEM; in jdi_fhd_r63452_probe()
182 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in jdi_fhd_r63452_probe()
183 if (IS_ERR(ctx->reset_gpio)) in jdi_fhd_r63452_probe()
184 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in jdi_fhd_r63452_probe()
185 "Failed to get reset-gpios\n"); in jdi_fhd_r63452_probe()
187 ctx->dsi = dsi; in jdi_fhd_r63452_probe()
188 mipi_dsi_set_drvdata(dsi, ctx); in jdi_fhd_r63452_probe()
190 dsi->lanes = 4; in jdi_fhd_r63452_probe()
191 dsi->format = MIPI_DSI_FMT_RGB888; in jdi_fhd_r63452_probe()
192 dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST | in jdi_fhd_r63452_probe()
195 drm_panel_init(&ctx->panel, dev, &jdi_fhd_r63452_panel_funcs, in jdi_fhd_r63452_probe()
197 ctx->panel.prepare_prev_first = true; in jdi_fhd_r63452_probe()
199 ret = drm_panel_of_backlight(&ctx->panel); in jdi_fhd_r63452_probe()
203 drm_panel_add(&ctx->panel); in jdi_fhd_r63452_probe()
205 ret = mipi_dsi_attach(dsi); in jdi_fhd_r63452_probe()
207 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in jdi_fhd_r63452_probe()
214 static void jdi_fhd_r63452_remove(struct mipi_dsi_device *dsi) in jdi_fhd_r63452_remove() argument
216 struct jdi_fhd_r63452 *ctx = mipi_dsi_get_drvdata(dsi); in jdi_fhd_r63452_remove()
219 ret = mipi_dsi_detach(dsi); in jdi_fhd_r63452_remove()
221 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in jdi_fhd_r63452_remove()
223 drm_panel_remove(&ctx->panel); in jdi_fhd_r63452_remove()
227 { .compatible = "jdi,fhd-r63452" },
236 .name = "panel-jdi-fhd-r63452",
243 MODULE_DESCRIPTION("DRM driver for JDI FHD R63452 DSI panel, command mode");