dm: core: Create a new header file for 'compat' features
At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.
Move the compatibility features into a separate header file.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index 734bc12..62accce 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <cpu_func.h>
+#include <malloc.h>
#include <asm/io.h>
#include <asm/arch/gpio.h>
#include <asm/arch/clk.h>
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index 0a725c5..6d7661d 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <dm.h>
+#include <malloc.h>
#include <video.h>
#include <video_console.h>
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 285633b..5fb6886 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -13,6 +13,7 @@
*/
#include <common.h>
+#include <malloc.h>
#include <memalign.h>
#include <video_fb.h>
#include <linux/list.h>
diff --git a/drivers/video/dw_mipi_dsi.c b/drivers/video/dw_mipi_dsi.c
index 83d7c7b..5dd75e7 100644
--- a/drivers/video/dw_mipi_dsi.c
+++ b/drivers/video/dw_mipi_dsi.c
@@ -19,6 +19,7 @@
#include <asm/io.h>
#include <asm/arch/gpio.h>
#include <dm/device-internal.h>
+#include <dm/device_compat.h>
#include <linux/iopoll.h>
#include <video_bridge.h>
diff --git a/drivers/video/hitachi_tx18d42vm_lcd.c b/drivers/video/hitachi_tx18d42vm_lcd.c
index 1629f55..a57abd2 100644
--- a/drivers/video/hitachi_tx18d42vm_lcd.c
+++ b/drivers/video/hitachi_tx18d42vm_lcd.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <malloc.h>
#include <asm/gpio.h>
#include <errno.h>
diff --git a/drivers/video/mali_dp.c b/drivers/video/mali_dp.c
index 71151a8..87a75a9 100644
--- a/drivers/video/mali_dp.c
+++ b/drivers/video/mali_dp.c
@@ -6,6 +6,7 @@
*/
#define DEBUG
#include <common.h>
+#include <malloc.h>
#include <video.h>
#include <dm.h>
#ifdef CONFIG_DISPLAY
@@ -16,6 +17,7 @@
#include <os.h>
#include <fdt_support.h>
#include <clk.h>
+#include <dm/device_compat.h>
#include <linux/sizes.h>
#define MALIDP_CORE_ID 0x0018
diff --git a/drivers/video/mvebu_lcd.c b/drivers/video/mvebu_lcd.c
index dc62545..3ff5b28 100644
--- a/drivers/video/mvebu_lcd.c
+++ b/drivers/video/mvebu_lcd.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <dm.h>
#include <video.h>
+#include <dm/device_compat.h>
#include <linux/mbus.h>
#include <asm/io.h>
#include <asm/arch/cpu.h>
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index c529810..6f80fba 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <dm.h>
#include <env.h>
+#include <dm/device_compat.h>
#include <linux/errno.h>
#include <malloc.h>
#include <video.h>
diff --git a/drivers/video/orisetech_otm8009a.c b/drivers/video/orisetech_otm8009a.c
index 89d9cfd..650ed07 100644
--- a/drivers/video/orisetech_otm8009a.c
+++ b/drivers/video/orisetech_otm8009a.c
@@ -13,6 +13,7 @@
#include <mipi_dsi.h>
#include <panel.h>
#include <asm/gpio.h>
+#include <dm/device_compat.h>
#include <power/regulator.h>
#define OTM8009A_BACKLIGHT_DEFAULT 240
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index ad20bf2..742579a 100644
--- a/drivers/video/pwm_backlight.c
+++ b/drivers/video/pwm_backlight.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <dm.h>
#include <backlight.h>
+#include <malloc.h>
#include <pwm.h>
#include <asm/gpio.h>
#include <power/regulator.h>
diff --git a/drivers/video/raydium-rm68200.c b/drivers/video/raydium-rm68200.c
index 91555e2..853dbc5 100644
--- a/drivers/video/raydium-rm68200.c
+++ b/drivers/video/raydium-rm68200.c
@@ -13,6 +13,7 @@
#include <mipi_dsi.h>
#include <panel.h>
#include <asm/gpio.h>
+#include <dm/device_compat.h>
#include <power/regulator.h>
/*** Manufacturer Command Set ***/
diff --git a/drivers/video/rockchip/rk3288_hdmi.c b/drivers/video/rockchip/rk3288_hdmi.c
index 3d25ce9..51eb415 100644
--- a/drivers/video/rockchip/rk3288_hdmi.c
+++ b/drivers/video/rockchip/rk3288_hdmi.c
@@ -9,6 +9,7 @@
#include <dm.h>
#include <dw_hdmi.h>
#include <edid.h>
+#include <malloc.h>
#include <regmap.h>
#include <syscon.h>
#include <asm/gpio.h>
diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c
index 4330725..8703df0 100644
--- a/drivers/video/rockchip/rk_edp.c
+++ b/drivers/video/rockchip/rk_edp.c
@@ -9,6 +9,7 @@
#include <display.h>
#include <dm.h>
#include <edid.h>
+#include <malloc.h>
#include <panel.h>
#include <regmap.h>
#include <syscon.h>
diff --git a/drivers/video/sandbox_osd.c b/drivers/video/sandbox_osd.c
index dd84489..7e72232 100644
--- a/drivers/video/sandbox_osd.c
+++ b/drivers/video/sandbox_osd.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <display.h>
#include <dm.h>
+#include <malloc.h>
#include <video_osd.h>
#include "sandbox_osd.h"
diff --git a/drivers/video/scf0403_lcd.c b/drivers/video/scf0403_lcd.c
index 58564e8..60075a6 100644
--- a/drivers/video/scf0403_lcd.c
+++ b/drivers/video/scf0403_lcd.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <malloc.h>
#include <asm/gpio.h>
#include <spi.h>
diff --git a/drivers/video/ssd2828.c b/drivers/video/ssd2828.c
index 4d40dca..83566bc 100644
--- a/drivers/video/ssd2828.c
+++ b/drivers/video/ssd2828.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <malloc.h>
#include <mipi_display.h>
#include <asm/arch/gpio.h>
#include <asm/gpio.h>
diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c
index 12895a8..ded03b1 100644
--- a/drivers/video/stm32/stm32_dsi.c
+++ b/drivers/video/stm32/stm32_dsi.c
@@ -20,6 +20,7 @@
#include <asm/io.h>
#include <asm/arch/gpio.h>
#include <dm/device-internal.h>
+#include <dm/device_compat.h>
#include <dm/lists.h>
#include <linux/iopoll.h>
#include <power/regulator.h>
diff --git a/drivers/video/stm32/stm32_ltdc.c b/drivers/video/stm32/stm32_ltdc.c
index 59ff692..be7e9bf 100644
--- a/drivers/video/stm32/stm32_ltdc.c
+++ b/drivers/video/stm32/stm32_ltdc.c
@@ -16,6 +16,7 @@
#include <asm/io.h>
#include <asm/arch/gpio.h>
#include <dm/device-internal.h>
+#include <dm/device_compat.h>
struct stm32_ltdc_priv {
void __iomem *regs;
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 12057c8..3d658e6 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <cpu_func.h>
#include <dm.h>
+#include <malloc.h>
#include <mapmem.h>
#include <stdio_dev.h>
#include <video.h>