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.
Unified · Split
| @@ -479,6 +479,7 @@ samsung_dsim_types[DSIM_TYPE_COUNT] = { · 478 unmodified lines | ||
| 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) |
| @@ -1452,10 +1453,17 @@ static int samsung_dsim_atomic_check(struct drm_bridge *bridge, · 967 unmodified lines | ||
| 1452 | 1453 | * 13.6.2.7.2 RGB interface |
| 1453 | 1454 | * both claim "Vsync, Hsync, and VDEN are active high signals.", the |
| 1454 | 1455 | * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. |
| 1456 | + * | |
| 1457 | + * The i.MX8M Plus glue logic between LCDIFv3 and DSIM does not | |
| 1458 | + * implement the same behavior, therefore LCDIFv3 must generate | |
| 1459 | + * HS/VS/DE signals active HIGH. | |
| 1455 | 1460 | */ |
| 1456 | 1461 | if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) { |
| 1457 | 1462 | adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); |
| 1458 | 1463 | adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); |
| 1464 | + } else if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MP) { | |
| 1465 | + adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); | |
| 1466 | + adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); | |
| 1459 | 1467 | } |
| 1460 | 1468 | |
| 1461 | 1469 | return 0; |
| @@ -1723,6 +1731,10 @@ static const struct samsung_dsim_host_ops generic_dsim_host_ops = { · 261 unmodified lines | ||
| 1723 | 1731 | .unregister_host = generic_dsim_unregister_host, |
| 1724 | 1732 | }; |
| 1725 | 1733 | |
| 1734 | +static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_high = { | |
| 1735 | + .input_bus_flags = DRM_BUS_FLAG_DE_HIGH, | |
| 1736 | +}; | |
| 1737 | + | |
| 1726 | 1738 | static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_low = { |
| 1727 | 1739 | .input_bus_flags = DRM_BUS_FLAG_DE_LOW, |
| 1728 | 1740 | }; |
| @@ -1812,6 +1824,8 @@ int samsung_dsim_probe(struct platform_device *pdev) · 83 unmodified lines | ||
| 1812 | 1824 | /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ |
| 1813 | 1825 | if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) |
| 1814 | 1826 | dsi->bridge.timings = &samsung_dsim_bridge_timings_de_low; |
| 1827 | + else | |
| 1828 | + dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high; | |
| 1815 | 1829 | |
| 1816 | 1830 | if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) |
| 1817 | 1831 | ret = dsi->plat_data->host_ops->register_host(dsi); |
| @@ -1917,11 +1931,20 @@ static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { · 99 unmodified lines | ||
| 1917 | 1931 | .host_ops = &generic_dsim_host_ops, |
| 1918 | 1932 | }; |
| 1919 | 1933 | |
| 1934 | +static const struct samsung_dsim_plat_data samsung_dsim_imx8mp_pdata = { | |
| 1935 | + .hw_type = DSIM_TYPE_IMX8MP, | |
| 1936 | + .host_ops = &generic_dsim_host_ops, | |
| 1937 | +}; | |
| 1938 | + | |
| 1920 | 1939 | static const struct of_device_id samsung_dsim_of_match[] = { |
| 1921 | 1940 | { |
| 1922 | 1941 | .compatible = "fsl,imx8mm-mipi-dsim", |
| 1923 | 1942 | .data = &samsung_dsim_imx8mm_pdata, |
| 1924 | 1943 | }, |
| 1944 | + { | |
| 1945 | + .compatible = "fsl,imx8mp-mipi-dsim", | |
| 1946 | + .data = &samsung_dsim_imx8mp_pdata, | |
| 1947 | + }, | |
| 1925 | 1948 | { /* sentinel. */ } |
| 1926 | 1949 | }; |
| 1927 | 1950 | MODULE_DEVICE_TABLE(of, samsung_dsim_of_match); |
| @@ -28,6 +28,7 @@ enum samsung_dsim_type { · 27 unmodified lines | ||
| 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 | |