Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: bridge: samsung-dsim: Add i.MX8M Plus support

Add extras to support i.MX8M Plus. The main change is the removal of
HS/VS/DE signal inversion in the LCDIFv3-DSIM glue logic, otherwise
the implementation of this IP in i.MX8M Plus is very much compatible
with the i.MX8M Mini/Nano one.

Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Acked-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <m.szyprowski@samsung.com>

authored by

Marek Vasut and committed by
Inki Dae
b2cfec52 073b8f9e

+24
+23
drivers/gpu/drm/bridge/samsung-dsim.c
··· 479 479 [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, 480 480 [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, 481 481 [DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, 482 + [DSIM_TYPE_IMX8MP] = &imx8mm_dsi_driver_data, 482 483 }; 483 484 484 485 static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) ··· 1453 1452 * 13.6.2.7.2 RGB interface 1454 1453 * both claim "Vsync, Hsync, and VDEN are active high signals.", the 1455 1454 * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. 1455 + * 1456 + * The i.MX8M Plus glue logic between LCDIFv3 and DSIM does not 1457 + * implement the same behavior, therefore LCDIFv3 must generate 1458 + * HS/VS/DE signals active HIGH. 1456 1459 */ 1457 1460 if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) { 1458 1461 adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); 1459 1462 adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); 1463 + } else if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MP) { 1464 + adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); 1465 + adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); 1460 1466 } 1461 1467 1462 1468 return 0; ··· 1731 1723 .unregister_host = generic_dsim_unregister_host, 1732 1724 }; 1733 1725 1726 + static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_high = { 1727 + .input_bus_flags = DRM_BUS_FLAG_DE_HIGH, 1728 + }; 1729 + 1734 1730 static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_low = { 1735 1731 .input_bus_flags = DRM_BUS_FLAG_DE_LOW, 1736 1732 }; ··· 1824 1812 /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ 1825 1813 if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) 1826 1814 dsi->bridge.timings = &samsung_dsim_bridge_timings_de_low; 1815 + else 1816 + dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high; 1827 1817 1828 1818 if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) 1829 1819 ret = dsi->plat_data->host_ops->register_host(dsi); ··· 1931 1917 .host_ops = &generic_dsim_host_ops, 1932 1918 }; 1933 1919 1920 + static const struct samsung_dsim_plat_data samsung_dsim_imx8mp_pdata = { 1921 + .hw_type = DSIM_TYPE_IMX8MP, 1922 + .host_ops = &generic_dsim_host_ops, 1923 + }; 1924 + 1934 1925 static const struct of_device_id samsung_dsim_of_match[] = { 1935 1926 { 1936 1927 .compatible = "fsl,imx8mm-mipi-dsim", 1937 1928 .data = &samsung_dsim_imx8mm_pdata, 1929 + }, 1930 + { 1931 + .compatible = "fsl,imx8mp-mipi-dsim", 1932 + .data = &samsung_dsim_imx8mp_pdata, 1938 1933 }, 1939 1934 { /* sentinel. */ } 1940 1935 };
+1
include/drm/bridge/samsung-dsim.h
··· 28 28 DSIM_TYPE_EXYNOS5422, 29 29 DSIM_TYPE_EXYNOS5433, 30 30 DSIM_TYPE_IMX8MM, 31 + DSIM_TYPE_IMX8MP, 31 32 DSIM_TYPE_COUNT, 32 33 }; 33 34