From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796013327; b=Bxczs0An7iIjnZ/Grzb7gkuMjMIl0USX4+SfsapcoQzuHasaGctBw/Hor6BZ2Cs0rhy6 ytFsWHyLLt2uJW2pN2NjLOA9/yI/FM4yCXNWZBAy8/SAq023aPFNBr5y55UlKPadtApDi 8f6q17HJLYLubQ4BhgizCtswwBasvgknmiJCN1IGdQT3YagDfB/Br7271BBTbj1dIebAb SfEiAmMTXkVSoUJeW6vrm4qAeSzBZbJMniaxiWJOWVIn5zHwUVS1KkNbbi/QQ6OIV7lDw eU4XjX9QWksT+lE2MoKwKngNty9ah7p1jO4avtHKAVYqIjwHFAd+/hgsiRMur+XbJNQ== 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=mzVXt6D9YfRukbFG1E/CGCFOAvqnR4bUdrFP1kkzYFWpik2Rjdam8KEoRxrUqLaliCwr Tvk9T8oLBq9yK1i++JggIDJ4xAikGoZ1N6/Ee5dn3VT+A2e/+w0oa4znNVyd3zsHCTQv5 gyQ1fPwJOfZBqD0wzOOudJrd/hOcS0dPVAzPo8zUHyizgD5gLCXBWaCsqrYdc7oprOspL me6yl5Uzrw7bmOWFabQLWrX4ZerfkWNpzm+KqoVDU1DbvidZGYHxDKVidnpTVssiTW5gW toSUa69A5dJqndKkLXbzeA5WLhoSBCnhacfDIbTsvpURj+DEzNmT1D2WqS/lbJ8bP5g== 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.47 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (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 8C30E606A327 for ; Mon, 30 Nov 2026 04:35:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8C30E606A327 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-f47.google.com with SMTP id a92af1059eb24-1b5786e099cso9452447c88.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=k+CJ7IpDBHCN/z1zi4L645pTdKPW+42HCNJAovhYJZh8E76l8vyGCT6LnnkuaUAa3v C666CsT3VFVSZOHw5oG0IAcWlI8V0x7+L6CNv0lqT+5NDl5HqGUk275WSKyDCdUHwSZ7 7Ay0IGUL3tMw4ZREE4ahfNO5mmOoOOwtA4Z/yo6aOmbM59F5xqpU7DzEZ91bccDKOyC+ mkdeGHA1svDkoa5prtP4ivI87x6/pWqTH0EjLC59UC4ITC28SssIknhkOXRMaQIR8iuz yfbIlwCE17Pa89FqYRVf/LTYSA68AKbz9YwNfxxNv01mHNg70uvEkhVVhmtD7cV6D+JP nrvw== X-Forwarded-Encrypted: i=1; AL+hErEf6BkWn284Cqio1T08B6+B5J8eeQtfIFOk0bUxq36w5HGk9yN9R6CNdfuVISHhtcwJVvj7K1HBsAY50Rs=@vger.kernel.org X-Gm-Message-State: APuU4Z+Go82UqsSqdhL1DjpH3Tyt8lB7yucIdAHKZf+Mig/3xBaEJUfN b1Cm5Y65pRPGlpaDzajpjlkmZHQHXWc66eXQDWDjGM2YEdoBRLlGtAPQ X-Gm-Gg: AZFdTZcrGicGzeY70v+EJCTlfXleWmwv2nFGn7CPWC++cWGJCAgpxUfbc1VMG/U8335 ec0RT0TOfHLao7b+6c7XPal6O6c78bHZdqhcAp5FrbQiiz4R47lRXHsX36sZrRRaryAsprM7Aa1 TEFyXqTibjzKRs+CZ8YREnzh+fLJQB++BNZHeXk1MyWSjNsLwrsBSEFJd8kADYqMcZWO4wYBr2J yXd6W4l/oscXugczM0M5blD/ug47932vcDvk1OepnE8CpEyBBG+8OyimuiMl94+dWVeaFmw6Fo5 kyb7rKCzcqC49O/fLX3XHqyO2lEafCYdYpZaZrbhKCVtCrzr60BOXNx+yWrq5zk9L/vXrGgoKiM 3/bnhzYtq7ZN3qjyWbVHSe/lh9koB4W52mIPhAZVq2cuaCYbWCV7Sh8xGxF9Qg786i5WGIStRrN TyVQcF0PKyBYdM0COu+4gpnr4uxBkXSo96Bbj4T6vhfn+uwrGgeFHE8d0deSRXp6onDDzhmAXMh AlfrJG1bU69su+rQ72zTOUydGWZhc6BU3piXb67SJNP7H/DXuEKX7kMt1su3jWwkljO6ZafoOW0 aNtdW2vBIGngxrfqlY0uM8q5xI8L9IBW20+L2EEA3YFdJmvnNE2Kt6TXhKk1eiLGe7WT 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-serial@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