Lines Matching +full:vcom +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0
29 #define MCS_P_DRV_M 0xC0B4 /* Panel Driving Mode */
30 #define MCS_OSC_ADJ 0xC181 /* Oscillator Adjustment for Idle/Normal mode */
31 #define MCS_RGB_VID_SET 0xC1A1 /* RGB Video Mode Setting */
35 #define MCS_PWR_CTRL2 0xC590 /* Power Control Setting 2 for Normal Mode */
57 #define MCS_VCOMDC 0xD900 /* VCOM Voltage Setting */
59 #define MCS_GMCT2_2N 0xE200 /* Gamma Correction 2.2- Setting */
115 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in otm8009a_dcs_write_buf()
118 dev_warn(ctx->dev, "mipi dsi dcs write buffer failed\n"); in otm8009a_dcs_write_buf()
135 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in otm8009a_init_sequence()
230 ret = mipi_dsi_dcs_set_column_address(dsi, 0, OTM8009A_HDISPLAY - 1); in otm8009a_init_sequence()
234 ret = mipi_dsi_dcs_set_page_address(dsi, 0, OTM8009A_VDISPLAY - 1); in otm8009a_init_sequence()
267 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in otm8009a_disable()
270 backlight_disable(ctx->bl_dev); in otm8009a_disable()
289 if (ctx->reset_gpio) { in otm8009a_unprepare()
290 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in otm8009a_unprepare()
294 regulator_disable(ctx->supply); in otm8009a_unprepare()
296 ctx->prepared = false; in otm8009a_unprepare()
306 ret = regulator_enable(ctx->supply); in otm8009a_prepare()
308 dev_err(panel->dev, "failed to enable supply: %d\n", ret); in otm8009a_prepare()
312 if (ctx->reset_gpio) { in otm8009a_prepare()
313 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in otm8009a_prepare()
314 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in otm8009a_prepare()
316 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in otm8009a_prepare()
324 ctx->prepared = true; in otm8009a_prepare()
333 backlight_enable(ctx->bl_dev); in otm8009a_enable()
341 struct drm_display_mode *mode; in otm8009a_get_modes() local
346 mode = drm_mode_duplicate(connector->dev, &modes[i]); in otm8009a_get_modes()
347 if (!mode) { in otm8009a_get_modes()
348 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in otm8009a_get_modes()
352 return -ENOMEM; in otm8009a_get_modes()
355 mode->type = DRM_MODE_TYPE_DRIVER; in otm8009a_get_modes()
357 /* Setting first mode as preferred */ in otm8009a_get_modes()
359 mode->type |= DRM_MODE_TYPE_PREFERRED; in otm8009a_get_modes()
361 drm_mode_set_name(mode); in otm8009a_get_modes()
362 drm_mode_probed_add(connector, mode); in otm8009a_get_modes()
365 connector->display_info.width_mm = mode->width_mm; in otm8009a_get_modes()
366 connector->display_info.height_mm = mode->height_mm; in otm8009a_get_modes()
380 * DSI-BASED BACKLIGHT
388 if (!ctx->prepared) { in otm8009a_backlight_update_status()
389 dev_dbg(&bd->dev, "lcd not ready yet for setting its backlight!\n"); in otm8009a_backlight_update_status()
390 return -ENXIO; in otm8009a_backlight_update_status()
393 if (bd->props.power <= BACKLIGHT_POWER_REDUCED) { in otm8009a_backlight_update_status()
396 * as otm8009a driver support only 8-bit brightness (1 param). in otm8009a_backlight_update_status()
399 data[1] = bd->props.brightness; in otm8009a_backlight_update_status()
423 struct device *dev = &dsi->dev; in otm8009a_probe()
429 return -ENOMEM; in otm8009a_probe()
431 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in otm8009a_probe()
432 if (IS_ERR(ctx->reset_gpio)) { in otm8009a_probe()
433 dev_err(dev, "cannot get reset-gpio\n"); in otm8009a_probe()
434 return PTR_ERR(ctx->reset_gpio); in otm8009a_probe()
437 ctx->supply = devm_regulator_get(dev, "power"); in otm8009a_probe()
438 if (IS_ERR(ctx->supply)) { in otm8009a_probe()
439 ret = PTR_ERR(ctx->supply); in otm8009a_probe()
440 if (ret != -EPROBE_DEFER) in otm8009a_probe()
447 ctx->dev = dev; in otm8009a_probe()
449 dsi->lanes = 2; in otm8009a_probe()
450 dsi->format = MIPI_DSI_FMT_RGB888; in otm8009a_probe()
451 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in otm8009a_probe()
454 drm_panel_init(&ctx->panel, dev, &otm8009a_drm_funcs, in otm8009a_probe()
457 ctx->bl_dev = devm_backlight_device_register(dev, dev_name(dev), in otm8009a_probe()
461 if (IS_ERR(ctx->bl_dev)) { in otm8009a_probe()
462 ret = PTR_ERR(ctx->bl_dev); in otm8009a_probe()
467 ctx->bl_dev->props.max_brightness = OTM8009A_BACKLIGHT_MAX; in otm8009a_probe()
468 ctx->bl_dev->props.brightness = OTM8009A_BACKLIGHT_DEFAULT; in otm8009a_probe()
469 ctx->bl_dev->props.power = BACKLIGHT_POWER_OFF; in otm8009a_probe()
470 ctx->bl_dev->props.type = BACKLIGHT_RAW; in otm8009a_probe()
472 drm_panel_add(&ctx->panel); in otm8009a_probe()
477 drm_panel_remove(&ctx->panel); in otm8009a_probe()
489 drm_panel_remove(&ctx->panel); in otm8009a_remove()
502 .name = "panel-orisetech-otm8009a",