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
27 static inline struct jdi_fhd_r63452 *to_jdi_fhd_r63452(struct drm_panel *panel) in to_jdi_fhd_r63452() argument
29 return container_of(panel, struct jdi_fhd_r63452, panel); in to_jdi_fhd_r63452()
34 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in jdi_fhd_r63452_reset()
36 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in jdi_fhd_r63452_reset()
38 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in jdi_fhd_r63452_reset()
44 struct mipi_dsi_device *dsi = ctx->dsi; in jdi_fhd_r63452_on() local
45 struct device *dev = &dsi->dev; in jdi_fhd_r63452_on()
48 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in jdi_fhd_r63452_on()
50 mipi_dsi_generic_write_seq(dsi, 0xb0, 0x00); in jdi_fhd_r63452_on()
51 mipi_dsi_generic_write_seq(dsi, 0xd6, 0x01); in jdi_fhd_r63452_on()
52 mipi_dsi_generic_write_seq(dsi, 0xec, in jdi_fhd_r63452_on()
55 mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); in jdi_fhd_r63452_on()
57 ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); in jdi_fhd_r63452_on()
63 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_ADDRESS_MODE, 0x00); in jdi_fhd_r63452_on()
65 ret = mipi_dsi_dcs_set_pixel_format(dsi, 0x77); in jdi_fhd_r63452_on()
71 ret = mipi_dsi_dcs_set_column_address(dsi, 0x0000, 0x0437); in jdi_fhd_r63452_on()
77 ret = mipi_dsi_dcs_set_page_address(dsi, 0x0000, 0x077f); in jdi_fhd_r63452_on()
83 ret = mipi_dsi_dcs_set_tear_scanline(dsi, 0x0000); in jdi_fhd_r63452_on()
89 ret = mipi_dsi_dcs_set_display_brightness(dsi, 0x00ff); in jdi_fhd_r63452_on()
95 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x24); in jdi_fhd_r63452_on()
96 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); in jdi_fhd_r63452_on()
97 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_CABC_MIN_BRIGHTNESS, 0x00); in jdi_fhd_r63452_on()
98 mipi_dsi_dcs_write_seq(dsi, 0x84, 0x00); in jdi_fhd_r63452_on()
100 ret = mipi_dsi_dcs_set_display_on(dsi); in jdi_fhd_r63452_on()
107 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in jdi_fhd_r63452_on()
114 mipi_dsi_generic_write_seq(dsi, 0xb0, 0x04); in jdi_fhd_r63452_on()
115 mipi_dsi_dcs_write_seq(dsi, 0x84, 0x00); in jdi_fhd_r63452_on()
116 mipi_dsi_generic_write_seq(dsi, 0xc8, 0x11); in jdi_fhd_r63452_on()
117 mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); in jdi_fhd_r63452_on()
124 struct mipi_dsi_device *dsi = ctx->dsi; in jdi_fhd_r63452_off() local
125 struct device *dev = &dsi->dev; in jdi_fhd_r63452_off()
128 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in jdi_fhd_r63452_off()
130 mipi_dsi_generic_write_seq(dsi, 0xb0, 0x00); in jdi_fhd_r63452_off()
131 mipi_dsi_generic_write_seq(dsi, 0xd6, 0x01); in jdi_fhd_r63452_off()
132 mipi_dsi_generic_write_seq(dsi, 0xec, in jdi_fhd_r63452_off()
135 mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); in jdi_fhd_r63452_off()
137 ret = mipi_dsi_dcs_set_display_off(dsi); in jdi_fhd_r63452_off()
144 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in jdi_fhd_r63452_off()
154 static int jdi_fhd_r63452_prepare(struct drm_panel *panel) in jdi_fhd_r63452_prepare() argument
156 struct jdi_fhd_r63452 *ctx = to_jdi_fhd_r63452(panel); in jdi_fhd_r63452_prepare()
157 struct device *dev = &ctx->dsi->dev; in jdi_fhd_r63452_prepare()
160 if (ctx->prepared) in jdi_fhd_r63452_prepare()
167 dev_err(dev, "Failed to initialize panel: %d\n", ret); in jdi_fhd_r63452_prepare()
168 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in jdi_fhd_r63452_prepare()
172 ctx->prepared = true; in jdi_fhd_r63452_prepare()
176 static int jdi_fhd_r63452_unprepare(struct drm_panel *panel) in jdi_fhd_r63452_unprepare() argument
178 struct jdi_fhd_r63452 *ctx = to_jdi_fhd_r63452(panel); in jdi_fhd_r63452_unprepare()
179 struct device *dev = &ctx->dsi->dev; in jdi_fhd_r63452_unprepare()
182 if (!ctx->prepared) in jdi_fhd_r63452_unprepare()
187 dev_err(dev, "Failed to un-initialize panel: %d\n", ret); in jdi_fhd_r63452_unprepare()
189 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in jdi_fhd_r63452_unprepare()
191 ctx->prepared = false; in jdi_fhd_r63452_unprepare()
209 static int jdi_fhd_r63452_get_modes(struct drm_panel *panel, in jdi_fhd_r63452_get_modes() argument
214 mode = drm_mode_duplicate(connector->dev, &jdi_fhd_r63452_mode); in jdi_fhd_r63452_get_modes()
216 return -ENOMEM; in jdi_fhd_r63452_get_modes()
220 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in jdi_fhd_r63452_get_modes()
221 connector->display_info.width_mm = mode->width_mm; in jdi_fhd_r63452_get_modes()
222 connector->display_info.height_mm = mode->height_mm; in jdi_fhd_r63452_get_modes()
234 static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi) in jdi_fhd_r63452_probe() argument
236 struct device *dev = &dsi->dev; in jdi_fhd_r63452_probe()
242 return -ENOMEM; in jdi_fhd_r63452_probe()
244 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in jdi_fhd_r63452_probe()
245 if (IS_ERR(ctx->reset_gpio)) in jdi_fhd_r63452_probe()
246 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in jdi_fhd_r63452_probe()
247 "Failed to get reset-gpios\n"); in jdi_fhd_r63452_probe()
249 ctx->dsi = dsi; in jdi_fhd_r63452_probe()
250 mipi_dsi_set_drvdata(dsi, ctx); in jdi_fhd_r63452_probe()
252 dsi->lanes = 4; in jdi_fhd_r63452_probe()
253 dsi->format = MIPI_DSI_FMT_RGB888; in jdi_fhd_r63452_probe()
254 dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST | in jdi_fhd_r63452_probe()
257 drm_panel_init(&ctx->panel, dev, &jdi_fhd_r63452_panel_funcs, in jdi_fhd_r63452_probe()
260 ret = drm_panel_of_backlight(&ctx->panel); in jdi_fhd_r63452_probe()
264 drm_panel_add(&ctx->panel); in jdi_fhd_r63452_probe()
266 ret = mipi_dsi_attach(dsi); in jdi_fhd_r63452_probe()
268 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in jdi_fhd_r63452_probe()
275 static void jdi_fhd_r63452_remove(struct mipi_dsi_device *dsi) in jdi_fhd_r63452_remove() argument
277 struct jdi_fhd_r63452 *ctx = mipi_dsi_get_drvdata(dsi); in jdi_fhd_r63452_remove()
280 ret = mipi_dsi_detach(dsi); in jdi_fhd_r63452_remove()
282 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in jdi_fhd_r63452_remove()
284 drm_panel_remove(&ctx->panel); in jdi_fhd_r63452_remove()
288 { .compatible = "jdi,fhd-r63452" },
297 .name = "panel-jdi-fhd-r63452",
304 MODULE_DESCRIPTION("DRM driver for JDI FHD R63452 DSI panel, command mode");