Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v2 08/16] property: Document that fwnode API returns available nodes
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

The fwnode API has historically provided two functions to iterate over a
fwnode's child nodes, fwnode_get_next_child_node() and
fwnode_get_next_available_child_node() whereas all of the fwnode API has
always worked on available nodes, apart unavailable ACPI child device
nodes could have been returned by fwnode_get_next_child_node().

Now that the availability check has been added to ACPI side as well,
document that the functions in the fwnode API return available nodes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/property.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 4bd64e729431..ff440456af7b 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -785,7 +785,7 @@ struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_nth_parent);
 
 /**
- * fwnode_get_next_child_node - Return the next child node handle for a node
+ * fwnode_get_next_child_node - Return the next available child node handle
  * @fwnode: Firmware node to find the next child node for.
  * @child: Handle to one of the node's child nodes or a %NULL handle.
  *
@@ -830,7 +830,7 @@ fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node);
 
 /**
- * device_get_next_child_node - Return the next child node handle for a device
+ * device_get_next_child_node - Return the next available child node handle for a device
  * @dev: Device to find the next child node for.
  * @child: Handle to one of the device's child nodes or a %NULL handle.
  *
@@ -858,7 +858,7 @@ struct fwnode_handle *device_get_next_child_node(const struct device *dev,
 EXPORT_SYMBOL_GPL(device_get_next_child_node);
 
 /**
- * fwnode_get_named_child_node - Return first matching named child node handle
+ * fwnode_get_named_child_node - Return first available matching named child node handle
  * @fwnode: Firmware node to find the named child node for.
  * @childname: String to match child node name against.
  *
@@ -874,7 +874,7 @@ fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_named_child_node);
 
 /**
- * device_get_named_child_node - Return first matching named child node handle
+ * device_get_named_child_node - Return first available matching named child node handle for a device
  * @dev: Device to find the named child node for.
  * @childname: String to match child node name against.
  *
@@ -928,7 +928,7 @@ bool fwnode_device_is_available(const struct fwnode_handle *fwnode)
 EXPORT_SYMBOL_GPL(fwnode_device_is_available);
 
 /**
- * fwnode_get_child_node_count - return the number of child nodes for a given firmware node
+ * fwnode_get_child_node_count - Return the number of available child nodes for a given firmware node
  * @fwnode: Pointer to the parent firmware node
  *
  * Return: the number of child nodes for a given firmware node.
@@ -946,7 +946,7 @@ unsigned int fwnode_get_child_node_count(const struct fwnode_handle *fwnode)
 EXPORT_SYMBOL_GPL(fwnode_get_child_node_count);
 
 /**
- * fwnode_get_named_child_node_count - number of child nodes with given name
+ * fwnode_get_named_child_node_count - Return the number of available child nodes with given name
  * @fwnode: Node which child nodes are counted.
  * @name: String to match child node name against.
  *
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count()
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

FWNODE_GRAPH_DEVICE_DISABLED flag isn't used anywhere, drop the flag and
support for it in fwnode_graph_get_endpoint_count().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/property.c  | 10 ++--------
 include/linux/property.h |  8 +-------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 7fc3257f223d..4bd64e729431 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1291,21 +1291,15 @@ EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id);
 /**
  * fwnode_graph_get_endpoint_count - Count endpoints on a device node
  * @fwnode: The node related to a device
- * @flags: fwnode lookup flags
  * Count endpoints in a device node.
- *
- * If FWNODE_GRAPH_DEVICE_DISABLED flag is specified, also unconnected endpoints
- * and endpoints connected to disabled devices are counted.
  */
-unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
-					     unsigned long flags)
+unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode)
 {
 	struct fwnode_handle *ep;
 	unsigned int count = 0;
 
 	fwnode_graph_for_each_endpoint(fwnode, ep) {
-		if (flags & FWNODE_GRAPH_DEVICE_DISABLED ||
-		    fwnode_graph_remote_available(ep))
+		if (fwnode_graph_remote_available(ep))
 			count++;
 	}
 
diff --git a/include/linux/property.h b/include/linux/property.h
index d1e80b3c9918..8b8bbbe6b5b7 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -503,19 +503,13 @@ static inline bool fwnode_graph_is_endpoint(const struct fwnode_handle *fwnode)
  * @FWNODE_GRAPH_ENDPOINT_NEXT: In the case of no exact match, look for the
  *				closest endpoint ID greater than the specified
  *				one.
- * @FWNODE_GRAPH_DEVICE_DISABLED: That the device to which the remote
- *				  endpoint of the given endpoint belongs to,
- *				  may be disabled, or that the endpoint is not
- *				  connected.
  */
 #define FWNODE_GRAPH_ENDPOINT_NEXT	BIT(0)
-#define FWNODE_GRAPH_DEVICE_DISABLED	BIT(1)
 
 struct fwnode_handle *
 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 				u32 port, u32 endpoint, unsigned long flags);
-unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
-					     unsigned long flags);
+unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode);
 
 #define fwnode_graph_for_each_endpoint(fwnode, child)				\
 	for (child = fwnode_graph_get_next_endpoint(fwnode, NULL); child;	\
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 12/16] media: thp7312: Use fwnode_for_each_child_node() instead
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/thp7312.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/thp7312.c b/drivers/media/i2c/thp7312.c
index 775cfba188d8..86208a47f472 100644
--- a/drivers/media/i2c/thp7312.c
+++ b/drivers/media/i2c/thp7312.c
@@ -2064,7 +2064,7 @@ static int thp7312_parse_dt(struct thp7312_device *thp7312)
 		return -EINVAL;
 	}
 
-	fwnode_for_each_available_child_node(sensors, node) {
+	fwnode_for_each_child_node(sensors, node) {
 		if (fwnode_name_eq(node, "sensor")) {
 			if (!thp7312_sensor_parse_dt(thp7312, node))
 				num_sensors++;
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 10/16] net: lan966x: Use fwnode_for_each_child_node() instead
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
index 7001584f1b7a..e8f9bf96a63b 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -1190,7 +1190,7 @@ static int lan966x_probe(struct platform_device *pdev)
 	lan966x_stats_init(lan966x);
 
 	/* go over the child nodes */
-	fwnode_for_each_available_child_node(ports, portnp) {
+	fwnode_for_each_child_node(ports, portnp) {
 		phy_interface_t phy_mode;
 		struct phy *serdes;
 		u32 p;
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id()
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

No caller uses FWNODE_GRAPH_DEVICE_DISABLED flag when calling
fwnode_graph_get_endpoint_by_id(). Drop support for the flag entirely and
remove it from the documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index b52f7b3bbf84..7fc3257f223d 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1239,9 +1239,6 @@ static bool fwnode_graph_remote_available(struct fwnode_handle *ep)
  * has not been found, look for the closest endpoint ID greater than the
  * specified one and return the endpoint that corresponds to it, if present.
  *
- * Does not return endpoints that belong to disabled devices or endpoints that
- * are unconnected, unless FWNODE_GRAPH_DEVICE_DISABLED is passed in @flags.
- *
  * Return: the fwnode handle of the local endpoint corresponding the port and
  * endpoint IDs or %NULL if not found.
  */
@@ -1252,13 +1249,12 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 	struct fwnode_handle *ep, *best_ep = NULL;
 	unsigned int best_ep_id = 0;
 	bool endpoint_next = flags & FWNODE_GRAPH_ENDPOINT_NEXT;
-	bool enabled_only = !(flags & FWNODE_GRAPH_DEVICE_DISABLED);
 
 	fwnode_graph_for_each_endpoint(fwnode, ep) {
 		struct fwnode_endpoint fwnode_ep = { 0 };
 		int ret;
 
-		if (enabled_only && !fwnode_graph_remote_available(ep))
+		if (!fwnode_graph_remote_available(ep))
 			continue;
 
 		ret = fwnode_graph_parse_endpoint(ep, &fwnode_ep);
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index d22d6b23e758..4bffd347e2f9 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -185,7 +185,7 @@ void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
 	fwnode->flags |= FWNODE_FLAG_NOT_DEVICE;
 	fwnode_links_purge_consumers(fwnode);
 
-	fwnode_for_each_available_child_node(fwnode, child)
+	fwnode_for_each_child_node(fwnode, child)
 		fw_devlink_purge_absent_suppliers(child);
 }
 EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
@@ -231,7 +231,7 @@ static void __fw_devlink_pickup_dangling_consumers(struct fwnode_handle *fwnode,
 	fwnode->flags |= FWNODE_FLAG_NOT_DEVICE;
 	__fwnode_links_move_consumers(fwnode, new_sup);
 
-	fwnode_for_each_available_child_node(fwnode, child)
+	fwnode_for_each_child_node(fwnode, child)
 		__fw_devlink_pickup_dangling_consumers(child, new_sup);
 }
 
@@ -1318,7 +1318,7 @@ void device_links_driver_bound(struct device *dev)
 
 		guard(mutex)(&fwnode_link_lock);
 
-		fwnode_for_each_available_child_node(dev->fwnode, child)
+		fwnode_for_each_child_node(dev->fwnode, child)
 			__fw_devlink_pickup_dangling_consumers(child,
 							       dev->fwnode);
 		__fw_devlink_link_to_consumers(dev);
@@ -1736,7 +1736,7 @@ static void fw_devlink_parse_fwtree(struct fwnode_handle *fwnode)
 
 	fw_devlink_parse_fwnode(fwnode);
 
-	while ((child = fwnode_get_next_available_child_node(fwnode, child)))
+	while ((child = fwnode_get_next_child_node(fwnode, child)))
 		fw_devlink_parse_fwtree(child);
 }
 
@@ -2309,7 +2309,7 @@ static void __fw_devlink_link_to_suppliers(struct device *dev,
 	 * case where the supplier is added before the consumer's parent device
 	 * (@dev).
 	 */
-	while ((child = fwnode_get_next_available_child_node(fwnode, child)))
+	while ((child = fwnode_get_next_child_node(fwnode, child)))
 		__fw_devlink_link_to_suppliers(dev, child);
 }
 
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

Move Return: section of fwnode_graph_get_endpoint_by_id() down where it
habitually is located.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index f626d5bbe806..b52f7b3bbf84 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1235,15 +1235,15 @@ static bool fwnode_graph_remote_available(struct fwnode_handle *ep)
  * The caller is responsible for calling fwnode_handle_put() on the returned
  * fwnode pointer.
  *
- * Return: the fwnode handle of the local endpoint corresponding the port and
- * endpoint IDs or %NULL if not found.
- *
  * If FWNODE_GRAPH_ENDPOINT_NEXT is passed in @flags and the specified endpoint
  * has not been found, look for the closest endpoint ID greater than the
  * specified one and return the endpoint that corresponds to it, if present.
  *
  * Does not return endpoints that belong to disabled devices or endpoints that
  * are unconnected, unless FWNODE_GRAPH_DEVICE_DISABLED is passed in @flags.
+ *
+ * Return: the fwnode handle of the local endpoint corresponding the port and
+ * endpoint IDs or %NULL if not found.
  */
 struct fwnode_handle *
 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

fwnode_graph_get_next_subnode() may return fwnode backed by ACPI device
nodes and there has been no check these devices are present in the system,
unlike there has been on fwnode OF backend. In order to provide consistent
behaviour towards callers, add a check for device presence by introducing
a new function acpi_get_next_present_subnode(), used as the
get_next_child_node() fwnode operation that also checks device node
presence.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/acpi/property.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 5438592dc136..01f3880ffcce 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1319,6 +1319,26 @@ acpi_get_next_subnode(const struct fwnode_handle *fwnode,
 	return NULL;
 }
 
+/**
+ * acpi_get_next_present_subnode - Return the next present child node handle for a fwnode
+ * @fwnode: Firmware node to find the next child node for.
+ * @child: Handle to one of the device's child nodes or a null handle.
+ * Like acpi_get_next_subnode(), but the device nodes returned by
+ * acpi_get_next_present_subnode() are guaranteed to be present.
+ * Returns: The next sub-node fwnode handle.
+ */
+static struct fwnode_handle *
+acpi_get_next_present_subnode(const struct fwnode_handle *fwnode,
+			      struct fwnode_handle *child)
+{
+	do {
+		child = acpi_get_next_subnode(fwnode, child);
+	} while (is_acpi_device_node(child) &&
+		 !acpi_device_is_present(to_acpi_device_node(child)));
+
+	return child;
+}
+
 /**
  * acpi_node_get_parent - Return parent fwnode of this fwnode
  * @fwnode: Firmware node whose parent to get
@@ -1664,7 +1684,7 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
 		.property_read_string_array =				\
 			acpi_fwnode_property_read_string_array,		\
 		.get_parent = acpi_node_get_parent,			\
-		.get_next_child_node = acpi_get_next_subnode,		\
+		.get_next_child_node = acpi_get_next_present_subnode,	\
 		.get_named_child_node = acpi_fwnode_get_named_child_node, \
 		.get_name = acpi_fwnode_get_name,			\
 		.get_name_prefix = acpi_fwnode_get_name_prefix,		\
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 00/16] Align availability checks on fwnode child node enumeration
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hello everyone,

Historically the fwnode property API has enumerated only available device
nodes on OF whereas on ACPI, also nodes that haven't been present in the
system have been provided. Both OF and ACPI have similar concepts of node
availbility, on OF it's the "status" property present on device nodes and
on ACPI the _STA object evaluates to device present, enabled and
functional bits, of which the present and functional bits are currently
being used to determine whether to enumerate a device.

Two additional functions, fwnode_get_next_available_child_node() and
fwnode_for_each_available_child_node(), have been provided to enumerate
the available nodes only on ACPI, whereas on OF the implementation has
been the same on the non-available variants. The motivation for providing
these has very likely been to provide fwnode variants of the similarly
named functions but the difference isn't justifiable from API consistency
viewpoint.

This set switches the users away from the "available" fwnode API functions
and later on removes them, aligning the functionality on all fwnode
backends.

since v1:

- Move patch "ACPI: property: Make acpi_get_next_subnode() static" as
  first.

- Add missing parentheses and kernel-doc Return: section in
  acpi_get_next_present_subnode() documentation and move the Return
  section: of fwnode_graph_get_endpoint_by_id() to the end of the
  documentation section (new patch for the latter).

- Use device_get_next_child_node() instead of fwnode_get_next_child_node()
  in flash LED driver drivers.

- Rework iterating port nodes in acpi_graph_get_next_endpoint() as
  suggested by Andy (new patch).

Sakari Ailus (16):
  ACPI: property: Make acpi_get_next_subnode() static
  ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint()
    only
  ACPI: property: Rework acpi_graph_get_next_endpoint()
  ACPI: property: Return present device nodes only on fwnode interface
  property: Move Return: section of fwnode_graph_get_endpoint_by_id()
    down
  property: Drop DEVICE_DISABLED flag in
    fwnode_graph_get_endpoint_by_id()
  property: Drop DEVICE_DISABLED flag in
    fwnode_graph_get_endpoint_count()
  property: Document that fwnode API returns available nodes
  driver core: Use fwnode_for_each_child_node() instead
  net: lan966x: Use fwnode_for_each_child_node() instead
  Input: touch-overlay - Use fwnode_for_each_child_node() instead
  media: thp7312: Use fwnode_for_each_child_node() instead
  leds: Use fwnode_for_each_child_node() instead
  leds: Use fwnode_get_next_child_node() instead
  property: Drop functions operating on "available" child nodes
  spi: cadence: Remove explicit device node availability check

 drivers/acpi/property.c                       | 42 +++++++++----
 drivers/base/core.c                           | 10 ++--
 drivers/base/property.c                       | 60 ++++---------------
 drivers/input/touch-overlay.c                 |  2 +-
 drivers/leds/flash/leds-rt4505.c              |  2 +-
 drivers/leds/flash/leds-rt8515.c              |  2 +-
 drivers/leds/flash/leds-sgm3140.c             |  3 +-
 drivers/leds/flash/leds-tps6131x.c            |  2 +-
 drivers/leds/leds-max5970.c                   |  2 +-
 drivers/leds/leds-max77705.c                  |  2 +-
 drivers/leds/rgb/leds-ktd202x.c               |  4 +-
 drivers/leds/rgb/leds-ncp5623.c               |  2 +-
 drivers/media/i2c/thp7312.c                   |  2 +-
 .../ethernet/microchip/lan966x/lan966x_main.c |  2 +-
 drivers/spi/spi-cadence-xspi.c                |  3 -
 include/linux/acpi.h                          | 10 ----
 include/linux/property.h                      | 14 +----
 17 files changed, 61 insertions(+), 103 deletions(-)

-- 
2.47.3


^ permalink raw reply

* [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

acpi_get_next_subnode() is only used in drivers/acpi/property.c. Remove
its prototype from include/linux/acpi.h and make it static.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/property.c |  5 +++--
 include/linux/acpi.h    | 10 ----------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 436019d96027..5435628c67e7 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1264,8 +1264,9 @@ static int stop_on_next(struct acpi_device *adev, void *data)
  * @fwnode: Firmware node to find the next child node for.
  * @child: Handle to one of the device's child nodes or a null handle.
  */
-struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
-					    struct fwnode_handle *child)
+static struct fwnode_handle *
+acpi_get_next_subnode(const struct fwnode_handle *fwnode,
+		      struct fwnode_handle *child)
 {
 	struct acpi_device *adev = to_acpi_device_node(fwnode);
 
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 5ff5d99f6ead..703323b9fe0c 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1349,9 +1349,6 @@ acpi_data_add_props(struct acpi_device_data *data, const guid_t *guid,
 int acpi_node_prop_get(const struct fwnode_handle *fwnode, const char *propname,
 		       void **valptr);
 
-struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
-					    struct fwnode_handle *child);
-
 struct acpi_probe_entry;
 typedef bool (*acpi_probe_entry_validate_subtbl)(struct acpi_subtable_header *,
 						 struct acpi_probe_entry *);
@@ -1450,13 +1447,6 @@ static inline int acpi_node_prop_get(const struct fwnode_handle *fwnode,
 	return -ENXIO;
 }
 
-static inline struct fwnode_handle *
-acpi_get_next_subnode(const struct fwnode_handle *fwnode,
-		      struct fwnode_handle *child)
-{
-	return NULL;
-}
-
 static inline struct fwnode_handle *
 acpi_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
 			     struct fwnode_handle *prev)
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
property API is somewhat problematic as the latter is used in the
impelementation of the former. Instead of using
fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
acpi_get_next_subnode() directly instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/acpi/property.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 5435628c67e7..3e85900080ac 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1381,7 +1381,7 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
 
 	if (!prev) {
 		do {
-			port = fwnode_get_next_child_node(fwnode, port);
+			port = acpi_get_next_subnode(fwnode, port);
 			/*
 			 * The names of the port nodes begin with "port@"
 			 * followed by the number of the port node and they also
@@ -1399,13 +1399,13 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
 	if (!port)
 		return NULL;
 
-	endpoint = fwnode_get_next_child_node(port, prev);
+	endpoint = acpi_get_next_subnode(port, prev);
 	while (!endpoint) {
-		port = fwnode_get_next_child_node(fwnode, port);
+		port = acpi_get_next_subnode(fwnode, port);
 		if (!port)
 			break;
 		if (is_acpi_graph_node(port, "port"))
-			endpoint = fwnode_get_next_child_node(port, NULL);
+			endpoint = acpi_get_next_subnode(port, NULL);
 	}
 
 	/*
-- 
2.47.3


^ permalink raw reply related

* [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint()
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

Rework the code obtaining the next endpoint in
acpi_graph_get_next_endpoint(). The resulting code removes unnecessary
contitionals and should be easier to follow.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/acpi/property.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 3e85900080ac..5438592dc136 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1399,14 +1399,15 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
 	if (!port)
 		return NULL;
 
-	endpoint = acpi_get_next_subnode(port, prev);
-	while (!endpoint) {
-		port = acpi_get_next_subnode(fwnode, port);
-		if (!port)
+	do {
+		endpoint = acpi_get_next_subnode(port, prev);
+		if (endpoint)
 			break;
+
+		port = acpi_get_next_subnode(fwnode, port);
 		if (is_acpi_graph_node(port, "port"))
-			endpoint = acpi_get_next_subnode(port, NULL);
-	}
+			prev = NULL;
+	} while (port);
 
 	/*
 	 * The names of the endpoint nodes begin with "endpoint@" followed by
-- 
2.47.3


^ permalink raw reply related

* [PATCH] Input: gpio-keys - fix misleading GPIO number
From: Wei @ 2025-09-24  6:49 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, linux-kernel, gatien.chevallier, linus.walleij,
	namcao, zhiqiang.tu

From: Wei Liu <wei.liu@oss.qualcomm.com>

The error log prints button->gpio, which is unset and default to 0
in non-legacy configurations, leading to misleading messages.

Use desc_to_gpio() to report the actual global GPIO number.

Signed-off-by: Wei Liu <wei.liu@oss.qualcomm.com>
---
 drivers/input/keyboard/gpio_keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index f9db86da0818..243295a3ea1d 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -584,7 +584,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
 				error = irq;
 				dev_err_probe(dev, error,
 					      "Unable to get irq number for GPIO %d\n",
-					      button->gpio);
+					      desc_to_gpio(bdata->gpiod));
 				return error;
 			}
 			bdata->irq = irq;
-- 
2.34.1


^ permalink raw reply related

* RE: [PATCH v2] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's
From: Xu, Even @ 2025-09-24  5:10 UTC (permalink / raw)
  To: Abhishek Tamboli, Sun, Xinpeng, jikos@kernel.org,
	bentiss@kernel.org
  Cc: mpearson-lenovo@squebb.ca, srinivas.pandruvada@linux.intel.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20250924043720.5545-1-abhishektamboli9@gmail.com>



> -----Original Message-----
> From: Abhishek Tamboli <abhishektamboli9@gmail.com>
> Sent: Wednesday, September 24, 2025 12:37 PM
> To: Xu, Even <even.xu@intel.com>; Sun, Xinpeng <xinpeng.sun@intel.com>;
> jikos@kernel.org; bentiss@kernel.org
> Cc: mpearson-lenovo@squebb.ca; srinivas.pandruvada@linux.intel.com; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH v2] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's
> 
> Add the missing PCI ID for the quickspi device used on the Lenovo Yoga Pro 9i
> 16IAH10.
> 
> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=220567
> 
> Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com>

Thank you for the patch!

Reviewed-by: Even Xu <even.xu@intel.com>

> ---
> Changes in v2:
> - Change the max_packet_size_value to align with
> MAX_PACKET_SIZE_VALUE_MTL
> 
>  drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c | 6 ++++++
> drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h | 2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> index 84314989dc53..14cabd5dc6dd 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> @@ -33,6 +33,10 @@ struct quickspi_driver_data ptl = {
>  	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_LNL,  };
> 
> +struct quickspi_driver_data arl = {
> +	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_MTL, };
> +
>  /* THC QuickSPI ACPI method to get device properties */
>  /* HIDSPI Method: {6e2ac436-0fcf-41af-a265-b32a220dcfab} */  static guid_t
> hidspi_guid = @@ -978,6 +982,8 @@ static const struct pci_device_id
> quickspi_pci_tbl[] = {
>  	{PCI_DEVICE_DATA(INTEL, THC_PTL_U_DEVICE_ID_SPI_PORT2, &ptl), },
>  	{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT1, &ptl), },
>  	{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT2, &ptl), },
> +	{PCI_DEVICE_DATA(INTEL, THC_ARL_DEVICE_ID_SPI_PORT1, &arl), },
> +	{PCI_DEVICE_DATA(INTEL, THC_ARL_DEVICE_ID_SPI_PORT2, &arl), },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(pci, quickspi_pci_tbl); diff --git a/drivers/hid/intel-thc-
> hid/intel-quickspi/quickspi-dev.h b/drivers/hid/intel-thc-hid/intel-
> quickspi/quickspi-dev.h
> index f3532d866749..c30e1a42eb09 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h
> @@ -21,6 +21,8 @@
>  #define PCI_DEVICE_ID_INTEL_THC_PTL_U_DEVICE_ID_SPI_PORT2
> 	0xE44B
>  #define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT1
> 	0x4D49
>  #define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT2
> 	0x4D4B
> +#define PCI_DEVICE_ID_INTEL_THC_ARL_DEVICE_ID_SPI_PORT1
> 	0x7749
> +#define PCI_DEVICE_ID_INTEL_THC_ARL_DEVICE_ID_SPI_PORT2
> 	0x774B
> 
>  /* HIDSPI special ACPI parameters DSM methods */
>  #define ACPI_QUICKSPI_REVISION_NUM			2
> --
> 2.34.1


^ permalink raw reply

* Re: [PATCH v3 1/3] input: mouse: trackpoint: Add doubletap enable/disable support
From: Vishnu Sankar @ 2025-09-24  4:55 UTC (permalink / raw)
  To: Hans de Goede
  Cc: dmitry.torokhov, hmh, ilpo.jarvinen, derekjohn.clark,
	mpearson-lenovo, linux-input, linux-kernel, ibm-acpi-devel,
	platform-driver-x86, vsankar
In-Reply-To: <6e834cb7-565b-4a4b-bf90-4765f5fc9cc9@kernel.org>

Hi Hans,

Thank you so much for your review.
Sorry for the delay in response.

On Thu, Sep 18, 2025 at 4:31 PM Hans de Goede <hansg@kernel.org> wrote:
>
> Hi Vishnu,
>
> On 18-Sep-25 4:37 AM, Vishnu Sankar wrote:
> > Hello all,
> >
> > Do we have any questions or concerns?
> > Thanks in advance!
> >
> > On Mon, Sep 1, 2025 at 10:53 PM Vishnu Sankar <vishnuocv@gmail.com> wrote:
> >>
> >> Add support for enabling and disabling doubletap on TrackPoint devices
> >> that support this functionality. The feature is detected using firmware
> >> ID and exposed via sysfs as `doubletap_enabled`.
>
> Hmm, you seem to be using a firmware ID prefix match, combined with
> a deny list of some firmware IDs with that prefix which do not support
> this. How do we know this deny list is complete?
We confirmed with the Lenovo product team, and this is what they
recommended using. Internal Documentation has listed these as the only
ID's that don't have double-tap support. And the trackpoint CO
confirmed that all future trackpoints will support the double-tap
feature.
>
> Also as Dmitry says you really should use the is_visible() callback
> to not show the attribute at all on unsupported systems.
Understood.
>
> >> The feature is only available on newer ThinkPads (2023 and later).The driver
> >> exposes this capability via a new sysfs attribute:
> >> "/sys/bus/serio/devices/seriox/doubletap_enabled".
> >>
> >> The attribute is only created if the device is detected to be capable of
> >> doubletap via firmware and variant ID checks. This functionality will be
> >> used by platform drivers such as thinkpad_acpi to expose and control doubletap
> >> via user interfaces.
>
> Hmm, you refer to thinkpad_acpi as a possible consumer of this
> functionality. But you only add a sysfs interface.
>
> thinkpad_acpi will need some in kernel interface to use this.
>
This was what I understood from the review of v1 of the patch, to just
use sysfs in thinkpad_acpi.
I'm sorry if my understanding was incorrect.

> Which brings me to my main question: thinkpad_acpi is the driver
> receiving the doubletap events since these are send out-of-bound
> and not through the ps/2 trackpoint protocol.
>
> thinkpad_acpi already has the capability to filter out these doubletap
> events and report nothing. Why is it necessary / better to disable
> the doubletap at the trackpoint fw-level, rather then just filtering
> it at the thinkpad_acpi level ?
On Windows, Lenovo’s driver toggles the firmware register (fn + G)
rather than just filtering in software. We thought that exposing the
same mechanism in Linux ensures consistent behavior across operating
systems.
>
> I don't really see a big advantage in filtering these events at
> the fw-level rather then in the kernel and we already have the
> in kernel filtering.
understood
>
> Since this is highly ThinkPad specific it seems that the current
> handling in thinkpad_acpi also logically is the best place to
> handle this.
Originally, when this feature was provided, it was enabled by default,
so nothing extra was needed to use it.
With new ThinkPads, it is disabled by default, and we need to change
the setting in the trackpoint registers.
In doing this, we thought it was better to make this enable/disable
use the register (Similar to Windows), but we understood that we can
just enable it and handle the masking/unmasking in thinkpad_acpi. This
will make it easier and not require communication between the drivers.
>
> What new use-cases if any does this enable?
Allows users to use the trackpoint doubletap as an input for whatever
they want. It's an HW feature, and we're trying to make sure Linux
users can access the same features that Windows (Quick launch) has.
>
> If you e.g. want some Lenovo specific control-panel GUI to
> enable/disable this, why not expose the existing filtering
> in thinkpad_acpi (which is hotkey controller only atm)
> in sysfs through thinkpad_acpi ?
>
No, we just want it to be enabled and usable by default for now.
The register needs to be set for the hotkey enable/disable to work.

> If we go the route of using the trackpoint fw-level filtering
> as is done in this patch, then IMHO we really also should
> make the existing code in thinkpad_acpi:
>
> static bool hotkey_notify_8xxx(const u32 hkey, bool *send_acpi_ev)
> {
>         switch (hkey) {
>         case TP_HKEY_EV_TRACK_DOUBLETAP:
>                 if (tp_features.trackpoint_doubletap)
>                         tpacpi_input_send_key(hkey, send_acpi_ev);
>
>                 return true;
>         default:
>                 return false;
>         }
> }
>
> static bool tpacpi_driver_event(const unsigned int hkey_event)
> {
>         ...
>         case TP_HKEY_EV_DOUBLETAP_TOGGLE:
>                 tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap;
>                 return true;
>         ...
> }
>
> Also use the fw-level filtering rather then having 2 different
> filters/enable-flags active with events only coming through if
> both let them through.
>
> But making the thinkpad_acpi code use the fw-level filtering
> will require some sort of in kernel API for this which is
> going to be tricky since these are 2 completely different
> subsystems ...
>
> So to me it seems KISS to just stick with the existing thinkpad_acpi
> level filtering.
Understood.
>
> TL;DR:
> - What use-cases does this new code enable ?
Enables the trackpoint doubletap so it works by default.
> - Why can't those use-cases be implemented with
>   the thinkpad_acpi level filtering?
As mentioned earlier, this feature is off by default.
It needs to be enabled before we get the enable/disable hotkeys.

>
>
> Regards,
>
> Hans
>
>
>
>
>
>
> >>
> >> Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
> >> Suggested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> >> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >> ---
> >> Changes in v2:
> >> - Improve commit messages
> >> - Sysfs attributes moved to trackpoint.c
> >> - Removed unnecessary comments
> >> - Removed unnecessary debug messages
> >> - Using strstarts() instead of strcmp()
> >> - is_trackpoint_dt_capable() modified
> >> - Removed _BIT suffix and used BIT() define.
> >> - Reverse the trackpoint_doubletap_status() logic to return error first.
> >> - Removed export functions as a result of the design change
> >> - Changed trackpoint_dev->psmouse to parent_psmouse
> >> - The path of trackpoint.h is not changed.
> >> Changes in v3:
> >> - No changes.
> >> ---
> >>  drivers/input/mouse/trackpoint.c | 149 +++++++++++++++++++++++++++++++
> >>  drivers/input/mouse/trackpoint.h |  15 ++++
> >>  2 files changed, 164 insertions(+)
> >>
> >> diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
> >> index 5f6643b69a2c..c6f17b0dec3a 100644
> >> --- a/drivers/input/mouse/trackpoint.c
> >> +++ b/drivers/input/mouse/trackpoint.c
> >> @@ -16,6 +16,8 @@
> >>  #include "psmouse.h"
> >>  #include "trackpoint.h"
> >>
> >> +static struct trackpoint_data *trackpoint_dev;
> >> +
> >>  static const char * const trackpoint_variants[] = {
> >>         [TP_VARIANT_IBM]                = "IBM",
> >>         [TP_VARIANT_ALPS]               = "ALPS",
> >> @@ -63,6 +65,21 @@ static int trackpoint_write(struct ps2dev *ps2dev, u8 loc, u8 val)
> >>         return ps2_command(ps2dev, param, MAKE_PS2_CMD(3, 0, TP_COMMAND));
> >>  }
> >>
> >> +/* Read function for TrackPoint extended registers */
> >> +static int trackpoint_extended_read(struct ps2dev *ps2dev, u8 loc, u8 *val)
> >> +{
> >> +       u8 ext_param[2] = {TP_READ_MEM, loc};
> >> +       int error;
> >> +
> >> +       error = ps2_command(ps2dev,
> >> +                           ext_param, MAKE_PS2_CMD(2, 1, TP_COMMAND));
> >> +
> >> +       if (!error)
> >> +               *val = ext_param[0];
> >> +
> >> +       return error;
> >> +}
> >> +
> >>  static int trackpoint_toggle_bit(struct ps2dev *ps2dev, u8 loc, u8 mask)
> >>  {
> >>         u8 param[3] = { TP_TOGGLE, loc, mask };
> >> @@ -393,6 +410,131 @@ static int trackpoint_reconnect(struct psmouse *psmouse)
> >>         return 0;
> >>  }
> >>
> >> +/* List of known incapable device PNP IDs */
> >> +static const char * const dt_incompatible_devices[] = {
> >> +       "LEN0304",
> >> +       "LEN0306",
> >> +       "LEN0317",
> >> +       "LEN031A",
> >> +       "LEN031B",
> >> +       "LEN031C",
> >> +       "LEN031D",
> >> +};
> >> +
> >> +/*
> >> + * checks if it’s a doubletap capable device
> >> + * The PNP ID format eg: is "PNP: LEN030d PNP0f13".
> >> + */
> >> +static bool is_trackpoint_dt_capable(const char *pnp_id)
> >> +{
> >> +       const char *id_start;
> >> +       char id[8];
> >> +
> >> +       if (!strstarts(pnp_id, "PNP: LEN03"))
> >> +               return false;
> >> +
> >> +       /* Points to "LEN03xxxx" */
> >> +       id_start = pnp_id + 5;
> >> +       if (sscanf(id_start, "%7s", id) != 1)
> >> +               return false;
> >> +
> >> +       /* Check if it's blacklisted */
> >> +       for (size_t i = 0; i < ARRAY_SIZE(dt_incompatible_devices); ++i) {
> >> +               if (strcmp(id, dt_incompatible_devices[i]) == 0)
> >> +                       return false;
> >> +       }
> >> +       return true;
> >> +}
> >> +
> >> +/* Trackpoint doubletap status function */
> >> +static int trackpoint_doubletap_status(bool *status)
> >> +{
> >> +       struct trackpoint_data *tp = trackpoint_dev;
> >> +       struct ps2dev *ps2dev = &tp->parent_psmouse->ps2dev;
> >> +       u8 reg_val;
> >> +       int rc;
> >> +
> >> +       /* Reading the Doubletap register using extended read */
> >> +       rc = trackpoint_extended_read(ps2dev, TP_DOUBLETAP, &reg_val);
> >> +       if (rc)
> >> +               return rc;
> >> +
> >> +       *status = reg_val & TP_DOUBLETAP_STATUS ? true : false;
> >> +
> >> +       return 0;
> >> +}
> >> +
> >> +/* Trackpoint doubletap enable/disable function */
> >> +static int trackpoint_set_doubletap(bool enable)
> >> +{
> >> +       struct trackpoint_data *tp = trackpoint_dev;
> >> +       struct ps2dev *ps2dev = &tp->parent_psmouse->ps2dev;
> >> +       static u8 doubletap_state;
> >> +       u8 new_val;
> >> +
> >> +       if (!tp)
> >> +               return -ENODEV;
> >> +
> >> +       new_val = enable ? TP_DOUBLETAP_ENABLE : TP_DOUBLETAP_DISABLE;
> >> +
> >> +       if (doubletap_state == new_val)
> >> +               return 0;
> >> +
> >> +       doubletap_state = new_val;
> >> +
> >> +       return trackpoint_write(ps2dev, TP_DOUBLETAP, new_val);
> >> +}
> >> +
> >> +/*
> >> + * Trackpoint Doubletap Interface
> >> + * Control/Monitoring of Trackpoint Doubletap from:
> >> + * /sys/bus/serio/devices/seriox/doubletap_enabled
> >> + */
> >> +static ssize_t doubletap_enabled_show(struct device *dev,
> >> +                               struct device_attribute *attr, char *buf)
> >> +{
> >> +       struct serio *serio = to_serio_port(dev);
> >> +       struct psmouse *psmouse = psmouse_from_serio(serio);
> >> +       struct trackpoint_data *tp = psmouse->private;
> >> +       bool status;
> >> +       int rc;
> >> +
> >> +       if (!tp || !tp->doubletap_capable)
> >> +               return -ENODEV;
> >> +
> >> +       rc = trackpoint_doubletap_status(&status);
> >> +       if (rc)
> >> +               return rc;
> >> +
> >> +       return sysfs_emit(buf, "%d\n", status ? 1 : 0);
> >> +}
> >> +
> >> +static ssize_t doubletap_enabled_store(struct device *dev,
> >> +                                       struct device_attribute *attr,
> >> +                                       const char *buf, size_t count)
> >> +{
> >> +       struct serio *serio = to_serio_port(dev);
> >> +       struct psmouse *psmouse = psmouse_from_serio(serio);
> >> +       struct trackpoint_data *tp = psmouse->private;
> >> +       bool enable;
> >> +       int err;
> >> +
> >> +       if (!tp || !tp->doubletap_capable)
> >> +               return -ENODEV;
> >> +
> >> +       err = kstrtobool(buf, &enable);
> >> +       if (err)
> >> +               return err;
> >> +
> >> +       err = trackpoint_set_doubletap(enable);
> >> +       if (err)
> >> +               return err;
> >> +
> >> +       return count;
> >> +}
> >> +
> >> +static DEVICE_ATTR_RW(doubletap_enabled);
> >> +
> >>  int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
> >>  {
> >>         struct ps2dev *ps2dev = &psmouse->ps2dev;
> >> @@ -425,6 +567,9 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
> >>         psmouse->reconnect = trackpoint_reconnect;
> >>         psmouse->disconnect = trackpoint_disconnect;
> >>
> >> +       trackpoint_dev = psmouse->private;
> >> +       trackpoint_dev->parent_psmouse = psmouse;
> >> +
> >>         if (variant_id != TP_VARIANT_IBM) {
> >>                 /* Newer variants do not support extended button query. */
> >>                 button_info = 0x33;
> >> @@ -470,6 +615,10 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
> >>                      psmouse->vendor, firmware_id,
> >>                      (button_info & 0xf0) >> 4, button_info & 0x0f);
> >>
> >> +       tp->doubletap_capable = is_trackpoint_dt_capable(ps2dev->serio->firmware_id);
> >> +       if (tp->doubletap_capable)
> >> +               device_create_file(&psmouse->ps2dev.serio->dev, &dev_attr_doubletap_enabled);
> >> +
> >>         return 0;
> >>  }
> >>
> >> diff --git a/drivers/input/mouse/trackpoint.h b/drivers/input/mouse/trackpoint.h
> >> index eb5412904fe0..256e8cb35581 100644
> >> --- a/drivers/input/mouse/trackpoint.h
> >> +++ b/drivers/input/mouse/trackpoint.h
> >> @@ -8,6 +8,8 @@
> >>  #ifndef _TRACKPOINT_H
> >>  #define _TRACKPOINT_H
> >>
> >> +#include <linux/bitops.h>
> >> +
> >>  /*
> >>   * These constants are from the TrackPoint System
> >>   * Engineering documentation Version 4 from IBM Watson
> >> @@ -69,6 +71,8 @@
> >>                                         /* (how hard it is to drag */
> >>                                         /* with Z-axis pressed) */
> >>
> >> +#define TP_DOUBLETAP           0x58    /* TrackPoint doubletap register */
> >> +
> >>  #define TP_MINDRAG             0x59    /* Minimum amount of force needed */
> >>                                         /* to trigger dragging */
> >>
> >> @@ -139,6 +143,14 @@
> >>  #define TP_DEF_TWOHAND         0x00
> >>  #define TP_DEF_SOURCE_TAG      0x00
> >>
> >> +/* Doubletap register values */
> >> +#define TP_DOUBLETAP_ENABLE    0xFF    /* Enable value */
> >> +#define TP_DOUBLETAP_DISABLE   0xFE    /* Disable value */
> >> +
> >> +#define TP_DOUBLETAP_STATUS_BIT 0      /* 0th bit defines enable/disable */
> >> +
> >> +#define TP_DOUBLETAP_STATUS   BIT(TP_DOUBLETAP_STATUS_BIT)
> >> +
> >>  #define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
> >>
> >>  struct trackpoint_data {
> >> @@ -150,11 +162,14 @@ struct trackpoint_data {
> >>         u8 thresh, upthresh;
> >>         u8 ztime, jenks;
> >>         u8 drift_time;
> >> +       bool doubletap_capable;
> >>
> >>         /* toggles */
> >>         bool press_to_select;
> >>         bool skipback;
> >>         bool ext_dev;
> >> +
> >> +       struct psmouse *parent_psmouse;
> >>  };
> >>
> >>  int trackpoint_detect(struct psmouse *psmouse, bool set_properties);
> >> --
> >> 2.48.1
> >>
> >
> >
>


--

Regards,

      Vishnu Sankar
     +817015150407 (Japan)

^ permalink raw reply

* [PATCH v2] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's
From: Abhishek Tamboli @ 2025-09-24  4:37 UTC (permalink / raw)
  To: even.xu, xinpeng.sun, jikos, bentiss
  Cc: mpearson-lenovo, srinivas.pandruvada, linux-input, linux-kernel

Add the missing PCI ID for the quickspi device used on
the Lenovo Yoga Pro 9i 16IAH10.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=220567

Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com>
---
Changes in v2:
- Change the max_packet_size_value to align
with MAX_PACKET_SIZE_VALUE_MTL

 drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c | 6 ++++++
 drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
index 84314989dc53..14cabd5dc6dd 100644
--- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
+++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
@@ -33,6 +33,10 @@ struct quickspi_driver_data ptl = {
 	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_LNL,
 };

+struct quickspi_driver_data arl = {
+	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_MTL,
+};
+
 /* THC QuickSPI ACPI method to get device properties */
 /* HIDSPI Method: {6e2ac436-0fcf-41af-a265-b32a220dcfab} */
 static guid_t hidspi_guid =
@@ -978,6 +982,8 @@ static const struct pci_device_id quickspi_pci_tbl[] = {
 	{PCI_DEVICE_DATA(INTEL, THC_PTL_U_DEVICE_ID_SPI_PORT2, &ptl), },
 	{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT1, &ptl), },
 	{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT2, &ptl), },
+	{PCI_DEVICE_DATA(INTEL, THC_ARL_DEVICE_ID_SPI_PORT1, &arl), },
+	{PCI_DEVICE_DATA(INTEL, THC_ARL_DEVICE_ID_SPI_PORT2, &arl), },
 	{}
 };
 MODULE_DEVICE_TABLE(pci, quickspi_pci_tbl);
diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h
index f3532d866749..c30e1a42eb09 100644
--- a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h
+++ b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h
@@ -21,6 +21,8 @@
 #define PCI_DEVICE_ID_INTEL_THC_PTL_U_DEVICE_ID_SPI_PORT2	0xE44B
 #define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT1 	0x4D49
 #define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT2 	0x4D4B
+#define PCI_DEVICE_ID_INTEL_THC_ARL_DEVICE_ID_SPI_PORT1 	0x7749
+#define PCI_DEVICE_ID_INTEL_THC_ARL_DEVICE_ID_SPI_PORT2 	0x774B

 /* HIDSPI special ACPI parameters DSM methods */
 #define ACPI_QUICKSPI_REVISION_NUM			2
--
2.34.1


^ permalink raw reply related

* Re: [PATCH] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's
From: Abhishek Tamboli @ 2025-09-24  4:09 UTC (permalink / raw)
  To: Xu, Even
  Cc: xinpeng.sun, jikos, bentiss, mpearson-lenovo, srinivas.pandruvada,
	linux-input, linux-kernel
In-Reply-To: <IA1PR11MB609835ED0230AC6D60C54906F41CA@IA1PR11MB6098.namprd11.prod.outlook.com>

On Wed, Sep 24, 2025 at 03:31:33AM +0000, Xu, Even wrote:
> 
> 
> > -----Original Message-----
> > From: Abhishek Tamboli <abhishektamboli9@gmail.com>
> > Sent: Tuesday, September 23, 2025 12:03 PM
> > To: Xu, Even <even.xu@intel.com>; Sun, Xinpeng <xinpeng.sun@intel.com>;
> > jikos@kernel.org; bentiss@kernel.org
> > Cc: mpearson-lenovo@squebb.ca; srinivas.pandruvada@linux.intel.com; linux-
> > input@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: [PATCH] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's
> > 
> > Add the missing PCI ID for the quickspi device used on the Lenovo Yoga Pro 9i
> > 16IAH10.
> > 
> > Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=220567
> > 
> > Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com>
> > ---
> >  drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c | 6 ++++++
> > drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h | 2 ++
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> > b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> > index 84314989dc53..49c8458f0118 100644
> > --- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> > +++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> > @@ -33,6 +33,10 @@ struct quickspi_driver_data ptl = {
> >  	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_LNL,  };
> > 
> > +struct quickspi_driver_data arl = {
> > +	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_LNL, };
> > +
> 
> As I know the THC IP in ARL is the same with in MTL, can you change this max_packet_size_value to align with MAX_PACKET_SIZE_VALUE_MTL?
Sure, I will do it.
Thanks, for the review.

^ permalink raw reply

* RE: [PATCH] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's
From: Xu, Even @ 2025-09-24  3:31 UTC (permalink / raw)
  To: Abhishek Tamboli, Sun, Xinpeng, jikos@kernel.org,
	bentiss@kernel.org
  Cc: mpearson-lenovo@squebb.ca, srinivas.pandruvada@linux.intel.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20250923040254.7547-1-abhishektamboli9@gmail.com>



> -----Original Message-----
> From: Abhishek Tamboli <abhishektamboli9@gmail.com>
> Sent: Tuesday, September 23, 2025 12:03 PM
> To: Xu, Even <even.xu@intel.com>; Sun, Xinpeng <xinpeng.sun@intel.com>;
> jikos@kernel.org; bentiss@kernel.org
> Cc: mpearson-lenovo@squebb.ca; srinivas.pandruvada@linux.intel.com; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's
> 
> Add the missing PCI ID for the quickspi device used on the Lenovo Yoga Pro 9i
> 16IAH10.
> 
> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=220567
> 
> Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com>
> ---
>  drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c | 6 ++++++
> drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h | 2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> index 84314989dc53..49c8458f0118 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> @@ -33,6 +33,10 @@ struct quickspi_driver_data ptl = {
>  	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_LNL,  };
> 
> +struct quickspi_driver_data arl = {
> +	.max_packet_size_value = MAX_PACKET_SIZE_VALUE_LNL, };
> +

As I know the THC IP in ARL is the same with in MTL, can you change this max_packet_size_value to align with MAX_PACKET_SIZE_VALUE_MTL?
Thanks!

>  /* THC QuickSPI ACPI method to get device properties */
>  /* HIDSPI Method: {6e2ac436-0fcf-41af-a265-b32a220dcfab} */  static guid_t
> hidspi_guid = @@ -978,6 +982,8 @@ static const struct pci_device_id
> quickspi_pci_tbl[] = {
>  	{PCI_DEVICE_DATA(INTEL, THC_PTL_U_DEVICE_ID_SPI_PORT2, &ptl), },
>  	{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT1, &ptl), },
>  	{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT2, &ptl), },
> +	{PCI_DEVICE_DATA(INTEL, THC_ARL_DEVICE_ID_SPI_PORT1, &arl), },
> +	{PCI_DEVICE_DATA(INTEL, THC_ARL_DEVICE_ID_SPI_PORT2, &arl), },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(pci, quickspi_pci_tbl); diff --git a/drivers/hid/intel-thc-
> hid/intel-quickspi/quickspi-dev.h b/drivers/hid/intel-thc-hid/intel-
> quickspi/quickspi-dev.h
> index f3532d866749..7f0fb0056244 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h
> @@ -21,6 +21,8 @@
>  #define PCI_DEVICE_ID_INTEL_THC_PTL_U_DEVICE_ID_SPI_PORT2
> 	0xE44B
>  #define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT1
> 	0x4D49
>  #define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT2
> 	0x4D4B
> +#define PCI_DEVICE_ID_INTEL_THC_ARL_DEVICE_ID_SPI_PORT1
> 	0x7749
> +#define PCI_DEVICE_ID_INTEL_THC_ARL_DEVICE_ID_SPI_PORT2
> 	0x774B
> 
>  /* HIDSPI special ACPI parameters DSM methods */
>  #define ACPI_QUICKSPI_REVISION_NUM			2
> --
> 2.34.1


^ permalink raw reply

* Thematic Funds Letter Of Intent
From: Al Sayyid Sultan @ 2025-09-23 23:54 UTC (permalink / raw)
  To: linux-input

To: linux-input@vger.kernel.org
Date: 24-09-2025
Thematic Funds Letter Of Intent

It's a pleasure to connect with you

Having been referred to your investment by my team, we would be 
honored to review your available investment projects for onward 
referral to my principal investors who can allocate capital for 
the financing of it.

kindly advise at your convenience

Best Regards,

Respectfully,
Al Sayyid Sultan Yarub Al Busaidi
Director

^ permalink raw reply

* Re: Touchpad multitouch leaves ghost fingers
From: Yinon Burgansky @ 2025-09-23 21:56 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <iav7hzeaarxifwxk7zlfnt6vipqkp4h4ldt634exlvcswz62gj@a7ongaeduylz>

On Tue, Sep 23, 2025 at 7:30 PM Benjamin Tissoires <bentiss@kernel.org> wrote:
> Got something out with https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/204
> that seems to solve your case on the hid-recorder you provided.

Thank you so much!
The install command didn't work properly for me:
```
$ ./install.sh "*DLL0945*"
$ tree /usr/local/lib/firmware
/usr/local/lib/firmware
└── hid
    └── bpf
        └── 0011-Synaptics__DLL0945.bpf.o
$ reboot
$ sudo tree /sys/fs/bpf
/sys/fs/bpf
0 directories, 0 files
```
I tried to add it manually and it seems to work now :)
```
$ sudo udev-hid-bpf add /sys/bus/hid/devices/0018:06CB:CE26.0005
/usr/local/lib/firmware/hid/bpf/0011-Synaptics__DLL0945.bpf.o
$ sudo tree /sys/fs/bpf
/sys/fs/bpf
└── hid
    └── 0018_06CB_CE26_0005
        └── 0011-Synaptics__DLL0945_bpf
            └── synaptics_dll0945

4 directories, 1 file
```
But I have to do it manually every time.
Not sure what's wrong, maybe the added udev rule:
```
$ cat /etc/udev/rules.d/81-hid-bpf.rules
ACTION!="add|remove|bind", GOTO="hid_bpf_end"
SUBSYSTEM!="hid", GOTO="hid_bpf_end"

# We lookup the hwdb during bind to set the property, but we don't do
anything else
IMPORT{builtin}="hwdb --subsystem=hid --lookup-prefix=hid-bpf:"
#ACTION=="add", ENV{.HID_BPF}=="1",
RUN{program}+="@@BINDIR@@/udev-hid-bpf add $sys$devpath"
#MARKER
ACTION=="add", ENV{.HID_BPF}=="1",
RUN{program}+="/usr/local/bin/udev-hid-bpf add $sys$devpath"
#ACTION=="remove", ENV{.HID_BPF}=="1",
RUN{program}+="@@BINDIR@@/udev-hid-bpf remove $sys$devpath"
#MARKER
ACTION=="remove", ENV{.HID_BPF}=="1",
RUN{program}+="/usr/local/bin/udev-hid-bpf remove $sys$devpath"

LABEL="hid_bpf_end"
```
this is the udevadm info (after reboot, it is sometimes hidraw3
sometimes hidraw4):
```
$  udevadm info --query=all --name=/dev/hidraw4
P: /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-DLL0945:00/0018:06CB:CE26.0005/hidraw/hidraw4
M: hidraw4
R: 4
J: c242:4
U: hidraw
D: c 242:4
N: hidraw4
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-DLL0945:00/0018:06CB:CE26.0005/hidraw/hidraw4
E: DEVNAME=/dev/hidraw4
E: MAJOR=242
E: MINOR=4
E: SUBSYSTEM=hidraw
E: USEC_INITIALIZED=3980846
E: ID_VENDOR_FROM_DATABASE=Dell Inc
E: ID_PATH=pci-0000:00:15.1-platform-i2c_designware.1
E: ID_PATH_TAG=pci-0000_00_15_1-platform-i2c_designware_1
E: ID_FOR_SEAT=hidraw-pci-0000_00_15_1-platform-i2c_designware_1
E: TAGS=:seat:
E: CURRENT_TAGS=:seat:
```

Thank you for the quick fix, it seems to work great so far!
Yinon

^ permalink raw reply

* Re: [PATCH v2 00/12] MediaTek dt-bindings sanitization (MT8173)
From: Rob Herring @ 2025-09-23 21:48 UTC (permalink / raw)
  To: Ariel D'Alessandro
  Cc: airlied, amergnat, andrew+netdev, andrew-ct.chen,
	angelogioacchino.delregno, broonie, chunkuang.hu, conor+dt, davem,
	dmitry.torokhov, edumazet, flora.fu, heiko, houlong.wei, jeesw,
	kernel, krzk+dt, kuba, lgirdwood, linus.walleij,
	louisalexis.eyraud, luiz.dentz, maarten.lankhorst, marcel,
	matthias.bgg, mchehab, minghsiu.tsai, mripard, p.zabel, pabeni,
	sean.wang, simona, support.opensource, tiffany.lin, tzimmermann,
	yunfei.dong, devicetree, dri-devel, linux-arm-kernel,
	linux-bluetooth, linux-gpio, linux-input, linux-kernel,
	linux-media, linux-mediatek, linux-rockchip, linux-sound, netdev
In-Reply-To: <20250911151001.108744-1-ariel.dalessandro@collabora.com>

On Thu, Sep 11, 2025 at 12:09:49PM -0300, Ariel D'Alessandro wrote:
> This patch series continues the effort to address Device Tree validation
> warnings for MediaTek platforms, with a focus on MT8173. It follows the
> initial cleanup series by Angelo [0].
> 
> Similarly to the ongoing MT8183 work done by Julien Massot, this patchset
> eliminates several of the remaining warnings by improving or converting DT
> bindings to YAML, adding missing properties, and updating device tree files
> accordingly.
> 
> [0] https://www.spinics.net/lists/kernel/msg5780177.html
> 
> Changes in v2:
> * Wrapped commit messages to 75 columns line wrap.
> * Replaced "YAML" by "DT schema" in patches subject and content.
> * mt8173-mdp: Fixed properties: compatible, clocks, iommus and
>   mediatek,vpu.
> * mt8173-vpu: Fixed line wrap. Dropped memory-region property description.
> * mediatek,mmsys: Dropped patch as it's not a binding issue.
> * mediatek,od: Rewrote commit log with details on DT schema users missing
>   the related property. Rewrote mediatek,gce-client-reg property.
> * mediatek,ufoe: Rewrote commit log with details on DT schema users missing
>   the related property. Rewrote mediatek,gce-client-reg property.
> * marvell,sd8897-bt: Moved to net/bluetooth/. Added missing ref to
>   bluetooth-controller.yaml. Dropped example. Updated reference in another
>   file. Minor fixes in properties.
> * mediatek,mt8173-rt5650: Dropped unnecessary quotes and unused label.
> * dlg,da9211: Dropped enable-gpios description. Rewrote generic example
>   node names. Minor fixes in properties.
> * melfas,mip4_ts: Dropped unnecessary quotes. Added "active high" to
>   ce-gpios property description.
> * mediatek,jpeg: Dropped patch as it doesn't apply.
> 
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> 
> Ariel D'Alessandro (12):
>   dt-bindings: media: Convert MediaTek mt8173-mdp bindings to DT schema
>   dt-bindings: media: Convert MediaTek mt8173-vpu bindings to DT schema
>   dt-bindings: net: Convert Marvell 8897/8997 bindings to DT schema
>   dt-bindings: ASoC: Convert MediaTek RT5650 codecs bindings to DT
>     schema
>   dt-bindings: display: mediatek,od: Add mediatek,gce-client-reg
>     property
>   dt-bindings: display: mediatek,ufoe: Add mediatek,gce-client-reg
>     property
>   arm64: dts: mediatek: mt8173: Fix mt8173-pinctrl node names
>   dt-bindings: pinctrl: mt65xx: Allow gpio-line-names
>   dt-bindings: regulator: Convert Dialog DA9211 Regulators to DT schema
>   arm64: dts: mediatek: mt8173-elm: Drop unused bank supply
>   dt-bindings: soc: mediatek: pwrap: Add power-domains property
>   dt-bindings: input: Convert MELFAS MIP4 Touchscreen to DT schema

As we're close to the merge window, I applied patches 2, 8, and 11.

Rob

^ permalink raw reply

* Re: [PATCH v7 2/3] dt-bindings: arm: bcm: raspberrypi,bcm2835-firmware: Add touchscreen child node
From: Rob Herring @ 2025-09-23 20:05 UTC (permalink / raw)
  To: Dario Binacchi
  Cc: linux-kernel, linux-amarula, sebastian.reichel,
	Broadcom internal kernel review list, Conor Dooley,
	Dmitry Torokhov, Eric Anholt, Florian Fainelli,
	Krzysztof Kozlowski, Ray Jui, Scott Branden, Stefan Wahren,
	devicetree, linux-arm-kernel, linux-input, linux-rpi-kernel
In-Reply-To: <20250923125741.2705551-2-dario.binacchi@amarulasolutions.com>

On Tue, Sep 23, 2025 at 02:57:11PM +0200, Dario Binacchi wrote:
> Convert Raspberry Pi firmware 7" touchscreen controller device tree
> binding to json-schema.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Changes in v7:
> - Add $ref: /schemas/input/touchscreen/touchscreen.yaml#
> 
> Changes in v5:
> - Move bindings into raspberrypi,bcm2835-firmware.yaml
> - Remove raspberrypi,firmware-ts.yaml
> - Update the commit message
> 
> Changes in v3:
> - Drop firmware-rpi node and use only touchscreen node to fix warnings
>   you can see in
>   https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250913092707.1005616-3-dario.binacchi@amarulasolutions.com/
> 
> Changes in v2:
> - Added in v2
> 
>  .../arm/bcm/raspberrypi,bcm2835-firmware.yaml | 28 +++++++++++++++++++
>  .../touchscreen/raspberrypi,firmware-ts.txt   | 26 -----------------
>  2 files changed, 28 insertions(+), 26 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/raspberrypi,firmware-ts.txt

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>

^ permalink raw reply

* Re: [PATCH v6 4/6] dt-bindings: touchscreen: fsl,imx6ul-tsc: support glitch thresold
From: Conor Dooley @ 2025-09-23 18:43 UTC (permalink / raw)
  To: Dario Binacchi
  Cc: linux-kernel, linux-amarula, Frank Li, Conor Dooley,
	Dmitry Torokhov, Fabio Estevam, Haibo Chen, Krzysztof Kozlowski,
	Pengutronix Kernel Team, Rob Herring, Sascha Hauer, Shawn Guo,
	devicetree, imx, linux-arm-kernel, linux-input
In-Reply-To: <20250923143746.2857292-5-dario.binacchi@amarulasolutions.com>

[-- Attachment #1: Type: text/plain, Size: 52 bytes --]

Acked-by: Conor Dooley <conor.dooley@microchip.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* Re: Touchpad multitouch leaves ghost fingers
From: Benjamin Tissoires @ 2025-09-23 16:30 UTC (permalink / raw)
  To: Yinon Burgansky; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <CAEU-x4mJiBM_zKg1DaeJkKB3W3Ay08bUTc-D3QjFjDxNiZGd0g@mail.gmail.com>

On Sep 22 2025, Yinon Burgansky wrote:
> On Mon, Sep 22, 2025 at 7:51 PM Benjamin Tissoires <bentiss@kernel.org> wrote:
> > Well, I was meaning that I would provide a HID-BPF MR ready to install
> > for you.
> That would be awesome! Thank you very much!

Got something out with https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/204
that seems to solve your case on the hid-recorder you provided.

> 
> > But if you want to play with it, feel free to do so :)
> > For a jump start on HID-BPF:
> > https://libevdev.pages.freedesktop.org/udev-hid-bpf/tutorial.html
> Thank you for the reference. I’m feeling quite fatigued from the
> debugging process, as it took me a considerable amount of time to
> identify the issue.
> It was surprisingly difficult to determine what exactly was wrong with
> the touchpad and to uncover the root cause; perhaps I didn’t search
> for the right terms.
> However, I’m glad I finally took the time to debug it, submit the bug
> report, and find out what was wrong. Thank you!
> 
> > The advantage of HID-BPF is that we can drop the file in the filesystem
> > and then forget about it.
> > My plan is to have the HID-BPF detect whether the quirk has been applied
> > or not and would gracefully remove itself once the kernel is fixed.
> That's cool, nice design.

Unfortunately I spoke too fast. The NSMU quirk is internal to the
hid-multitouch driver, and not exported in the struct hid_device. Thus
we don't have a direct access to the quirk. It should also be present in
the driver data of the hid_device or in the input_device, but in both
cases BPF prevents us to simply follow the pointers.

In the end, it shouldn't be an issue if you have both the fixed kernel
and the BPF because both fixes are not mutually exclusive.

> 
> > PS: please try to refrain from top-posting your reply. The usage is to
> > inline your reply or reply below,
> Sorry about that, hopefully I did it right this time.

Yep, much better this time. I didn't meant to be rude, but if you want
to interact with the LKML, some people gets angry about top posting and
would just send you a link without even reading your email. So better
having better habits :)

Cheers,
Benjamin

^ permalink raw reply

* Re: [PATCH] HID: ft260: Use sysfs_emit to write formatted data to user buffer in sysfs show function.
From: bhanuseshukumar @ 2025-09-23 14:58 UTC (permalink / raw)
  To: Greg KH
  Cc: Michael Zaidman, Jiri Kosina, Benjamin Tissoires, linux-i2c,
	linux-input, linux-kernel, skhan, linux-kernel-mentees
In-Reply-To: <2025092316-pasta-parachute-737e@gregkh>

On 23/09/25 20:26, Greg KH wrote:
> On Tue, Sep 23, 2025 at 08:19:26PM +0530, Bhanu Seshu Kumar Valluri wrote:
>> Inline with sysfs documentation, sysfs_emit is used in show function
>> to write formatted data into user buffer. sysfs_emit is already PAGE_SIZE
>> aware.
>>
>> Signed-off-by: Bhanu Seshu Kumar Valluri <bhanuseshukumar@gmail.com>
>> ---
>>  Note: Patch is compile tested and verified with checkpatch.
>>
>>  drivers/hid/hid-ft260.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
>> index 333341e80b0e..8677bea46bea 100644
>> --- a/drivers/hid/hid-ft260.c
>> +++ b/drivers/hid/hid-ft260.c
>> @@ -826,7 +826,7 @@ static int ft260_byte_show(struct hid_device *hdev, int id, u8 *cfg, int len,
>>  	if (ret < 0)
>>  		return ret;
>>  
>> -	return scnprintf(buf, PAGE_SIZE, "%d\n", *field);
>> +	return sysfs_emit(buf, "%d\n", *field);
>>  }
>>  
>>  static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len,
>> @@ -838,7 +838,7 @@ static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len,
>>  	if (ret < 0)
>>  		return ret;
>>  
>> -	return scnprintf(buf, PAGE_SIZE, "%d\n", le16_to_cpu(*field));
>> +	return sysfs_emit(buf, "%d\n", le16_to_cpu(*field));
> 
> There's no need to change existing users in the kernel for stuff like
> this, only try to do this for new sysfs files.  We've had too many bugs
> where "simple" changes like this cause problems (recently in the USB
> core for example.)
> 
> thanks,
> 
> greg k-h

OK. Thanks for the prompt feedback on this. 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox