mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
55 lines
1.8 KiB
Diff
55 lines
1.8 KiB
Diff
From 9101338af83f9e74bad4163ad4d6569cb812699f Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Lessard?= <jefflessard3@gmail.com>
|
|
Date: Sat, 30 Aug 2025 20:35:34 -0400
|
|
Subject: [PATCH 42/54] TEST: auxdisplay: linedisp: add num_chars sysfs
|
|
attribute
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Add a read-only 'num_chars' sysfs attribute to report display digit count.
|
|
|
|
The num_chars attribute provides essential capability information to
|
|
userspace applications that need to know display dimensions before writing
|
|
messages, complementing the existing message and scroll controls.
|
|
|
|
No functional changes to existing behavior.
|
|
|
|
Signed-off-by: Jean-François Lessard <jefflessard3@gmail.com>
|
|
---
|
|
drivers/auxdisplay/line-display.c | 11 +++++++++++
|
|
1 file changed, 11 insertions(+)
|
|
|
|
diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c
|
|
index ea23c43bb7b2..abeed8812088 100644
|
|
--- a/drivers/auxdisplay/line-display.c
|
|
+++ b/drivers/auxdisplay/line-display.c
|
|
@@ -211,6 +211,16 @@ static ssize_t scroll_step_ms_store(struct device *dev,
|
|
|
|
static DEVICE_ATTR_RW(scroll_step_ms);
|
|
|
|
+static ssize_t num_chars_show(struct device *dev, struct device_attribute *attr,
|
|
+ char *buf)
|
|
+{
|
|
+ struct linedisp *linedisp = to_linedisp(dev);
|
|
+
|
|
+ return sysfs_emit(buf, "%u\n", linedisp->num_chars);
|
|
+}
|
|
+
|
|
+static DEVICE_ATTR_RO(num_chars);
|
|
+
|
|
static ssize_t map_seg_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|
{
|
|
struct linedisp *linedisp = to_linedisp(dev);
|
|
@@ -242,6 +252,7 @@ static DEVICE_ATTR(map_seg14, 0644, map_seg_show, map_seg_store);
|
|
static struct attribute *linedisp_attrs[] = {
|
|
&dev_attr_message.attr,
|
|
&dev_attr_scroll_step_ms.attr,
|
|
+ &dev_attr_num_chars.attr,
|
|
&dev_attr_map_seg7.attr,
|
|
&dev_attr_map_seg14.attr,
|
|
NULL
|
|
--
|
|
2.34.1
|
|
|