lkml.org 
[lkml]   [2021]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 22/32] video: handle HAS_IOPORT dependencies
Date
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
not being declared. We thus need to add HAS_IOPORT as dependency for
those drivers using them and guard inline code in headers.

Co-developed-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
drivers/video/fbdev/Kconfig | 1 +
include/video/vga.h | 8 ++++++++
2 files changed, 9 insertions(+)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index a3446d44c118..d95f638f4deb 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -436,6 +436,7 @@ config FB_FM2
config FB_ARC
tristate "Arc Monochrome LCD board support"
depends on FB && (X86 || COMPILE_TEST)
+ depends on HAS_IOPORT
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
diff --git a/include/video/vga.h b/include/video/vga.h
index d334e64c1c19..53cb52c0fddb 100644
--- a/include/video/vga.h
+++ b/include/video/vga.h
@@ -201,18 +201,26 @@ extern int restore_vga(struct vgastate *state);

static inline unsigned char vga_io_r (unsigned short port)
{
+#ifdef CONFIG_HAS_IOPORT
return inb_p(port);
+#else
+ return 0xff;
+#endif
}

static inline void vga_io_w (unsigned short port, unsigned char val)
{
+#ifdef CONFIG_HAS_IOPORT
outb_p(val, port);
+#endif
}

static inline void vga_io_w_fast (unsigned short port, unsigned char reg,
unsigned char val)
{
+#ifdef CONFIG_HAS_IOPORT
outw(VGA_OUT16VAL (val, reg), port);
+#endif
}

static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
--
2.32.0
\
 
 \ /
  Last update: 2021-12-27 17:46    [W:0.414 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site