aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay/charlcd.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-08-01auxdisplay: charlcd: delete mdelay in long_sleepJia-Ju Bai1-4/+1
The function long_sleep() calls mdelay() when in an interrupt handler. But only charlcd_clear_display() and charlcd_init_display calls long_sleep(), and my tool finds that the two functions are never called in an interrupt handler. Thus mdelay() and in_interrupt() are not necessary. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12auxdisplay: Replace licenses with SPDX identifiersMiguel Ojeda1-5/+1
Cc: Philippe Ombredanne <pombredanne@nexb.com> Acked-by: Willy Tarreau <w@1wt.eu> Acked-by: Linus Walleij <triad@dflund.se> Acked-by: Robin van der Gracht <robin@protonic.nl> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12auxdisplay: charlcd: Fix and clean up handling of x/y commandsMiguel Ojeda1-17/+78
The current version is not parsing multiple x/y commands as the code originally intended. On top of that, kstrtoul() expects NULL-terminated strings. Finally, the code does two passes over the string. Some explanations about the supported syntax are added as well. Cc: Willy Tarreau <w@1wt.eu> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Robert Abel <rabel@robertabel.eu> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12auxdisplay: charlcd: fix hex literal ranges for graphics commandRobert Abel1-2/+2
The graphics command expects 16 hexadecimal literals, but would allow characters in range [0-9a-zA-Z] instead of [0-9a-fA-F]. Signed-off-by: Robert Abel <rabel@robertabel.eu> Acked-by: Willy Tarreau <w@1wt.eu> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12auxdisplay: charlcd: fix two-line command ^[[LN not marked as processedRobert Abel1-0/+1
Signed-off-by: Robert Abel <rabel@robertabel.eu> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12auxdisplay: charlcd: replace octal literal with form-feed escape sequenceRobert Abel1-1/+1
There is no need to resort to octal escape sequence for the form feed character when an established escape sequence exists. Signed-off-by: Robert Abel <rabel@robertabel.eu> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12auxdisplay: charlcd: use null character instead of zero literal to terminate stringsRobert Abel1-2/+2
Using '\0' instead of plain 0 makes the intent clearer that this is indeed a string and not a series of integers. Signed-off-by: Robert Abel <rabel@robertabel.eu> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changesSean Young1-3/+4
If the line extends beyond the width to the screen, nothing changes. The existing code will call charlcd_gotoxy every time for this case. Signed-off-by: Sean Young <sean@mess.org> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2017-09-18auxdisplay: charlcd: properly restore atomic counter on error pathWilly Tarreau1-2/+9
Commit f4757af ("staging: panel: Fix single-open policy race condition") introduced in 3.19-rc1 attempted to fix a race condition on the open, but failed to properly do it and used to exit without restoring the semaphore. This results in -EBUSY being returned after the first open error until the module is reloaded or the system restarted (ie: consecutive to a dual open resulting in -EBUSY or to a permission error). [ Note for stable maintainers: the code moved from drivers/misc/panel.c to drivers/auxdisplay/{charlcd,panel}.c during 4.12. The patch easily applies there (modulo the renamed atomic counter) but I can provide a tested backport if desired. ] Fixes: f4757af85 # 3.19-rc1 Cc: stable@vger.kernel.org Cc: Mariusz Gorski <marius.gorski@gmail.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-17auxdisplay: charlcd: Add support for displays with more than two linesGeert Uytterhoeven1-9/+13
On displays with more than two lines, the additional lines are stored in the buffers used for the first two lines, but beyond the visible parts. Adjust the DDRAM address calculation to cater for this. When clearing the display, avoid writing more spaces than the actual size of the physical buffer. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-17auxdisplay: charlcd: Add support for 4-bit interfacesGeert Uytterhoeven1-6/+30
In 4-bit mode, 8-bit commands and data are written using two raw writes to the data interface: high nibble first, low nibble last. This must be handled by the low-level driver. However, as we don't know in which mode (4-bit or 8-bit) nor 4-bit phase the LCD was left, initialization must always be handled using raw writes, and needs to configure the LCD for 8-bit mode first. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-17auxdisplay: charlcd: Extract character LCD core from misc/panelGeert Uytterhoeven1-0/+790
Extract the character LCD core from the Parallel port LCD/Keypad Panel driver in the misc subsystem, and convert it into a subdriver in the auxdisplay subsystem. This allows the character LCD core to be used by other drivers later. Compilation is controlled by its own Kconfig symbol CHARLCD, which is to be selected by its users, but can be enabled manually for compile-testing. All functions changed their prefix from "lcd_" to "charlcd_", and gained a "struct charlcd *" parameter to operate on a specific instance. While the driver API thus is ready to support multiple instances, the current limitation of a single display (/dev/lcd has a single misc minor assigned) is retained. No functional changes intended. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>