struct gpio_desc enable;
};
+struct simple_panel_drv_data {
+ const struct drm_display_mode *modes;
+ unsigned int num_modes;
+ const struct mipi_dsi_panel_plat *mipi_dsi;
+};
+
static int simple_panel_enable_backlight(struct udevice *dev)
{
struct simple_panel_priv *priv = dev_get_priv(dev);
}
#endif
+static int simple_panel_get_modes(struct udevice *dev,
+ const struct drm_display_mode **modes)
+{
+ const struct simple_panel_drv_data *data =
+ (const struct simple_panel_drv_data *)dev_get_driver_data(dev);
+
+ if (!data || !data->modes || data->num_modes == 0)
+ return -ENODEV;
+
+ *modes = data->modes;
+ return data->num_modes;
+}
+
static int simple_panel_get_display_timing(struct udevice *dev,
struct display_timing *timings)
{
+ const struct simple_panel_drv_data *data =
+ (const struct simple_panel_drv_data *)dev_get_driver_data(dev);
const void *blob = gd->fdt_blob;
int ret;
- /* Check for timing subnode if panel node first */
+ /* Prefer the use of drm_display_mode if available */
+ if (data && data->modes && data->num_modes > 0)
+ return -ENODEV;
+
+ /* Check for timing subnode in panel node */
ret = fdtdec_decode_display_timing(blob, dev_of_offset(dev),
0, timings);
if (!ret)
static int simple_panel_probe(struct udevice *dev)
{
struct simple_panel_priv *priv = dev_get_priv(dev);
+ const struct simple_panel_drv_data *data =
+ (const struct simple_panel_drv_data *)dev_get_driver_data(dev);
struct mipi_dsi_panel_plat *plat = dev_get_plat(dev);
- struct mipi_dsi_panel_plat *dsi_data =
- (struct mipi_dsi_panel_plat *)dev_get_driver_data(dev);
int ret;
ret = regulator_set_enable_if_allowed(priv->reg, true);
return ret;
}
- if (dsi_data)
- memcpy(plat, dsi_data, sizeof(struct mipi_dsi_panel_plat));
+ if (data && data->mipi_dsi)
+ memcpy(plat, data->mipi_dsi, sizeof(struct mipi_dsi_panel_plat));
return 0;
}
.enable_backlight = simple_panel_enable_backlight,
.set_backlight = simple_panel_set_backlight,
.get_display_timing = simple_panel_get_display_timing,
+ .get_modes = simple_panel_get_modes,
};
static const struct mipi_dsi_panel_plat panasonic_vvx10f004b00 = {
.lanes = 4,
};
+static const struct simple_panel_drv_data panasonic_vvx10f004b00_data = {
+ .mipi_dsi = &panasonic_vvx10f004b00,
+};
+
+static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
+ .clock = 30000,
+ .hdisplay = 800,
+ .hsync_start = 800 + 39,
+ .hsync_end = 800 + 39 + 47,
+ .htotal = 800 + 39 + 47 + 39,
+ .vdisplay = 480,
+ .vsync_start = 480 + 13,
+ .vsync_end = 480 + 13 + 2,
+ .vtotal = 480 + 13 + 2 + 29,
+ .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
+};
+
+static const struct simple_panel_drv_data tfc_s9700rtwv43tr_01b_data = {
+ .modes = &tfc_s9700rtwv43tr_01b_mode,
+ .num_modes = 1,
+};
+
static const struct udevice_id simple_panel_ids[] = {
{ .compatible = "simple-panel" },
{ .compatible = "panel-lvds" },
{ .compatible = "sharp,lq123p1jx31" },
{ .compatible = "boe,nv101wxmn51" },
{ .compatible = "panasonic,vvx10f004b00",
- .data = (ulong)&panasonic_vvx10f004b00 },
+ .data = (ulong)&panasonic_vvx10f004b00_data },
+ { .compatible = "tfc,s9700rtwv43tr-01b",
+ .data = (ulong)&tfc_s9700rtwv43tr_01b_data },
{ }
};