Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp518497rwd; Tue, 16 May 2023 04:31:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7iMUbTPQ4e6ZMVCwwTPxOD7Ym0sU0OBRmpv64GsXuDW4vM031n4aNPodiDcPmxsgcBZLMp X-Received: by 2002:a17:90b:c15:b0:252:aac9:8748 with SMTP id bp21-20020a17090b0c1500b00252aac98748mr14784090pjb.25.1684236707412; Tue, 16 May 2023 04:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684236707; cv=none; d=google.com; s=arc-20160816; b=TCCSYauArqTUsYuVoFQuYzYpteFDykHtAshuGZm0OmFlwhXF5s31ZLsO+/82LcduQc 6grQNoG4F+JXJ6gK4eHR1307ye5oVtYLz++oed9C2qlK1NH2ziJIBtvfcrb3BkTEOfIb xzmPCEI6KK6HQ/cK2bAk7Un1klpTHP6C+oW+LK81HX9wscSyLBbl7NNe3PBI4QqeaJZg 29lmOvzk/JARzCiWR8Xh8LaT91k/BWRKvcCbCHeoGB9oLEEvwG0f8I2uN2RAifbmRBXV dXlefiIJ70eVK1w4/wUEP4K7gboujVeTGePW83BXiQVsOq2xuRWsZuq6tm7mNnyD52ls sVtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GddyyZp53XCFbHA+UlfqwnCOM642C8kJwAI7G8A4EMc=; b=iuBsm9GSp9RUyShWbxvfP7TCG4mcYGiWG5U7ObqxXCTZHQq1O7TmIJvYdggBHNayUB v9j+qqRSpfpCGJ0kWEVXS2SOzoehka79ZjGXlb3rL/tYQuwM+zhu1cfU1JjUGiJp2AX+ MMaZzBhWtsogAXjzvJtQpNCg2fUAOe0M8OMmudWHGc6fISFSvTCY8AlRIXMkvztKvvtA gouHZ9R/V9Us/1tFpRsNHunMWis3Ksqcfn1M2vKAFAvIRHOSeSvrTJjOX25VLnBcxUqW YADmq88SCixxrke+PtXmltSECbazjFYlKal16XXmsV91aZGfKdN1sMSoBVfw+9le3Mz0 6eQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gCUXaNwS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a63e113000000b00530878c182fsi11502160pgh.289.2023.05.16.04.31.33; Tue, 16 May 2023 04:31:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gCUXaNwS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232691AbjEPLFT (ORCPT + 99 others); Tue, 16 May 2023 07:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232685AbjEPLE0 (ORCPT ); Tue, 16 May 2023 07:04:26 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88CC740E1; Tue, 16 May 2023 04:02:27 -0700 (PDT) Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GB0ZBe006778; Tue, 16 May 2023 11:01:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=GddyyZp53XCFbHA+UlfqwnCOM642C8kJwAI7G8A4EMc=; b=gCUXaNwSIz7+jEsbulc9asFmZVZnkfRExcJPKCi2LZ7q6fjogDFFtcMc5NZX8u7C34aa pax2vBoab/3Tiv8kP5+wKloJjrcmQkI9jvR6rTHNxpvh7W9n0Pu32/Ba+fnZk+asBXAy xh4LEEtczaa+hPFM3IAJv5e2rEt0FRKC8nY2PpPtGC8Gz1c1Owe6mq/jzzjAypQcDIAl o70CAFdeCA/VAtZ0HYE6LvyySNt1f4uy/zn8xeqgFfDOAcim78wD8DOZib1FUr6Xx9TM G3ID2KAc0cm9ssCmX4YSdrnXU5iGYMI7KpKOMykPR+PPNdsaSAzwx48zr4rFLaBsuvIS 2g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm8fbg74x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:01:22 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34GAunC1023215; Tue, 16 May 2023 11:01:21 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm8fbg734-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:01:21 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34G2udTA003251; Tue, 16 May 2023 11:01:18 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3qj264sanj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:01:17 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34GB1FVq21562020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 May 2023 11:01:15 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 184652004D; Tue, 16 May 2023 11:01:14 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B2DDA20043; Tue, 16 May 2023 11:01:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 16 May 2023 11:01:13 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann , Greg Kroah-Hartman , Helge Deller Cc: Bjorn Helgaas , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Mauro Carvalho Chehab , Alan Stern , "Rafael J. Wysocki" , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v4 38/41] video: handle HAS_IOPORT dependencies Date: Tue, 16 May 2023 13:00:34 +0200 Message-Id: <20230516110038.2413224-39-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516110038.2413224-1-schnelle@linux.ibm.com> References: <20230516110038.2413224-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: U1BF03WUwsRAJC7EFdeMORFIt9tVSYzq X-Proofpoint-GUID: Afhtb4-lw9ZZ9X_W50Hk2yC0c11v-7gL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-16_04,2023-05-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxscore=0 clxscore=1015 adultscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 priorityscore=1501 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305160089 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle --- Note: The HAS_IOPORT Kconfig option was added in v6.4-rc1 so per-subsystem patches may be applied independently drivers/video/console/Kconfig | 1 + drivers/video/fbdev/Kconfig | 21 +++++++++++---------- include/video/vga.h | 8 ++++++++ 3 files changed, 20 insertions(+), 10 deletions(-) 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 diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 96e91570cdd3..a56c57dd839b 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 @@ -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 diff --git a/include/video/vga.h b/include/video/vga.h index 947c0abd04ef..f4b806b85c86 100644 --- a/include/video/vga.h +++ b/include/video/vga.h @@ -203,18 +203,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.39.2