From patchwork Thu Aug 8 17:27:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 817787 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25B5E18E740; Thu, 8 Aug 2024 17:27:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138067; cv=none; b=eV1pFYGW4fyB53yDRgR/GJD+j7fsb5gx9w8DQaoHH8HWZbWzprwd6s7VGUKRcSvzRNlCgtW5NbXpojRlTRWQTZcDgSFT6eXBGaM48rceJCeU/KxyaGotyiQ1adwGOiIXl1bWu0VoHzXyth6ODQQa6piL/nXjTacytMEEtApmRWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138067; c=relaxed/simple; bh=lZgCGE2JH573K2NAkhL4/zSicSgUSNOwnDRrFSN8yYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YQ4HKwetLZ6aeSlxJkly1f/ehFbaBEA6oT+hglolQ4ZrzKPn1xKVLB5V6w8mo08/KQyhsipLY2of8TqXD4N5lRqG1RHjd2qNTXTzlLUkspLracfgrm05hLmhLSzOIdmgkCOL0Gsiio7kbCS5w7fS0bPgxqUinxy8jRJIp1Kfey4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gDL6Jbwy; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gDL6Jbwy" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-710afd56c99so973020b3a.0; Thu, 08 Aug 2024 10:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723138065; x=1723742865; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HUhyJiY4BdJGXiYkCxfj6FYUu6YAuBztn0Q47pWM934=; b=gDL6JbwyYaqn4dectJoSTf5HhJw2UqhzIWBSvPzpd9wJsvX+TkZkfaXjCaRNBvmycG WkoqTpWVh4U2JnW5nuA/CeJDxE9R+Y4kHsPZaWSOgV059beOxEh0B5heMZPQGY6m1ugk UziNxXgKejsiqOJnzMppRbgMq6cJVVo8UqquOY4sKfl1KDiM+basqzMwwaMZmQD2OmhY GmxB9oa2JpdGUoQOtbeR15nlJHh/mzpnVUGdZ0em7TXg2CVYRoCwVI+KzVRMckMhSyDe cxS0DsN++l3mLYw1vkFN1vAwfdmJpbaxgM7/hMKC2a2jPHzUKofTqBUeCUweWw10um/S VDKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723138065; x=1723742865; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HUhyJiY4BdJGXiYkCxfj6FYUu6YAuBztn0Q47pWM934=; b=oV3XKUjrDdjoH/fuk/cUBPds8+BmMCkBI9MG1aXYVu1W+PQmUiHZ45wmFY56P9EmPg aJdWGJ2lwez7daQkv0uCk/Xo/GNkwbKv0rYgcPcy6hnFdObQgHV8M86pDSDtZu3BeVeq x3ZKMgAeQV0Wn5F2DSm6y55v2wgCLNo8bRNyWPBKpXPSg5w10zglliQA8eW6O1UJzpqv 2muPN+NMO3qzku21PwMulaykJal/+c6mGMv2gCtYzMCWopCLgj6w5BYIlgs+JSUKcYw8 8bM1EGVkXiQ2KpCUnxaIFGLJI0fyM13bYfdXeUO/G8dLfczD5MR4eojCfDosHc7UOmAu y0Ow== X-Gm-Message-State: AOJu0YyfGftaYC5QAIk5QYdA48+2y14k8u5CCzFoNwlSAzE1r+gRwAxN Z1vYfD67RlG3kBLB8jSONSTM3pCbGiJwMIEXx5k/VSBbZtJ1+A5DWjBl9g== X-Google-Smtp-Source: AGHT+IFY8crf+yUSRdJCT/zJ10D/kiTeYHaQwPKkdwU/fnEa5MTdPm0GQsgV4bW1clmJ8quFjtN3Dg== X-Received: by 2002:aa7:8d53:0:b0:705:d6ad:2495 with SMTP id d2e1a72fcca58-710cc90db8cmr3788996b3a.12.1723138065009; Thu, 08 Aug 2024 10:27:45 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:4403:e9e1:aefe:e6e8]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e89ffsm1349829b3a.180.2024.08.08.10.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 10:27:44 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik , Jiri Kosina , Benjamin Tissoires Subject: [RFC PATCH 1/5] Input: inport - remove driver Date: Thu, 8 Aug 2024 10:27:27 -0700 Message-ID: <20240808172733.1194442-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog In-Reply-To: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> References: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Inport (ATI XL and Microsoft) mice use specialized bus interface implemented via an ISA add-in card. Have been superseded by PS/2 and then USB, and are historical curiosity by now. Remove the driver. Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/Kconfig | 16 ---- drivers/input/mouse/Makefile | 1 - drivers/input/mouse/inport.c | 177 ----------------------------------- 3 files changed, 194 deletions(-) delete mode 100644 drivers/input/mouse/inport.c diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index 8a27a20d04b0..9c3102fa8e3c 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -312,22 +312,6 @@ config MOUSE_ELAN_I2C_SMBUS If unsure, say Y. -config MOUSE_INPORT - tristate "InPort/MS/ATIXL busmouse" - depends on ISA - help - Say Y here if you have an InPort, Microsoft or ATI XL busmouse. - They are rather rare these days. - - To compile this driver as a module, choose M here: the - module will be called inport. - -config MOUSE_ATIXL - bool "ATI XL variant" - depends on MOUSE_INPORT - help - Say Y here if your mouse is of the ATI XL variety. - config MOUSE_LOGIBM tristate "Logitech busmouse" depends on ISA diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile index 563029551529..ef96db1fc945 100644 --- a/drivers/input/mouse/Makefile +++ b/drivers/input/mouse/Makefile @@ -12,7 +12,6 @@ obj-$(CONFIG_MOUSE_BCM5974) += bcm5974.o obj-$(CONFIG_MOUSE_CYAPA) += cyapatp.o obj-$(CONFIG_MOUSE_ELAN_I2C) += elan_i2c.o obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o -obj-$(CONFIG_MOUSE_INPORT) += inport.o obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o diff --git a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c deleted file mode 100644 index 401d8bff8e84..000000000000 --- a/drivers/input/mouse/inport.c +++ /dev/null @@ -1,177 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 1999-2001 Vojtech Pavlik - * - * Based on the work of: - * Teemu Rantanen Derrick Cole - * Peter Cervasio Christoph Niemann - * Philip Blundell Russell King - * Bob Harris - */ - -/* - * Inport (ATI XL and Microsoft) busmouse driver for Linux - */ - -#include -#include -#include -#include -#include - -#include -#include - -MODULE_AUTHOR("Vojtech Pavlik "); -MODULE_DESCRIPTION("Inport (ATI XL and Microsoft) busmouse driver"); -MODULE_LICENSE("GPL"); - -#define INPORT_BASE 0x23c -#define INPORT_EXTENT 4 - -#define INPORT_CONTROL_PORT INPORT_BASE + 0 -#define INPORT_DATA_PORT INPORT_BASE + 1 -#define INPORT_SIGNATURE_PORT INPORT_BASE + 2 - -#define INPORT_REG_BTNS 0x00 -#define INPORT_REG_X 0x01 -#define INPORT_REG_Y 0x02 -#define INPORT_REG_MODE 0x07 -#define INPORT_RESET 0x80 - -#ifdef CONFIG_MOUSE_ATIXL -#define INPORT_NAME "ATI XL Mouse" -#define INPORT_VENDOR 0x0002 -#define INPORT_SPEED_30HZ 0x01 -#define INPORT_SPEED_50HZ 0x02 -#define INPORT_SPEED_100HZ 0x03 -#define INPORT_SPEED_200HZ 0x04 -#define INPORT_MODE_BASE INPORT_SPEED_100HZ -#define INPORT_MODE_IRQ 0x08 -#else -#define INPORT_NAME "Microsoft InPort Mouse" -#define INPORT_VENDOR 0x0001 -#define INPORT_MODE_BASE 0x10 -#define INPORT_MODE_IRQ 0x01 -#endif -#define INPORT_MODE_HOLD 0x20 - -#define INPORT_IRQ 5 - -static int inport_irq = INPORT_IRQ; -module_param_hw_named(irq, inport_irq, uint, irq, 0); -MODULE_PARM_DESC(irq, "IRQ number (5=default)"); - -static struct input_dev *inport_dev; - -static irqreturn_t inport_interrupt(int irq, void *dev_id) -{ - unsigned char buttons; - - outb(INPORT_REG_MODE, INPORT_CONTROL_PORT); - outb(INPORT_MODE_HOLD | INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT); - - outb(INPORT_REG_X, INPORT_CONTROL_PORT); - input_report_rel(inport_dev, REL_X, inb(INPORT_DATA_PORT)); - - outb(INPORT_REG_Y, INPORT_CONTROL_PORT); - input_report_rel(inport_dev, REL_Y, inb(INPORT_DATA_PORT)); - - outb(INPORT_REG_BTNS, INPORT_CONTROL_PORT); - buttons = inb(INPORT_DATA_PORT); - - input_report_key(inport_dev, BTN_MIDDLE, buttons & 1); - input_report_key(inport_dev, BTN_LEFT, buttons & 2); - input_report_key(inport_dev, BTN_RIGHT, buttons & 4); - - outb(INPORT_REG_MODE, INPORT_CONTROL_PORT); - outb(INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT); - - input_sync(inport_dev); - return IRQ_HANDLED; -} - -static int inport_open(struct input_dev *dev) -{ - if (request_irq(inport_irq, inport_interrupt, 0, "inport", NULL)) - return -EBUSY; - outb(INPORT_REG_MODE, INPORT_CONTROL_PORT); - outb(INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT); - - return 0; -} - -static void inport_close(struct input_dev *dev) -{ - outb(INPORT_REG_MODE, INPORT_CONTROL_PORT); - outb(INPORT_MODE_BASE, INPORT_DATA_PORT); - free_irq(inport_irq, NULL); -} - -static int __init inport_init(void) -{ - unsigned char a, b, c; - int err; - - if (!request_region(INPORT_BASE, INPORT_EXTENT, "inport")) { - printk(KERN_ERR "inport.c: Can't allocate ports at %#x\n", INPORT_BASE); - return -EBUSY; - } - - a = inb(INPORT_SIGNATURE_PORT); - b = inb(INPORT_SIGNATURE_PORT); - c = inb(INPORT_SIGNATURE_PORT); - if (a == b || a != c) { - printk(KERN_INFO "inport.c: Didn't find InPort mouse at %#x\n", INPORT_BASE); - err = -ENODEV; - goto err_release_region; - } - - inport_dev = input_allocate_device(); - if (!inport_dev) { - printk(KERN_ERR "inport.c: Not enough memory for input device\n"); - err = -ENOMEM; - goto err_release_region; - } - - inport_dev->name = INPORT_NAME; - inport_dev->phys = "isa023c/input0"; - inport_dev->id.bustype = BUS_ISA; - inport_dev->id.vendor = INPORT_VENDOR; - inport_dev->id.product = 0x0001; - inport_dev->id.version = 0x0100; - - inport_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); - inport_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | - BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); - inport_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); - - inport_dev->open = inport_open; - inport_dev->close = inport_close; - - outb(INPORT_RESET, INPORT_CONTROL_PORT); - outb(INPORT_REG_MODE, INPORT_CONTROL_PORT); - outb(INPORT_MODE_BASE, INPORT_DATA_PORT); - - err = input_register_device(inport_dev); - if (err) - goto err_free_dev; - - return 0; - - err_free_dev: - input_free_device(inport_dev); - err_release_region: - release_region(INPORT_BASE, INPORT_EXTENT); - - return err; -} - -static void __exit inport_exit(void) -{ - input_unregister_device(inport_dev); - release_region(INPORT_BASE, INPORT_EXTENT); -} - -module_init(inport_init); -module_exit(inport_exit); From patchwork Thu Aug 8 17:27:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 818323 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 474071917CB; Thu, 8 Aug 2024 17:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138068; cv=none; b=s+be3twrxUsrUGeiCzKM9Pw9TVyFQXpiGd+mOVsTQ4Qq9xenzpwxvgk/8RhanMWcYQ6nqQZxWcaZ5CfHm79Dy6Nor162F/7RxOovCDx9Ea7GXWjL3teqEj4kXGOFJatToWeHzl5wueuCCFI+3mssuKblNdTMp9gAklfyiGU4ceY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138068; c=relaxed/simple; bh=z7CmfIlggHc6GW4Pq7QEHM6q1SCKYulgju9o3siiY7k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HSiX9C0d3sUSH5PuQ+cMrplZOMjr+E9aQfeKtUFs7y+OpmPfG96z0s3Xko2WKsOOE2XR1AFU9fi+KoTautAd+KvE1her9xPfka0C4A9e/EZQ0wPoTpXjNdt8Y01rTx+fdwXAipyN6jGTf715cr6Cz8kAxKgkAtP/kVZPfeZoGH8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JXVDjK5W; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JXVDjK5W" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-70d162eef54so1002528b3a.3; Thu, 08 Aug 2024 10:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723138066; x=1723742866; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9glaQj2klfmBtUR/sEp1TdcmyuE2YttOBf1sYIJp+nM=; b=JXVDjK5WFGoTwBSsRqcNF0CBsm3teiYAodraHM32lm5KV4JuPZ7Cp2CvETSR6oMZEO cXMoNbv89uf7eYGp0XJEJCSMXmgixi6CoczkdvLvDP+7IlG40EwwswnWmtHsrtgxWo8w 6muy21mpB+dpFgxuQmaj0lbMpnuE5uHJDHt7jJbuWLYnkrRFq3gQQrjwuaSPmc39XUX2 Ji5pmXdcfRWO5J0+Jr0AvtEF/91qhkoZb5dtcmH2BhvnW3W/nIHqQMsui6lxRRfdJ0zV I9a2GvXfs5oQmx7wc7G6vZLGlhk2DUefhXkN6tGBnk9PtAYRPckX19oBxKUEXHwcANMT IOgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723138066; x=1723742866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9glaQj2klfmBtUR/sEp1TdcmyuE2YttOBf1sYIJp+nM=; b=EotNdrlhyBx0gWROoql40BAH94xNSWceA9XPaQQ80v61YaZm50SCPlwfX/6RCjLTZl h5+k3YIju+52FDfTq+bDcAPl5ITP8e58rVbfnmfAFtSZkoAvuHePaebjcBurzT8tqk37 0SpyqwMVdeosaUp1SWtMGGS6tTUDaP0jiEvv88Gs5+0mrmLdSgvLScsFVautjLR3IqON TjQPts1dAsHu72NFs4Z7ezGSnaoqT/JL0iXLiopVZyUvQUiHRHUNNN/OnM67r3ivsua6 h8rBZB7vLEiO+EFX91ek3j3+JdJsM62i6IX81isquLAItYe67WO68QVBmQe0YLBkGZSw 8xIw== X-Gm-Message-State: AOJu0YypkFRdkco4FvuqzvILIZ70mGZEDho9VpgYTe7LvJ3rCMlx/EiC SzIGpDDAbwNgyH8I2GDSZ1zsF9wvRObtODMhuKv1dAIrtWwiTztX+Wxjmg== X-Google-Smtp-Source: AGHT+IHP3F3O0c6NqSNKit6DywisiVCSnwyzlEpNaJREXf7VL1IIBJAV9xatV3Rg2P5K/6LZ/uzYuA== X-Received: by 2002:a05:6a00:2293:b0:70b:2efd:7bee with SMTP id d2e1a72fcca58-710cae1c228mr3497809b3a.21.1723138066205; Thu, 08 Aug 2024 10:27:46 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:4403:e9e1:aefe:e6e8]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e89ffsm1349829b3a.180.2024.08.08.10.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 10:27:45 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik , Jiri Kosina , Benjamin Tissoires Subject: [RFC PATCH 2/5] Input: logibm - remove driver Date: Thu, 8 Aug 2024 10:27:28 -0700 Message-ID: <20240808172733.1194442-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog In-Reply-To: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> References: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Bus mice use specialized bus interface implemented via an ISA add-in cards. They were superseded by PS/2 and later USB. Kconfig entry for the Logitech bus mice states that they "are rather rare these days". This statement was true in 2002 and is no less true in 2024. Remove the driver. Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/Kconfig | 10 --- drivers/input/mouse/Makefile | 1 - drivers/input/mouse/logibm.c | 166 ----------------------------------- 3 files changed, 177 deletions(-) delete mode 100644 drivers/input/mouse/logibm.c diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index 9c3102fa8e3c..f660e6ba24c2 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -312,16 +312,6 @@ config MOUSE_ELAN_I2C_SMBUS If unsure, say Y. -config MOUSE_LOGIBM - tristate "Logitech busmouse" - depends on ISA - help - Say Y here if you have a Logitech busmouse. - They are rather rare these days. - - To compile this driver as a module, choose M here: the - module will be called logibm. - config MOUSE_PC110PAD tristate "IBM PC110 touchpad" depends on ISA diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile index ef96db1fc945..e745b64fed49 100644 --- a/drivers/input/mouse/Makefile +++ b/drivers/input/mouse/Makefile @@ -12,7 +12,6 @@ obj-$(CONFIG_MOUSE_BCM5974) += bcm5974.o obj-$(CONFIG_MOUSE_CYAPA) += cyapatp.o obj-$(CONFIG_MOUSE_ELAN_I2C) += elan_i2c.o obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o -obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o obj-$(CONFIG_MOUSE_PS2) += psmouse.o diff --git a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c deleted file mode 100644 index 0aab63dbc30a..000000000000 --- a/drivers/input/mouse/logibm.c +++ /dev/null @@ -1,166 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 1999-2001 Vojtech Pavlik - * - * Based on the work of: - * James Banks Matthew Dillon - * David Giller Nathan Laredo - * Linus Torvalds Johan Myreen - * Cliff Matthews Philip Blundell - * Russell King - */ - -/* - * Logitech Bus Mouse Driver for Linux - */ - -#include -#include -#include -#include -#include -#include - -#include -#include - -MODULE_AUTHOR("Vojtech Pavlik "); -MODULE_DESCRIPTION("Logitech busmouse driver"); -MODULE_LICENSE("GPL"); - -#define LOGIBM_BASE 0x23c -#define LOGIBM_EXTENT 4 - -#define LOGIBM_DATA_PORT LOGIBM_BASE + 0 -#define LOGIBM_SIGNATURE_PORT LOGIBM_BASE + 1 -#define LOGIBM_CONTROL_PORT LOGIBM_BASE + 2 -#define LOGIBM_CONFIG_PORT LOGIBM_BASE + 3 - -#define LOGIBM_ENABLE_IRQ 0x00 -#define LOGIBM_DISABLE_IRQ 0x10 -#define LOGIBM_READ_X_LOW 0x80 -#define LOGIBM_READ_X_HIGH 0xa0 -#define LOGIBM_READ_Y_LOW 0xc0 -#define LOGIBM_READ_Y_HIGH 0xe0 - -#define LOGIBM_DEFAULT_MODE 0x90 -#define LOGIBM_CONFIG_BYTE 0x91 -#define LOGIBM_SIGNATURE_BYTE 0xa5 - -#define LOGIBM_IRQ 5 - -static int logibm_irq = LOGIBM_IRQ; -module_param_hw_named(irq, logibm_irq, uint, irq, 0); -MODULE_PARM_DESC(irq, "IRQ number (5=default)"); - -static struct input_dev *logibm_dev; - -static irqreturn_t logibm_interrupt(int irq, void *dev_id) -{ - char dx, dy; - unsigned char buttons; - - outb(LOGIBM_READ_X_LOW, LOGIBM_CONTROL_PORT); - dx = (inb(LOGIBM_DATA_PORT) & 0xf); - outb(LOGIBM_READ_X_HIGH, LOGIBM_CONTROL_PORT); - dx |= (inb(LOGIBM_DATA_PORT) & 0xf) << 4; - outb(LOGIBM_READ_Y_LOW, LOGIBM_CONTROL_PORT); - dy = (inb(LOGIBM_DATA_PORT) & 0xf); - outb(LOGIBM_READ_Y_HIGH, LOGIBM_CONTROL_PORT); - buttons = inb(LOGIBM_DATA_PORT); - dy |= (buttons & 0xf) << 4; - buttons = ~buttons >> 5; - - input_report_rel(logibm_dev, REL_X, dx); - input_report_rel(logibm_dev, REL_Y, dy); - input_report_key(logibm_dev, BTN_RIGHT, buttons & 1); - input_report_key(logibm_dev, BTN_MIDDLE, buttons & 2); - input_report_key(logibm_dev, BTN_LEFT, buttons & 4); - input_sync(logibm_dev); - - outb(LOGIBM_ENABLE_IRQ, LOGIBM_CONTROL_PORT); - return IRQ_HANDLED; -} - -static int logibm_open(struct input_dev *dev) -{ - if (request_irq(logibm_irq, logibm_interrupt, 0, "logibm", NULL)) { - printk(KERN_ERR "logibm.c: Can't allocate irq %d\n", logibm_irq); - return -EBUSY; - } - outb(LOGIBM_ENABLE_IRQ, LOGIBM_CONTROL_PORT); - return 0; -} - -static void logibm_close(struct input_dev *dev) -{ - outb(LOGIBM_DISABLE_IRQ, LOGIBM_CONTROL_PORT); - free_irq(logibm_irq, NULL); -} - -static int __init logibm_init(void) -{ - int err; - - if (!request_region(LOGIBM_BASE, LOGIBM_EXTENT, "logibm")) { - printk(KERN_ERR "logibm.c: Can't allocate ports at %#x\n", LOGIBM_BASE); - return -EBUSY; - } - - outb(LOGIBM_CONFIG_BYTE, LOGIBM_CONFIG_PORT); - outb(LOGIBM_SIGNATURE_BYTE, LOGIBM_SIGNATURE_PORT); - udelay(100); - - if (inb(LOGIBM_SIGNATURE_PORT) != LOGIBM_SIGNATURE_BYTE) { - printk(KERN_INFO "logibm.c: Didn't find Logitech busmouse at %#x\n", LOGIBM_BASE); - err = -ENODEV; - goto err_release_region; - } - - outb(LOGIBM_DEFAULT_MODE, LOGIBM_CONFIG_PORT); - outb(LOGIBM_DISABLE_IRQ, LOGIBM_CONTROL_PORT); - - logibm_dev = input_allocate_device(); - if (!logibm_dev) { - printk(KERN_ERR "logibm.c: Not enough memory for input device\n"); - err = -ENOMEM; - goto err_release_region; - } - - logibm_dev->name = "Logitech bus mouse"; - logibm_dev->phys = "isa023c/input0"; - logibm_dev->id.bustype = BUS_ISA; - logibm_dev->id.vendor = 0x0003; - logibm_dev->id.product = 0x0001; - logibm_dev->id.version = 0x0100; - - logibm_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); - logibm_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | - BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); - logibm_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); - - logibm_dev->open = logibm_open; - logibm_dev->close = logibm_close; - - err = input_register_device(logibm_dev); - if (err) - goto err_free_dev; - - return 0; - - err_free_dev: - input_free_device(logibm_dev); - err_release_region: - release_region(LOGIBM_BASE, LOGIBM_EXTENT); - - return err; -} - -static void __exit logibm_exit(void) -{ - input_unregister_device(logibm_dev); - release_region(LOGIBM_BASE, LOGIBM_EXTENT); -} - -module_init(logibm_init); -module_exit(logibm_exit); From patchwork Thu Aug 8 17:27:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 817786 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7714191F65; Thu, 8 Aug 2024 17:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138070; cv=none; b=dt8O0CE+FFwIbKPJzJbjXkm4i0J6bSOrh2ckgPhsmHiTOpwF5Qc9RW4f6Uz0Q5+afH/DOaogLwHfT8zeSRMt63UGhLsu1LtY0Vz7PDDVsjURpqux3pst8xRT4kImtB6PgnA4DPE0YKjRiJbTrLL3jds1MW1Wwcvi2zy85+PeUHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138070; c=relaxed/simple; bh=JiG9JU7BMC0nbgb7xMU1fHsrYsmQ1eqXt8YVfdaVmPQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HfPFWhpwVor/zRy3ui7c+T5LBjvMye6JgRFr0BPQBXmAMb+vEhSCJhTYrDFv2aenqTS6cHN0G0kjr1mlaq0PHWVY8MDuXo28E5iqvRfOiHMDFKOb7ctfg0x9q/dTZdNZN4RqD3rTD4tSx4YbtLpqhObyKPjcMFF+JWu7eXBddh4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ds6WMUex; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ds6WMUex" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-70d1fb6c108so987853b3a.3; Thu, 08 Aug 2024 10:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723138068; x=1723742868; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HWkxNnU4sBqalSwyfrRRirCD1vzPLoXEjt3eORuHZEk=; b=Ds6WMUexGDZOoK3tS+xQqzmuJ+OIAKRy9m+4KBHlqB9McGCCXFQFRMfHPlM3bSFJao pFuCEA8tWtL+o/WXDIiceAHUH8ucTiZTIm6hxTjXoWWyNzA5Q5kDO1M1AxQwIAMVUHa+ aQVw/0gxLmPvDasmgKF9R+9+1nTAbc+DLSPSOeKzdJ2GUrGkVqnvTSN0SsSCSi5rtH00 WIBWd5ZJbXV9vtIhjV7KRQm+nWFCJphn9FSjL/0sTBGX6kmt73JOUG6mTKAEG7ctGhVx XC2kFUxUyVvZPqKROt/gLMX13j+lUPzJRH0igWOPiTbKeNaS6rAxAOvB8iKbVATq2jIe z6lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723138068; x=1723742868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HWkxNnU4sBqalSwyfrRRirCD1vzPLoXEjt3eORuHZEk=; b=CUmT+GpP7cpUx/fr6E9Nz+YZ4Zwejcvkbv5GGIJCXh2jI2bypv16rnCHpx3AgRYBhp 5sguxzoZ5Hk+CvAAtY3VIQw9jsOzuSxHw0/Vd3AsoNK4g776M63tdP9tI7t9DXD/Q4WE b3mdyN3Mw1EBm+wri5qFHzUiekNOuHXIIHXadOyaUfL7iO7cayyfnvj55PFmNRtaJrq/ dyJv+DwDAKfnEf7RgIsjZJRJL0OXenrGKlbhXDmqsFZLI0FthG0RIJTOT5Q/Cj1bm32o DkQ+ZCuOUMumPEM9M7h3Gzir0dDW6bXDI/TMuK+KDGCndD1dJLewcq3m4RMfYXjxRI/e wIOQ== X-Gm-Message-State: AOJu0Yyz6jN1DfcdMTzcKhiELvbb/I7UzG4qMwGwqrWGkA1sl4danrrk ncpY4YL9X8NxzfA4+okTBEpzxQQEHBUNmim9tlZTFvkfG4UVbISzx4sS5Q== X-Google-Smtp-Source: AGHT+IGtu27SHBP86xkut5jFOZP9QMYAdUvjhgVB0NYFDN61MXtxY2e+tXyMK2jpwDEu04a76CWwtg== X-Received: by 2002:a05:6a21:998f:b0:1c4:8294:3963 with SMTP id adf61e73a8af0-1c6fcedc911mr3652636637.24.1723138067279; Thu, 08 Aug 2024 10:27:47 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:4403:e9e1:aefe:e6e8]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e89ffsm1349829b3a.180.2024.08.08.10.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 10:27:46 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik , Jiri Kosina , Benjamin Tissoires Subject: [RFC PATCH 3/5] Input: pc110pad - remove driver Date: Thu, 8 Aug 2024 10:27:29 -0700 Message-ID: <20240808172733.1194442-4-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog In-Reply-To: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> References: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Palm Top PC 110 is a handheld personal computer with 80486SX CPU that was released exclusively in Japan in September 1995. While the kernel still supports 486 CPU it is highly unlikely that anyone is using this device with the latest kernel. Remove the driver. Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/Kconfig | 10 --- drivers/input/mouse/Makefile | 1 - drivers/input/mouse/pc110pad.c | 160 --------------------------------- 3 files changed, 171 deletions(-) delete mode 100644 drivers/input/mouse/pc110pad.c diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index f660e6ba24c2..7b7053c57588 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -312,16 +312,6 @@ config MOUSE_ELAN_I2C_SMBUS If unsure, say Y. -config MOUSE_PC110PAD - tristate "IBM PC110 touchpad" - depends on ISA - help - Say Y if you have the IBM PC-110 micro-notebook and want its - touchpad supported. - - To compile this driver as a module, choose M here: the - module will be called pc110pad. - config MOUSE_AMIGA tristate "Amiga mouse" depends on AMIGA diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile index e745b64fed49..4f9fb7d87a37 100644 --- a/drivers/input/mouse/Makefile +++ b/drivers/input/mouse/Makefile @@ -13,7 +13,6 @@ obj-$(CONFIG_MOUSE_CYAPA) += cyapatp.o obj-$(CONFIG_MOUSE_ELAN_I2C) += elan_i2c.o obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o -obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o obj-$(CONFIG_MOUSE_PS2) += psmouse.o obj-$(CONFIG_MOUSE_RISCPC) += rpcmouse.o obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c deleted file mode 100644 index efa58049f746..000000000000 --- a/drivers/input/mouse/pc110pad.c +++ /dev/null @@ -1,160 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2000-2001 Vojtech Pavlik - * - * Based on the work of: - * Alan Cox Robin O'Leary - */ - -/* - * IBM PC110 touchpad driver for Linux - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -MODULE_AUTHOR("Vojtech Pavlik "); -MODULE_DESCRIPTION("IBM PC110 touchpad driver"); -MODULE_LICENSE("GPL"); - -#define PC110PAD_OFF 0x30 -#define PC110PAD_ON 0x38 - -static int pc110pad_irq = 10; -static int pc110pad_io = 0x15e0; - -static struct input_dev *pc110pad_dev; -static int pc110pad_data[3]; -static int pc110pad_count; - -static irqreturn_t pc110pad_interrupt(int irq, void *ptr) -{ - int value = inb_p(pc110pad_io); - int handshake = inb_p(pc110pad_io + 2); - - outb(handshake | 1, pc110pad_io + 2); - udelay(2); - outb(handshake & ~1, pc110pad_io + 2); - udelay(2); - inb_p(0x64); - - pc110pad_data[pc110pad_count++] = value; - - if (pc110pad_count < 3) - return IRQ_HANDLED; - - input_report_key(pc110pad_dev, BTN_TOUCH, - pc110pad_data[0] & 0x01); - input_report_abs(pc110pad_dev, ABS_X, - pc110pad_data[1] | ((pc110pad_data[0] << 3) & 0x80) | ((pc110pad_data[0] << 1) & 0x100)); - input_report_abs(pc110pad_dev, ABS_Y, - pc110pad_data[2] | ((pc110pad_data[0] << 4) & 0x80)); - input_sync(pc110pad_dev); - - pc110pad_count = 0; - return IRQ_HANDLED; -} - -static void pc110pad_close(struct input_dev *dev) -{ - outb(PC110PAD_OFF, pc110pad_io + 2); -} - -static int pc110pad_open(struct input_dev *dev) -{ - pc110pad_interrupt(0, NULL); - pc110pad_interrupt(0, NULL); - pc110pad_interrupt(0, NULL); - outb(PC110PAD_ON, pc110pad_io + 2); - pc110pad_count = 0; - - return 0; -} - -/* - * We try to avoid enabling the hardware if it's not - * there, but we don't know how to test. But we do know - * that the PC110 is not a PCI system. So if we find any - * PCI devices in the machine, we don't have a PC110. - */ -static int __init pc110pad_init(void) -{ - int err; - - if (!no_pci_devices()) - return -ENODEV; - - if (!request_region(pc110pad_io, 4, "pc110pad")) { - printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n", - pc110pad_io, pc110pad_io + 4); - return -EBUSY; - } - - outb(PC110PAD_OFF, pc110pad_io + 2); - - if (request_irq(pc110pad_irq, pc110pad_interrupt, 0, "pc110pad", NULL)) { - printk(KERN_ERR "pc110pad: Unable to get irq %d.\n", pc110pad_irq); - err = -EBUSY; - goto err_release_region; - } - - pc110pad_dev = input_allocate_device(); - if (!pc110pad_dev) { - printk(KERN_ERR "pc110pad: Not enough memory.\n"); - err = -ENOMEM; - goto err_free_irq; - } - - pc110pad_dev->name = "IBM PC110 TouchPad"; - pc110pad_dev->phys = "isa15e0/input0"; - pc110pad_dev->id.bustype = BUS_ISA; - pc110pad_dev->id.vendor = 0x0003; - pc110pad_dev->id.product = 0x0001; - pc110pad_dev->id.version = 0x0100; - - pc110pad_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); - pc110pad_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y); - pc110pad_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); - - input_abs_set_max(pc110pad_dev, ABS_X, 0x1ff); - input_abs_set_max(pc110pad_dev, ABS_Y, 0x0ff); - - pc110pad_dev->open = pc110pad_open; - pc110pad_dev->close = pc110pad_close; - - err = input_register_device(pc110pad_dev); - if (err) - goto err_free_dev; - - return 0; - - err_free_dev: - input_free_device(pc110pad_dev); - err_free_irq: - free_irq(pc110pad_irq, NULL); - err_release_region: - release_region(pc110pad_io, 4); - - return err; -} - -static void __exit pc110pad_exit(void) -{ - outb(PC110PAD_OFF, pc110pad_io + 2); - free_irq(pc110pad_irq, NULL); - input_unregister_device(pc110pad_dev); - release_region(pc110pad_io, 4); -} - -module_init(pc110pad_init); -module_exit(pc110pad_exit); From patchwork Thu Aug 8 17:27:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 818322 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AA8B191F89; Thu, 8 Aug 2024 17:27:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138070; cv=none; b=QlNyN2YRJuTZW6AV0MZUkkA1OQYC6t71SzDZcqq8+liQekB2cJqKeaRjCWvafPyS6IC6KCMRe1+nvO7wd6gGfRxxReIGbbjOzjv48FwKD8Yrk5JSt76KSi7/SY07nNUT7EJ3Hgo0uaorF1RP4z+5TRr15wXKQJuFp/LvfETJe80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138070; c=relaxed/simple; bh=3ZsKmwzrlZfB2YYTxc4oG+oooZiVbr6oeemLdO/TzAY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mh3VeW/mbvgrPe8hsrxpTTP9+6K0addr1GD0UEfypXlbMn7ut+U8aw2SvP55SwqMBrIacO/ZnbCzFlsYWqKy1aPWjEeNGCweETl34D4K+aKGLQb3YET+f0L0m9iiHPxUMu6i0rK7JVWG5LdmulAySIbGWoRkCo+NdR2W7zxw8As= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Jlwgd9YV; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jlwgd9YV" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-710afd56c99so973074b3a.0; Thu, 08 Aug 2024 10:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723138068; x=1723742868; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vdvbvAUR0z2Nufq0kmY32p/2v+6ROcGHOdtM6kL6rew=; b=Jlwgd9YVQ5vn05OleB3V5rRA1tOZt+VvzujZVbvMI7W07TYw6KwQOLLY4pGWMUfNch Qsfli/m78DZuH3eXGCLu496NRRWE1iGeF8YJ6PhyARRd3fCDr0EWXve+V3Hub0byHA+A oNSu5YlwhkU6XljO0+hYCx7i+Ol/Tsosyqwcya5s7teeUgEynlRmHFp8377u3HEvcHWq VFgCUt7sYCLHr8X1/1vy4xBdZ4hED4WzPRx7M5wlUhRWWtCSSzQRM4Qs6iR8TfAchmK7 4FkYUlyubzxJHj5lucaqXbdIroHLHoePPqslIu7E5ghTVqBvq9kQSkT5NYAqfYb7/UU8 VLjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723138068; x=1723742868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vdvbvAUR0z2Nufq0kmY32p/2v+6ROcGHOdtM6kL6rew=; b=N5YvsAHSWsNFn46j3Ocj9wdGhPhW7YIQqhiybxlqO50lYJmKAoZr3SI/LnWNfIUeTB 5ERuf6+yooU7trjLzbAP4HGfrbo3FSmE/qsBnBDqRSpXCPEpgK0KjIRfdllkVT9iD6q7 QTutXfhr2un7D792GejWyn1CxL60tC6yNbxfKz94qVrB2h/5k2g8yflrQgogOMq1NdB/ 2E3PiDyyGg6qhjexs4PjLDDbgdbMiUWjcmFItlslvvGWlePGv32A3LHZ5/J6/gk5xctc cTvicEXMouZCMj5tEDsQ8xK///Yo9t4VF4F7ipksN5Hp9nJgmQJU6x8k5fIwuTnqzVYF 6P4A== X-Gm-Message-State: AOJu0Yw+Ki9utX7C61VGRj0WrTB4Is9nXUgmXPbvYPrJvErNnxGgxNeL Xr+CSB1vHbydc771RI+G6R/UrBkyQDzUc6OKdXHuYoHx2ZsMOebWAWwguQ== X-Google-Smtp-Source: AGHT+IEKh9p5SSTF7S+TymiO0GmRZV06egORQLFN1Dv4EbCZYUe4lJ/7OUlzqlQka8ISkWpsUIuANw== X-Received: by 2002:a05:6a00:3a06:b0:70e:aa44:39df with SMTP id d2e1a72fcca58-710cc6f7d3amr3706574b3a.1.1723138068286; Thu, 08 Aug 2024 10:27:48 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:4403:e9e1:aefe:e6e8]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e89ffsm1349829b3a.180.2024.08.08.10.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 10:27:47 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik , Jiri Kosina , Benjamin Tissoires Subject: [RFC PATCH 4/5] Input: mk712 - remove driver Date: Thu, 8 Aug 2024 10:27:30 -0700 Message-ID: <20240808172733.1194442-5-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog In-Reply-To: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> References: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This touchscreen controller was used om Gateway AOL Connected Touchpad released in 2000 and, according to Wikipedia, removed from the market in October 2001 due to slow sales. It looks like it can still be bought on eBay for $1000 but I really doubt anyone will actually use it. Remove the driver. Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/Kconfig | 12 -- drivers/input/touchscreen/Makefile | 1 - drivers/input/touchscreen/mk712.c | 215 ----------------------------- 3 files changed, 228 deletions(-) delete mode 100644 drivers/input/touchscreen/mk712.c diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 1ac26fc2e3eb..4685660faaf6 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -687,18 +687,6 @@ config TOUCHSCREEN_INEXIO To compile this driver as a module, choose M here: the module will be called inexio. -config TOUCHSCREEN_MK712 - tristate "ICS MicroClock MK712 touchscreen" - depends on ISA - help - Say Y here if you have the ICS MicroClock MK712 touchscreen - controller chip in your system. - - If unsure, say N. - - To compile this driver as a module, choose M here: the - module will be called mk712. - config TOUCHSCREEN_HP600 tristate "HP Jornada 6xx touchscreen" depends on SH_HP6XX && SH_ADC diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 82bc837ca01e..23d19ba7dc6e 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -65,7 +65,6 @@ obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o obj-$(CONFIG_TOUCHSCREEN_MMS114) += mms114.o obj-$(CONFIG_TOUCHSCREEN_MSG2638) += msg2638.o obj-$(CONFIG_TOUCHSCREEN_MTOUCH) += mtouch.o -obj-$(CONFIG_TOUCHSCREEN_MK712) += mk712.o obj-$(CONFIG_TOUCHSCREEN_NOVATEK_NVT_TS) += novatek-nvt-ts.o obj-$(CONFIG_TOUCHSCREEN_HP600) += hp680_ts_input.o obj-$(CONFIG_TOUCHSCREEN_HP7XX) += jornada720_ts.o diff --git a/drivers/input/touchscreen/mk712.c b/drivers/input/touchscreen/mk712.c deleted file mode 100644 index 753d9cc1de1f..000000000000 --- a/drivers/input/touchscreen/mk712.c +++ /dev/null @@ -1,215 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * ICS MK712 touchscreen controller driver - * - * Copyright (c) 1999-2002 Transmeta Corporation - * Copyright (c) 2005 Rick Koch - * Copyright (c) 2005 Vojtech Pavlik - */ - - -/* - * This driver supports the ICS MicroClock MK712 TouchScreen controller, - * found in Gateway AOL Connected Touchpad computers. - * - * Documentation for ICS MK712 can be found at: - * https://www.idt.com/general-parts/mk712-touch-screen-controller - */ - -/* - * 1999-12-18: original version, Daniel Quinlan - * 1999-12-19: added anti-jitter code, report pen-up events, fixed mk712_poll - * to use queue_empty, Nathan Laredo - * 1999-12-20: improved random point rejection, Nathan Laredo - * 2000-01-05: checked in new anti-jitter code, changed mouse protocol, fixed - * queue code, added module options, other fixes, Daniel Quinlan - * 2002-03-15: Clean up for kernel merge - * Fixed multi open race, fixed memory checks, fixed resource - * allocation, fixed close/powerdown bug, switched to new init - * 2005-01-18: Ported to 2.6 from 2.4.28, Rick Koch - * 2005-02-05: Rewritten for the input layer, Vojtech Pavlik - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MODULE_AUTHOR("Daniel Quinlan , Vojtech Pavlik "); -MODULE_DESCRIPTION("ICS MicroClock MK712 TouchScreen driver"); -MODULE_LICENSE("GPL"); - -static unsigned int mk712_io = 0x260; /* Also 0x200, 0x208, 0x300 */ -module_param_hw_named(io, mk712_io, uint, ioport, 0); -MODULE_PARM_DESC(io, "I/O base address of MK712 touchscreen controller"); - -static unsigned int mk712_irq = 10; /* Also 12, 14, 15 */ -module_param_hw_named(irq, mk712_irq, uint, irq, 0); -MODULE_PARM_DESC(irq, "IRQ of MK712 touchscreen controller"); - -/* eight 8-bit registers */ -#define MK712_STATUS 0 -#define MK712_X 2 -#define MK712_Y 4 -#define MK712_CONTROL 6 -#define MK712_RATE 7 - -/* status */ -#define MK712_STATUS_TOUCH 0x10 -#define MK712_CONVERSION_COMPLETE 0x80 - -/* control */ -#define MK712_ENABLE_INT 0x01 -#define MK712_INT_ON_CONVERSION_COMPLETE 0x02 -#define MK712_INT_ON_CHANGE_IN_TOUCH_STATUS 0x04 -#define MK712_ENABLE_PERIODIC_CONVERSIONS 0x10 -#define MK712_READ_ONE_POINT 0x20 -#define MK712_POWERUP 0x40 - -static struct input_dev *mk712_dev; -static DEFINE_SPINLOCK(mk712_lock); - -static irqreturn_t mk712_interrupt(int irq, void *dev_id) -{ - unsigned char status; - static int debounce = 1; - static unsigned short last_x; - static unsigned short last_y; - - spin_lock(&mk712_lock); - - status = inb(mk712_io + MK712_STATUS); - - if (~status & MK712_CONVERSION_COMPLETE) { - debounce = 1; - goto end; - } - - if (~status & MK712_STATUS_TOUCH) { - debounce = 1; - input_report_key(mk712_dev, BTN_TOUCH, 0); - goto end; - } - - if (debounce) { - debounce = 0; - goto end; - } - - input_report_key(mk712_dev, BTN_TOUCH, 1); - input_report_abs(mk712_dev, ABS_X, last_x); - input_report_abs(mk712_dev, ABS_Y, last_y); - - end: - last_x = inw(mk712_io + MK712_X) & 0x0fff; - last_y = inw(mk712_io + MK712_Y) & 0x0fff; - input_sync(mk712_dev); - spin_unlock(&mk712_lock); - return IRQ_HANDLED; -} - -static int mk712_open(struct input_dev *dev) -{ - unsigned long flags; - - spin_lock_irqsave(&mk712_lock, flags); - - outb(0, mk712_io + MK712_CONTROL); /* Reset */ - - outb(MK712_ENABLE_INT | MK712_INT_ON_CONVERSION_COMPLETE | - MK712_INT_ON_CHANGE_IN_TOUCH_STATUS | - MK712_ENABLE_PERIODIC_CONVERSIONS | - MK712_POWERUP, mk712_io + MK712_CONTROL); - - outb(10, mk712_io + MK712_RATE); /* 187 points per second */ - - spin_unlock_irqrestore(&mk712_lock, flags); - - return 0; -} - -static void mk712_close(struct input_dev *dev) -{ - unsigned long flags; - - spin_lock_irqsave(&mk712_lock, flags); - - outb(0, mk712_io + MK712_CONTROL); - - spin_unlock_irqrestore(&mk712_lock, flags); -} - -static int __init mk712_init(void) -{ - int err; - - if (!request_region(mk712_io, 8, "mk712")) { - printk(KERN_WARNING "mk712: unable to get IO region\n"); - return -ENODEV; - } - - outb(0, mk712_io + MK712_CONTROL); - - if ((inw(mk712_io + MK712_X) & 0xf000) || /* Sanity check */ - (inw(mk712_io + MK712_Y) & 0xf000) || - (inw(mk712_io + MK712_STATUS) & 0xf333)) { - printk(KERN_WARNING "mk712: device not present\n"); - err = -ENODEV; - goto fail1; - } - - mk712_dev = input_allocate_device(); - if (!mk712_dev) { - printk(KERN_ERR "mk712: not enough memory\n"); - err = -ENOMEM; - goto fail1; - } - - mk712_dev->name = "ICS MicroClock MK712 TouchScreen"; - mk712_dev->phys = "isa0260/input0"; - mk712_dev->id.bustype = BUS_ISA; - mk712_dev->id.vendor = 0x0005; - mk712_dev->id.product = 0x0001; - mk712_dev->id.version = 0x0100; - - mk712_dev->open = mk712_open; - mk712_dev->close = mk712_close; - - mk712_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); - mk712_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); - input_set_abs_params(mk712_dev, ABS_X, 0, 0xfff, 88, 0); - input_set_abs_params(mk712_dev, ABS_Y, 0, 0xfff, 88, 0); - - if (request_irq(mk712_irq, mk712_interrupt, 0, "mk712", mk712_dev)) { - printk(KERN_WARNING "mk712: unable to get IRQ\n"); - err = -EBUSY; - goto fail1; - } - - err = input_register_device(mk712_dev); - if (err) - goto fail2; - - return 0; - - fail2: free_irq(mk712_irq, mk712_dev); - fail1: input_free_device(mk712_dev); - release_region(mk712_io, 8); - return err; -} - -static void __exit mk712_exit(void) -{ - input_unregister_device(mk712_dev); - free_irq(mk712_irq, mk712_dev); - release_region(mk712_io, 8); -} - -module_init(mk712_init); -module_exit(mk712_exit); From patchwork Thu Aug 8 17:27:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 817785 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9066B1922CC; Thu, 8 Aug 2024 17:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138072; cv=none; b=FZnkwiuTkU7qtpGrPlixp0kroCMScf4xZJUoI6VDdj3ztVlyCDJ8xsPH1ZpF9uR/P0bcvuKd056g/crTcUZGwSE6rY/k+urbtkSAWbLC9nL4l4BVhvEPbqeSNqKwAFvOHinOqidYNouT491BvHyfJ424Gy/GIgrs4AQTllZ0dB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723138072; c=relaxed/simple; bh=dRi5Uxsw1SqVcQJw/OCgJPsOMrveCqLhXgGtzkccVgs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qGw9J2GEp7EZqBStTDn6RCJzLfYvQ7ZRsUcY9FnJIfofCR6laMb7C+rdeB7W9+LEcHxO2wn1N3MTdCorju72XiJZ7SrUQKjhn57f2Xd5XmOGNrY5tXyau5wX95rVKgLdFnf4XFWu6SYkSaepICoua82JTi68hCsjOPgeh1Y0XyA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bv6ExeEa; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bv6ExeEa" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-70d19d768c2so927926b3a.3; Thu, 08 Aug 2024 10:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723138069; x=1723742869; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ieJFhFzS+sS6bkrY7PwRdr8dfJifoCFcuPsanvyTTx4=; b=bv6ExeEaWmnpkxI25x76wfWUbj+caCx6GIMObZFmgwUzAsY3/KuBwwzkmmoUWn+cWa TKLKetw81PM/ZCrI9O8RsOY3gaF2CGhdOhs22xnvd+/4+bkiK3PVvjBbaoKbjKZNkLAu y0NTPf66DmmVtL2Anh/bKfS63kG0b0WY2OlpRg7z13eamk2vJU0iOL0dRjLSxwAt42Ef HRObVbNBIVC+AopfQDI/7//6elYe7s5zLPAG2fM+g3S+ynnrgX/Scew5qTaVUmuGk7yI pF5bgFoLe76oLuDjA/Lb3pkWNHxRelS7FofftrUbv3EKxBElOAnmvkKwaeEuSqGlW7xo Knog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723138069; x=1723742869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ieJFhFzS+sS6bkrY7PwRdr8dfJifoCFcuPsanvyTTx4=; b=Wx937voY4w5q4xWVMT1KejPfXs/T7TzuH1IbG3LCNE2qPNteB6Crj8+mrLrTCySU7Q ThyrUKUdmb5YanqmQb8siEZFWf6N5TW+r5cC6B0sZCH2ghtUwAPaanBD10J4KRLok3g4 QxqfVcawtNZfi1kRc8CjBfQvA+Rgf7m3glk+zOSRfpFuSQv4FgohmFiyUe8YXFEn8muV kAFQ3cZGYuLUNu6uYPWRp5am+DQKG6TFAZ88V3XersOtJ73t2DJ9OSK08dQalHKDyF8Q xtXRAVJNciV/QWe7rksruLHrEpCsFQ6opIBS2CsZeZiLWaENJUL85ZIvUqonxpYYAXGI en4Q== X-Gm-Message-State: AOJu0YzoTSTcsZ8ytyM2+fV90sigCjFVY+drVJzX5xm8A3kmz+PYIUAZ Cyr2YjK7mVPHqqHYURbP5ZECsWyIQ/57HOcI62qsgmELnopW7gY6p7ly4w== X-Google-Smtp-Source: AGHT+IGRqKhzo1rj7EBGIhV/ltFdLdkwa2qFpyqB4gD9vhJObVyG1+HA4pNjsEv/ifYUyf2tlfzUgw== X-Received: by 2002:a05:6a20:12d5:b0:1c2:a722:92b2 with SMTP id adf61e73a8af0-1c6fcf9c861mr3142375637.45.1723138069434; Thu, 08 Aug 2024 10:27:49 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:4403:e9e1:aefe:e6e8]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e89ffsm1349829b3a.180.2024.08.08.10.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 10:27:48 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik , Jiri Kosina , Benjamin Tissoires Subject: [RFC PATCH 5/5] Input: ct82c710 - remove driver Date: Thu, 8 Aug 2024 10:27:31 -0700 Message-ID: <20240808172733.1194442-6-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog In-Reply-To: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> References: <20240808172733.1194442-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a PS/2 mouse interface chip from Chips & Technologies that was used in TI TravelMate and Gateway Nomad laptops, which used 386 and 486 CPUs. While the kernel still supports 486 CPU it is highly unlikely that anyone is using these devices with the latest kernel. Remove the driver. Signed-off-by: Dmitry Torokhov --- drivers/input/serio/Kconfig | 13 -- drivers/input/serio/Makefile | 1 - drivers/input/serio/ct82c710.c | 239 --------------------------------- 3 files changed, 253 deletions(-) delete mode 100644 drivers/input/serio/ct82c710.c diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index 17edc1597446..cf449f7cbaa5 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig @@ -55,19 +55,6 @@ config SERIO_SERPORT To compile this driver as a module, choose M here: the module will be called serport. -config SERIO_CT82C710 - tristate "ct82c710 Aux port controller" - depends on X86 - help - Say Y here if you have a Texas Instruments TravelMate notebook - equipped with the ct82c710 chip and want to use a mouse connected - to the "QuickPort". - - If unsure, say N. - - To compile this driver as a module, choose M here: the - module will be called ct82c710. - config SERIO_Q40KBD tristate "Q40 keyboard controller" depends on Q40 diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile index 6d97bad7b844..8ab98f4aa28d 100644 --- a/drivers/input/serio/Makefile +++ b/drivers/input/serio/Makefile @@ -9,7 +9,6 @@ obj-$(CONFIG_SERIO) += serio.o obj-$(CONFIG_SERIO_I8042) += i8042.o obj-$(CONFIG_SERIO_PARKBD) += parkbd.o obj-$(CONFIG_SERIO_SERPORT) += serport.o -obj-$(CONFIG_SERIO_CT82C710) += ct82c710.o obj-$(CONFIG_SERIO_RPCKBD) += rpckbd.o obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c deleted file mode 100644 index 6834440b37f6..000000000000 --- a/drivers/input/serio/ct82c710.c +++ /dev/null @@ -1,239 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 1999-2001 Vojtech Pavlik - */ - -/* - * 82C710 C&T mouse port chip driver for Linux - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -MODULE_AUTHOR("Vojtech Pavlik "); -MODULE_DESCRIPTION("82C710 C&T mouse port chip driver"); -MODULE_LICENSE("GPL"); - -/* - * ct82c710 interface - */ - -#define CT82C710_DEV_IDLE 0x01 /* Device Idle */ -#define CT82C710_RX_FULL 0x02 /* Device Char received */ -#define CT82C710_TX_IDLE 0x04 /* Device XMIT Idle */ -#define CT82C710_RESET 0x08 /* Device Reset */ -#define CT82C710_INTS_ON 0x10 /* Device Interrupt On */ -#define CT82C710_ERROR_FLAG 0x20 /* Device Error */ -#define CT82C710_CLEAR 0x40 /* Device Clear */ -#define CT82C710_ENABLE 0x80 /* Device Enable */ - -#define CT82C710_IRQ 12 - -#define CT82C710_DATA ct82c710_iores.start -#define CT82C710_STATUS (ct82c710_iores.start + 1) - -static struct serio *ct82c710_port; -static struct platform_device *ct82c710_device; -static struct resource ct82c710_iores; - -/* - * Interrupt handler for the 82C710 mouse port. A character - * is waiting in the 82C710. - */ - -static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id) -{ - return serio_interrupt(ct82c710_port, inb(CT82C710_DATA), 0); -} - -/* - * Wait for device to send output char and flush any input char. - */ - -static int ct82c170_wait(void) -{ - int timeout = 60000; - - while ((inb(CT82C710_STATUS) & (CT82C710_RX_FULL | CT82C710_TX_IDLE | CT82C710_DEV_IDLE)) - != (CT82C710_DEV_IDLE | CT82C710_TX_IDLE) && timeout) { - - if (inb_p(CT82C710_STATUS) & CT82C710_RX_FULL) inb_p(CT82C710_DATA); - - udelay(1); - timeout--; - } - - return !timeout; -} - -static void ct82c710_close(struct serio *serio) -{ - if (ct82c170_wait()) - printk(KERN_WARNING "ct82c710.c: Device busy in close()\n"); - - outb_p(inb_p(CT82C710_STATUS) & ~(CT82C710_ENABLE | CT82C710_INTS_ON), CT82C710_STATUS); - - if (ct82c170_wait()) - printk(KERN_WARNING "ct82c710.c: Device busy in close()\n"); - - free_irq(CT82C710_IRQ, NULL); -} - -static int ct82c710_open(struct serio *serio) -{ - unsigned char status; - int err; - - err = request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL); - if (err) - return err; - - status = inb_p(CT82C710_STATUS); - - status |= (CT82C710_ENABLE | CT82C710_RESET); - outb_p(status, CT82C710_STATUS); - - status &= ~(CT82C710_RESET); - outb_p(status, CT82C710_STATUS); - - status |= CT82C710_INTS_ON; - outb_p(status, CT82C710_STATUS); /* Enable interrupts */ - - while (ct82c170_wait()) { - printk(KERN_ERR "ct82c710: Device busy in open()\n"); - status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON); - outb_p(status, CT82C710_STATUS); - free_irq(CT82C710_IRQ, NULL); - return -EBUSY; - } - - return 0; -} - -/* - * Write to the 82C710 mouse device. - */ - -static int ct82c710_write(struct serio *port, unsigned char c) -{ - if (ct82c170_wait()) return -1; - outb_p(c, CT82C710_DATA); - return 0; -} - -/* - * See if we can find a 82C710 device. Read mouse address. - */ - -static int __init ct82c710_detect(void) -{ - outb_p(0x55, 0x2fa); /* Any value except 9, ff or 36 */ - outb_p(0xaa, 0x3fa); /* Inverse of 55 */ - outb_p(0x36, 0x3fa); /* Address the chip */ - outb_p(0xe4, 0x3fa); /* 390/4; 390 = config address */ - outb_p(0x1b, 0x2fa); /* Inverse of e4 */ - outb_p(0x0f, 0x390); /* Write index */ - if (inb_p(0x391) != 0xe4) /* Config address found? */ - return -ENODEV; /* No: no 82C710 here */ - - outb_p(0x0d, 0x390); /* Write index */ - ct82c710_iores.start = inb_p(0x391) << 2; /* Get mouse I/O address */ - ct82c710_iores.end = ct82c710_iores.start + 1; - ct82c710_iores.flags = IORESOURCE_IO; - outb_p(0x0f, 0x390); - outb_p(0x0f, 0x391); /* Close config mode */ - - return 0; -} - -static int ct82c710_probe(struct platform_device *dev) -{ - ct82c710_port = kzalloc(sizeof(*ct82c710_port), GFP_KERNEL); - if (!ct82c710_port) - return -ENOMEM; - - ct82c710_port->id.type = SERIO_8042; - ct82c710_port->dev.parent = &dev->dev; - ct82c710_port->open = ct82c710_open; - ct82c710_port->close = ct82c710_close; - ct82c710_port->write = ct82c710_write; - strscpy(ct82c710_port->name, "C&T 82c710 mouse port", - sizeof(ct82c710_port->name)); - snprintf(ct82c710_port->phys, sizeof(ct82c710_port->phys), - "isa%16llx/serio0", (unsigned long long)CT82C710_DATA); - - serio_register_port(ct82c710_port); - - printk(KERN_INFO "serio: C&T 82c710 mouse port at %#llx irq %d\n", - (unsigned long long)CT82C710_DATA, CT82C710_IRQ); - - return 0; -} - -static void ct82c710_remove(struct platform_device *dev) -{ - serio_unregister_port(ct82c710_port); -} - -static struct platform_driver ct82c710_driver = { - .driver = { - .name = "ct82c710", - }, - .probe = ct82c710_probe, - .remove_new = ct82c710_remove, -}; - - -static int __init ct82c710_init(void) -{ - int error; - - error = ct82c710_detect(); - if (error) - return error; - - error = platform_driver_register(&ct82c710_driver); - if (error) - return error; - - ct82c710_device = platform_device_alloc("ct82c710", -1); - if (!ct82c710_device) { - error = -ENOMEM; - goto err_unregister_driver; - } - - error = platform_device_add_resources(ct82c710_device, &ct82c710_iores, 1); - if (error) - goto err_free_device; - - error = platform_device_add(ct82c710_device); - if (error) - goto err_free_device; - - return 0; - - err_free_device: - platform_device_put(ct82c710_device); - err_unregister_driver: - platform_driver_unregister(&ct82c710_driver); - return error; -} - -static void __exit ct82c710_exit(void) -{ - platform_device_unregister(ct82c710_device); - platform_driver_unregister(&ct82c710_driver); -} - -module_init(ct82c710_init); -module_exit(ct82c710_exit);