Commit Graph

13 Commits

Author SHA1 Message Date
Jeff Johnson
4adbf7086d auxdisplay: linedisp: add missing MODULE_DESCRIPTION() macro
make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/auxdisplay/line-display.o

Add the missing invocation of the MODULE_DESCRIPTION() macro.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-06-04 10:29:36 +03:00
Chris Packham
c8ffef985a auxdisplay: linedisp: Support configuring the boot message
Like we do for charlcd, allow the configuration of the initial message
on line-display devices.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-06-04 10:29:36 +03:00
Andy Shevchenko
4ce026d5f4 auxdisplay: linedisp: Allocate buffer for the string
Always allocate a buffer for the currently displayed characters.
It makes the line display API simpler.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-26 18:02:19 +02:00
Andy Shevchenko
34ddc83dc7 auxdisplay: linedisp: Add support for overriding character mapping
There is already the driver using character mapping table for
7 or 14 segment display. It is possible to override it. Make
the similar in the line display library to allow other drivers
to utilise the same functionality.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-15 14:30:15 +02:00
Andy Shevchenko
70fb97c061 auxdisplay: linedisp: Provide struct linedisp_ops for future extension
Currently the line display library doesn't scale in case we want to
provide more operations. Prepare the library to take a newly created
struct linedisp_ops that scales.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-15 14:30:15 +02:00
Andy Shevchenko
fe5bd82f59 auxdisplay: linedisp: Move exported symbols to a namespace
Avoid unnecessary pollution of the global symbol namespace by
moving library functions in to a specific namespace and import
that into the drivers that make use of the functions.

For more info: https://lwn.net/Articles/760045/

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-15 13:31:21 +02:00
Andy Shevchenko
6134b0be91 auxdisplay: linedisp: Add missing header(s)
Do not imply that some of the generic headers may be always included.
Instead, include explicitly what we are direct user of.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-15 13:31:21 +02:00
Andy Shevchenko
7168791fca auxdisplay: linedisp: Unshadow error codes in ->store()
kstrtox() may return different error codes.

Unshadow them in the ->store() callback to give better error report.

While at it, add missing kstrtox.h inclusion.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-15 13:31:20 +02:00
Andy Shevchenko
50d6b9d56e auxdisplay: linedisp: Use unique number for id
The absence of decrementation of linedisp_id is incorrect in two ways,
i.e. it may cause:
- an ID exhaustion
- (and if the above is addressed) a duplicate id number may be allocated
  next time a device is added

Replace above mentioned approach by using IDA framework.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-15 13:31:12 +02:00
Andy Shevchenko
2327960f0c auxdisplay: linedisp: Free allocated resources in ->release()
While there is no issue currently with the resources allocation,
the code may still be made more robust by deallocating message
in the ->release() callback.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-02-15 13:24:54 +02:00
Geert Uytterhoeven
d79141c39f auxdisplay: linedisp: Add support for changing scroll rate
If the message to display is longer than the number of characters that
the display can show, the message will be scrolled.  Currently the
scroll rate is fixed, moving every 500 ms.

Add support for changing the scroll rate through a "scroll_step_ms"
device attribute in sysfs.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-10-21 23:36:29 +02:00
Geert Uytterhoeven
364f2c392f auxdisplay: linedisp: Use kmemdup_nul() helper
Use the existing kmemdup_nul() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-10-21 23:36:29 +02:00
Geert Uytterhoeven
7e76aece6f auxdisplay: Extract character line display core support
Extract the character line display core support from the simple ASCII
LCD driver for the MIPS Boston, Malta & SEAD3 development boards into
its own subdriver, so it can be reused for other displays.

As this moves the "message" device attribute in sysfs in a "linedisp.N"
subdirectory, a symlink is added to preserve backwards compatibility.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-10-21 23:36:28 +02:00