Den 11.08.2019 19.02, skrev Sam Ravnborg:
Hi Noralf.
On Thu, Aug 01, 2019 at 03:52:49PM +0200, Noralf Trønnes wrote:
Add support for panels that use the DPI interface. ILI9341 has onboard RAM so the assumption made here is that all such panels support pixel upload over DBI.
The presence/absense of the Device Tree 'port' node decides which interface is used for pixel transfer.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 56 ++++++++++++++++---- 1 file changed, 45 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
<snip>
static int ili9341_remove(struct spi_device *spi) { struct ili9341 *ili = spi_get_drvdata(spi);
- drm_dev_unplug(&ili->dbidev.drm);
- drm_atomic_helper_shutdown(&ili->dbidev.drm);
- if (ili->use_dpi) {
drm_panel_remove(&ili->panel);
drm_panel_disable(&ili->panel);
drm_panel_unprepare(&ili->panel);
kfree(ili);
At first I thought - order is wrong. But drm_panel_remove() prevents display drivers from using the driver. And this will not invalidate the other calls. Maybe add a short comment?
I just copied this code from Josef's driver, didn't actually look that close at it. Isn't there a common pattern for this in the panel drivers? I would assume that everyone would have to do more or less the same on driver unbind.
Noralf.
Sam
} else {
drm_dev_unplug(&ili->dbidev.drm);
drm_atomic_helper_shutdown(&ili->dbidev.drm);
}
return 0;
}