Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2746788rwd; Mon, 22 May 2023 03:53:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5FwpxcMQ2+UZFerzG/9rSY8nt9BbatdNNz66jXReEmJkH1tFvE7LVeN3Hb4V+G7+C5k1n1 X-Received: by 2002:a17:902:e74c:b0:1af:a349:3f0d with SMTP id p12-20020a170902e74c00b001afa3493f0dmr6596417plf.23.1684752823321; Mon, 22 May 2023 03:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684752823; cv=none; d=google.com; s=arc-20160816; b=XUQ4pF7xqwW0/XVsfAUW+DDJ7kOXEfUmnVQVLIPpoSxGet0cl1XRDIu2xHMFLLdfKf WbMBr8wYWAmRu+NNtmXn2DK6wMjgZDcezzaWX1iCowZFbZIVo79ARjq6zbcitVoDB8/K dL+gCHukBrbqVbm8EAnssfpOy7EIsEtHsXhBAAOjgMbVDqM/Lp5ZBfEbx4WAp5DpD1Sw y5nzCANgITyVT8fF1qmMypG5jK23NI9h+wpD13URfkNiU852uFoVQzYzexHbHhT0SOG/ XTVz2hjZiMF0eyX1JxrRD0VjMukUhBLLKSx+SlMIcGzW9SaUWELaP63UtpX7GrVoO6lo UiLQ== 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=Q3KezN7Dg1yUy1aoxJvKOm2EF7m5HjkM4ODXo76O98U=; b=DIX1kW3hxcaIGfLT/KftvunmoX6pssHPsRcNZhcUe3QzTE0y2SLxbjWeBW35SRi8co w/rh9W5bOigjRmqMMnYBehs1/OKBopN/YBTQWLYnl9lN7x7PMwUPhGFwbRKm2jAViNBy MGw53lVOULXXL8Q1LChIbAhHvoliZQqN+DS20A0qd2SLS+vxDytY6NSUXUgCuyUaeiXG 88sn0uzjQXto+ptrygymhhhF7JdpTTyzoBppgER7AJaOjzvxQDDtW9A/3Z5XiZ/bPYVm +N8A1Kpp8/jdhz5JVXCdmZFUPkOHwaX3Fox+n9iiPeD+1MPrQBuLQt61wX9g5A7StN9j pWPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=trCFkXUK; 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 i11-20020a170902c94b00b001a6bb44db86si4688612pla.226.2023.05.22.03.53.28; Mon, 22 May 2023 03:53:43 -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=trCFkXUK; 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 S231873AbjEVKwZ (ORCPT + 99 others); Mon, 22 May 2023 06:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbjEVKvr (ORCPT ); Mon, 22 May 2023 06:51:47 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE32818C; Mon, 22 May 2023 03:51:24 -0700 (PDT) Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34M9Melt006230; Mon, 22 May 2023 10:51:11 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=Q3KezN7Dg1yUy1aoxJvKOm2EF7m5HjkM4ODXo76O98U=; b=trCFkXUKh2HvDN0cfAScvmCvd5YCw6TxpzX8KWyc361jr2phEn4JZxp2B1z3CT+a15br q3jIkT/3GcXIM/fK8S3D42FIh3A69VpJpkDq4UI2b0yHDttgNESLJJLgQ0SXhg7r7XwP 8xxC1jOLREwGOpcWsxAlKo3v6jYAieU3pziWFp+wpOuJmJJw1YFN0aszaxb/eaOeTB7u niXUAfAXLblgdbplnHlIa0Up49k2GbRVY9+YPoGTD51550C22nEeklxcagWTA6VhLiak I5IWMBle84gBcv8sbIB3m3a7Tnz1hUo+7i5TQrls4Ypvb+papKBCWAYSoLhQEcvgkkGL JQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqgk8s30a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:10 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34MAbZ1h023711; Mon, 22 May 2023 10:51:10 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqgk8s2y8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:09 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34M3tYdn009545; Mon, 22 May 2023 10:51:07 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3qppcu8wev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:07 +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 34MAp35o4981324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2023 10:51:03 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0FBC620043; Mon, 22 May 2023 10:51:03 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A18D020040; Mon, 22 May 2023 10:51:02 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 May 2023 10:51:02 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann , Dmitry Torokhov Cc: Greg Kroah-Hartman , 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-input@vger.kernel.org Subject: [PATCH v5 16/44] Input: gameport: add ISA and HAS_IOPORT dependencies Date: Mon, 22 May 2023 12:50:21 +0200 Message-Id: <20230522105049.1467313-17-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522105049.1467313-1-schnelle@linux.ibm.com> References: <20230522105049.1467313-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ExqTYt-CoUFf4bJE6m43wER4NUh7sT72 X-Proofpoint-ORIG-GUID: tWu58CQLcge7w6zm95HQnBPwAFb8mrPB 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-22_06,2023-05-22_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 adultscore=0 impostorscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305220089 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. As ISA already implies HAS_IOPORT we can simply add this dependency and guard sections of code using inb()/outb() as alternative access methods. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle --- drivers/input/gameport/Kconfig | 4 +++- include/linux/gameport.h | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/input/gameport/Kconfig b/drivers/input/gameport/Kconfig index 5a2c2fb3217d..fe73b26e647a 100644 --- a/drivers/input/gameport/Kconfig +++ b/drivers/input/gameport/Kconfig @@ -25,6 +25,7 @@ if GAMEPORT config GAMEPORT_NS558 tristate "Classic ISA and PnP gameport support" + depends on ISA help Say Y here if you have an ISA or PnP gameport. @@ -35,6 +36,7 @@ config GAMEPORT_NS558 config GAMEPORT_L4 tristate "PDPI Lightning 4 gamecard support" + depends on ISA help Say Y here if you have a PDPI Lightning 4 gamecard. @@ -53,7 +55,7 @@ config GAMEPORT_EMU10K1 config GAMEPORT_FM801 tristate "ForteMedia FM801 gameport support" - depends on PCI + depends on PCI && HAS_IOPORT help Say Y here if you have ForteMedia FM801 PCI audio controller (Abit AU10, Genius Sound Maker, HP Workstation zx2000, diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 8c2f00018e89..4d5720022b63 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -167,16 +167,21 @@ static inline void gameport_trigger(struct gameport *gameport) { if (gameport->trigger) gameport->trigger(gameport); +#ifdef CONFIG_HAS_IOPORT else outb(0xff, gameport->io); +#endif } static inline unsigned char gameport_read(struct gameport *gameport) { if (gameport->read) return gameport->read(gameport); - else - return inb(gameport->io); +#ifdef CONFIG_HAS_IOPORT + return inb(gameport->io); +#else + return 0xff; +#endif } static inline int gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons) -- 2.39.2