From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB32CC43219 for ; Mon, 27 Dec 2021 16:44:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbhL0QoU (ORCPT ); Mon, 27 Dec 2021 11:44:20 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41762 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbhL0QoE (ORCPT ); Mon, 27 Dec 2021 11:44:04 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BRFfQA8021756; Mon, 27 Dec 2021 16:43:38 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=l8mKszTsk7HmD0sKamZFoRlnXMuFzugZKY8/iUH88Q8=; b=cMrrlmKjkofsNLg5ogvKqdodQoezDsEgwBHZlTs46nZWR9oWzFnN0OaANtQ7eq/bC5oi ZstOzgzXoz7Hf9u6/tL5ivIKMm3mef4vwT1Ynx7eH1fNJUlrJifpTzXPkmVsWrNdgQA/ g7Px1Ybf5hun66i6ho764LI1ahIsGJlr2CY3xLawfu5irk54CRiCM23+oXDpqyXVoYbM q99CShu67pJT+usAfZ83r3iUfERyjufJBAoY89HntSmQ9UIS5s1XJdkmWKZS8eqxAUJd MLtGh6UeLjORJACAuzJ1GFbf3+uZuOiNwcte0XamuPfhfzFL7lEQU+fK0JuDgmFYJmT8 Hg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7gbns176-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Dec 2021 16:43:38 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BRGeYf1006547; Mon, 27 Dec 2021 16:43:37 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7gbns16k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Dec 2021 16:43:37 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BRGc4m8005226; Mon, 27 Dec 2021 16:43:35 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 3d5tjjbhjw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Dec 2021 16:43:34 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BRGhW3P44761354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Dec 2021 16:43:32 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F36CA4060; Mon, 27 Dec 2021 16:43:32 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0607FA405F; Mon, 27 Dec 2021 16:43:32 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 27 Dec 2021 16:43:31 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-input@vger.kernel.org Subject: [RFC 07/32] Input: gameport: add ISA and HAS_IOPORT dependencies Date: Mon, 27 Dec 2021 17:42:52 +0100 Message-Id: <20211227164317.4146918-8-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211227164317.4146918-1-schnelle@linux.ibm.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0NBAEMHOy9sP5vWXiDigEQRn9FkWRPjz X-Proofpoint-GUID: mvw6Psa3Rs08dzdnOjxq9_dFXgALA-8Y X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-27_08,2021-12-24_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112270080 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 | 2 ++ include/linux/gameport.h | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/input/gameport/Kconfig b/drivers/input/gameport/Kconfig index 082280f95333..366a2723e9a0 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. 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E711C433F5 for ; Mon, 27 Dec 2021 16:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c5DUPAIcoT1YHTG4fMDNNtMWNyNfxbyrQ/Pvdk/rqDg=; b=BOPshdzBXj1kRk kkAT6yAVzywZdgUx/orKF+FmvC86RBd2JBqc5nOiXmo1Gg8sXPiebVzw8h50H2HpbBi2nqSwgEVt8 McysoAjvo05XbzlaKAtmtg+XzZpp4yKIZhcHVsAVRzWEUqHr+XhmAPhajt6tjFqqlajDxY0QsmzT/ VsgZPUG++fVF44LhgWNojFLGg9d225oE2VqltmWYIXccTDOdYB3/qz0e5aUlAL/RA+GoIHRIxA37C aIWlH+dLk8hUCFQhhnL0B/qv3lxoABA9pGEYO6BFPQrSUvV2jOCSL+leE/V1t+4iRUQlOXN4kRGnJ zYXGbbeG3uRVHze8kqUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1t76-00H0zv-SR; Mon, 27 Dec 2021 16:44:44 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1t6O-00H0Rw-RW for linux-riscv@lists.infradead.org; Mon, 27 Dec 2021 16:44:03 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BRFfQA8021756; Mon, 27 Dec 2021 16:43:38 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=l8mKszTsk7HmD0sKamZFoRlnXMuFzugZKY8/iUH88Q8=; b=cMrrlmKjkofsNLg5ogvKqdodQoezDsEgwBHZlTs46nZWR9oWzFnN0OaANtQ7eq/bC5oi ZstOzgzXoz7Hf9u6/tL5ivIKMm3mef4vwT1Ynx7eH1fNJUlrJifpTzXPkmVsWrNdgQA/ g7Px1Ybf5hun66i6ho764LI1ahIsGJlr2CY3xLawfu5irk54CRiCM23+oXDpqyXVoYbM q99CShu67pJT+usAfZ83r3iUfERyjufJBAoY89HntSmQ9UIS5s1XJdkmWKZS8eqxAUJd MLtGh6UeLjORJACAuzJ1GFbf3+uZuOiNwcte0XamuPfhfzFL7lEQU+fK0JuDgmFYJmT8 Hg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7gbns176-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Dec 2021 16:43:38 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BRGeYf1006547; Mon, 27 Dec 2021 16:43:37 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7gbns16k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Dec 2021 16:43:37 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BRGc4m8005226; Mon, 27 Dec 2021 16:43:35 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 3d5tjjbhjw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Dec 2021 16:43:34 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BRGhW3P44761354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Dec 2021 16:43:32 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F36CA4060; Mon, 27 Dec 2021 16:43:32 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0607FA405F; Mon, 27 Dec 2021 16:43:32 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 27 Dec 2021 16:43:31 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-input@vger.kernel.org Subject: [RFC 07/32] Input: gameport: add ISA and HAS_IOPORT dependencies Date: Mon, 27 Dec 2021 17:42:52 +0100 Message-Id: <20211227164317.4146918-8-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211227164317.4146918-1-schnelle@linux.ibm.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0NBAEMHOy9sP5vWXiDigEQRn9FkWRPjz X-Proofpoint-GUID: mvw6Psa3Rs08dzdnOjxq9_dFXgALA-8Y X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-27_08,2021-12-24_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112270080 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211227_084400_924212_52F5EE37 X-CRM114-Status: GOOD ( 18.06 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 | 2 ++ include/linux/gameport.h | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/input/gameport/Kconfig b/drivers/input/gameport/Kconfig index 082280f95333..366a2723e9a0 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. 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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv