static const u32 rad_bus_formats[] = {
MEDIA_BUS_FMT_RGB888_1X24,
MEDIA_BUS_FMT_RGB666_1X18,
MEDIA_BUS_FMT_RGB565_1X16,
};
static const u32 rad_bus_flags = DRM_BUS_FLAG_DE_LOW |
DRM_BUS_FLAG_PIXDATA_NEGEDGE;
static int st7701_get_modes(struct drm_panel *panel)
{
struct st7701 *st7701 = panel_to_st7701(panel);
const struct drm_display_mode *desc_mode = st7701->desc->mode;
struct drm_display_mode *mode;
DRM_ERROR("==suvine=st7701_get_modes=\n");
mode = drm_mode_duplicate(panel->drm, desc_mode);
if (!mode) {
DRM_DEV_ERROR(&st7701->dsi->dev,
"failed to add mode %ux%ux@%u\n",
desc_mode->hdisplay, desc_mode->vdisplay,
desc_mode->vrefresh);
return -ENOMEM;
}
drm_mode_set_name(mode);
drm_mode_probed_add(panel->connector, mode);
panel->connector->display_info.width_mm = desc_mode->width_mm;
panel->connector->display_info.height_mm = desc_mode->height_mm;
panel->connector->display_info.bus_flags = rad_bus_flags;
drm_display_info_set_bus_formats(&panel->connector->display_info,
rad_bus_formats,
ARRAY_SIZE(rad_bus_formats));
return 1;
}