[Letux-kernel] [RFC 26/28] drm/ingenic: add jz4730 SoC info

H. Nikolaus Schaller hns at goldelico.com
Sat Jan 23 17:28:52 CET 2021


This LCDC is almost the same as the jz4740 but not fully.
Mainly it does not support more than 16 bit/pixel and
needs a stripped down formats table.

Signed-off-by: H. Nikolaus Schaller <hns at goldelico.com>
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index b86fbb2a27302..5e5e644623660 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1169,6 +1169,11 @@ static int ingenic_drm_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const u32 jz4730_formats[] = {
+	DRM_FORMAT_XRGB1555,
+	DRM_FORMAT_RGB565,
+};
+
 static const u32 jz4740_formats[] = {
 	DRM_FORMAT_XRGB1555,
 	DRM_FORMAT_RGB565,
@@ -1205,6 +1210,21 @@ static const u32 jz4770_formats_f0[] = {
 	DRM_FORMAT_XRGB2101010,
 };
 
+static const struct jz_soc_info jz4730_soc_info = {
+	.needs_dev_clk = true,
+	.has_osd = false,
+	.has_pcfg = false,
+	.has_recover = false,
+	.has_rgbc = false,
+	.hwdesc_size = sizeof(struct ingenic_dma_hwdesc),
+	.max_width = 800,
+	.max_height = 600,
+	.formats_f1 = jz4730_formats,
+	.num_formats_f1 = ARRAY_SIZE(jz4730_formats),
+	/* JZ4730 has only one plane */
+	.max_reg = JZ_REG_LCD_CMD1 + 1,
+};
+
 static const struct jz_soc_info jz4740_soc_info = {
 	.needs_dev_clk = true,
 	.has_osd = false,
@@ -1238,6 +1258,7 @@ static const struct jz_soc_info jz4770_soc_info = {
 };
 
 static const struct of_device_id ingenic_drm_of_match[] = {
+	{ .compatible = "ingenic,jz4730-lcd", .data = &jz4730_soc_info },
 	{ .compatible = "ingenic,jz4740-lcd", .data = &jz4740_soc_info },
 	{ .compatible = "ingenic,jz4725b-lcd", .data = &jz4725b_soc_info },
 	{ .compatible = "ingenic,jz4770-lcd", .data = &jz4770_soc_info },
-- 
2.26.2



More information about the Letux-kernel mailing list