Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp193686iob; Mon, 2 May 2022 16:51:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+vIZkCO8lcFLe3odaQMvM8FXWG58X5ApFw+//yOzk6sp0u+Nm3QSqz1+VNf2vf3lM4f7T X-Received: by 2002:a17:903:300b:b0:15c:b49b:6647 with SMTP id o11-20020a170903300b00b0015cb49b6647mr14111010pla.90.1651535463362; Mon, 02 May 2022 16:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651535463; cv=none; d=google.com; s=arc-20160816; b=uzucFwo+0urARjs4QoIxs09mKZntSuBuYY163xhHCwoqeeGu3OZ9ilmD6hobSICIRI OlfF+zyeJYwSED3HQAMpGERZEpc+VH7U2LtznVX64Rp33SE4SyuD2XhSpdOyQQFkMLIu 6LxVOJLhfiyltOqX8dm6RR3NLTKByXawHcnCVosrCym3udFv3NrUN6A92dQq0xZTjoDk 6dRzAXkwwZufiTAnxcd6cGKuFkTOENjmIF/dLa3jMHT33bWtOYUssbqN9dDPyfDV3xc+ Z5bzgNj4dfXzjQoCRfZxEaXpof6I9T1HWnSNnFgXKQcpIZxQxb6PuxOfIwCwI204OPPx VtYA== 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=NwYCnI58rhQOvI4ztnnRGw2LWsLAqNLHi894VNzquR0=; b=FyM3Fw7xfpLdFrjBJM9yJJMqWxSMib98k4PlySK6Uyet9aOvxoS/6T8g337f8aPuZO TSy06HdYQ9v6B6zH5YickFWjQixng+5fi1uozEP/MXxn4U61Je5Wn0IRYs0kAFCl9XK0 7Lc+2S6XOdsZHLJYQN5FwTiaNxCfwirhBPodt83dh1WITbypL5mSOCz1htg7VXMWWc7R 7cwus4uwmsbBWkCgCyBPZsz8uOJyzLNEN21I2vkg0K+tE3fx77YGP6KQRdTVUnJ7KHJv vCxltUxkk8fPYHLJOmCn5lEwBGYDtKNAgJMlfprFgdmM+hMd60FB5uNZNf/9fu03f7gP zf+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ibm.com header.s=pp1 header.b=adXjZUEk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b14-20020a63340e000000b003ab5908dc1esi16728686pga.795.2022.05.02.16.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:51:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@ibm.com header.s=pp1 header.b=adXjZUEk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1FF1B9FEA; Mon, 2 May 2022 16:50:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376507AbiD2NzP (ORCPT + 99 others); Fri, 29 Apr 2022 09:55:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376427AbiD2Nyq (ORCPT ); Fri, 29 Apr 2022 09:54:46 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78024583B0; Fri, 29 Apr 2022 06:51:27 -0700 (PDT) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23TDKJ4r005926; Fri, 29 Apr 2022 13:51:23 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=NwYCnI58rhQOvI4ztnnRGw2LWsLAqNLHi894VNzquR0=; b=adXjZUEkPcN1IfOq1AkHcM3UfqHhnmmjazrIvVgP/OzvcKu8J8+kY6OAE3KwbqkeuxSY 8sUixQDy4E3X+RPebXrlwB5Z48ETNz3NFo6SxNH5vgYTfUbSO7YztPFatBFaJtARxm5d +wVwrprezxGctQEWgNHuGDhdQfbqzMUPae++KKtd0UntxGDaE5Fie0BLJMJPq6AbhA7Y +F7kiAvYyn4eL/wXABmPPLnTN2zePuIYGTI7PGFZhEKJ/GLwOqlVjc0UrKwYWrzRwp4a MCw/hgiotnZ+Uq5KJrZTxB2T1HON9FykdFxBzZV54yTg+UVzG5Da4Oy5pH66mKcLWTzo 7w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqtvxmndp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:22 +0000 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 23TDmX3J019603; Fri, 29 Apr 2022 13:51:22 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqtvxmncv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:22 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23TDS5hh011971; Fri, 29 Apr 2022 13:51:20 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06fra.de.ibm.com with ESMTP id 3fm8qhqavs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:51:20 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23TDpQnv23855428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Apr 2022 13:51:26 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D512C4C046; Fri, 29 Apr 2022 13:51:17 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FB984C040; Fri, 29 Apr 2022 13:51:17 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 29 Apr 2022 13:51:17 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann , Dmitry Torokhov , linux-input@vger.kernel.org (open list:INPUT (KEYBOARD, MOUSE, JOYSTICK , TOUCHSCREEN)...) Subject: [PATCH 07/37] Input: gameport: add ISA and HAS_IOPORT dependencies Date: Fri, 29 Apr 2022 15:50:11 +0200 Message-Id: <20220429135108.2781579-14-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220429135108.2781579-1-schnelle@linux.ibm.com> References: <20220429135108.2781579-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: renjD5P0Cu-WniTjBUQv4kNtoXsuo82u X-Proofpoint-GUID: onxuuYsLp_JNjLw16h_Npj4AINEIEs6o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-29_06,2022-04-28_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 clxscore=1011 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204290078 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: 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 69081d899492..9e55ac748a86 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.32.0