video: omap-fb: Rework to enable COMPILE_TEST option
Subsystems (3)
PATCH 1/1 video: omap-fb: Rework to enable COMPILE_TEST option
To add a compilation check for the omap-fb driver, move the omap-fb.h header to a global location.
The "omap_add_display" function is used only for legacy boards, so we will move it to a common place for such calls (omap_devices.c).
Signed-off-by Alexander Shiyan <[email protected]>
---
arch/arm/boards/archosg9/board.c | 2 +-
.../boards/phytec-phycore-omap4460/board.c | 5 ++-
arch/arm/mach-omap/Makefile | 2 +-
arch/arm/mach-omap/include/mach/devices.h | 3 ++
arch/arm/mach-omap/omap_devices.c | 29 +++++++++++++++
arch/arm/mach-omap/omap_fb.c | 36 -------------------
drivers/video/Kconfig | 2 +-
drivers/video/omap.c | 3 +-
.../include/mach => include/video}/omap-fb.h | 10 ++----
9 files changed, 41 insertions(+), 51 deletions(-)
delete mode 100644 arch/arm/mach-omap/omap_fb.c
rename {arch/arm/mach-omap/include/mach => include/video}/omap-fb.h (80%)arch/arm/boards/archosg9/board.c +1 -1
@@ -5,10 +5,10 @@#include <init.h> #include <asm/armlinux.h> #include <generated/mach-types.h> +#include <mach/devices.h> #include <mach/omap4-silicon.h> #include <mach/omap4-devices.h> #include <mach/omap4_rom_usb.h> -#include <mach/omap-fb.h> #include <linux/sizes.h> #include <i2c/i2c.h> #include <gpio.h>
arch/arm/boards/phytec-phycore-omap4460/board.c +2 -3
@@ -10,10 +10,10 @@#include <envfs.h> #include <asm/armlinux.h> #include <generated/mach-types.h> +#include <mach/devices.h> #include <mach/omap4-silicon.h> #include <mach/omap4-devices.h> #include <mach/omap4-clock.h> -#include <mach/omap-fb.h> #include <mach/sdrc.h> #include <mach/sys_info.h> #include <mach/syslib.h>
@@ -292,8 +292,7 @@ static int pcm049_devices_init(void)armlinux_set_architecture (MACH_TYPE_PCM049 ); -if (IS_ENABLED (CONFIG_DRIVER_VIDEO_OMAP )) -omap_add_display (&pcm049_fb_data); +omap_add_display (&pcm049_fb_data);if (IS_ENABLED (CONFIG_DEFAULT_ENVIRONMENT_GENERIC ))defaultenv_append_directory (defaultenv_phytec_phycore_omap4460);
arch/arm/mach-omap/Makefile +1 -1
@@ -15,7 +15,7 @@ # GNU General Public License for more details. # # -obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o omap_fb.o +obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o pbl-$(CONFIG_ARCH_OMAP) += syslib.o obj-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o pbl-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
arch/arm/mach-omap/include/mach/devices.h +3 -0
@@ -4,6 +4,7 @@#define __MACH_OMAP_DEVICES_H#include <mach/omap_hsmmc.h> +#include <video/omap-fb.h> void omap_add_ram0 (resource_size_t size);
@@ -11,4 +12,6 @@ void omap_add_sram0(resource_size_t base, resource_size_t size);struct device_d *omap_add_uart (int id,unsigned long base); +struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata); +#endif /* __MACH_OMAP_DEVICES_H */
arch/arm/mach-omap/omap_devices.c +29 -0
@@ -26,3 +26,32 @@ struct device_d *omap_add_uart(int id, unsigned long base)return add_generic_device ("omap-uart" , id,NULL , base,1024 ,IORESOURCE_MEM |IORESOURCE_MEM_8BIT , &serial_plat); } + +#if defined(CONFIG_DRIVER_VIDEO_OMAP ) +static struct resource omapfb_resources[] = { + { + .name ="omap4_dss" , + .start =0x48040000 , + .end =0x48040000 +512 -1 , + .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , + }, { + .name ="omap4_dispc" , + .start =0x48041000 , + .end =0x48041000 +3072 -1 , + .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , + }, +}; + +struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) +{ +return add_generic_device_res ("omap_fb" ,-1 , + omapfb_resources, +ARRAY_SIZE (omapfb_resources), + o_pdata); +} +#else +struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) +{ +return NULL ; +} +#endif
arch/arm/mach-omap/omap_fb.c deleted +0 -36
@@ -1,36 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only - -#include <driver.h> -#include <common.h> -#include <linux/ioport.h> -#include <mach/omap-fb.h> - -#if defined(CONFIG_DRIVER_VIDEO_OMAP ) -static struct resource omapfb_resources[] = { - { - .name ="omap4_dss" , - .start =0x48040000 , - .end =0x48040000 +512 -1 , - .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , - }, { - .name ="omap4_dispc" , - .start =0x48041000 , - .end =0x48041000 +3072 -1 , - .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , - }, -}; - -struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) -{ -return add_generic_device_res ("omap_fb" ,-1 , - omapfb_resources, -ARRAY_SIZE (omapfb_resources), - o_pdata); -} -#else -struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) -{ -return NULL ; -} -#endif -EXPORT_SYMBOL (omap_add_display);
drivers/video/Kconfig +1 -1
@@ -75,7 +75,7 @@ config DRIVER_VIDEO_S3C24XX config DRIVER_VIDEO_OMAP bool "OMAP framebuffer driver" - depends on ARCH_OMAP4 + depends on ARCH_OMAP4 || COMPILE_TEST help Add support for OMAP Display Controller. Currently this driver only supports OMAP4 SoCs in DISPC parallel mode on
drivers/video/omap.c +1 -2
@@ -20,8 +20,7 @@#include <clock.h> #include <linux/err.h> -#include <mach/omap4-silicon.h> -#include <mach/omap-fb.h> +#include <video/omap-fb.h> #include <mmu.h>
include/video/omap-fb.h renamed from arch/arm/mach-omap/include/mach/omap-fb.h +3 -7
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H -#define H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H +#ifndef OMAP_FB_H +#define OMAP_FB_H #include <fb.h>
@@ -42,8 +42,4 @@ struct omapfb_platform_data { void (*enable)(int p); }; -struct device_d ; -struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata); - - -#endif /* H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H */ +#endif /* OMAP_FB_H */
Signature · 7 lines
2.32.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 6 lines · Alexander Shiyan
To add a compilation check for the omap-fb driver, move the
omap-fb.hheader to a global location.
The "omap_add_display" function is used only for legacy boards, so we will move it to a common place for such calls (omap_devices.c).Signed-off-by Alexander Shiyan <[email protected]>
Quoted 13 lines
---
arch/arm/boards/archosg9/board.c | 2 +-
.../boards/phytec-phycore-omap4460/board.c | 5 ++-
arch/arm/mach-omap/Makefile | 2 +-
arch/arm/mach-omap/include/mach/devices.h | 3 ++
arch/arm/mach-omap/omap_devices.c | 29 +++++++++++++++
arch/arm/mach-omap/omap_fb.c | 36 -------------------
drivers/video/Kconfig | 2 +-
drivers/video/omap.c | 3 +-
.../include/mach => include/video}/omap-fb.h | 10 ++----
9 files changed, 41 insertions(+), 51 deletions(-)
delete mode 100644 arch/arm/mach-omap/omap_fb.c
rename {arch/arm/mach-omap/include/mach => include/video}/omap-fb.h (80%)Applied, thanks
Sascha
Quoted 217 lines
arch/arm/boards/archosg9/board.c +1
-1@@ -5,10 +5,10 @@#include <init.h> #include <asm/armlinux.h> #include <generated/mach-types.h> +#include <mach/devices.h> #include <mach/omap4-silicon.h> #include <mach/omap4-devices.h> #include <mach/omap4_rom_usb.h> -#include <mach/omap-fb.h> #include <linux/sizes.h> #include <i2c/i2c.h> #include <gpio.h> arch/arm/boards/phytec-phycore-omap4460/board.c +2
-3@@ -10,10 +10,10 @@#include <envfs.h> #include <asm/armlinux.h> #include <generated/mach-types.h> +#include <mach/devices.h> #include <mach/omap4-silicon.h> #include <mach/omap4-devices.h> #include <mach/omap4-clock.h> -#include <mach/omap-fb.h> #include <mach/sdrc.h> #include <mach/sys_info.h> #include <mach/syslib.h> @@ -292,8 +292,7 @@ static int pcm049_devices_init(void)armlinux_set_architecture (MACH_TYPE_PCM049 ); -if (IS_ENABLED (CONFIG_DRIVER_VIDEO_OMAP )) -omap_add_display (&pcm049_fb_data); +omap_add_display (&pcm049_fb_data);if (IS_ENABLED (CONFIG_DEFAULT_ENVIRONMENT_GENERIC ))defaultenv_append_directory (defaultenv_phytec_phycore_omap4460);arch/arm/mach-omap/Makefile +1
-1@@ -15,7 +15,7 @@ # GNU General Public License for more details. # # -obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o omap_fb.o +obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o pbl-$(CONFIG_ARCH_OMAP) += syslib.o obj-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o pbl-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.oarch/arm/mach-omap/include/mach/devices.h +3
-0@@ -4,6 +4,7 @@#define __MACH_OMAP_DEVICES_H#include <mach/omap_hsmmc.h> +#include <video/omap-fb.h> void omap_add_ram0 (resource_size_t size);@@ -11,4 +12,6 @@ void omap_add_sram0(resource_size_t base, resource_size_t size);struct device_d *omap_add_uart (int id,unsigned long base); +struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata); +#endif /* __MACH_OMAP_DEVICES_H */ arch/arm/mach-omap/omap_devices.c +29
-0@@ -26,3 +26,32 @@ struct device_d *omap_add_uart(int id, unsigned long base)return add_generic_device ("omap-uart" , id,NULL , base,1024 ,IORESOURCE_MEM |IORESOURCE_MEM_8BIT , &serial_plat); } + +#if defined(CONFIG_DRIVER_VIDEO_OMAP ) +static struct resource omapfb_resources[] = { + { + .name ="omap4_dss" , + .start =0x48040000 , + .end =0x48040000 +512 -1 , + .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , + }, { + .name ="omap4_dispc" , + .start =0x48041000 , + .end =0x48041000 +3072 -1 , + .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , + }, +}; + +struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) +{ +return add_generic_device_res ("omap_fb" ,-1 , + omapfb_resources, +ARRAY_SIZE (omapfb_resources), + o_pdata); +} +#else +struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) +{ +return NULL ; +} +#endif arch/arm/mach-omap/omap_fb.c deleted +0
-36@@ -1,36 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only - -#include <driver.h> -#include <common.h> -#include <linux/ioport.h> -#include <mach/omap-fb.h> - -#if defined(CONFIG_DRIVER_VIDEO_OMAP ) -static struct resource omapfb_resources[] = { - { - .name ="omap4_dss" , - .start =0x48040000 , - .end =0x48040000 +512 -1 , - .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , - }, { - .name ="omap4_dispc" , - .start =0x48041000 , - .end =0x48041000 +3072 -1 , - .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , - }, -}; - -struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) -{ -return add_generic_device_res ("omap_fb" ,-1 , - omapfb_resources, -ARRAY_SIZE (omapfb_resources), - o_pdata); -} -#else -struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata) -{ -return NULL ; -} -#endif -EXPORT_SYMBOL (omap_add_display);drivers/video/Kconfig +1
-1@@ -75,7 +75,7 @@ config DRIVER_VIDEO_S3C24XX config DRIVER_VIDEO_OMAP bool "OMAP framebuffer driver" - depends on ARCH_OMAP4 + depends on ARCH_OMAP4 || COMPILE_TEST help Add support for OMAP Display Controller. Currently this driver only supports OMAP4 SoCs in DISPC parallel mode ondrivers/video/omap.c +1
-2@@ -20,8 +20,7 @@#include <clock.h> #include <linux/err.h> -#include <mach/omap4-silicon.h> -#include <mach/omap-fb.h> +#include <video/omap-fb.h> #include <mmu.h> include/video/omap-fb.h renamed from arch/arm/mach-omap/include/mach/omap-fb.h +3
-7@@ -1,7 +1,7 @@/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H -#define H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H +#ifndef OMAP_FB_H +#define OMAP_FB_H #include <fb.h> @@ -42,8 +42,4 @@ struct omapfb_platform_data { void (*enable)(int p); }; -struct device_d ; -struct device_d *omap_add_display (struct omapfb_platform_data *o_pdata); - - -#endif /* H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_FB4_H */ +#endif /* OMAP_FB_H */ Signature · 7 lines
2.32.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox