History

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.

Marek Vasut committed 3 years ago

Commit b2cfec51 parent 073b8f92 files · +24 −0Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/bridge/samsung-dsim.c +23 −0
  2. include/drm/bridge/samsung-dsim.h +1 −0
drivers/gpu/drm/bridge/samsung-dsim.c+23−0
@@ -479,6 +479,7 @@ samsung_dsim_types[DSIM_TYPE_COUNT] = { · 478 unmodified lines
479479 [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data,
480480 [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data,
481481 [DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data,
482+ [DSIM_TYPE_IMX8MP] = &imx8mm_dsi_driver_data,
482483 };
483484
484485 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
14521453 * 13.6.2.7.2 RGB interface
14531454 * both claim "Vsync, Hsync, and VDEN are active high signals.", the
14541455 * 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.
14551460 */
14561461 if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) {
14571462 adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
14581463 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);
14591467 }
14601468
14611469 return 0;
@@ -1723,6 +1731,10 @@ static const struct samsung_dsim_host_ops generic_dsim_host_ops = { · 261 unmodified lines
17231731 .unregister_host = generic_dsim_unregister_host,
17241732 };
17251733
1734+static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_high = {
1735+ .input_bus_flags = DRM_BUS_FLAG_DE_HIGH,
1736+};
1737+
17261738 static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_low = {
17271739 .input_bus_flags = DRM_BUS_FLAG_DE_LOW,
17281740 };
@@ -1812,6 +1824,8 @@ int samsung_dsim_probe(struct platform_device *pdev) · 83 unmodified lines
18121824 /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */
18131825 if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM)
18141826 dsi->bridge.timings = &samsung_dsim_bridge_timings_de_low;
1827+ else
1828+ dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high;
18151829
18161830 if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host)
18171831 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
19171931 .host_ops = &generic_dsim_host_ops,
19181932 };
19191933
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+
19201939 static const struct of_device_id samsung_dsim_of_match[] = {
19211940 {
19221941 .compatible = "fsl,imx8mm-mipi-dsim",
19231942 .data = &samsung_dsim_imx8mm_pdata,
19241943 },
1944+ {
1945+ .compatible = "fsl,imx8mp-mipi-dsim",
1946+ .data = &samsung_dsim_imx8mp_pdata,
1947+ },
19251948 { /* sentinel. */ }
19261949 };
19271950 MODULE_DEVICE_TABLE(of, samsung_dsim_of_match);
include/drm/bridge/samsung-dsim.h+1−0
@@ -28,6 +28,7 @@ enum samsung_dsim_type { · 27 unmodified lines
2828 DSIM_TYPE_EXYNOS5422,
2929 DSIM_TYPE_EXYNOS5433,
3030 DSIM_TYPE_IMX8MM,
31+ DSIM_TYPE_IMX8MP,
3132 DSIM_TYPE_COUNT,
3233 };
3334

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t