Skip to content

Commit 00de283

Browse files
committed
Merge patch series "auxdisplay: linedisp: support attribute attachment to auxdisplay devices"
Jean-François Lessard <jefflessard3@gmail.com> says: This series modernizes the auxdisplay line display (linedisp) library to enable seamless integration with auxdisplay parent devices while maintaining backward compatibility. The key improvement is adding attach/detach APIs that allow linedisp sysfs attributes to be bound directly to their parent auxdisplay devices avoiding child device proliferation and enabling a uniform 7-segment userspace interface across different driver architectures. This series introduces attachment infrastructure for linedisp devices. The first consumer of this API will be the TM16XX driver series. See the related patch series: auxdisplay: Add TM16xx 7-segment LED matrix display controllers driver Changes include: 1. Encapsulate container_of() usage with to_linedisp() helper function for cleaner context retrieval 2. Improve message display behavior with static padding when message length is smaller than display width 3. Add 'num_chars' read-only attribute for userspace capability discovery 4. Add attach/detach API for sysfs attributes binding to parent devices 5. Document all linedisp sysfs attributes in ABI documentation All existing linedisp_register() users remain unaffected. The new APIs enable drivers like TM16XX to integrate 7-segment functionality within their LED class device hierarchy while providing a uniform 7-segment API. Thanks to Andy Shevchenko for early feedback and guidance. Link: https://lore.kernel.org/r/20250918121321.116248-1-jefflessard3@gmail.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2 parents 3a86608 + 3ba5c78 commit 00de283

3 files changed

Lines changed: 312 additions & 22 deletions

File tree

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
What: /sys/.../message
2+
Date: October 2021
3+
KernelVersion: 5.16
4+
Description:
5+
Controls the text message displayed on character line displays.
6+
7+
Reading returns the current message with a trailing newline.
8+
Writing updates the displayed message. Messages longer than the
9+
display width will automatically scroll. Trailing newlines in
10+
input are automatically trimmed.
11+
12+
Writing an empty string clears the display.
13+
14+
Example:
15+
echo "Hello World" > message
16+
cat message # Returns "Hello World\n"
17+
18+
What: /sys/.../num_chars
19+
Date: November 2025
20+
KernelVersion: 6.18
21+
Contact: Jean-François Lessard <jefflessard3@gmail.com>
22+
Description:
23+
Read-only attribute showing the character width capacity of
24+
the line display device. Messages longer than this will scroll.
25+
26+
Example:
27+
cat num_chars # Returns "16\n" for 16-char display
28+
29+
What: /sys/.../scroll_step_ms
30+
Date: October 2021
31+
KernelVersion: 5.16
32+
Description:
33+
Controls the scrolling speed for messages longer than the display
34+
width, specified in milliseconds per scroll step.
35+
36+
Setting to 0 disables scrolling. Default is 500ms.
37+
38+
Example:
39+
echo "250" > scroll_step_ms # 4Hz scrolling
40+
cat scroll_step_ms # Returns "250\n"
41+
42+
What: /sys/.../map_seg7
43+
Date: January 2024
44+
KernelVersion: 6.9
45+
Description:
46+
Read/write binary blob representing the ASCII-to-7-segment
47+
display conversion table used by the linedisp driver, as defined
48+
by struct seg7_conversion_map in <linux/map_to_7segment.h>.
49+
50+
Only visible on displays with 7-segment capability.
51+
52+
This attribute is not human-readable. Writes must match the
53+
struct size exactly, else -EINVAL is returned; reads return the
54+
entire mapping as a binary blob.
55+
56+
This interface and its implementation match existing conventions
57+
used in segment-mapped display drivers since 2005.
58+
59+
ABI note: This style of binary sysfs attribute *is an exception*
60+
to current "one value per file, text only" sysfs rules, for
61+
historical compatibility and driver uniformity. New drivers are
62+
discouraged from introducing additional binary sysfs ABIs.
63+
64+
Reference interface guidance:
65+
- include/uapi/linux/map_to_7segment.h
66+
67+
What: /sys/.../map_seg14
68+
Date: January 2024
69+
KernelVersion: 6.9
70+
Description:
71+
Read/write binary blob representing the ASCII-to-14-segment
72+
display conversion table used by the linedisp driver, as defined
73+
by struct seg14_conversion_map in <linux/map_to_14segment.h>.
74+
75+
Only visible on displays with 14-segment capability.
76+
77+
This attribute is not human-readable. Writes must match the
78+
struct size exactly, else -EINVAL is returned; reads return the
79+
entire mapping as a binary blob.
80+
81+
This interface and its implementation match existing conventions
82+
used by segment-mapped display drivers since 2005.
83+
84+
ABI note: This style of binary sysfs attribute *is an exception*
85+
to current "one value per file, text only" sysfs rules, for
86+
historical compatibility and driver uniformity. New drivers are
87+
discouraged from introducing additional binary sysfs ABIs.
88+
89+
Reference interface guidance:
90+
- include/uapi/linux/map_to_14segment.h

0 commit comments

Comments
 (0)