Lines Matching +full:dsi +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-only
18 struct mipi_dsi_device *dsi; member
31 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in s6e88a0_ams452ef01_reset()
33 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in s6e88a0_ams452ef01_reset()
35 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in s6e88a0_ams452ef01_reset()
41 struct mipi_dsi_device *dsi = ctx->dsi; in s6e88a0_ams452ef01_on() local
42 struct device *dev = &dsi->dev; in s6e88a0_ams452ef01_on()
45 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in s6e88a0_ams452ef01_on()
47 mipi_dsi_dcs_write_seq(dsi, 0xf0, 0x5a, 0x5a); // enable LEVEL2 commands in s6e88a0_ams452ef01_on()
48 mipi_dsi_dcs_write_seq(dsi, 0xcc, 0x4c); // set Pixel Clock Divider polarity in s6e88a0_ams452ef01_on()
50 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in s6e88a0_ams452ef01_on()
58 mipi_dsi_dcs_write_seq(dsi, 0xca, in s6e88a0_ams452ef01_on()
70 mipi_dsi_dcs_write_seq(dsi, 0xb2, 0x40, 0x0a, 0x17, 0x00, 0x0a); in s6e88a0_ams452ef01_on()
71 mipi_dsi_dcs_write_seq(dsi, 0xb6, 0x2c, 0x0b); // set default elvss voltage in s6e88a0_ams452ef01_on()
72 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); in s6e88a0_ams452ef01_on()
73 mipi_dsi_dcs_write_seq(dsi, 0xf7, 0x03); // gamma/aor update in s6e88a0_ams452ef01_on()
74 mipi_dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5); // disable LEVEL2 commands in s6e88a0_ams452ef01_on()
76 ret = mipi_dsi_dcs_set_display_on(dsi); in s6e88a0_ams452ef01_on()
87 struct mipi_dsi_device *dsi = ctx->dsi; in s6e88a0_ams452ef01_off() local
88 struct device *dev = &dsi->dev; in s6e88a0_ams452ef01_off()
91 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in s6e88a0_ams452ef01_off()
93 ret = mipi_dsi_dcs_set_display_off(dsi); in s6e88a0_ams452ef01_off()
100 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in s6e88a0_ams452ef01_off()
113 struct device *dev = &ctx->dsi->dev; in s6e88a0_ams452ef01_prepare()
116 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in s6e88a0_ams452ef01_prepare()
127 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in s6e88a0_ams452ef01_prepare()
128 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), in s6e88a0_ams452ef01_prepare()
129 ctx->supplies); in s6e88a0_ams452ef01_prepare()
139 struct device *dev = &ctx->dsi->dev; in s6e88a0_ams452ef01_unprepare()
144 dev_err(dev, "Failed to un-initialize panel: %d\n", ret); in s6e88a0_ams452ef01_unprepare()
146 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in s6e88a0_ams452ef01_unprepare()
147 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in s6e88a0_ams452ef01_unprepare()
171 mode = drm_mode_duplicate(connector->dev, &s6e88a0_ams452ef01_mode); in s6e88a0_ams452ef01_get_modes()
173 return -ENOMEM; in s6e88a0_ams452ef01_get_modes()
177 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in s6e88a0_ams452ef01_get_modes()
178 connector->display_info.width_mm = mode->width_mm; in s6e88a0_ams452ef01_get_modes()
179 connector->display_info.height_mm = mode->height_mm; in s6e88a0_ams452ef01_get_modes()
191 static int s6e88a0_ams452ef01_probe(struct mipi_dsi_device *dsi) in s6e88a0_ams452ef01_probe() argument
193 struct device *dev = &dsi->dev; in s6e88a0_ams452ef01_probe()
199 return -ENOMEM; in s6e88a0_ams452ef01_probe()
201 ctx->supplies[0].supply = "vdd3"; in s6e88a0_ams452ef01_probe()
202 ctx->supplies[1].supply = "vci"; in s6e88a0_ams452ef01_probe()
203 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), in s6e88a0_ams452ef01_probe()
204 ctx->supplies); in s6e88a0_ams452ef01_probe()
210 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in s6e88a0_ams452ef01_probe()
211 if (IS_ERR(ctx->reset_gpio)) { in s6e88a0_ams452ef01_probe()
212 ret = PTR_ERR(ctx->reset_gpio); in s6e88a0_ams452ef01_probe()
213 dev_err(dev, "Failed to get reset-gpios: %d\n", ret); in s6e88a0_ams452ef01_probe()
217 ctx->dsi = dsi; in s6e88a0_ams452ef01_probe()
218 mipi_dsi_set_drvdata(dsi, ctx); in s6e88a0_ams452ef01_probe()
220 dsi->lanes = 2; in s6e88a0_ams452ef01_probe()
221 dsi->format = MIPI_DSI_FMT_RGB888; in s6e88a0_ams452ef01_probe()
222 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST; in s6e88a0_ams452ef01_probe()
224 drm_panel_init(&ctx->panel, dev, &s6e88a0_ams452ef01_panel_funcs, in s6e88a0_ams452ef01_probe()
227 drm_panel_add(&ctx->panel); in s6e88a0_ams452ef01_probe()
229 ret = mipi_dsi_attach(dsi); in s6e88a0_ams452ef01_probe()
231 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in s6e88a0_ams452ef01_probe()
232 drm_panel_remove(&ctx->panel); in s6e88a0_ams452ef01_probe()
239 static void s6e88a0_ams452ef01_remove(struct mipi_dsi_device *dsi) in s6e88a0_ams452ef01_remove() argument
241 struct s6e88a0_ams452ef01 *ctx = mipi_dsi_get_drvdata(dsi); in s6e88a0_ams452ef01_remove()
244 ret = mipi_dsi_detach(dsi); in s6e88a0_ams452ef01_remove()
246 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in s6e88a0_ams452ef01_remove()
248 drm_panel_remove(&ctx->panel); in s6e88a0_ams452ef01_remove()
252 { .compatible = "samsung,s6e88a0-ams452ef01" },
261 .name = "panel-s6e88a0-ams452ef01",
268 MODULE_DESCRIPTION("MIPI-DSI based Panel Driver for AMS452EF01 AMOLED LCD with a S6E88A0 controller…