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
29 struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel) in to_sofef00_panel() argument
31 return container_of(panel, struct sofef00_panel, panel); in to_sofef00_panel()
36 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in sofef00_panel_reset()
38 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in sofef00_panel_reset()
40 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in sofef00_panel_reset()
46 struct mipi_dsi_device *dsi = ctx->dsi; in sofef00_panel_on() local
47 struct device *dev = &dsi->dev; in sofef00_panel_on()
50 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in sofef00_panel_on()
52 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in sofef00_panel_on()
59 mipi_dsi_dcs_write_seq(dsi, 0xf0, 0x5a, 0x5a); in sofef00_panel_on()
61 ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); in sofef00_panel_on()
67 mipi_dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5); in sofef00_panel_on()
68 mipi_dsi_dcs_write_seq(dsi, 0xf0, 0x5a, 0x5a); in sofef00_panel_on()
69 mipi_dsi_dcs_write_seq(dsi, 0xb0, 0x07); in sofef00_panel_on()
70 mipi_dsi_dcs_write_seq(dsi, 0xb6, 0x12); in sofef00_panel_on()
71 mipi_dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5); in sofef00_panel_on()
72 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20); in sofef00_panel_on()
73 mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); in sofef00_panel_on()
75 ret = mipi_dsi_dcs_set_display_on(dsi); in sofef00_panel_on()
86 struct mipi_dsi_device *dsi = ctx->dsi; in sofef00_panel_off() local
87 struct device *dev = &dsi->dev; in sofef00_panel_off()
90 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in sofef00_panel_off()
92 ret = mipi_dsi_dcs_set_display_off(dsi); in sofef00_panel_off()
99 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in sofef00_panel_off()
109 static int sofef00_panel_prepare(struct drm_panel *panel) in sofef00_panel_prepare() argument
111 struct sofef00_panel *ctx = to_sofef00_panel(panel); in sofef00_panel_prepare()
112 struct device *dev = &ctx->dsi->dev; in sofef00_panel_prepare()
115 ret = regulator_enable(ctx->supply); in sofef00_panel_prepare()
125 dev_err(dev, "Failed to initialize panel: %d\n", ret); in sofef00_panel_prepare()
126 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in sofef00_panel_prepare()
133 static int sofef00_panel_unprepare(struct drm_panel *panel) in sofef00_panel_unprepare() argument
135 struct sofef00_panel *ctx = to_sofef00_panel(panel); in sofef00_panel_unprepare()
136 struct device *dev = &ctx->dsi->dev; in sofef00_panel_unprepare()
141 dev_err(dev, "Failed to un-initialize panel: %d\n", ret); in sofef00_panel_unprepare()
143 regulator_disable(ctx->supply); in sofef00_panel_unprepare()
176 static int sofef00_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector) in sofef00_panel_get_modes() argument
179 struct sofef00_panel *ctx = to_sofef00_panel(panel); in sofef00_panel_get_modes()
181 mode = drm_mode_duplicate(connector->dev, ctx->mode); in sofef00_panel_get_modes()
183 return -ENOMEM; in sofef00_panel_get_modes()
187 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in sofef00_panel_get_modes()
188 connector->display_info.width_mm = mode->width_mm; in sofef00_panel_get_modes()
189 connector->display_info.height_mm = mode->height_mm; in sofef00_panel_get_modes()
203 struct mipi_dsi_device *dsi = bl_get_data(bl); in sofef00_panel_bl_update_status() local
207 err = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness); in sofef00_panel_bl_update_status()
219 sofef00_create_backlight(struct mipi_dsi_device *dsi) in sofef00_create_backlight() argument
221 struct device *dev = &dsi->dev; in sofef00_create_backlight()
228 return devm_backlight_device_register(dev, dev_name(dev), dev, dsi, in sofef00_create_backlight()
232 static int sofef00_panel_probe(struct mipi_dsi_device *dsi) in sofef00_panel_probe() argument
234 struct device *dev = &dsi->dev; in sofef00_panel_probe()
240 return -ENOMEM; in sofef00_panel_probe()
242 ctx->mode = of_device_get_match_data(dev); in sofef00_panel_probe()
244 if (!ctx->mode) { in sofef00_panel_probe()
246 return -ENODEV; in sofef00_panel_probe()
249 ctx->supply = devm_regulator_get(dev, "vddio"); in sofef00_panel_probe()
250 if (IS_ERR(ctx->supply)) in sofef00_panel_probe()
251 return dev_err_probe(dev, PTR_ERR(ctx->supply), in sofef00_panel_probe()
254 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in sofef00_panel_probe()
255 if (IS_ERR(ctx->reset_gpio)) in sofef00_panel_probe()
256 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in sofef00_panel_probe()
257 "Failed to get reset-gpios\n"); in sofef00_panel_probe()
259 ctx->dsi = dsi; in sofef00_panel_probe()
260 mipi_dsi_set_drvdata(dsi, ctx); in sofef00_panel_probe()
262 dsi->lanes = 4; in sofef00_panel_probe()
263 dsi->format = MIPI_DSI_FMT_RGB888; in sofef00_panel_probe()
265 drm_panel_init(&ctx->panel, dev, &sofef00_panel_panel_funcs, in sofef00_panel_probe()
268 ctx->panel.backlight = sofef00_create_backlight(dsi); in sofef00_panel_probe()
269 if (IS_ERR(ctx->panel.backlight)) in sofef00_panel_probe()
270 return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), in sofef00_panel_probe()
273 drm_panel_add(&ctx->panel); in sofef00_panel_probe()
275 ret = mipi_dsi_attach(dsi); in sofef00_panel_probe()
277 dev_err(dev, "Failed to attach to DSI host: %d\n", ret); in sofef00_panel_probe()
278 drm_panel_remove(&ctx->panel); in sofef00_panel_probe()
285 static void sofef00_panel_remove(struct mipi_dsi_device *dsi) in sofef00_panel_remove() argument
287 struct sofef00_panel *ctx = mipi_dsi_get_drvdata(dsi); in sofef00_panel_remove()
290 ret = mipi_dsi_detach(dsi); in sofef00_panel_remove()
292 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in sofef00_panel_remove()
294 drm_panel_remove(&ctx->panel); in sofef00_panel_remove()
314 .name = "panel-oneplus6",
322 MODULE_DESCRIPTION("DRM driver for Samsung AMOLED DSI panels found in OnePlus 6/6T phones");