Commit 9a2654c0 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Sam Ravnborg

drm/panel: Add and fill drm_panel type field

Add a type field to the drm_panel structure to report the panel type,
using DRM_MODE_CONNECTOR_* macros (the values that make sense are LVDS,
eDP, DSI and DPI). This will be used to initialise the corresponding
connector type.

Update all panel drivers accordingly. The panel-simple driver only
specifies the type for the known to be LVDS panels, while all other
panels are left as unknown and will be converted on a case-by-case
basis as they all need to be carefully reviewed.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190904132804.29680-2-laurent.pinchart@ideasonboard.com
parent 464828df
...@@ -46,16 +46,19 @@ static LIST_HEAD(panel_list); ...@@ -46,16 +46,19 @@ static LIST_HEAD(panel_list);
* @panel: DRM panel * @panel: DRM panel
* @dev: parent device of the panel * @dev: parent device of the panel
* @funcs: panel operations * @funcs: panel operations
* @connector_type: the connector type (DRM_MODE_CONNECTOR_*) corresponding to
* the panel interface
* *
* Initialize the panel structure for subsequent registration with * Initialize the panel structure for subsequent registration with
* drm_panel_add(). * drm_panel_add().
*/ */
void drm_panel_init(struct drm_panel *panel, struct device *dev, void drm_panel_init(struct drm_panel *panel, struct device *dev,
const struct drm_panel_funcs *funcs) const struct drm_panel_funcs *funcs, int connector_type)
{ {
INIT_LIST_HEAD(&panel->list); INIT_LIST_HEAD(&panel->list);
panel->dev = dev; panel->dev = dev;
panel->funcs = funcs; panel->funcs = funcs;
panel->connector_type = connector_type;
} }
EXPORT_SYMBOL(drm_panel_init); EXPORT_SYMBOL(drm_panel_init);
......
...@@ -350,7 +350,8 @@ static int versatile_panel_probe(struct platform_device *pdev) ...@@ -350,7 +350,8 @@ static int versatile_panel_probe(struct platform_device *pdev)
dev_info(dev, "panel mounted on IB2 daughterboard\n"); dev_info(dev, "panel mounted on IB2 daughterboard\n");
} }
drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs); drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&vpanel->panel); return drm_panel_add(&vpanel->panel);
} }
......
...@@ -204,7 +204,8 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -204,7 +204,8 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi)
mipi_dsi_set_drvdata(dsi, ctx); mipi_dsi_set_drvdata(dsi, ctx);
ctx->dsi = dsi; ctx->dsi = dsi;
drm_panel_init(&ctx->panel, &dsi->dev, &feiyang_funcs); drm_panel_init(&ctx->panel, &dsi->dev, &feiyang_funcs,
DRM_MODE_CONNECTOR_DSI);
ctx->dvdd = devm_regulator_get(&dsi->dev, "dvdd"); ctx->dvdd = devm_regulator_get(&dsi->dev, "dvdd");
if (IS_ERR(ctx->dvdd)) { if (IS_ERR(ctx->dvdd)) {
......
...@@ -895,7 +895,8 @@ static int ili9322_probe(struct spi_device *spi) ...@@ -895,7 +895,8 @@ static int ili9322_probe(struct spi_device *spi)
ili->input = ili->conf->input; ili->input = ili->conf->input;
} }
drm_panel_init(&ili->panel, dev, &ili9322_drm_funcs); drm_panel_init(&ili->panel, dev, &ili9322_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&ili->panel); return drm_panel_add(&ili->panel);
} }
......
...@@ -433,7 +433,8 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -433,7 +433,8 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
mipi_dsi_set_drvdata(dsi, ctx); mipi_dsi_set_drvdata(dsi, ctx);
ctx->dsi = dsi; ctx->dsi = dsi;
drm_panel_init(&ctx->panel, &dsi->dev, &ili9881c_funcs); drm_panel_init(&ctx->panel, &dsi->dev, &ili9881c_funcs,
DRM_MODE_CONNECTOR_DSI);
ctx->power = devm_regulator_get(&dsi->dev, "power"); ctx->power = devm_regulator_get(&dsi->dev, "power");
if (IS_ERR(ctx->power)) { if (IS_ERR(ctx->power)) {
......
...@@ -487,7 +487,8 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi, ...@@ -487,7 +487,8 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi,
if (IS_ERR(innolux->backlight)) if (IS_ERR(innolux->backlight))
return PTR_ERR(innolux->backlight); return PTR_ERR(innolux->backlight);
drm_panel_init(&innolux->base, dev, &innolux_panel_funcs); drm_panel_init(&innolux->base, dev, &innolux_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
err = drm_panel_add(&innolux->base); err = drm_panel_add(&innolux->base);
if (err < 0) if (err < 0)
......
...@@ -437,7 +437,8 @@ static int jdi_panel_add(struct jdi_panel *jdi) ...@@ -437,7 +437,8 @@ static int jdi_panel_add(struct jdi_panel *jdi)
return ret; return ret;
} }
drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs); drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&jdi->base); ret = drm_panel_add(&jdi->base);
......
...@@ -392,7 +392,7 @@ static int kingdisplay_panel_add(struct kingdisplay_panel *kingdisplay) ...@@ -392,7 +392,7 @@ static int kingdisplay_panel_add(struct kingdisplay_panel *kingdisplay)
return PTR_ERR(kingdisplay->backlight); return PTR_ERR(kingdisplay->backlight);
drm_panel_init(&kingdisplay->base, &kingdisplay->link->dev, drm_panel_init(&kingdisplay->base, &kingdisplay->link->dev,
&kingdisplay_panel_funcs); &kingdisplay_panel_funcs, DRM_MODE_CONNECTOR_DSI);
return drm_panel_add(&kingdisplay->base); return drm_panel_add(&kingdisplay->base);
} }
......
...@@ -196,7 +196,8 @@ static int lb035q02_probe(struct spi_device *spi) ...@@ -196,7 +196,8 @@ static int lb035q02_probe(struct spi_device *spi)
if (ret < 0) if (ret < 0)
return ret; return ret;
drm_panel_init(&lcd->panel, &lcd->spi->dev, &lb035q02_funcs); drm_panel_init(&lcd->panel, &lcd->spi->dev, &lb035q02_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); return drm_panel_add(&lcd->panel);
} }
......
...@@ -259,7 +259,8 @@ static int lg4573_probe(struct spi_device *spi) ...@@ -259,7 +259,8 @@ static int lg4573_probe(struct spi_device *spi)
return ret; return ret;
} }
drm_panel_init(&ctx->panel, &spi->dev, &lg4573_drm_funcs); drm_panel_init(&ctx->panel, &spi->dev, &lg4573_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&ctx->panel); return drm_panel_add(&ctx->panel);
} }
......
...@@ -260,7 +260,8 @@ static int panel_lvds_probe(struct platform_device *pdev) ...@@ -260,7 +260,8 @@ static int panel_lvds_probe(struct platform_device *pdev)
*/ */
/* Register the panel. */ /* Register the panel. */
drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs); drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs,
DRM_MODE_CONNECTOR_LVDS);
ret = drm_panel_add(&lvds->panel); ret = drm_panel_add(&lvds->panel);
if (ret < 0) if (ret < 0)
......
...@@ -205,7 +205,8 @@ static int nl8048_probe(struct spi_device *spi) ...@@ -205,7 +205,8 @@ static int nl8048_probe(struct spi_device *spi)
if (ret < 0) if (ret < 0)
return ret; return ret;
drm_panel_init(&lcd->panel, &lcd->spi->dev, &nl8048_funcs); drm_panel_init(&lcd->panel, &lcd->spi->dev, &nl8048_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); return drm_panel_add(&lcd->panel);
} }
......
...@@ -292,7 +292,8 @@ static int nt39016_probe(struct spi_device *spi) ...@@ -292,7 +292,8 @@ static int nt39016_probe(struct spi_device *spi)
return err; return err;
} }
drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs); drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs,
DRM_MODE_CONNECTOR_DPI);
err = drm_panel_add(&panel->drm_panel); err = drm_panel_add(&panel->drm_panel);
if (err < 0) { if (err < 0) {
......
...@@ -288,7 +288,8 @@ static int lcd_olinuxino_probe(struct i2c_client *client, ...@@ -288,7 +288,8 @@ static int lcd_olinuxino_probe(struct i2c_client *client,
if (IS_ERR(lcd->backlight)) if (IS_ERR(lcd->backlight))
return PTR_ERR(lcd->backlight); return PTR_ERR(lcd->backlight);
drm_panel_init(&lcd->panel, dev, &lcd_olinuxino_funcs); drm_panel_init(&lcd->panel, dev, &lcd_olinuxino_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); return drm_panel_add(&lcd->panel);
} }
......
...@@ -455,7 +455,8 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi) ...@@ -455,7 +455,8 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)
dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM; MIPI_DSI_MODE_LPM;
drm_panel_init(&ctx->panel, dev, &otm8009a_drm_funcs); drm_panel_init(&ctx->panel, dev, &otm8009a_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
ctx->bl_dev = devm_backlight_device_register(dev, dev_name(dev), ctx->bl_dev = devm_backlight_device_register(dev, dev_name(dev),
dsi->host->dev, ctx, dsi->host->dev, ctx,
......
...@@ -167,7 +167,7 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587) ...@@ -167,7 +167,7 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587)
return PTR_ERR(osd101t2587->backlight); return PTR_ERR(osd101t2587->backlight);
drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev, drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev,
&osd101t2587_panel_funcs); &osd101t2587_panel_funcs, DRM_MODE_CONNECTOR_DSI);
return drm_panel_add(&osd101t2587->base); return drm_panel_add(&osd101t2587->base);
} }
......
...@@ -224,7 +224,7 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt) ...@@ -224,7 +224,7 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt)
} }
drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev, drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev,
&wuxga_nt_panel_funcs); &wuxga_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&wuxga_nt->base); ret = drm_panel_add(&wuxga_nt->base);
if (ret < 0) if (ret < 0)
......
...@@ -426,7 +426,8 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c, ...@@ -426,7 +426,8 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c,
return PTR_ERR(ts->dsi); return PTR_ERR(ts->dsi);
} }
drm_panel_init(&ts->base, dev, &rpi_touchscreen_funcs); drm_panel_init(&ts->base, dev, &rpi_touchscreen_funcs,
DRM_MODE_CONNECTOR_DSI);
/* This appears last, as it's what will unblock the DSI host /* This appears last, as it's what will unblock the DSI host
* driver's component bind function. * driver's component bind function.
......
...@@ -606,7 +606,8 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi) ...@@ -606,7 +606,8 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi)
if (ret) if (ret)
return ret; return ret;
drm_panel_init(&panel->panel, dev, &rad_panel_funcs); drm_panel_init(&panel->panel, dev, &rad_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
dev_set_drvdata(dev, panel); dev_set_drvdata(dev, panel);
ret = drm_panel_add(&panel->panel); ret = drm_panel_add(&panel->panel);
......
...@@ -404,7 +404,8 @@ static int rm68200_probe(struct mipi_dsi_device *dsi) ...@@ -404,7 +404,8 @@ static int rm68200_probe(struct mipi_dsi_device *dsi)
dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM; MIPI_DSI_MODE_LPM;
drm_panel_init(&ctx->panel, dev, &rm68200_drm_funcs); drm_panel_init(&ctx->panel, dev, &rm68200_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
......
...@@ -343,7 +343,8 @@ static int jh057n_probe(struct mipi_dsi_device *dsi) ...@@ -343,7 +343,8 @@ static int jh057n_probe(struct mipi_dsi_device *dsi)
return ret; return ret;
} }
drm_panel_init(&ctx->panel, dev, &jh057n_drm_funcs); drm_panel_init(&ctx->panel, dev, &jh057n_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
......
...@@ -173,7 +173,8 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -173,7 +173,8 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
mipi_dsi_set_drvdata(dsi, ctx); mipi_dsi_set_drvdata(dsi, ctx);
ctx->dsi = dsi; ctx->dsi = dsi;
drm_panel_init(&ctx->panel, &dsi->dev, &rb070d30_panel_funcs); drm_panel_init(&ctx->panel, &dsi->dev, &rb070d30_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
ctx->gpios.reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); ctx->gpios.reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->gpios.reset)) { if (IS_ERR(ctx->gpios.reset)) {
......
...@@ -351,7 +351,8 @@ static int ld9040_probe(struct spi_device *spi) ...@@ -351,7 +351,8 @@ static int ld9040_probe(struct spi_device *spi)
return ret; return ret;
} }
drm_panel_init(&ctx->panel, dev, &ld9040_drm_funcs); drm_panel_init(&ctx->panel, dev, &ld9040_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&ctx->panel); return drm_panel_add(&ctx->panel);
} }
......
...@@ -215,7 +215,8 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi) ...@@ -215,7 +215,8 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
return ret; return ret;
} }
drm_panel_init(&s6->panel, dev, &s6d16d0_drm_funcs); drm_panel_init(&s6->panel, dev, &s6d16d0_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&s6->panel); ret = drm_panel_add(&s6->panel);
if (ret < 0) if (ret < 0)
......
...@@ -732,7 +732,8 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) ...@@ -732,7 +732,8 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)
ctx->bl_dev->props.brightness = S6E3HA2_DEFAULT_BRIGHTNESS; ctx->bl_dev->props.brightness = S6E3HA2_DEFAULT_BRIGHTNESS;
ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; ctx->bl_dev->props.power = FB_BLANK_POWERDOWN;
drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs); drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&ctx->panel); ret = drm_panel_add(&ctx->panel);
if (ret < 0) if (ret < 0)
......
...@@ -466,7 +466,8 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi) ...@@ -466,7 +466,8 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
return PTR_ERR(ctx->reset_gpio); return PTR_ERR(ctx->reset_gpio);
} }
drm_panel_init(&ctx->panel, dev, &s6e63j0x03_funcs); drm_panel_init(&ctx->panel, dev, &s6e63j0x03_funcs,
DRM_MODE_CONNECTOR_DSI);
ctx->bl_dev = backlight_device_register("s6e63j0x03", dev, ctx, ctx->bl_dev = backlight_device_register("s6e63j0x03", dev, ctx,
&s6e63j0x03_bl_ops, NULL); &s6e63j0x03_bl_ops, NULL);
......
...@@ -473,7 +473,8 @@ static int s6e63m0_probe(struct spi_device *spi) ...@@ -473,7 +473,8 @@ static int s6e63m0_probe(struct spi_device *spi)
return ret; return ret;
} }
drm_panel_init(&ctx->panel, dev, &s6e63m0_drm_funcs); drm_panel_init(&ctx->panel, dev, &s6e63m0_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
ret = s6e63m0_backlight_register(ctx); ret = s6e63m0_backlight_register(ctx);
if (ret < 0) if (ret < 0)
......
...@@ -1017,7 +1017,8 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi) ...@@ -1017,7 +1017,8 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)
ctx->brightness = GAMMA_LEVEL_NUM - 1; ctx->brightness = GAMMA_LEVEL_NUM - 1;
drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs); drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&ctx->panel); ret = drm_panel_add(&ctx->panel);
if (ret < 0) if (ret < 0)
......
...@@ -274,7 +274,8 @@ static int seiko_panel_probe(struct device *dev, ...@@ -274,7 +274,8 @@ static int seiko_panel_probe(struct device *dev,
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
drm_panel_init(&panel->base, dev, &seiko_panel_funcs); drm_panel_init(&panel->base, dev, &seiko_panel_funcs,
DRM_MODE_CONNECTOR_DPI);
err = drm_panel_add(&panel->base); err = drm_panel_add(&panel->base);
if (err < 0) if (err < 0)
......
...@@ -329,7 +329,8 @@ static int sharp_panel_add(struct sharp_panel *sharp) ...@@ -329,7 +329,8 @@ static int sharp_panel_add(struct sharp_panel *sharp)
if (IS_ERR(sharp->backlight)) if (IS_ERR(sharp->backlight))
return PTR_ERR(sharp->backlight); return PTR_ERR(sharp->backlight);
drm_panel_init(&sharp->base, &sharp->link1->dev, &sharp_panel_funcs); drm_panel_init(&sharp->base, &sharp->link1->dev, &sharp_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
return drm_panel_add(&sharp->base); return drm_panel_add(&sharp->base);
} }
......
...@@ -185,7 +185,8 @@ static int ls037v7dw01_probe(struct platform_device *pdev) ...@@ -185,7 +185,8 @@ static int ls037v7dw01_probe(struct platform_device *pdev)
return PTR_ERR(lcd->ud_gpio); return PTR_ERR(lcd->ud_gpio);
} }
drm_panel_init(&lcd->panel, &pdev->dev, &ls037v7dw01_funcs); drm_panel_init(&lcd->panel, &pdev->dev, &ls037v7dw01_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); return drm_panel_add(&lcd->panel);
} }
......
...@@ -265,7 +265,7 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt) ...@@ -265,7 +265,7 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
return PTR_ERR(sharp_nt->backlight); return PTR_ERR(sharp_nt->backlight);
drm_panel_init(&sharp_nt->base, &sharp_nt->dsi->dev, drm_panel_init(&sharp_nt->base, &sharp_nt->dsi->dev,
&sharp_nt_panel_funcs); &sharp_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
return drm_panel_add(&sharp_nt->base); return drm_panel_add(&sharp_nt->base);
} }
......
...@@ -94,6 +94,7 @@ struct panel_desc { ...@@ -94,6 +94,7 @@ struct panel_desc {
u32 bus_format; u32 bus_format;
u32 bus_flags; u32 bus_flags;
int connector_type;
}; };
struct panel_simple { struct panel_simple {
...@@ -464,7 +465,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) ...@@ -464,7 +465,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
panel_simple_parse_panel_timing_node(dev, panel, &dt); panel_simple_parse_panel_timing_node(dev, panel, &dt);
drm_panel_init(&panel->base, dev, &panel_simple_funcs); drm_panel_init(&panel->base, dev, &panel_simple_funcs,
desc->connector_type);
err = drm_panel_add(&panel->base); err = drm_panel_add(&panel->base);
if (err < 0) if (err < 0)
...@@ -831,6 +833,7 @@ static const struct panel_desc auo_g133han01 = { ...@@ -831,6 +833,7 @@ static const struct panel_desc auo_g133han01 = {
.unprepare = 1000, .unprepare = 1000,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing auo_g185han01_timings = { static const struct display_timing auo_g185han01_timings = {
...@@ -860,6 +863,7 @@ static const struct panel_desc auo_g185han01 = { ...@@ -860,6 +863,7 @@ static const struct panel_desc auo_g185han01 = {
.unprepare = 1000, .unprepare = 1000,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing auo_p320hvn03_timings = { static const struct display_timing auo_p320hvn03_timings = {
...@@ -888,6 +892,7 @@ static const struct panel_desc auo_p320hvn03 = { ...@@ -888,6 +892,7 @@ static const struct panel_desc auo_p320hvn03 = {
.unprepare = 500, .unprepare = 500,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode auo_t215hvn01_mode = { static const struct drm_display_mode auo_t215hvn01_mode = {
...@@ -1203,6 +1208,7 @@ static const struct panel_desc dlc_dlc0700yzg_1 = { ...@@ -1203,6 +1208,7 @@ static const struct panel_desc dlc_dlc0700yzg_1 = {
.disable = 200, .disable = 200,
}, },
.bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing dlc_dlc1010gig_timing = { static const struct display_timing dlc_dlc1010gig_timing = {
...@@ -1233,6 +1239,7 @@ static const struct panel_desc dlc_dlc1010gig = { ...@@ -1233,6 +1239,7 @@ static const struct panel_desc dlc_dlc1010gig = {
.unprepare = 60, .unprepare = 60,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode edt_et035012dm6_mode = { static const struct drm_display_mode edt_et035012dm6_mode = {
...@@ -1499,6 +1506,7 @@ static const struct panel_desc hannstar_hsd070pww1 = { ...@@ -1499,6 +1506,7 @@ static const struct panel_desc hannstar_hsd070pww1 = {
.height = 94, .height = 94,
}, },
.bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing hannstar_hsd100pxn1_timing = { static const struct display_timing hannstar_hsd100pxn1_timing = {
...@@ -1523,6 +1531,7 @@ static const struct panel_desc hannstar_hsd100pxn1 = { ...@@ -1523,6 +1531,7 @@ static const struct panel_desc hannstar_hsd100pxn1 = {
.height = 152, .height = 152,
}, },
.bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = { static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
...@@ -1629,6 +1638,7 @@ static const struct panel_desc innolux_g070y2_l01 = { ...@@ -1629,6 +1638,7 @@ static const struct panel_desc innolux_g070y2_l01 = {
.unprepare = 800, .unprepare = 800,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing innolux_g101ice_l01_timing = { static const struct display_timing innolux_g101ice_l01_timing = {
...@@ -1657,6 +1667,7 @@ static const struct panel_desc innolux_g101ice_l01 = { ...@@ -1657,6 +1667,7 @@ static const struct panel_desc innolux_g101ice_l01 = {
.disable = 200, .disable = 200,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing innolux_g121i1_l01_timing = { static const struct display_timing innolux_g121i1_l01_timing = {
...@@ -1684,6 +1695,7 @@ static const struct panel_desc innolux_g121i1_l01 = { ...@@ -1684,6 +1695,7 @@ static const struct panel_desc innolux_g121i1_l01 = {
.disable = 20, .disable = 20,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode innolux_g121x1_l03_mode = { static const struct drm_display_mode innolux_g121x1_l03_mode = {
...@@ -1867,6 +1879,7 @@ static const struct panel_desc koe_tx31d200vm0baa = { ...@@ -1867,6 +1879,7 @@ static const struct panel_desc koe_tx31d200vm0baa = {
.height = 109, .height = 109,
}, },
.bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing kyo_tcg121xglp_timing = { static const struct display_timing kyo_tcg121xglp_timing = {
...@@ -1891,6 +1904,7 @@ static const struct panel_desc kyo_tcg121xglp = { ...@@ -1891,6 +1904,7 @@ static const struct panel_desc kyo_tcg121xglp = {
.height = 184, .height = 184,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode lemaker_bl035_rgb_002_mode = { static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
...@@ -1939,6 +1953,7 @@ static const struct panel_desc lg_lb070wv8 = { ...@@ -1939,6 +1953,7 @@ static const struct panel_desc lg_lb070wv8 = {
.height = 91, .height = 91,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode lg_lp079qx1_sp0v_mode = { static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
...@@ -2061,6 +2076,7 @@ static const struct panel_desc mitsubishi_aa070mc01 = { ...@@ -2061,6 +2076,7 @@ static const struct panel_desc mitsubishi_aa070mc01 = {
.disable = 400, .disable = 400,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
.bus_flags = DRM_BUS_FLAG_DE_HIGH, .bus_flags = DRM_BUS_FLAG_DE_HIGH,
}; };
...@@ -2089,6 +2105,7 @@ static const struct panel_desc nec_nl12880bc20_05 = { ...@@ -2089,6 +2105,7 @@ static const struct panel_desc nec_nl12880bc20_05 = {
.disable = 50, .disable = 50,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode nec_nl4827hc19_05b_mode = { static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
...@@ -2191,6 +2208,7 @@ static const struct panel_desc nlt_nl192108ac18_02d = { ...@@ -2191,6 +2208,7 @@ static const struct panel_desc nlt_nl192108ac18_02d = {
.unprepare = 500, .unprepare = 500,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode nvd_9128_mode = { static const struct drm_display_mode nvd_9128_mode = {
...@@ -2214,6 +2232,7 @@ static const struct panel_desc nvd_9128 = { ...@@ -2214,6 +2232,7 @@ static const struct panel_desc nvd_9128 = {
.height = 88, .height = 88,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing okaya_rs800480t_7x0gp_timing = { static const struct display_timing okaya_rs800480t_7x0gp_timing = {
...@@ -2626,6 +2645,7 @@ static const struct panel_desc sharp_lq101k1ly04 = { ...@@ -2626,6 +2645,7 @@ static const struct panel_desc sharp_lq101k1ly04 = {
.height = 136, .height = 136,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing sharp_lq123p1jx31_timing = { static const struct display_timing sharp_lq123p1jx31_timing = {
...@@ -2805,6 +2825,7 @@ static const struct panel_desc tianma_tm070jdhg30 = { ...@@ -2805,6 +2825,7 @@ static const struct panel_desc tianma_tm070jdhg30 = {
.height = 95, .height = 95,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct display_timing tianma_tm070rvhg71_timing = { static const struct display_timing tianma_tm070rvhg71_timing = {
...@@ -2829,6 +2850,7 @@ static const struct panel_desc tianma_tm070rvhg71 = { ...@@ -2829,6 +2850,7 @@ static const struct panel_desc tianma_tm070rvhg71 = {
.height = 86, .height = 86,
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = { static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
...@@ -2911,6 +2933,7 @@ static const struct panel_desc toshiba_lt089ac29000 = { ...@@ -2911,6 +2933,7 @@ static const struct panel_desc toshiba_lt089ac29000 = {
}, },
.bus_format = MEDIA_BUS_FMT_RGB888_1X24, .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
.bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct drm_display_mode tpk_f07a_0102_mode = { static const struct drm_display_mode tpk_f07a_0102_mode = {
...@@ -2981,6 +3004,7 @@ static const struct panel_desc urt_umsh_8596md_lvds = { ...@@ -2981,6 +3004,7 @@ static const struct panel_desc urt_umsh_8596md_lvds = {
.height = 91, .height = 91,
}, },
.bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
.connector_type = DRM_MODE_CONNECTOR_LVDS,
}; };
static const struct panel_desc urt_umsh_8596md_parallel = { static const struct panel_desc urt_umsh_8596md_parallel = {
......
...@@ -369,7 +369,8 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -369,7 +369,8 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(st7701->backlight)) if (IS_ERR(st7701->backlight))
return PTR_ERR(st7701->backlight); return PTR_ERR(st7701->backlight);
drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs); drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs,
DRM_MODE_CONNECTOR_DSI);
/** /**
* Once sleep out has been issued, ST7701 IC required to wait 120ms * Once sleep out has been issued, ST7701 IC required to wait 120ms
......
...@@ -381,7 +381,8 @@ static int st7789v_probe(struct spi_device *spi) ...@@ -381,7 +381,8 @@ static int st7789v_probe(struct spi_device *spi)
spi_set_drvdata(spi, ctx); spi_set_drvdata(spi, ctx);
ctx->spi = spi; ctx->spi = spi;
drm_panel_init(&ctx->panel, &spi->dev, &st7789v_drm_funcs); drm_panel_init(&ctx->panel, &spi->dev, &st7789v_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
ctx->power = devm_regulator_get(&spi->dev, "power"); ctx->power = devm_regulator_get(&spi->dev, "power");
if (IS_ERR(ctx->power)) if (IS_ERR(ctx->power))
......
...@@ -648,7 +648,8 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -648,7 +648,8 @@ static int acx565akm_probe(struct spi_device *spi)
return ret; return ret;
} }
drm_panel_init(&lcd->panel, &lcd->spi->dev, &acx565akm_funcs); drm_panel_init(&lcd->panel, &lcd->spi->dev, &acx565akm_funcs,
DRM_MODE_CONNECTOR_DPI);
ret = drm_panel_add(&lcd->panel); ret = drm_panel_add(&lcd->panel);
if (ret < 0) { if (ret < 0) {
......
...@@ -347,7 +347,8 @@ static int td028ttec1_probe(struct spi_device *spi) ...@@ -347,7 +347,8 @@ static int td028ttec1_probe(struct spi_device *spi)
return ret; return ret;
} }
drm_panel_init(&lcd->panel, &lcd->spi->dev, &td028ttec1_funcs); drm_panel_init(&lcd->panel, &lcd->spi->dev, &td028ttec1_funcs,
DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); return drm_panel_add(&lcd->panel);
} }
......
...@@ -458,7 +458,8 @@ static int td043mtea1_probe(struct spi_device *spi) ...@@ -458,7 +458,8 @@ static int td043mtea1_probe(struct spi_device *spi)
return ret; return ret;
} }
drm_panel_init(&lcd->panel, &lcd->spi->dev, &td043mtea1_funcs); drm_panel_init(&lcd->panel, &lcd->spi->dev, &td043mtea1_funcs,
DRM_MODE_CONNECTOR_DPI);
ret = drm_panel_add(&lcd->panel); ret = drm_panel_add(&lcd->panel);
if (ret < 0) { if (ret < 0) {
......
...@@ -457,7 +457,8 @@ static int tpg110_probe(struct spi_device *spi) ...@@ -457,7 +457,8 @@ static int tpg110_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
drm_panel_init(&tpg->panel, dev, &tpg110_drm_funcs); drm_panel_init(&tpg->panel, dev, &tpg110_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
spi_set_drvdata(spi, tpg); spi_set_drvdata(spi, tpg);
return drm_panel_add(&tpg->panel); return drm_panel_add(&tpg->panel);
......
...@@ -518,7 +518,8 @@ static int truly_nt35597_panel_add(struct truly_nt35597 *ctx) ...@@ -518,7 +518,8 @@ static int truly_nt35597_panel_add(struct truly_nt35597 *ctx)
/* dual port */ /* dual port */
gpiod_set_value(ctx->mode_gpio, 0); gpiod_set_value(ctx->mode_gpio, 0);
drm_panel_init(&ctx->panel, dev, &truly_nt35597_drm_funcs); drm_panel_init(&ctx->panel, dev, &truly_nt35597_drm_funcs,
DRM_MODE_CONNECTOR_DSI);
drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
return 0; return 0;
......
...@@ -139,6 +139,15 @@ struct drm_panel { ...@@ -139,6 +139,15 @@ struct drm_panel {
*/ */
const struct drm_panel_funcs *funcs; const struct drm_panel_funcs *funcs;
/**
* @connector_type:
*
* Type of the panel as a DRM_MODE_CONNECTOR_* value. This is used to
* initialise the drm_connector corresponding to the panel with the
* correct connector type.
*/
int connector_type;
/** /**
* @list: * @list:
* *
...@@ -148,7 +157,8 @@ struct drm_panel { ...@@ -148,7 +157,8 @@ struct drm_panel {
}; };
void drm_panel_init(struct drm_panel *panel, struct device *dev, void drm_panel_init(struct drm_panel *panel, struct device *dev,
const struct drm_panel_funcs *funcs); const struct drm_panel_funcs *funcs,
int connector_type);
int drm_panel_add(struct drm_panel *panel); int drm_panel_add(struct drm_panel *panel);
void drm_panel_remove(struct drm_panel *panel); void drm_panel_remove(struct drm_panel *panel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment