From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796013328; b=W/GwzOfHEoTaIUY6bLznP0WgkokFICdckBWRiwcBaM8sVP4qXEQT0s5hKsZ2+PoH8/Jo oJU8CeLBVecDHwMhC8yxI3occyDpCH0oC/YjNpNOfLKvWDVKrxIiL669e0VQ2n+/ieE4o KBeQHVCW7/p065Y/DwLSmoZEawPBK+xwx4Frdq7+dcMhR8jUJNDG0UIMyCdj2U4DXRHoi YWc+56YR6oY4Xm//6q/PMhmsxFpo7YQhzyuE+dUg2Ox9JwUEJEB/xapU1VxrZz7qgjZ2V PAAeDgGZWufnIo1nZUdfoqN4RLUvGSTsOlI7LaQlakCkgCe6uDCFyqZXF+5g+lyX/aQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796013328; 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=SDe/WgitdWcCrRaDcOu67bZWbo9JwkuN4/XA+kff7F8RD3T6lODZjAkCJIpeMEApRMkz 56saLeff5yI2ZkO2D8Otanqkz5PIc+A7eHBxDhPaZaUFaUN0+OJnDIeI0/k1rZ1wYKIo7 Erf3qGn4keG+lgPnanFiw3VvVaZheQheuJDDOCTKpHI+II4zsQ/fbqJQ3/LWHN7lCTrht bi0A15Z8Ivk25NsjKEJ4vPaHUyeMJxa5zh5y/MIu2JwXoW5493ulhUuOxS5Zyv+Ef8gyM 5Ki5dTxx24TPBGIwoDHxMl4vTofIUvprzWrkiLyJSkiMxaaXnFLvu6SIWo6eSEf8cdw== 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.51 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (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 9B2D5606A329 for ; Mon, 30 Nov 2026 04:35:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9B2D5606A329 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-f51.google.com with SMTP id a92af1059eb24-1b563e32936so5526509c88.1 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=fedeYRwYFcMtByeeWxqdPoO6gHRd7vujZgBJJCgEGpMq4Fd4hBSCks3Rp/mH9U3TIO KSkK219g0ymlvgWjApVfw/2eAjmkILqePjIj7KerX9C8l6t2utgAb28O0WHmpjQS0/xi oR54/2DCRcwPFoo+pqFxdGY4xrtfvEJWl/3HJOSvEs2rLlU+ZiotSy3QszjYasoY0g45 1aCSUK5I7+l+3sss9KhHwa26piDiQGkIWkrabVectboP9KSfR4VO00kbynchrA764+SM kxwWopfAKx0WI0XoWH/Z061Ut2lsNx+rwhFLqibQPXPUyJC28hCWGN93Rvr0OTL/vvL2 ruww== X-Forwarded-Encrypted: i=1; AL+hErFBUdUS2MzFjL+iaE4F8kwP21FRjDJBlC4M3xKP37xlMxsqYEcZG+zVIsmSCJM1/hP9Bdjc+tPRZEIt@vger.kernel.org X-Gm-Message-State: APuU4Z+q1GfA60pEV6doU8hSbneuG7RyssinLWQB13QU6+Jiwq4XpiqT VoPLCfGuDIx9HlyGV+JKaJ6vCI/nZUJ2IYIZt9CRTKfsMRNQK5RjFrk1 X-Gm-Gg: AZFdTZc2ancpST+dzAPLBxytQ/dv1lVOxhQwoE6HA2uCmB1MA2LYs8v37o58q2hLgvc 0lwojpe7T5gRZJlUbOO76BVmyABOGMV1PwBDTGuZrZiM4caNmm3qt/8mADhAADD835X1+JBpx+I gt9+c9M1l1BqYH4bE2S/SdXSWjrbOwVvx1Cn/niLuqn/iV8KCdKLJxzbOds5KVUK3iNl/9MpJBG WuPFppuzWxKuPpraQ8ICBAtuyC3is4buWT4+B0xswVSR4grmgz8THFNH4hymW2ujQhs9UdYSJsG TQFFOhEtV5KTY1ryc+cdQNA59wW1EcDfi0Zu8LYyaJ1pyHIVkGih/PZ1MIHUfpYxkr0+JXLhcFG 6l33NkV3fY6Mr043HtO+MY6htXLpWxnt2ukcpES0dE11b2M/dXOaTkQTysyjr+jhy3moYw01crs x1EoRqMFMvBTFzuBabzZ6Q/IV8ofdVGn4mBit98SnYPQ2b+uGVV9lbtWBjERZIJOgEOtkR7u/HN U+XMPJ2PITchgFTUN5RJIr617u+N7pdjxQlFRJsn1YP3gGKEV47zxwC1ARF39RliwJ8LlHQwAuu hjddOCDHI/hJEYCEfklzDq084a2UJc3fUfoewtH/MjBj2t2U8DeMANoKCT+uPQQS5qeb 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-gpio@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