Lines Matching +full:elvss +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-only
3 * MIPI-DSI based s6e3ha2 AMOLED 5.7 inch panel driver.
246 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in s6e3ha2_dcs_write()
299 if (ctx->desc->type == HF2_TYPE) in s6e3ha2_freq_calibration()
305 if (ctx->desc->type == HA2_TYPE) in s6e3ha2_freq_calibration()
412 return bl_dev->props.brightness; in s6e3ha2_get_brightness()
417 struct backlight_device *bl_dev = ctx->bl_dev; in s6e3ha2_set_vint()
418 unsigned int brightness = bl_dev->props.brightness; in s6e3ha2_set_vint()
420 vint_table[brightness * (S6E3HA2_VINT_STATUS_MAX - 1) / in s6e3ha2_set_vint()
428 return (brightness * (S6E3HA2_NUM_GAMMA_STEPS - 1)) / in s6e3ha2_get_brightness_index()
434 struct backlight_device *bl_dev = ctx->bl_dev; in s6e3ha2_update_gamma()
444 bl_dev->props.brightness = brightness; in s6e3ha2_update_gamma()
452 unsigned int brightness = bl_dev->props.brightness; in s6e3ha2_set_brightness()
456 brightness > bl_dev->props.max_brightness) { in s6e3ha2_set_brightness()
457 dev_err(ctx->dev, "Invalid brightness: %u\n", brightness); in s6e3ha2_set_brightness()
458 return -EINVAL; in s6e3ha2_set_brightness()
461 if (bl_dev->props.power > BACKLIGHT_POWER_REDUCED) in s6e3ha2_set_brightness()
462 return -EPERM; in s6e3ha2_set_brightness()
480 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in s6e3ha2_panel_init()
498 return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in s6e3ha2_power_off()
504 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in s6e3ha2_disable()
511 ctx->bl_dev->props.power = BACKLIGHT_POWER_REDUCED; in s6e3ha2_disable()
527 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in s6e3ha2_power_on()
533 gpiod_set_value(ctx->enable_gpio, 0); in s6e3ha2_power_on()
535 gpiod_set_value(ctx->enable_gpio, 1); in s6e3ha2_power_on()
537 gpiod_set_value(ctx->reset_gpio, 1); in s6e3ha2_power_on()
539 gpiod_set_value(ctx->reset_gpio, 0); in s6e3ha2_power_on()
557 ctx->bl_dev->props.power = BACKLIGHT_POWER_REDUCED; in s6e3ha2_prepare()
569 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in s6e3ha2_enable()
590 s6e3ha2_call_write_func(ret, s6e3ha2_set_brightness(ctx->bl_dev)); in s6e3ha2_enable()
598 /* elvss temp compensation */ in s6e3ha2_enable()
604 ctx->bl_dev->props.power = BACKLIGHT_POWER_ON; in s6e3ha2_enable()
651 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in s6e3ha2_get_modes()
653 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in s6e3ha2_get_modes()
654 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in s6e3ha2_get_modes()
655 drm_mode_vrefresh(ctx->desc->mode)); in s6e3ha2_get_modes()
656 return -ENOMEM; in s6e3ha2_get_modes()
661 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in s6e3ha2_get_modes()
664 connector->display_info.width_mm = 71; in s6e3ha2_get_modes()
665 connector->display_info.height_mm = 125; in s6e3ha2_get_modes()
680 struct device *dev = &dsi->dev; in s6e3ha2_probe()
686 return -ENOMEM; in s6e3ha2_probe()
690 ctx->dev = dev; in s6e3ha2_probe()
691 ctx->desc = of_device_get_match_data(dev); in s6e3ha2_probe()
693 dsi->lanes = 4; in s6e3ha2_probe()
694 dsi->format = MIPI_DSI_FMT_RGB888; in s6e3ha2_probe()
695 dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS | in s6e3ha2_probe()
699 ctx->supplies[0].supply = "vdd3"; in s6e3ha2_probe()
700 ctx->supplies[1].supply = "vci"; in s6e3ha2_probe()
702 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), in s6e3ha2_probe()
703 ctx->supplies); in s6e3ha2_probe()
709 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in s6e3ha2_probe()
710 if (IS_ERR(ctx->reset_gpio)) { in s6e3ha2_probe()
711 dev_err(dev, "cannot get reset-gpios %ld\n", in s6e3ha2_probe()
712 PTR_ERR(ctx->reset_gpio)); in s6e3ha2_probe()
713 return PTR_ERR(ctx->reset_gpio); in s6e3ha2_probe()
716 ctx->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH); in s6e3ha2_probe()
717 if (IS_ERR(ctx->enable_gpio)) { in s6e3ha2_probe()
718 dev_err(dev, "cannot get enable-gpios %ld\n", in s6e3ha2_probe()
719 PTR_ERR(ctx->enable_gpio)); in s6e3ha2_probe()
720 return PTR_ERR(ctx->enable_gpio); in s6e3ha2_probe()
723 ctx->bl_dev = backlight_device_register("s6e3ha2", dev, ctx, in s6e3ha2_probe()
725 if (IS_ERR(ctx->bl_dev)) { in s6e3ha2_probe()
727 return PTR_ERR(ctx->bl_dev); in s6e3ha2_probe()
730 ctx->bl_dev->props.max_brightness = S6E3HA2_MAX_BRIGHTNESS; in s6e3ha2_probe()
731 ctx->bl_dev->props.brightness = S6E3HA2_DEFAULT_BRIGHTNESS; in s6e3ha2_probe()
732 ctx->bl_dev->props.power = BACKLIGHT_POWER_OFF; in s6e3ha2_probe()
734 drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs, in s6e3ha2_probe()
736 ctx->panel.prepare_prev_first = true; in s6e3ha2_probe()
738 drm_panel_add(&ctx->panel); in s6e3ha2_probe()
747 drm_panel_remove(&ctx->panel); in s6e3ha2_probe()
748 backlight_device_unregister(ctx->bl_dev); in s6e3ha2_probe()
758 drm_panel_remove(&ctx->panel); in s6e3ha2_remove()
759 backlight_device_unregister(ctx->bl_dev); in s6e3ha2_remove()
773 .name = "panel-samsung-s6e3ha2",
782 MODULE_DESCRIPTION("MIPI-DSI based s6e3ha2 AMOLED Panel Driver");