From patchwork Tue May 16 11:00:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Schnelle X-Patchwork-Id: 94646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp347433vqo; Tue, 16 May 2023 04:22:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xfcfImsORBDlF+Yu1L5+Eff0hQBNdnNCFfj1isEXY5Wr/Ltlv9X+IuKNruDtrOFVpGfdd X-Received: by 2002:a05:6a20:8404:b0:105:f40f:c234 with SMTP id c4-20020a056a20840400b00105f40fc234mr8710367pzd.17.1684236156542; Tue, 16 May 2023 04:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684236156; cv=none; d=google.com; s=arc-20160816; b=HWW5JS0TjqMB9dKkr8Sy64hijGbzBKUNDFWSa8+EQ4U8aggNLDQiKkwtdivZqt9Esv gQq68bzfoHDpIRib9/pNBOPHsP5jK7VmEjU0RmVCqzTZ+MD+3nG85axYT2URey4yG8Ys ZWWXWe6Y1DpXoAGVtj4sMKLB7fxw6R0WvEwwmbkwXtWDS1k79YVyQGw/2yx87Zj4B5Y9 IvFs3PKb+CVm8WcJhWFLBJmHkW06QkN5BGEknfn0YpYZiYg6w6i1O0zt7q+aVrgsre16 W2q1aP9i8LBZxToJPDiYtG4yGo7Z5YkCMFv2a+S2mxQlNdSDWzeFeI3atla1cMDVKRwT ri+g== 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=fiI3qCBQBrgOe49H09tQUlcrUGoyTcWs/PwUWE9ULEk=; b=wmMC+w4d0SwlU1tbOGyRvScSBXuGE8MovI2alg7KQYR8qfwSmsaMQm9HqhCrm5xPp3 6x9aA09/tWKJJMfhSgy1S1UB/h80JstqOQ4zJNBFj0MW3OUbiKUwQL9qLfM/432/h+om Ixmrsv7Q/pZTb+ae+Yju3mHi9q91n3hdgJBMFxUxR+daYYayYz0l+SDKwc853LSRo5ET ryKF36A2sSD0Yc1wCJq07TE1BN3CJ4102icUjUgqX3F9WTpyH6ad+4z3BQHuLIjS1XmL MgkiKdlZ6CxEfm1vRaI6yGMeB3knGsknRhQY1c+yFVR1xjKJDR2EwGHN5ZeLlrhS0JQM tOFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="f49fyV6/"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l193-20020a6391ca000000b0052c8d7a08a4si13897227pge.8.2023.05.16.04.22.23; Tue, 16 May 2023 04:22:36 -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="f49fyV6/"; 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 S231240AbjEPLCB (ORCPT + 99 others); Tue, 16 May 2023 07:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232560AbjEPLBn (ORCPT ); Tue, 16 May 2023 07:01:43 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA6C44C27; Tue, 16 May 2023 04:01:11 -0700 (PDT) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GAdNN0010615; Tue, 16 May 2023 11:00:57 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=fiI3qCBQBrgOe49H09tQUlcrUGoyTcWs/PwUWE9ULEk=; b=f49fyV6/pED05zX+rPZ3xV1moe5EkZXukU/pwxTPKXl++VfCALj7zpUKaQmbiyvz4x9/ A/Gr1s35JtNVwmXtEo0JsNFHn52x6YEq3gvaB9qB2N5ue0l4s5909BquYyoQpOSMXCxi PXdoBDAtTBNDwu7jVSCgVDi9+yDLjS3U3kz6WVD60RJwg/eFZ/w3HUkcRbqOJg/X84Ma TZkL5VF1ASZNNWSYLDr4Zxmxe1iQwMh/SDnL9oVCH2+Bp3KSC7TQCCh8TvImgLe7UgCv IlF8EbR1ORbdJCm1SuNSldveMwpgTS1BG2OHaYi/ezi/37DsdZtx94Fy5KHPxXjsHxY7 wA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qm7kfsmq3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:57 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34GAuebJ014229; Tue, 16 May 2023 11:00:56 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 3qm7kfsmn9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:56 +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 34G68P8l001731; Tue, 16 May 2023 11:00:53 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3qj264sanc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 11:00:53 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34GB0oJR53608760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 May 2023 11:00:50 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C45E02005A; Tue, 16 May 2023 11:00:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EFF720043; Tue, 16 May 2023 11:00:50 +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:00:50 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann , Dmitry Torokhov Cc: Greg Kroah-Hartman , Bjorn Helgaas , =?utf-8?q?Uwe_Kleine-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 v4 14/41] Input: gameport: add ISA and HAS_IOPORT dependencies Date: Tue, 16 May 2023 13:00:10 +0200 Message-Id: <20230516110038.2413224-15-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 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: vkCL6W6tF84T0sectLlO5ht3tqil2grA X-Proofpoint-ORIG-GUID: 2JC4JeQBFOJOurUdmTaFRLwQtrjCTV1U 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 spamscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766049611982691270?= X-GMAIL-MSGID: =?utf-8?q?1766049611982691270?= 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 --- Note: The HAS_IOPORT Kconfig option was added in v6.4-rc1 so per-subsystem patches may be applied independently 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)