Skip to content

Input: support overlay objects on touchscreens

Javier Carrasco linux-devicetree linux-input lkml 11 versions – In review

Get series with b4
b4 am 20241016-feature-ts_virtobj_patch-v11-0-b292a1bbb0a1@wolfvision.net change-id 20230510-feature-ts_virtobj_patch-e267540aae74

Versions newest first

  1. v11 Latest4 patches 2 repliesIn review
  2. v104 patches 4 repliesSuperseded
  3. v94 patches 3 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v84 patches0 repliesSuperseded
v74 patches5 repliesSuperseded
v64 patches7 repliesSuperseded
v54 patches5 repliesSuperseded
v44 patches3 repliesSuperseded
v34 patches9 repliesSuperseded
v24 patches5 repliesSuperseded
v14 patches13 repliesSuperseded

Changes in v11 from the cover letter

- {touch-overlay,st1232}.c: work on assigned slots instead of positions
retrieved by the sensor to account for those that don't track the
contacts themselves.
- touch-overlay.c: do not emit sync and rely on the driver calling it.
- touch-overlay.c: use cleanup attribute for fwnode_handle *overlay.
- touch-overlay.c: simplify return paths in touch_overlay_map().
- touch-overlay.c: drop validity check in touch_overlay_segment_event()
(internal function, not API).
- Link to v10: https://lore.kernel.org/r/20240626-feature-ts_virtobj_patch-v10-0-873ad79bb2c9@wolfvision.net

Patches in v11 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dt-bindings: touchscreen: add touch-overlay propertyDocumentation/devicetree/bindings/input/touchscreen/touchscreen.yaml+119 -00 replies
2/4Input: touch-overlay - Add touchscreen overlay handlingMAINTAINERS drivers/input/Makefile drivers/input/touch-overlay.c +1 more+310 -10 replies
3/4dt-bindings: input: touchscreen: st1232: add touch-overlay exampleDocumentation/devicetree/bindings/input/touchscreen/sitronix,st1232.yaml+29 -00 replies
4/4Input: st1232 - add touch-overlay handlingdrivers/input/touchscreen/st1232.c+27 -80 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJeff LaBundyRob Herring
1/4R-b R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v11 thread

Cover letter [PATCH v11 0/4] Input: support overlay objects on touchscreens

Some touchscreens are shipped with a physical layer on top of them where a number of buttons and a resized touchscreen surface might be available.

In order to generate proper key events by overlay buttons and adjust the touch events to a clipped surface, this series offers a documented, device-tree-based solution by means of helper functions.
An implementation for a specific touchscreen driver is also included.

The functions in touch-overlay provide a simple workflow to acquire physical objects from the device tree, map them into a list and generate events according to the object descriptions.

This feature has been tested with a JT240MHQS-E3 display, which consists of an st1624 as the base touchscreen and an overlay with two buttons and a frame that clips its effective surface mounted on it.

To: Dmitry Torokhov <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Bastian Hecht <[email protected]>
To: Michael Riesch <[email protected]>

Changes in v11:
- {touch-overlay,st1232}.c: work on assigned slots instead of positions
retrieved by the sensor to account for those that don't track the
contacts themselves.
- touch-overlay.c: do not emit sync and rely on the driver calling it.
- touch-overlay.c: use cleanup attribute for fwnode_handle *overlay.
- touch-overlay.c: simplify return paths in touch_overlay_map().
- touch-overlay.c: drop validity check in touch_overlay_segment_event()
(internal function, not API).
- Link to v10: https://lore.kernel.org/r/20240626-feature-ts_virtobj_patch-v10-0-873ad79bb2c9@wolfvision.net

Changes in v10:
- touch-overlay.c: use fwnode_for_each_available_child_node() macro as
there is no point in adding unavailable objects.
- touch-overlay.c: initialize error in touch_overlay_map(), which would
be returned uninitialized if there were no touch overlay segments.
- touch-overlay.c: fix fwnode_handle refcount (overlay must always be
decremented before returning, fw_segment in error paths of the loop).
- Patch 4/4: update description (the feature does not add a second input
device anymore).
- Link to v9: https://lore.kernel.org/r/20240422-feature-ts_virtobj_patch-v9-0-acf118d12a8a@wolfvision.net

Changes in v9:
- touch-overlay.c: trigger a button release if the finger slides out of
the button segment to be consistent with the button press when sliding
into a button segment (see touch_overlay_button_event()).
- touch-overlay.c: (nit) remove braces in if with a single statement in touch_overaly_process_event().
- Link to v8: https://lore.kernel.org/r/20240320-feature-ts_virtobj_patch-v8-0-cab6e7dcb1f6@wolfvision.net

Changes in v8:
- touchscreen bindings: fix description formatting.
- Link to v7: https://lore.kernel.org/r/20240119-feature-ts_virtobj_patch-v7-0-eda70985808f@wolfvision.net

Changes in v7:
- General: return to a single input device implementation.
- touchscreen bindings: segment instead of button in the label
description.
- touch-overlay.c: define button-specific data inside segment struct.
- touch-overlay.c: remove fwnode_property_present() and check return
value of fwnode_property_read_u32() in touch_overlay_get_segment().
- touch-overlay.c: simplify return path in touch_overlay_map().
- Link to v6: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v6-0-d8a605975153@wolfvision.net

Changes in v6:
- General: use a single list to manage a single type of object.
- General: swap patches to have bindings preceding the code.
- touch-overlay.c: minor code-sytle fixes.
- Link to v5: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v5-0-ff6b5c4db693@wolfvision.net

Changes in v5:
- touchscreen bindings: move overlay common properties to a $def entry (Rob Herring)
- st1232 bindings: move overlays to the existing example instead of
making a new one (Rob Herring)
- Link to v4: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v4-0-5c6c0fc1eed6@wolfvision.net

Changes in v4:
- General: rename "touchscreen" to "touch" to include other consumers.
- PATCH 1/4: move touch-overlay feature to input core.
- PATCH 1/4, 3/4: set key caps and report key events without consumer's
intervention.
- PATCH 2/4: add missing 'required' field with the required properties.
- Link to v3: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v3-0-b4fb7fc4bab7@wolfvision.net

Changes in v3:
- General: rename "virtobj" and "virtual" to "overlay"
- PATCH 1/4: Make feature bool instead of tristate (selected by
supported touchscreens)
- Link to v2: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v2-0-f68a6bfe7a0f@wolfvision.net

Changes in v2:
- PATCH 1/4: remove preprocessor directives (the module is selected by
the drivers that support the feature). Typo in the commit message.
- PATCH 2/4: more detailed documentation. Images and examples were added.
- PATCH 3/4: select ts-virtobj automatically.
- Link to v1: https://lore.kernel.org/r/20230510-feature-ts_virtobj_patch-v1-0-5ae5e81bc264@wolfvision.net

---
Javier Carrasco (4):
dt-bindings: touchscreen: add touch-overlay property
Input: touch-overlay - Add touchscreen overlay handling
dt-bindings: input: touchscreen: st1232: add touch-overlay example
Input: st1232 - add touch-overlay handling

 .../input/touchscreen/sitronix,st1232.yaml         |  29 +++
 .../bindings/input/touchscreen/touchscreen.yaml    | 119 +++++++++
 MAINTAINERS                                        |   7 +
 drivers/input/Makefile                             |   2 +-
 drivers/input/touch-overlay.c                      | 277 +++++++++++++++++++++
 drivers/input/touchscreen/st1232.c                 |  35 ++-
 include/linux/input/touch-overlay.h                |  25 ++
 7 files changed, 485 insertions(+), 9 deletions(-)

---
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
change-id: 20230510-feature-ts_virtobj_patch-e267540aae74

Best regards,

Signature · 1 line
Javier Carrasco <[email protected]>