* [PATCH v5 34/44] staging: add HAS_IOPORT dependencies
[not found] <20230522105049.1467313-1-schnelle@linux.ibm.com>
@ 2023-05-22 10:50 ` Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 39/44] vgacon: " Niklas Schnelle
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: Niklas Schnelle @ 2023-05-22 10:50 UTC (permalink / raw)
To: Arnd Bergmann, Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman,
Forest Bond
Cc: Bjorn Helgaas, Uwe Kleine-König, Mauro Carvalho Chehab,
Alan Stern, Rafael J. Wysocki, Geert Uytterhoeven, Paul Walmsley,
Palmer Dabbelt, Albert Ou, linux-kernel, linux-arch, linux-pci,
Arnd Bergmann, linux-fbdev, linux-staging
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.
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/staging/sm750fb/Kconfig | 2 +-
drivers/staging/vt6655/Kconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig
index 1461c89701c3..ab3d9b057d56 100644
--- a/drivers/staging/sm750fb/Kconfig
+++ b/drivers/staging/sm750fb/Kconfig
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
config FB_SM750
tristate "Silicon Motion SM750 framebuffer support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_MODE_HELPERS
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
diff --git a/drivers/staging/vt6655/Kconfig b/drivers/staging/vt6655/Kconfig
index d1cd5de46dcf..077f62ebe80c 100644
--- a/drivers/staging/vt6655/Kconfig
+++ b/drivers/staging/vt6655/Kconfig
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
config VT6655
tristate "VIA Technologies VT6655 support"
- depends on PCI && MAC80211 && m
+ depends on PCI && HAS_IOPORT && MAC80211 && m
help
This is a vendor-written driver for VIA VT6655.
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v5 39/44] vgacon: add HAS_IOPORT dependencies
[not found] <20230522105049.1467313-1-schnelle@linux.ibm.com>
2023-05-22 10:50 ` [PATCH v5 34/44] staging: add HAS_IOPORT dependencies Niklas Schnelle
@ 2023-05-22 10:50 ` Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 40/44] fbdev: " Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 41/44] video: Handle " Niklas Schnelle
3 siblings, 0 replies; 4+ messages in thread
From: Niklas Schnelle @ 2023-05-22 10:50 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman, Helge Deller
Cc: Bjorn Helgaas, Uwe Kleine-König, Mauro Carvalho Chehab,
Alan Stern, Rafael J. Wysocki, Geert Uytterhoeven, Paul Walmsley,
Palmer Dabbelt, Albert Ou, linux-kernel, linux-arch, linux-pci,
Arnd Bergmann, linux-fbdev, dri-devel
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.
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/console/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 22cea5082ac4..64974eaa3ac5 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -10,6 +10,7 @@ config VGA_CONSOLE
depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !SUPERH && \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
!ARM64 && !ARC && !MICROBLAZE && !OPENRISC && !S390 && !UML
+ depends on HAS_IOPORT
select APERTURE_HELPERS if (DRM || FB || VFIO_PCI_CORE)
default y
help
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v5 40/44] fbdev: add HAS_IOPORT dependencies
[not found] <20230522105049.1467313-1-schnelle@linux.ibm.com>
2023-05-22 10:50 ` [PATCH v5 34/44] staging: add HAS_IOPORT dependencies Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 39/44] vgacon: " Niklas Schnelle
@ 2023-05-22 10:50 ` Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 41/44] video: Handle " Niklas Schnelle
3 siblings, 0 replies; 4+ messages in thread
From: Niklas Schnelle @ 2023-05-22 10:50 UTC (permalink / raw)
To: Arnd Bergmann, Helge Deller
Cc: Greg Kroah-Hartman, Bjorn Helgaas, Uwe Kleine-König,
Mauro Carvalho Chehab, Alan Stern, Rafael J. Wysocki,
Geert Uytterhoeven, Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-kernel, linux-arch, linux-pci, Arnd Bergmann, linux-fbdev,
dri-devel
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.
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 | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 0fdf5f46802c..4eea398ebbfe 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -335,7 +335,7 @@ config FB_IMX
config FB_CYBER2000
tristate "CyberPro 2000/2010/5000 support"
- depends on FB && PCI && (BROKEN || !SPARC64)
+ depends on FB && PCI && HAS_IOPORT && (BROKEN || !SPARC64)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -429,6 +429,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
@@ -531,7 +532,7 @@ config FB_IMSTT
config FB_VGA16
tristate "VGA 16-color graphics support"
- depends on FB && (X86 || PPC)
+ depends on FB && HAS_IOPORT
select APERTURE_HELPERS
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
@@ -1332,7 +1333,7 @@ config FB_ATY_BACKLIGHT
config FB_S3
tristate "S3 Trio/Virge support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1393,7 +1394,7 @@ config FB_SAVAGE_ACCEL
config FB_SIS
tristate "SiS/XGI display support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1424,7 +1425,7 @@ config FB_SIS_315
config FB_VIA
tristate "VIA UniChrome (Pro) and Chrome9 display support"
- depends on FB && PCI && GPIOLIB && I2C && (X86 || COMPILE_TEST)
+ depends on FB && PCI && GPIOLIB && I2C && HAS_IOPORT && (X86 || COMPILE_TEST)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1463,7 +1464,7 @@ endif
config FB_NEOMAGIC
tristate "NeoMagic display support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_MODE_HELPERS
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
@@ -1493,7 +1494,7 @@ config FB_KYRO
config FB_3DFX
tristate "3Dfx Banshee/Voodoo3/Voodoo5 display support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_CFB_IMAGEBLIT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
@@ -1543,7 +1544,7 @@ config FB_VOODOO1
config FB_VT8623
tristate "VIA VT8623 support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1558,7 +1559,7 @@ config FB_VT8623
config FB_TRIDENT
tristate "Trident/CyberXXX/CyberBlade support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -1581,7 +1582,7 @@ config FB_TRIDENT
config FB_ARK
tristate "ARK 2000PV support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -2195,7 +2196,7 @@ config FB_SSD1307
config FB_SM712
tristate "Silicon Motion SM712 framebuffer support"
- depends on FB && PCI
+ depends on FB && PCI && HAS_IOPORT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v5 41/44] video: Handle HAS_IOPORT dependencies
[not found] <20230522105049.1467313-1-schnelle@linux.ibm.com>
` (2 preceding siblings ...)
2023-05-22 10:50 ` [PATCH v5 40/44] fbdev: " Niklas Schnelle
@ 2023-05-22 10:50 ` Niklas Schnelle
3 siblings, 0 replies; 4+ messages in thread
From: Niklas Schnelle @ 2023-05-22 10:50 UTC (permalink / raw)
To: Arnd Bergmann, Helge Deller
Cc: Greg Kroah-Hartman, Bjorn Helgaas, Uwe Kleine-König,
Mauro Carvalho Chehab, Alan Stern, Rafael J. Wysocki,
Geert Uytterhoeven, Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-kernel, linux-arch, linux-pci, Arnd Bergmann, linux-fbdev,
dri-devel
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
not being declared. We thus need to #ifdef functions and their callsites
which unconditionally use these I/O accessors. In the
include/video/vga.h these are conveniently all those functions with the
vga_io_* prefix.
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 | 3 ++-
include/video/vga.h | 35 +++++++++++++++++++++++++----------
2 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 4eea398ebbfe..598d06bddf6a 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -532,7 +532,8 @@ config FB_IMSTT
config FB_VGA16
tristate "VGA 16-color graphics support"
- depends on FB && HAS_IOPORT
+ depends on FB && (X86 || PPC)
+ depends on HAS_IOPORT
select APERTURE_HELPERS
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
diff --git a/include/video/vga.h b/include/video/vga.h
index 947c0abd04ef..ed89295941c4 100644
--- a/include/video/vga.h
+++ b/include/video/vga.h
@@ -201,6 +201,7 @@ extern int restore_vga(struct vgastate *state);
* generic VGA port read/write
*/
+#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_r (unsigned short port)
{
return inb_p(port);
@@ -210,12 +211,12 @@ static inline void vga_io_w (unsigned short port, unsigned char val)
{
outb_p(val, port);
}
-
static inline void vga_io_w_fast (unsigned short port, unsigned char reg,
unsigned char val)
{
outw(VGA_OUT16VAL (val, reg), port);
}
+#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
{
@@ -235,28 +236,34 @@ static inline void vga_mm_w_fast (void __iomem *regbase, unsigned short port,
static inline unsigned char vga_r (void __iomem *regbase, unsigned short port)
{
- if (regbase)
- return vga_mm_r (regbase, port);
- else
+#ifdef CONFIG_HAS_IOPORT
+ if (!regbase)
return vga_io_r (port);
+ else
+#endif /* CONFIG_HAS_IOPORT */
+ return vga_mm_r (regbase, port);
}
static inline void vga_w (void __iomem *regbase, unsigned short port, unsigned char val)
{
- if (regbase)
- vga_mm_w (regbase, port, val);
- else
+#ifdef CONFIG_HAS_IOPORT
+ if (!regbase)
vga_io_w (port, val);
+ else
+#endif /* CONFIG_HAS_IOPORT */
+ vga_mm_w (regbase, port, val);
}
static inline void vga_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val)
{
- if (regbase)
- vga_mm_w_fast (regbase, port, reg, val);
- else
+#ifdef CONFIG_HAS_IOPORT
+ if (!regbase)
vga_io_w_fast (port, reg, val);
+ else
+#endif /* CONFIG_HAS_IOPORT */
+ vga_mm_w_fast (regbase, port, reg, val);
}
@@ -280,6 +287,7 @@ static inline void vga_wcrt (void __iomem *regbase, unsigned char reg, unsigned
#endif /* VGA_OUTW_WRITE */
}
+#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rcrt (unsigned char reg)
{
vga_io_w (VGA_CRT_IC, reg);
@@ -295,6 +303,7 @@ static inline void vga_io_wcrt (unsigned char reg, unsigned char val)
vga_io_w (VGA_CRT_DC, val);
#endif /* VGA_OUTW_WRITE */
}
+#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rcrt (void __iomem *regbase, unsigned char reg)
{
@@ -333,6 +342,7 @@ static inline void vga_wseq (void __iomem *regbase, unsigned char reg, unsigned
#endif /* VGA_OUTW_WRITE */
}
+#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rseq (unsigned char reg)
{
vga_io_w (VGA_SEQ_I, reg);
@@ -348,6 +358,7 @@ static inline void vga_io_wseq (unsigned char reg, unsigned char val)
vga_io_w (VGA_SEQ_D, val);
#endif /* VGA_OUTW_WRITE */
}
+#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rseq (void __iomem *regbase, unsigned char reg)
{
@@ -385,6 +396,7 @@ static inline void vga_wgfx (void __iomem *regbase, unsigned char reg, unsigned
#endif /* VGA_OUTW_WRITE */
}
+#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rgfx (unsigned char reg)
{
vga_io_w (VGA_GFX_I, reg);
@@ -400,6 +412,7 @@ static inline void vga_io_wgfx (unsigned char reg, unsigned char val)
vga_io_w (VGA_GFX_D, val);
#endif /* VGA_OUTW_WRITE */
}
+#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rgfx (void __iomem *regbase, unsigned char reg)
{
@@ -434,6 +447,7 @@ static inline void vga_wattr (void __iomem *regbase, unsigned char reg, unsigned
vga_w (regbase, VGA_ATT_W, val);
}
+#ifdef CONFIG_HAS_IOPORT
static inline unsigned char vga_io_rattr (unsigned char reg)
{
vga_io_w (VGA_ATT_IW, reg);
@@ -445,6 +459,7 @@ static inline void vga_io_wattr (unsigned char reg, unsigned char val)
vga_io_w (VGA_ATT_IW, reg);
vga_io_w (VGA_ATT_W, val);
}
+#endif /* CONFIG_HAS_IOPORT */
static inline unsigned char vga_mm_rattr (void __iomem *regbase, unsigned char reg)
{
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-22 10:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230522105049.1467313-1-schnelle@linux.ibm.com>
2023-05-22 10:50 ` [PATCH v5 34/44] staging: add HAS_IOPORT dependencies Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 39/44] vgacon: " Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 40/44] fbdev: " Niklas Schnelle
2023-05-22 10:50 ` [PATCH v5 41/44] video: Handle " Niklas Schnelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).