Skip to content

Commit

Permalink
drm/panel: Add and fill drm_panel type field
Browse files Browse the repository at this point in the history
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190904132804.29680-2-laurent.pinchart@ideasonboard.com
  • Loading branch information
Laurent Pinchart authored and Sam Ravnborg committed Sep 8, 2019
1 parent 464828d commit 9a2654c
Show file tree
Hide file tree
Showing 41 changed files with 112 additions and 41 deletions.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/drm_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,19 @@ static LIST_HEAD(panel_list);
* @panel: DRM panel
* @dev: parent device of the panel
* @funcs: panel operations
* @connector_type: the connector type (DRM_MODE_CONNECTOR_*) corresponding to
* the panel interface
*
* Initialize the panel structure for subsequent registration with
* drm_panel_add().
*/
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);
panel->dev = dev;
panel->funcs = funcs;
panel->connector_type = connector_type;
}
EXPORT_SYMBOL(drm_panel_init);

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-arm-versatile.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ static int versatile_panel_probe(struct platform_device *pdev)
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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi)
mipi_dsi_set_drvdata(dsi, ctx);
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");
if (IS_ERR(ctx->dvdd)) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-ilitek-ili9322.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,8 @@ static int ili9322_probe(struct spi_device *spi)
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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
mipi_dsi_set_drvdata(dsi, ctx);
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");
if (IS_ERR(ctx->power)) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-innolux-p079zca.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi,
if (IS_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);
if (err < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ static int jdi_panel_add(struct jdi_panel *jdi)
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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static int kingdisplay_panel_add(struct kingdisplay_panel *kingdisplay)
return PTR_ERR(kingdisplay->backlight);

drm_panel_init(&kingdisplay->base, &kingdisplay->link->dev,
&kingdisplay_panel_funcs);
&kingdisplay_panel_funcs, DRM_MODE_CONNECTOR_DSI);

return drm_panel_add(&kingdisplay->base);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-lg-lb035q02.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ static int lb035q02_probe(struct spi_device *spi)
if (ret < 0)
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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-lg-lg4573.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ static int lg4573_probe(struct spi_device *spi)
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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ static int panel_lvds_probe(struct platform_device *pdev)
*/

/* 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);
if (ret < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-nec-nl8048hl11.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ static int nl8048_probe(struct spi_device *spi)
if (ret < 0)
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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-novatek-nt39016.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ static int nt39016_probe(struct spi_device *spi)
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);
if (err < 0) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ static int lcd_olinuxino_probe(struct i2c_client *client,
if (IS_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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
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),
dsi->host->dev, ctx,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587)
return PTR_ERR(osd101t2587->backlight);

drm_panel_init(&osd101t2587->base, &osd101t2587->dsi->dev,
&osd101t2587_panel_funcs);
&osd101t2587_panel_funcs, DRM_MODE_CONNECTOR_DSI);

return drm_panel_add(&osd101t2587->base);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
&wuxga_nt_panel_funcs);
&wuxga_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);

ret = drm_panel_add(&wuxga_nt->base);
if (ret < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c,
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
* driver's component bind function.
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-raydium-rm67191.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi)
if (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);

ret = drm_panel_add(&panel->panel);
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-raydium-rm68200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
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);

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ static int jh057n_probe(struct mipi_dsi_device *dsi)
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);

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-ronbo-rb070d30.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
mipi_dsi_set_drvdata(dsi, ctx);
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);
if (IS_ERR(ctx->gpios.reset)) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-ld9040.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ static int ld9040_probe(struct spi_device *spi)
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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
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);
if (ret < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.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);
if (ret < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
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,
&s6e63j0x03_bl_ops, NULL);
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ static int s6e63m0_probe(struct spi_device *spi)
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);
if (ret < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,8 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)

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);
if (ret < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ static int seiko_panel_probe(struct device *dev,
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);
if (err < 0)
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ static int sharp_panel_add(struct sharp_panel *sharp)
if (IS_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);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ static int ls037v7dw01_probe(struct platform_device *pdev)
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);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
return PTR_ERR(sharp_nt->backlight);

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);
}
Expand Down
Loading

0 comments on commit 9a2654c

Please sign in to comment.