From 2fd001cd36005846caa6456fff1008c6f5bae9d4 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 29 Mar 2024 21:32:12 +0100 Subject: arch: Rename fbdev header and source files The per-architecture fbdev code has no dependencies on fbdev and can be used for any video-related subsystem. Rename the files to 'video'. Use video-sti.c on parisc as the source file depends on CONFIG_STI_CORE. On arc, arm, arm64, sh, and um the asm header file is an empty wrapper around the file in asm-generic. Let Kbuild generate the file. The build system does this automatically. Only um needs to generate video.h explicitly, so that it overrides the host architecture's header. The latter would otherwise interfere with the build. Further update all includes statements, include guards, and Makefiles. Also update a few strings and comments to refer to video instead of fbdev. v3: - arc, arm, arm64, sh: generate asm header via build system (Sam, Helge, Arnd) - um: rename fb.h to video.h - fix typo in commit message (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Cc: Vineet Gupta Cc: Catalin Marinas Cc: Will Deacon Cc: Huacai Chen Cc: WANG Xuerui Cc: Geert Uytterhoeven Cc: Thomas Bogendoerfer Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: "David S. Miller" Cc: Andreas Larsson Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Arnd Bergmann --- arch/sparc/include/asm/fb.h | 45 ------------------------------------------ arch/sparc/include/asm/video.h | 45 ++++++++++++++++++++++++++++++++++++++++++ arch/sparc/video/Makefile | 2 +- arch/sparc/video/fbdev.c | 25 ----------------------- arch/sparc/video/video.c | 25 +++++++++++++++++++++++ 5 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 arch/sparc/include/asm/fb.h create mode 100644 arch/sparc/include/asm/video.h delete mode 100644 arch/sparc/video/fbdev.c create mode 100644 arch/sparc/video/video.c (limited to 'arch/sparc') diff --git a/arch/sparc/include/asm/fb.h b/arch/sparc/include/asm/fb.h deleted file mode 100644 index 07f0325d6921..000000000000 --- a/arch/sparc/include/asm/fb.h +++ /dev/null @@ -1,45 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _SPARC_FB_H_ -#define _SPARC_FB_H_ - -#include -#include - -#include - -struct device; - -#ifdef CONFIG_SPARC32 -static inline pgprot_t pgprot_framebuffer(pgprot_t prot, - unsigned long vm_start, unsigned long vm_end, - unsigned long offset) -{ - return prot; -} -#define pgprot_framebuffer pgprot_framebuffer -#endif - -bool video_is_primary_device(struct device *dev); -#define video_is_primary_device video_is_primary_device - -static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n) -{ - sbus_memcpy_fromio(to, from, n); -} -#define fb_memcpy_fromio fb_memcpy_fromio - -static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n) -{ - sbus_memcpy_toio(to, from, n); -} -#define fb_memcpy_toio fb_memcpy_toio - -static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n) -{ - sbus_memset_io(addr, c, n); -} -#define fb_memset fb_memset_io - -#include - -#endif /* _SPARC_FB_H_ */ diff --git a/arch/sparc/include/asm/video.h b/arch/sparc/include/asm/video.h new file mode 100644 index 000000000000..a6f48f52db58 --- /dev/null +++ b/arch/sparc/include/asm/video.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _SPARC_VIDEO_H_ +#define _SPARC_VIDEO_H_ + +#include +#include + +#include + +struct device; + +#ifdef CONFIG_SPARC32 +static inline pgprot_t pgprot_framebuffer(pgprot_t prot, + unsigned long vm_start, unsigned long vm_end, + unsigned long offset) +{ + return prot; +} +#define pgprot_framebuffer pgprot_framebuffer +#endif + +bool video_is_primary_device(struct device *dev); +#define video_is_primary_device video_is_primary_device + +static inline void fb_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n) +{ + sbus_memcpy_fromio(to, from, n); +} +#define fb_memcpy_fromio fb_memcpy_fromio + +static inline void fb_memcpy_toio(volatile void __iomem *to, const void *from, size_t n) +{ + sbus_memcpy_toio(to, from, n); +} +#define fb_memcpy_toio fb_memcpy_toio + +static inline void fb_memset_io(volatile void __iomem *addr, int c, size_t n) +{ + sbus_memset_io(addr, c, n); +} +#define fb_memset fb_memset_io + +#include + +#endif /* _SPARC_VIDEO_H_ */ diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile index 9dd82880a027..fdf83a408d75 100644 --- a/arch/sparc/video/Makefile +++ b/arch/sparc/video/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-y += fbdev.o +obj-y += video.o diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/fbdev.c deleted file mode 100644 index e46f0499c277..000000000000 --- a/arch/sparc/video/fbdev.c +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include -#include - -#include -#include - -bool video_is_primary_device(struct device *dev) -{ - struct device_node *node = dev->of_node; - - if (console_set_on_cmdline) - return false; - - if (node && node == of_console_device) - return true; - - return false; -} -EXPORT_SYMBOL(video_is_primary_device); - -MODULE_DESCRIPTION("Sparc fbdev helpers"); -MODULE_LICENSE("GPL"); diff --git a/arch/sparc/video/video.c b/arch/sparc/video/video.c new file mode 100644 index 000000000000..2414380caadc --- /dev/null +++ b/arch/sparc/video/video.c @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include + +#include +#include + +bool video_is_primary_device(struct device *dev) +{ + struct device_node *node = dev->of_node; + + if (console_set_on_cmdline) + return false; + + if (node && node == of_console_device) + return true; + + return false; +} +EXPORT_SYMBOL(video_is_primary_device); + +MODULE_DESCRIPTION("Sparc video helpers"); +MODULE_LICENSE("GPL"); -- cgit v1.2.3