Lines Matching +full:avee +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-only
22 #define MCS_PARAM_SCALER_FUNCTION 0x58 /* Scale-up function */
93 gpiod_set_value_cansleep(nt->reset_gpio, 1); in nt35950_reset()
95 gpiod_set_value_cansleep(nt->reset_gpio, 0); in nt35950_reset()
97 gpiod_set_value_cansleep(nt->reset_gpio, 1); in nt35950_reset()
102 * nt35950_set_cmd2_page - Select manufacturer control (CMD2) page
105 * @page: Page number (0-7)
115 if (!dsi_ctx->accum_err) in nt35950_set_cmd2_page()
116 nt->last_page = page; in nt35950_set_cmd2_page()
120 * nt35950_set_data_compression - Set data compression mode
131 u8 last_page = nt->last_page; in nt35950_set_data_compression()
154 * nt35950_set_scaler - Enable/disable resolution upscaling
168 * nt35950_set_scale_mode - Resolution upscaling mode
182 * nt35950_inject_black_image - Display a completely black image
190 * It makes sense to push a black image before sending the sleep-out
191 * and display-on commands.
209 cmd_test[ARRAY_SIZE(cmd_test) - 1] = 0x00; in nt35950_inject_black_image()
214 * nt35950_set_dispout - Set Display Output register parameters
222 const struct nt35950_panel_mode *mode_data = nt->desc->mode_data; in nt35950_set_dispout()
224 if (mode_data[nt->cur_mode].is_video_mode) in nt35950_set_dispout()
226 if (mode_data[nt->cur_mode].enable_sram) in nt35950_set_dispout()
235 struct drm_connector *connector = nt->connector; in nt35950_get_current_mode()
240 if (!connector->state || !connector->state->crtc) in nt35950_get_current_mode()
243 crtc_state = connector->state->crtc->state; in nt35950_get_current_mode()
245 for (i = 0; i < nt->desc->num_modes; i++) { in nt35950_get_current_mode()
246 if (drm_mode_match(&crtc_state->mode, in nt35950_get_current_mode()
247 &nt->desc->mode_data[i].mode, in nt35950_get_current_mode()
257 const struct nt35950_panel_mode *mode_data = nt->desc->mode_data; in nt35950_on()
258 struct mipi_dsi_device *dsi = nt->dsi[0]; in nt35950_on()
261 nt->cur_mode = nt35950_get_current_mode(nt); in nt35950_on()
262 nt->dsi[0]->mode_flags |= MIPI_DSI_MODE_LPM; in nt35950_on()
263 nt->dsi[1]->mode_flags |= MIPI_DSI_MODE_LPM; in nt35950_on()
266 nt35950_set_data_compression(&dsi_ctx, nt, mode_data[nt->cur_mode].compression); in nt35950_on()
267 nt35950_set_scale_mode(&dsi_ctx, mode_data[nt->cur_mode].scaler_mode); in nt35950_on()
268 nt35950_set_scaler(&dsi_ctx, mode_data[nt->cur_mode].scaler_on); in nt35950_on()
286 /* SPR Mode: YYG Rainbow-RGB */ in nt35950_on()
301 nt->dsi[0]->mode_flags &= ~MIPI_DSI_MODE_LPM; in nt35950_on()
302 nt->dsi[1]->mode_flags &= ~MIPI_DSI_MODE_LPM; in nt35950_on()
309 struct mipi_dsi_device *dsi = nt->dsi[0]; in nt35950_off()
318 nt->dsi[0]->mode_flags |= MIPI_DSI_MODE_LPM; in nt35950_off()
319 nt->dsi[1]->mode_flags |= MIPI_DSI_MODE_LPM; in nt35950_off()
326 nt->vregs[0].supply = "vddio"; in nt35950_sharp_init_vregs()
327 nt->vregs[1].supply = "avdd"; in nt35950_sharp_init_vregs()
328 nt->vregs[2].supply = "avee"; in nt35950_sharp_init_vregs()
329 nt->vregs[3].supply = "dvdd"; in nt35950_sharp_init_vregs()
330 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(nt->vregs), in nt35950_sharp_init_vregs()
331 nt->vregs); in nt35950_sharp_init_vregs()
335 ret = regulator_is_supported_voltage(nt->vregs[0].consumer, in nt35950_sharp_init_vregs()
338 return -EINVAL; in nt35950_sharp_init_vregs()
339 ret = regulator_is_supported_voltage(nt->vregs[1].consumer, in nt35950_sharp_init_vregs()
342 return -EINVAL; in nt35950_sharp_init_vregs()
343 /* AVEE is negative: -5.90V to -5.20V */ in nt35950_sharp_init_vregs()
344 ret = regulator_is_supported_voltage(nt->vregs[2].consumer, in nt35950_sharp_init_vregs()
347 return -EINVAL; in nt35950_sharp_init_vregs()
349 ret = regulator_is_supported_voltage(nt->vregs[3].consumer, in nt35950_sharp_init_vregs()
352 return -EINVAL; in nt35950_sharp_init_vregs()
362 ret = regulator_enable(nt->vregs[0].consumer); in nt35950_prepare()
367 ret = regulator_enable(nt->vregs[3].consumer); in nt35950_prepare()
372 ret = regulator_enable(nt->vregs[1].consumer); in nt35950_prepare()
376 ret = regulator_enable(nt->vregs[2].consumer); in nt35950_prepare()
387 regulator_bulk_disable(ARRAY_SIZE(nt->vregs), nt->vregs); in nt35950_prepare()
400 gpiod_set_value_cansleep(nt->reset_gpio, 0); in nt35950_unprepare()
401 regulator_bulk_disable(ARRAY_SIZE(nt->vregs), nt->vregs); in nt35950_unprepare()
412 for (i = 0; i < nt->desc->num_modes; i++) { in nt35950_get_modes()
415 mode = drm_mode_duplicate(connector->dev, in nt35950_get_modes()
416 &nt->desc->mode_data[i].mode); in nt35950_get_modes()
418 return -ENOMEM; in nt35950_get_modes()
422 mode->type |= DRM_MODE_TYPE_DRIVER; in nt35950_get_modes()
423 if (nt->desc->num_modes == 1) in nt35950_get_modes()
424 mode->type |= DRM_MODE_TYPE_PREFERRED; in nt35950_get_modes()
429 connector->display_info.bpc = 8; in nt35950_get_modes()
430 connector->display_info.height_mm = nt->desc->mode_data[0].mode.height_mm; in nt35950_get_modes()
431 connector->display_info.width_mm = nt->desc->mode_data[0].mode.width_mm; in nt35950_get_modes()
432 nt->connector = connector; in nt35950_get_modes()
434 return nt->desc->num_modes; in nt35950_get_modes()
445 struct device *dev = &dsi->dev; in nt35950_probe()
454 return -ENOMEM; in nt35950_probe()
460 nt->desc = of_device_get_match_data(dev); in nt35950_probe()
461 if (!nt->desc) in nt35950_probe()
462 return -ENODEV; in nt35950_probe()
464 nt->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_ASIS); in nt35950_probe()
465 if (IS_ERR(nt->reset_gpio)) { in nt35950_probe()
466 return dev_err_probe(dev, PTR_ERR(nt->reset_gpio), in nt35950_probe()
471 if (nt->desc->is_dual_dsi) { in nt35950_probe()
472 info = &nt->desc->dsi_info; in nt35950_probe()
473 dsi_r = of_graph_get_remote_node(dsi->dev.of_node, 1, -1); in nt35950_probe()
476 return -ENODEV; in nt35950_probe()
481 return dev_err_probe(dev, -EPROBE_DEFER, "Cannot get secondary DSI host\n"); in nt35950_probe()
483 nt->dsi[1] = mipi_dsi_device_register_full(dsi_r_host, info); in nt35950_probe()
484 if (!nt->dsi[1]) { in nt35950_probe()
486 return -ENODEV; in nt35950_probe()
491 nt->dsi[0] = dsi; in nt35950_probe()
494 drm_panel_init(&nt->panel, dev, &nt35950_panel_funcs, in nt35950_probe()
497 ret = drm_panel_of_backlight(&nt->panel); in nt35950_probe()
500 mipi_dsi_device_unregister(nt->dsi[1]); in nt35950_probe()
505 drm_panel_add(&nt->panel); in nt35950_probe()
508 nt->dsi[i]->lanes = nt->desc->num_lanes; in nt35950_probe()
509 nt->dsi[i]->format = MIPI_DSI_FMT_RGB888; in nt35950_probe()
511 nt->dsi[i]->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS | in nt35950_probe()
514 if (nt->desc->mode_data[0].is_video_mode) in nt35950_probe()
515 nt->dsi[i]->mode_flags |= MIPI_DSI_MODE_VIDEO; in nt35950_probe()
517 ret = mipi_dsi_attach(nt->dsi[i]); in nt35950_probe()
521 mipi_dsi_device_unregister(nt->dsi[1]); in nt35950_probe()
528 /* Make sure to set RESX LOW before starting the power-on sequence */ in nt35950_probe()
529 gpiod_set_value_cansleep(nt->reset_gpio, 0); in nt35950_probe()
538 ret = mipi_dsi_detach(nt->dsi[0]); in nt35950_remove()
540 dev_err(&dsi->dev, in nt35950_remove()
543 if (nt->dsi[1]) { in nt35950_remove()
544 ret = mipi_dsi_detach(nt->dsi[1]); in nt35950_remove()
546 dev_err(&dsi->dev, in nt35950_remove()
548 mipi_dsi_device_unregister(nt->dsi[1]); in nt35950_remove()
551 drm_panel_remove(&nt->panel); in nt35950_remove()
602 .name = "panel-novatek-nt35950",