From f5c76125c00e8c71ca430f9bea12fc059f08308b Mon Sep 17 00:00:00 2001
From: Leonard Crestez <leonard.crestez@nxp.com>
Date: Fri, 9 Feb 2018 16:54:55 +0200
Subject: [PATCH] MLK-17750: drm/imx: ldb: Fix build on imx6/7

This code is enabled in upstream imx_v6_v7_defconfig but fails to build
because of sc api calls. Fix this by adding ifdef checks to pixel_link
code.

Check for CONFIG_HAVE_IMX8_SOC becuase it is selected by both 8qm and
8qx.

These calls are already guarded at runtime with checks for devtype
pixel_link_valid_quirks so the empty ifdefed functions will never get
called anyway.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

It might make sense to add a dedicated config option for SC api
like CONFIG_HAVE_IMX_SCU, right now drivers/soc/imx/sc is guarded by
CONFIG_ARCH_FSL_IMX8QM which means you can't build 8qxp separately.

(cherry picked from commit a928239dffb3bf5232340eeb24fb583e4b2635b6)
---
 drivers/gpu/drm/imx/imx-ldb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index e524a21d734b46..9ef6d4a8dcb764 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -886,6 +886,9 @@ static int imx_ldb_panel_ddc(struct device *dev,
 	return 0;
 }
 
+#ifndef CONFIG_HAVE_IMX8_SOC
+static void ldb_pixel_link_config(int id) {}
+#else
 static void ldb_pixel_link_config(int id)
 {
 	sc_err_t sciErr;
@@ -928,6 +931,7 @@ static void ldb_pixel_link_config(int id)
 
 	sc_ipc_close(mu_id);
 }
+#endif
 
 static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
 {
-- 
GitLab