Lines Matching +full:elish +full:- +full:csot +full:- +full:nt36523
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Novatek NT36523 DriverIC panels driver
68 struct mipi_dsi_device *dsi0 = pinfo->dsi[0]; in elish_boe_init_sequence()
69 struct mipi_dsi_device *dsi1 = pinfo->dsi[1]; in elish_boe_init_sequence()
288 struct mipi_dsi_device *dsi0 = pinfo->dsi[0]; in elish_csot_init_sequence()
289 struct mipi_dsi_device *dsi1 = pinfo->dsi[1]; in elish_csot_init_sequence()
486 struct mipi_dsi_device *dsi = pinfo->dsi[0]; in j606f_boe_init_sequence()
487 struct device *dev = &dsi->dev; in j606f_boe_init_sequence()
982 .type = "BOE-elish",
1000 .type = "CSOT-elish",
1030 gpiod_set_value_cansleep(pinfo->reset_gpio, 1); in nt36523_reset()
1032 gpiod_set_value_cansleep(pinfo->reset_gpio, 0); in nt36523_reset()
1034 gpiod_set_value_cansleep(pinfo->reset_gpio, 1); in nt36523_reset()
1036 gpiod_set_value_cansleep(pinfo->reset_gpio, 0); in nt36523_reset()
1045 ret = regulator_enable(pinfo->vddio); in nt36523_prepare()
1047 dev_err(panel->dev, "failed to enable vddio regulator: %d\n", ret); in nt36523_prepare()
1053 ret = pinfo->desc->init_sequence(pinfo); in nt36523_prepare()
1055 regulator_disable(pinfo->vddio); in nt36523_prepare()
1056 dev_err(panel->dev, "failed to initialize panel: %d\n", ret); in nt36523_prepare()
1068 for (i = 0; i < DSI_NUM_MIN + pinfo->desc->is_dual_dsi; i++) { in nt36523_disable()
1069 ret = mipi_dsi_dcs_set_display_off(pinfo->dsi[i]); in nt36523_disable()
1071 dev_err(&pinfo->dsi[i]->dev, "failed to set display off: %d\n", ret); in nt36523_disable()
1074 for (i = 0; i < DSI_NUM_MIN + pinfo->desc->is_dual_dsi; i++) { in nt36523_disable()
1075 ret = mipi_dsi_dcs_enter_sleep_mode(pinfo->dsi[i]); in nt36523_disable()
1077 dev_err(&pinfo->dsi[i]->dev, "failed to enter sleep mode: %d\n", ret); in nt36523_disable()
1089 gpiod_set_value_cansleep(pinfo->reset_gpio, 1); in nt36523_unprepare()
1090 regulator_disable(pinfo->vddio); in nt36523_unprepare()
1100 ret = mipi_dsi_detach(pinfo->dsi[0]); in nt36523_remove()
1102 dev_err(&dsi->dev, "failed to detach from DSI0 host: %d\n", ret); in nt36523_remove()
1104 if (pinfo->desc->is_dual_dsi) { in nt36523_remove()
1105 ret = mipi_dsi_detach(pinfo->dsi[1]); in nt36523_remove()
1107 dev_err(&pinfo->dsi[1]->dev, "failed to detach from DSI1 host: %d\n", ret); in nt36523_remove()
1108 mipi_dsi_device_unregister(pinfo->dsi[1]); in nt36523_remove()
1111 drm_panel_remove(&pinfo->panel); in nt36523_remove()
1120 for (i = 0; i < pinfo->desc->num_modes; i++) { in nt36523_get_modes()
1121 const struct drm_display_mode *m = &pinfo->desc->modes[i]; in nt36523_get_modes()
1124 mode = drm_mode_duplicate(connector->dev, m); in nt36523_get_modes()
1126 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in nt36523_get_modes()
1127 m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); in nt36523_get_modes()
1128 return -ENOMEM; in nt36523_get_modes()
1131 mode->type = DRM_MODE_TYPE_DRIVER; in nt36523_get_modes()
1133 mode->type |= DRM_MODE_TYPE_PREFERRED; in nt36523_get_modes()
1139 connector->display_info.width_mm = pinfo->desc->width_mm; in nt36523_get_modes()
1140 connector->display_info.height_mm = pinfo->desc->height_mm; in nt36523_get_modes()
1141 connector->display_info.bpc = pinfo->desc->bpc; in nt36523_get_modes()
1143 return pinfo->desc->num_modes; in nt36523_get_modes()
1150 return pinfo->orientation; in nt36523_get_orientation()
1167 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in nt36523_bl_update_status()
1173 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in nt36523_bl_update_status()
1184 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in nt36523_bl_get_brightness()
1190 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in nt36523_bl_get_brightness()
1202 struct device *dev = &dsi->dev; in nt36523_create_backlight()
1216 struct device *dev = &dsi->dev; in nt36523_probe()
1225 return -ENOMEM; in nt36523_probe()
1227 pinfo->vddio = devm_regulator_get(dev, "vddio"); in nt36523_probe()
1228 if (IS_ERR(pinfo->vddio)) in nt36523_probe()
1229 return dev_err_probe(dev, PTR_ERR(pinfo->vddio), "failed to get vddio regulator\n"); in nt36523_probe()
1231 pinfo->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in nt36523_probe()
1232 if (IS_ERR(pinfo->reset_gpio)) in nt36523_probe()
1233 return dev_err_probe(dev, PTR_ERR(pinfo->reset_gpio), "failed to get reset gpio\n"); in nt36523_probe()
1235 pinfo->desc = of_device_get_match_data(dev); in nt36523_probe()
1236 if (!pinfo->desc) in nt36523_probe()
1237 return -ENODEV; in nt36523_probe()
1240 if (pinfo->desc->is_dual_dsi) { in nt36523_probe()
1241 info = &pinfo->desc->dsi_info; in nt36523_probe()
1243 dsi1 = of_graph_get_remote_node(dsi->dev.of_node, 1, -1); in nt36523_probe()
1246 return -ENODEV; in nt36523_probe()
1252 return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n"); in nt36523_probe()
1254 pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info); in nt36523_probe()
1255 if (IS_ERR(pinfo->dsi[1])) { in nt36523_probe()
1257 return PTR_ERR(pinfo->dsi[1]); in nt36523_probe()
1261 pinfo->dsi[0] = dsi; in nt36523_probe()
1263 drm_panel_init(&pinfo->panel, dev, &nt36523_panel_funcs, DRM_MODE_CONNECTOR_DSI); in nt36523_probe()
1265 ret = of_drm_get_panel_orientation(dev->of_node, &pinfo->orientation); in nt36523_probe()
1267 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); in nt36523_probe()
1271 pinfo->panel.prepare_prev_first = true; in nt36523_probe()
1273 if (pinfo->desc->has_dcs_backlight) { in nt36523_probe()
1274 pinfo->panel.backlight = nt36523_create_backlight(dsi); in nt36523_probe()
1275 if (IS_ERR(pinfo->panel.backlight)) in nt36523_probe()
1276 return dev_err_probe(dev, PTR_ERR(pinfo->panel.backlight), in nt36523_probe()
1279 ret = drm_panel_of_backlight(&pinfo->panel); in nt36523_probe()
1284 drm_panel_add(&pinfo->panel); in nt36523_probe()
1286 for (i = 0; i < DSI_NUM_MIN + pinfo->desc->is_dual_dsi; i++) { in nt36523_probe()
1287 pinfo->dsi[i]->lanes = pinfo->desc->lanes; in nt36523_probe()
1288 pinfo->dsi[i]->format = pinfo->desc->format; in nt36523_probe()
1289 pinfo->dsi[i]->mode_flags = pinfo->desc->mode_flags; in nt36523_probe()
1291 ret = mipi_dsi_attach(pinfo->dsi[i]); in nt36523_probe()
1301 .compatible = "lenovo,j606f-boe-nt36523w",
1305 .compatible = "xiaomi,elish-boe-nt36523",
1309 .compatible = "xiaomi,elish-csot-nt36523",
1320 .name = "panel-novatek-nt36523",
1327 MODULE_DESCRIPTION("DRM driver for Novatek NT36523 based MIPI DSI panels");