Lines Matching refs:dbidev

210 	struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev);
231 switch (dbidev->pixel_format) {
258 static void mipi_dbi_set_window_address(struct mipi_dbi_dev *dbidev,
262 struct mipi_dbi *dbi = &dbidev->dbi;
264 xs += dbidev->left_offset;
265 xe += dbidev->left_offset;
266 ys += dbidev->top_offset;
267 ye += dbidev->top_offset;
278 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev);
282 struct mipi_dbi *dbi = &dbidev->dbi;
295 tr = dbidev->tx_buf;
303 mipi_dbi_set_window_address(dbidev, rect->x1, rect->x2 - 1, rect->y1,
307 dst_format = drm_format_info(dbidev->pixel_format);
330 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);
332 return drm_crtc_helper_mode_valid_fixed(&pipe->crtc, mode, &dbidev->mode);
372 * @dbidev: MIPI DBI device structure
383 void mipi_dbi_enable_flush(struct mipi_dbi_dev *dbidev,
397 if (!drm_dev_enter(&dbidev->drm, &idx))
402 backlight_enable(dbidev->backlight);
408 static void mipi_dbi_blank(struct mipi_dbi_dev *dbidev)
410 struct drm_device *drm = &dbidev->drm;
413 struct mipi_dbi *dbi = &dbidev->dbi;
421 dst_format = drm_format_info(dbidev->pixel_format);
424 memset(dbidev->tx_buf, 0, len);
426 mipi_dbi_set_window_address(dbidev, 0, width - 1, 0, height - 1);
428 (u8 *)dbidev->tx_buf, len);
443 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);
447 if (dbidev->backlight)
448 backlight_disable(dbidev->backlight);
450 mipi_dbi_blank(dbidev);
452 if (dbidev->regulator)
453 regulator_disable(dbidev->regulator);
454 if (dbidev->io_regulator)
455 regulator_disable(dbidev->io_regulator);
545 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(connector->dev);
547 return drm_connector_helper_get_modes_fixed(connector, &dbidev->mode);
592 * @dbidev: MIPI DBI device structure to initialize
613 int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev,
623 struct drm_device *drm = &dbidev->drm;
626 if (!dbidev->dbi.command)
633 dbidev->tx_buf = devm_kmalloc(drm->dev, tx_buf_size, GFP_KERNEL);
634 if (!dbidev->tx_buf)
637 drm_mode_copy(&dbidev->mode, mode);
638 ret = mipi_dbi_rotate_mode(&dbidev->mode, rotation);
644 drm_connector_helper_add(&dbidev->connector, &mipi_dbi_connector_hfuncs);
645 ret = drm_connector_init(drm, &dbidev->connector, &mipi_dbi_connector_funcs,
650 ret = drm_simple_display_pipe_init(drm, &dbidev->pipe, funcs, formats, format_count,
651 modifiers, &dbidev->connector);
655 drm_plane_enable_fb_damage_clips(&dbidev->pipe.plane);
658 drm->mode_config.min_width = dbidev->mode.hdisplay;
659 drm->mode_config.max_width = dbidev->mode.hdisplay;
660 drm->mode_config.min_height = dbidev->mode.vdisplay;
661 drm->mode_config.max_height = dbidev->mode.vdisplay;
662 dbidev->rotation = rotation;
663 dbidev->pixel_format = formats[0];
665 dbidev->dbi.write_memory_bpw = 8;
675 * @dbidev: MIPI DBI device structure to initialize
690 int mipi_dbi_dev_init(struct mipi_dbi_dev *dbidev,
696 dbidev->drm.mode_config.preferred_depth = 16;
698 return mipi_dbi_dev_init_with_formats(dbidev, funcs, mipi_dbi_formats,
754 static int mipi_dbi_poweron_reset_conditional(struct mipi_dbi_dev *dbidev, bool cond)
756 struct device *dev = dbidev->drm.dev;
757 struct mipi_dbi *dbi = &dbidev->dbi;
760 if (dbidev->regulator) {
761 ret = regulator_enable(dbidev->regulator);
768 if (dbidev->io_regulator) {
769 ret = regulator_enable(dbidev->io_regulator);
772 if (dbidev->regulator)
773 regulator_disable(dbidev->regulator);
785 if (dbidev->regulator)
786 regulator_disable(dbidev->regulator);
787 if (dbidev->io_regulator)
788 regulator_disable(dbidev->io_regulator);
807 * @dbidev: MIPI DBI device structure
815 int mipi_dbi_poweron_reset(struct mipi_dbi_dev *dbidev)
817 return mipi_dbi_poweron_reset_conditional(dbidev, false);
823 * @dbidev: MIPI DBI device structure
833 int mipi_dbi_poweron_conditional_reset(struct mipi_dbi_dev *dbidev)
835 return mipi_dbi_poweron_reset_conditional(dbidev, true);
1381 struct mipi_dbi_dev *dbidev = m->private;
1386 if (!drm_dev_enter(&dbidev->drm, &idx))
1425 ret = mipi_dbi_command_buf(&dbidev->dbi, cmd, parameters, i);
1437 struct mipi_dbi_dev *dbidev = m->private;
1438 struct mipi_dbi *dbi = &dbidev->dbi;
1443 if (!drm_dev_enter(&dbidev->drm, &idx))
1507 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(minor->dev);
1510 if (dbidev->dbi.read_commands)
1512 debugfs_create_file("command", mode, minor->debugfs_root, dbidev,