Lines Matching refs:dbidev
237 static void mipi_dbi_set_window_address(struct mipi_dbi_dev *dbidev, in mipi_dbi_set_window_address() argument
241 struct mipi_dbi *dbi = &dbidev->dbi; in mipi_dbi_set_window_address()
243 xs += dbidev->left_offset; in mipi_dbi_set_window_address()
244 xe += dbidev->left_offset; in mipi_dbi_set_window_address()
245 ys += dbidev->top_offset; in mipi_dbi_set_window_address()
246 ye += dbidev->top_offset; in mipi_dbi_set_window_address()
257 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); in mipi_dbi_fb_dirty() local
260 struct mipi_dbi *dbi = &dbidev->dbi; in mipi_dbi_fb_dirty()
272 tr = dbidev->tx_buf; in mipi_dbi_fb_dirty()
280 mipi_dbi_set_window_address(dbidev, rect->x1, rect->x2 - 1, rect->y1, in mipi_dbi_fb_dirty()
302 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); in mipi_dbi_pipe_mode_valid() local
304 return drm_crtc_helper_mode_valid_fixed(&pipe->crtc, mode, &dbidev->mode); in mipi_dbi_pipe_mode_valid()
354 void mipi_dbi_enable_flush(struct mipi_dbi_dev *dbidev, in mipi_dbi_enable_flush() argument
368 if (!drm_dev_enter(&dbidev->drm, &idx)) in mipi_dbi_enable_flush()
372 backlight_enable(dbidev->backlight); in mipi_dbi_enable_flush()
378 static void mipi_dbi_blank(struct mipi_dbi_dev *dbidev) in mipi_dbi_blank() argument
380 struct drm_device *drm = &dbidev->drm; in mipi_dbi_blank()
383 struct mipi_dbi *dbi = &dbidev->dbi; in mipi_dbi_blank()
390 memset(dbidev->tx_buf, 0, len); in mipi_dbi_blank()
392 mipi_dbi_set_window_address(dbidev, 0, width - 1, 0, height - 1); in mipi_dbi_blank()
394 (u8 *)dbidev->tx_buf, len); in mipi_dbi_blank()
409 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); in mipi_dbi_pipe_disable() local
413 if (dbidev->backlight) in mipi_dbi_pipe_disable()
414 backlight_disable(dbidev->backlight); in mipi_dbi_pipe_disable()
416 mipi_dbi_blank(dbidev); in mipi_dbi_pipe_disable()
418 if (dbidev->regulator) in mipi_dbi_pipe_disable()
419 regulator_disable(dbidev->regulator); in mipi_dbi_pipe_disable()
420 if (dbidev->io_regulator) in mipi_dbi_pipe_disable()
421 regulator_disable(dbidev->io_regulator); in mipi_dbi_pipe_disable()
511 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(connector->dev); in mipi_dbi_connector_get_modes() local
513 return drm_connector_helper_get_modes_fixed(connector, &dbidev->mode); in mipi_dbi_connector_get_modes()
579 int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev, in mipi_dbi_dev_init_with_formats() argument
589 struct drm_device *drm = &dbidev->drm; in mipi_dbi_dev_init_with_formats()
592 if (!dbidev->dbi.command) in mipi_dbi_dev_init_with_formats()
599 dbidev->tx_buf = devm_kmalloc(drm->dev, tx_buf_size, GFP_KERNEL); in mipi_dbi_dev_init_with_formats()
600 if (!dbidev->tx_buf) in mipi_dbi_dev_init_with_formats()
603 drm_mode_copy(&dbidev->mode, mode); in mipi_dbi_dev_init_with_formats()
604 ret = mipi_dbi_rotate_mode(&dbidev->mode, rotation); in mipi_dbi_dev_init_with_formats()
610 drm_connector_helper_add(&dbidev->connector, &mipi_dbi_connector_hfuncs); in mipi_dbi_dev_init_with_formats()
611 ret = drm_connector_init(drm, &dbidev->connector, &mipi_dbi_connector_funcs, in mipi_dbi_dev_init_with_formats()
616 ret = drm_simple_display_pipe_init(drm, &dbidev->pipe, funcs, formats, format_count, in mipi_dbi_dev_init_with_formats()
617 modifiers, &dbidev->connector); in mipi_dbi_dev_init_with_formats()
621 drm_plane_enable_fb_damage_clips(&dbidev->pipe.plane); in mipi_dbi_dev_init_with_formats()
624 drm->mode_config.min_width = dbidev->mode.hdisplay; in mipi_dbi_dev_init_with_formats()
625 drm->mode_config.max_width = dbidev->mode.hdisplay; in mipi_dbi_dev_init_with_formats()
626 drm->mode_config.min_height = dbidev->mode.vdisplay; in mipi_dbi_dev_init_with_formats()
627 drm->mode_config.max_height = dbidev->mode.vdisplay; in mipi_dbi_dev_init_with_formats()
628 dbidev->rotation = rotation; in mipi_dbi_dev_init_with_formats()
653 int mipi_dbi_dev_init(struct mipi_dbi_dev *dbidev, in mipi_dbi_dev_init() argument
659 dbidev->drm.mode_config.preferred_depth = 16; in mipi_dbi_dev_init()
661 return mipi_dbi_dev_init_with_formats(dbidev, funcs, mipi_dbi_formats, in mipi_dbi_dev_init()
717 static int mipi_dbi_poweron_reset_conditional(struct mipi_dbi_dev *dbidev, bool cond) in mipi_dbi_poweron_reset_conditional() argument
719 struct device *dev = dbidev->drm.dev; in mipi_dbi_poweron_reset_conditional()
720 struct mipi_dbi *dbi = &dbidev->dbi; in mipi_dbi_poweron_reset_conditional()
723 if (dbidev->regulator) { in mipi_dbi_poweron_reset_conditional()
724 ret = regulator_enable(dbidev->regulator); in mipi_dbi_poweron_reset_conditional()
731 if (dbidev->io_regulator) { in mipi_dbi_poweron_reset_conditional()
732 ret = regulator_enable(dbidev->io_regulator); in mipi_dbi_poweron_reset_conditional()
735 if (dbidev->regulator) in mipi_dbi_poweron_reset_conditional()
736 regulator_disable(dbidev->regulator); in mipi_dbi_poweron_reset_conditional()
748 if (dbidev->regulator) in mipi_dbi_poweron_reset_conditional()
749 regulator_disable(dbidev->regulator); in mipi_dbi_poweron_reset_conditional()
750 if (dbidev->io_regulator) in mipi_dbi_poweron_reset_conditional()
751 regulator_disable(dbidev->io_regulator); in mipi_dbi_poweron_reset_conditional()
778 int mipi_dbi_poweron_reset(struct mipi_dbi_dev *dbidev) in mipi_dbi_poweron_reset() argument
780 return mipi_dbi_poweron_reset_conditional(dbidev, false); in mipi_dbi_poweron_reset()
796 int mipi_dbi_poweron_conditional_reset(struct mipi_dbi_dev *dbidev) in mipi_dbi_poweron_conditional_reset() argument
798 return mipi_dbi_poweron_reset_conditional(dbidev, true); in mipi_dbi_poweron_conditional_reset()
1326 struct mipi_dbi_dev *dbidev = m->private; in mipi_dbi_debugfs_command_write() local
1331 if (!drm_dev_enter(&dbidev->drm, &idx)) in mipi_dbi_debugfs_command_write()
1370 ret = mipi_dbi_command_buf(&dbidev->dbi, cmd, parameters, i); in mipi_dbi_debugfs_command_write()
1382 struct mipi_dbi_dev *dbidev = m->private; in mipi_dbi_debugfs_command_show() local
1383 struct mipi_dbi *dbi = &dbidev->dbi; in mipi_dbi_debugfs_command_show()
1388 if (!drm_dev_enter(&dbidev->drm, &idx)) in mipi_dbi_debugfs_command_show()
1452 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(minor->dev); in mipi_dbi_debugfs_init() local
1455 if (dbidev->dbi.read_commands) in mipi_dbi_debugfs_init()
1457 debugfs_create_file("command", mode, minor->debugfs_root, dbidev, in mipi_dbi_debugfs_init()