From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796013327; b=KCDA43zPwjlvArCNDwM3WvjNU+3FedSCywbHrj+7Ec89B79jmJY+mRYh1TnsA4Yq/znu 5SkXLhRstlmz3d4s77eVvJNoObsVVhIO9utYGdYsOPrFl3dagl9E3bdQOSoeo7/WnL7dD q35iHTD0Q0R8nIVqPCShtAafD8rO82QGnn643Lr0IPVJpb+Pgscf+wd/+dq8+IT5fn//r zkLRUyuzBzeTWeNibOrt0z7S/XmmPvfe3fqkbciFY5bwCSl+303K+xWNPKfVczuPVHvmj aO8ebYrX6UgoOrqn6Myo+NAW61veMKtWh+XZaxxVu2LPajFy3Jp4BZ9xugFM2K3Vg2A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796013327; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding: Content-Disposition; bh=ovbAOfpVFXZnRXwxFy0DqA1kU3gURuYJa+QlbNZQr58=; b=TU7N6jT0NL5lrkV35xalb+sZr2oOY80FKMcZpHgNyEJf7hNzuwttxT3IalcjIz5E8WsY lGFHEeSUV2UvDyOx7m2ofTHLHStHmmgtbX1T8t9clbJ7tF4weJULwvuB9YCzsQdpeq2d8 0whH2IviXexkW+WzXK42LNfLlfLYVvP9Ksy8QZr29G7hFJHwLULJXSQjpX5u0VFdbzmDT R3kfP6ZlVYasoZhIvSkYYQ/9ZN8GJ7oMnjAibbeSXaILTViMWD4Se0ifN/Txi7vrtCZhQ +mykiJRXGApn20dr1uHZUFeUx/FE+E/KkDacd+dGYZ0GRnjBofKfC2RWb5u58BmAecw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=teCLTQ4G; arc=none smtp.remote-ip=74.125.82.48 Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A438606A325 for ; Mon, 30 Nov 2026 04:35:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8A438606A325 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.a=rsa-sha256 header.s=20260707 header.b=teCLTQ4G Received: by mail-dl1-f48.google.com with SMTP id a92af1059eb24-1b5786e099cso9452446c88.0 for ; Sun, 29 Nov 2026 20:35:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796013327; x=1796618127; darn=vger.kernel.org; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ovbAOfpVFXZnRXwxFy0DqA1kU3gURuYJa+QlbNZQr58=; b=teCLTQ4GwzQdSdlMOmiLnUThbWbWeYAkB/1INmoUi/MA5YXylpcvBR219hx3Uqo3zO +0QKHFnagaMmITZAeIZzog0nAKQj9gyyUiMVBGOYg0Xe/5h9Aat7n3+6c4vxLa2P0TqB dKJyHN5gxOzoPYhvRs4W+4VZRloLMBohoOSHU+wbzusYAH5f5YEqmuQX90PLU2iXJbiL UYWuq7Or97NT7YfmswyUhif5EKJI5A3ujgbj/FqCzLcE0K4e4xpGKgKFpmsrCXUF+8m1 CI938ULSLZOyr+/wDP/du5G6OyhpnKmEu8Klmla6veQOVB9A4F4Q5XxkfCuzWt+FPrsI bRyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796013327; x=1796618127; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ovbAOfpVFXZnRXwxFy0DqA1kU3gURuYJa+QlbNZQr58=; b=gcA09QVR75A8tRLvvzJB+OxOn1c/2XtuJCqDjXnugC5v4d6Lq5mTjOKk+BEEy587Fl ZKwQYkigKbE5e7v2DxtXmIYqsGzZTbYb0vvSI0KNrc2MvacD3dmmRjr/g0XI1jCLLBzh TT6p/MzzVK8YJrb28VhcFbXp5hpw237ArRks8SMGrk4NfrdlvT3Zy/vqG7OjU8cfttSW tYpFvneRg/WOnZ/9qBFcKNiHE4FYZaGXUK9E8fxQeAZJpGm30WjcCW0XxprKEfufmGOD TG0+GSsJK8xcqq/BcJtNE0vLnpBk+DLU5hmhavBaKTW5Baj8ynEZrN8QLybPjrZSffbP 1Ziw== X-Forwarded-Encrypted: i=1; AL+hErF4RDApsRmG6zvPiWSEycCPzjdtc0pUVgow3i0VJwJSZQzk/cG3f7S3FlYHa8vveBUIf+WgmhpI+MjUNg==@vger.kernel.org X-Gm-Message-State: APuU4Z85DmUGnkEzjYhsmDXE2Sw0/1kvyxq/12+IEnC+U4bq7VbgfPUH lNKaQ9o4Ul7UMZ05lLw+XKKCNVBVr5agLhELrfe4O4yYnbUSWPC8G5U2 X-Gm-Gg: AZFdTZcUnhrb6CszcMuWhMhmMsWCDYsTOEJs/Xuyco0UfNaYUNu3mek9h2y3zSUB9Wd MbBQ8YFn1CucE8qbcmNCfB4BcJJ2gaMHDs0r0KqveMJM4SyZKqQXrCjt64j1IzsvmQ/DevbxyvR Z3LnH2WrkC8Elj7C9E7bL+cQB7lJQbuV9KcKopAHhI2RoWzRfd566eeJHLZf2Ye2aF3CIZmL8f3 Oxj6dZxTcKGyqtLbrAwFJZHO9DmvK1FsynKQCCQlO5e9ztHXqlU3r82gr9YvA99QzP/txXmbClE 6Yvndhm7KCgdL+7nGEfspn2IgBL/B5oFr0mP+r4wbBtQ9jh8Gjxy72gDrCNxOeXHW+pk6Stkb9n i2aG5YGOXUv5pxXPXfTAgGDgNEMnatH5t+7dsPwMAbyfWh1FoHJLYYOAZ3jueSgR7bdnL3/a3NY Fndnfb6yx6zAa5oti6dFO8HDqTRR2WB/od37pLGywsnQD7Kl/RTGn9oUSO+5DzfvUVWDm8m/Gdc 5olAmOzx0oYwtGOYQhhkC1r+/COH4067evK0UP/RSS/MRPvYInFLxHIZtA1bA7uuLB+Ab6eFrK5 Y517GH7EAvCsFkZsDzGyPrmHRKmJs/Z1EQujZmKQX1Ch9WE4AWUgatOhASTSZf6IvU33 X-Received: by 2002:a05:701a:cc96:20b0:1b5:8265:33a7 with SMTP id a92af1059eb24-1b5826535c1mr17564786c88.17.1796013326517; Sun, 29 Nov 2026 20:35:26 -0800 (PST) Received: from localhost ([2a00:79e0:2ebe:8:ba7e:5b43:81b2:edf]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5567ff27bsm86612454c88.6.2026.11.29.20.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 20:35:26 -0800 (PST) Date: Sun, 29 Nov 2026 20:35:25 -0800 Message-ID: From: Dmitry Torokhov To: Linus Walleij Cc: sashiko-reviews@lists.linux.dev, Michael Zaidman , linux-input@vger.kernel.org, linux-serial@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH v4 03/16] HID: ft260: add GPIO support In-Reply-To: References: <20261117200423.19561-1-michael.zaidman@gmail.com> <20261117200423.19561-4-michael.zaidman@gmail.com> X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Linus, On Mon, Nov 30, 2026 at 12:17:47AM +0100, Linus Walleij wrote: > And yet your LLM inference fails to see what kind of architectural > violation this is. And this should be [Severity: Critical] Thank God LLMs still cannot figure out architectural direction on their own, otherwise we would all be out of a job... ... > I wonder if I can add something to review-prompts to make it > detect things like this better? Yes, kernel/subsystem/gpio.md in review-prompts would be the place for it. It already triggers on gpio_chip usage anywhere in the tree, whereas a separate pinctrl guide would not load when a driver avoids pinctrl altogether. That said, this rule is not really documented in the kernel tree either, so neither humans nor LLMs have much to go on. If the diff below matches what you have in mind, I am happy to send it as a proper patch. Thanks. diff --git a/Documentation/driver-api/gpio/driver.rst b/Documentation/driver-api/gpio/driver.rst index 3e53374c7e9f..7cd34b3d1672 100644 --- a/Documentation/driver-api/gpio/driver.rst +++ b/Documentation/driver-api/gpio/driver.rst @@ -284,6 +284,20 @@ supports more versatile control over electrical properties and can handle different pull-up or pull-down resistance values. +Multiplexed GPIO pins +--------------------- + +If pins handled by a GPIO controller can be multiplexed between GPIO and +other hardware functions (such as UART, I2C, SPI, clock, or LED signals), +do not implement ad-hoc pin-function selection in the GPIO driver or expose +custom sysfs attributes to change pin modes. Implement a combined pin +control and GPIO driver under ``drivers/pinctrl/`` instead. When the pins +are part of a multi-function or bridge device handled in another subsystem +(such as USB or HID), spawn a child device (for example, a platform device) +for the combined driver. See Documentation/driver-api/pin-control.rst for +details. + + GPIO drivers providing IRQs =========================== diff --git a/Documentation/driver-api/pin-control.rst b/Documentation/driver-api/pin-control.rst index 80106e44a368..27d5e3b1fc49 100644 --- a/Documentation/driver-api/pin-control.rst +++ b/Documentation/driver-api/pin-control.rst @@ -1470,6 +1470,28 @@ will be done when the state is activated, so in effect one specific pin can be used by different functions at different times on a running system. +Userspace pin multiplexing +========================== + +Drivers must not expose custom per-driver userspace interfaces (such as +driver-specific sysfs attributes) for inspecting or changing pin multiplexing +and pin function selection. Pin multiplexing must be implemented through the +pin control subsystem in ``drivers/pinctrl/``. + +When a multi-function or bridge device lives in another subsystem (for example, +a USB or HID adapter combining I2C, serial, and multiplexed GPIO pins), spawn a +child device such as a platform device and implement a combined pin control and +GPIO driver under ``drivers/pinctrl/`` rather than adding ad-hoc mux controls +to the parent driver. + +If hotpluggable or otherwise non-firmware-described hardware genuinely needs +userspace control over pin groups and functions (because Device Tree, ACPI, or +board mappings cannot describe the wiring), that support must be designed as a +standardized interface in the pin control core rather than per-driver sysfs +files. The ``pinmux-select`` debugfs file described below is for debugging only +and is not a stable userspace ABI. + + Debugfs files ============= -- Dmitry