summaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay (follow)
Commit message (Collapse)AuthorAgeFilesLines
* auxdisplay: lcd2s: Use array size explicitly in lcd2s_gotoxy()Andy Shevchenko2022-03-181-1/+1
| | | | | | | | | | | | Currently the reading of the onstack array is confusing since two out of three members are of different types. Let it be more clear by explicitly set the array size, so everybody will understand that parameters are cast to the type of the array. While at it, add a missed space. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: lcd2s: Switch to i2c ->probe_new()Andy Shevchenko2022-03-181-3/+2
| | | | | | | | | | The deprecated i2c ->probe() functionality doesn't work with OF compatible strings, as it only checks for the i2c device id. While it's not a problem right now, it would still bring a better code. Switch to the new way of probing. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: lcd2s: use module_i2c_driver to simplify the codeAndy Shevchenko2022-03-181-18/+1
| | | | | | | | Use the module_i2c_driver() macro to make the code smaller and a bit simpler. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: lcd2s: make use of device property APIAndy Shevchenko2022-03-181-5/+3
| | | | | | | | Make use of device property API in this driver so that both OF based system and ACPI based system can use this driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: lcd2s: Fix multi-line comment styleAndy Shevchenko2022-03-181-11/+10
| | | | | | | | | Fix multi-line comment style: - start sentences with Capital letter - use non-networking style of the first line Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: lcd2s: Use proper API to free the instance of charlcd objectAndy Shevchenko2022-03-031-2/+2
| | | | | | | | | | | | | While it might work, the current approach is fragile in a few ways: - whenever members in the structure are shuffled, the pointer will be wrong - the resource freeing may include more than covered by kfree() Fix this by using charlcd_free() call instead of kfree(). Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Cc: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: lcd2s: Fix memory leak in ->remove()Andy Shevchenko2022-03-031-11/+7
| | | | | | | | | | Once allocated the struct lcd2s_data is never freed. Fix the memory leak by switching to devm_kzalloc(). Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Cc: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: lcd2s: Fix lcd2s_redefine_char() featureAndy Shevchenko2022-03-031-1/+1
| | | | | | | | | | | | | | | | It seems that the lcd2s_redefine_char() has never been properly tested. The buffer is filled by DEF_CUSTOM_CHAR command followed by the character number (from 0 to 7), but immediately after that these bytes are rewritten by the decoded hex stream. Fix the index to fill the buffer after the command and number. Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Cc: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> [fixed typo in commit message] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: charlcd: checking for pointer reference before dereferencingLuiz Sampaio2021-11-241-0/+3
| | | | | | | | | | | Check if the pointer lcd->ops->init_display exists before dereferencing it. If a driver called charlcd_init() without defining the ops, this would return segmentation fault, as happened to me when implementing a charlcd driver. Checking the pointer before dereferencing protects from segmentation fault. Signed-off-by: Luiz Sampaio <sampaio.ime@gmail.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: charlcd: fixing coding style issueLuiz Sampaio2021-11-241-1/+1
| | | | | | | Removing 'int' from 'unsigned long int' declaration, which is unnecessary. Signed-off-by: Luiz Sampaio <sampaio.ime@gmail.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: cfag12864bfb: code indent should use tabs where possibleHuiquan Deng2021-10-221-3/+3
| | | | | | | | Resolves the checkpatch error. Signed-off-by: Huiquan Deng <denghuiquan@cdjrlc.com> [reworded and avoid moving the line] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: remove superfluous header filesMianhan Liu2021-10-221-1/+0
| | | | | | | | | | | ht16k33.c doesn't use any macro or function declared in linux/slab.h. Thus, these files can be removed from ht16k33.c safely without affecting the compilation. Signed-off-by: Mianhan Liu <liumh1@shanghaitech.edu.cn> Acked-by: Robin van der Gracht <robin@protonic.nl> [reworded] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ks0108: remove superfluous header filesMianhan Liu2021-10-221-3/+0
| | | | | | | | | | | ks0108.c doesn't use any macro or function declared in linux/fs.h, linux/io.h and linux/uaccess.h. Thus, these files can be removed from ks0108.c safely without affecting the compilation. Signed-off-by: Mianhan Liu <liumh1@shanghaitech.edu.cn> [reworded] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: cfag12864bfb: remove superfluous header filesMianhan Liu2021-10-221-3/+0
| | | | | | | | | | | cfag12864bfb.c doesn't use any macro or function declared in linux/delay.h, linux/string.h and linux/uaccess.h. Thus, these files can be removed from cfag12864bfb.c safely without affecting the compilation. Signed-off-by: Mianhan Liu <liumh1@shanghaitech.edu.cn> [reworded] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Make use of device propertiesGeert Uytterhoeven2021-10-212-16/+13
| | | | | | | | | | | | The device property API allows drivers to gather device resources from different sources, such as ACPI, and lift the dependency on Device Tree. Convert the driver to unleash the power of the device property API. Suggested-by: Marek BehĂșn <kabel@kernel.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Add LED supportGeert Uytterhoeven2021-10-212-16/+112
| | | | | | | | | | | | | | | | | Instantiate a single LED based on the "led" subnode in DT. This allows the user to control display brightness and blinking (backed by hardware support) through the LED class API and triggers, and exposes the display color. The LED will be named "auxdisplay:<color>:<function>". When running in dot-matrix mode and if no "led" subnode is found, the driver falls back to the traditional backlight mode, to preserve backwards compatibility. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Marek BehĂșn <kabel@kernel.org> Reviewed-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Add support for segment displaysGeert Uytterhoeven2021-10-212-7/+190
| | | | | | | | | | | | | | The Holtek HT16K33 LED controller is not only used for driving dot-matrix displays, but also for driving segment displays. Add support for 4-digit 7-segment and quad 14-segment alphanumeric displays, like the Adafruit 7-segment and 14-segment display backpack and FeatherWing expansion boards. Use the character line display core support to display a message, which will be scrolled if it doesn't fit. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Extract frame buffer probingGeert Uytterhoeven2021-10-211-48/+53
| | | | | | | | | | | | Extract all frame buffer (including backlight) probing into ht16k33_fbdev_probe(). Call ht16k33_fbdev_probe() after ht16k33_keypad_probe(), as the latter does not need any manual cleanup in the probe error path. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Extract ht16k33_brightness_set()Geert Uytterhoeven2021-10-211-6/+19
| | | | | | | | | Extract brightness handling into a helper function, so it can be called from multiple places. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Move delayed workGeert Uytterhoeven2021-10-211-8/+7
| | | | | | | | | Move delayed_work from ht16k33_fbdev to ht16k33_priv, as it is not specific to dot-matrix displays, but common to all display types. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Add helper variable devGeert Uytterhoeven2021-10-211-21/+22
| | | | | | | | | This driver has many users of "client->dev". Add shorthands to simplify the code. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Convert to simple i2c probe functionGeert Uytterhoeven2021-10-211-3/+2
| | | | | | | | | ht16k33_probe() does not use the passed i2c_device_id, so the driver can be converted trivially to the new-style of i2c probing. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Remove unneeded error check in keypad probe()Geert Uytterhoeven2021-10-211-5/+1
| | | | | | | | | There is no need to check the return code of input_register_device(), just propagate it to the caller. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Use HT16K33_FB_SIZE in ht16k33_initialize()Geert Uytterhoeven2021-10-211-1/+1
| | | | | | | | | | Use the existing HT16K33_FB_SIZE definition instead of open-coding the same calculation using an hardcoded value. While at it, restore reverse Christmas tree variable declaration order. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Fix frame buffer device blankingGeert Uytterhoeven2021-10-211-0/+10
| | | | | | | | | | | | | | | | | As the ht16k33 frame buffer sub-driver does not register an fb_ops.fb_blank() handler, blanking does not work: $ echo 1 > /sys/class/graphics/fb0/blank sh: write error: Invalid argument Fix this by providing a handler that always returns zero, to make sure blank events will be sent to the actual device handling the backlight. Reported-by: Robin van der Gracht <robin@protonic.nl> Suggested-by: Robin van der Gracht <robin@protonic.nl> Fixes: 8992da44c6805d53 ("auxdisplay: ht16k33: Driver for LED controller") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Connect backlight to fbdevGeert Uytterhoeven2021-10-211-28/+28
| | | | | | | | | | | | Currently /sys/class/graphics/fb0/bl_curve is not accessible (-ENODEV), as the driver does not connect the backlight to the frame buffer device. Fix this moving backlight initialization up, and filling in fb_info.bl_dev. Fixes: 8992da44c6805d53 ("auxdisplay: ht16k33: Driver for LED controller") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: linedisp: Add support for changing scroll rateGeert Uytterhoeven2021-10-211-2/+35
| | | | | | | | | | | | 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>
* auxdisplay: linedisp: Use kmemdup_nul() helperGeert Uytterhoeven2021-10-211-4/+1
| | | | | | | | 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>
* auxdisplay: Extract character line display core supportGeert Uytterhoeven2021-10-215-174/+312
| | | | | | | | | | | | 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>
* auxdisplay: img-ascii-lcd: Convert device attribute to sysfs_emit()Geert Uytterhoeven2021-10-211-1/+1
| | | | | | | | Convert the "message" device attribute from sprintf() to sysfs_emit(), as the latter is aware of the PAGE_SIZE buffer. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: img-ascii-lcd: Add helper variable devGeert Uytterhoeven2021-10-211-7/+6
| | | | | | | | img_ascii_lcd_probe() has many users of "pdev->dev". Add a shorthand to simplify the code. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty stringGeert Uytterhoeven2021-10-211-0/+10
| | | | | | | | | | | | | | | | | | While writing an empty string to a device attribute is a no-op, and thus does not need explicit safeguards, the user can still write a single newline to an attribute file: echo > .../message If that happens, img_ascii_lcd_display() trims the newline, yielding an empty string, and causing an infinite loop in img_ascii_lcd_scroll(). Fix this by adding a check for empty strings. Clear the display in case one is encountered. Fixes: 0cad855fbd083ee5 ("auxdisplay: img-ascii-lcd: driver for simple ASCII LCD displays") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Replace symbolic permissions with octal permissionsJinchao Wang2021-07-162-3/+3
| | | | | | | | Resolves the checkpatch warning. Signed-off-by: Jinchao Wang <wjc@cdjrlc.com> [edited wording] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ks0108: Switch to use module_parport_driver()Andy Shevchenko2021-07-161-13/+1
| | | | | | | Switch to use module_parport_driver() to reduce boilerplate code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: charlcd: Drop unneeded initializers and switch to C99 styleAndy Shevchenko2021-07-161-3/+1
| | | | | | | | | | | For structure initializers the fields are 0 (or NULL) by default, so there is no need to fill them explicitly. Besides that, much easier to read when initializers use C99 style. Hence, convert to C99 style as well. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: hd44780: Fix oops on module unloadingLars Poeschel2021-07-161-1/+1
| | | | | | | | | | | Fixes: 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/CAHp75VfKyqy+vM0XkP9Yb+znGOTVT4zYCRY3A3nQ7C3WNUVN0g@mail.gmail.com/ Reported-By: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com> [added Link, Fixes, Cc stable tags, edited message] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* treewide: remove editor modelines and cruftMasahiro Yamada2021-05-071-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The section "19) Editor modelines and other cruft" in Documentation/process/coding-style.rst clearly says, "Do not include any of these in source files." I recently receive a patch to explicitly add a new one. Let's do treewide cleanups, otherwise some people follow the existing code and attempt to upstream their favoriate editor setups. It is even nicer if scripts/checkpatch.pl can check it. If we like to impose coding style in an editor-independent manner, I think editorconfig (patch [1]) is a saner solution. [1] https://lore.kernel.org/lkml/20200703073143.423557-1-danny@kdrag0n.dev/ Link: https://lkml.kernel.org/r/20210324054457.1477489-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> [auxdisplay] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* auxdisplay: Remove in_interrupt() usage.Sebastian Andrzej Siewior2021-03-161-10/+8
| | | | | | | | | | | | | | | | | | | | | | | charlcd_write() is invoked as a VFS->write() callback and as such it is always invoked from preemptible context and may sleep. charlcd_puts() is invoked from register/unregister callback which is preemptible. The reboot notifier callback is also invoked from preemptible context. Therefore there is no need to use in_interrupt() to figure out if it is safe to sleep because it always is. in_interrupt() and related context checks are being removed from non-core code. Using schedule() to schedule (and be friendly to others) is discouraged and cond_resched() should be used instead. Remove in_interrupt() and use cond_resched() to schedule every 32 iterations if needed. Link: https://lkml.kernel.org/r/20200914204209.256266093@linutronix.de Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> [mo: fixed a couple typos in comment and commit message] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* treewide: Miguel has movedMiguel Ojeda2021-02-263-6/+6
| | | | | | | | | Update contact info. Link: https://lkml.kernel.org/r/20210206162524.GA11520@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* auxdisplay: Fix duplicate CHARLCD config symbolGeert Uytterhoeven2021-01-251-3/+0
| | | | | | | | | A second CHARLCD config symbol was added instead of moving the existing one. Fix this by removing the old one. Fixes: 718e05ed92ecac0d ("auxdisplay: Introduce hd44780_common.[ch]") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: ht16k33: Fix refresh rate handlingGeert Uytterhoeven2021-01-251-2/+1
| | | | | | | | | Drop the call to msecs_to_jiffies(), as "HZ / fbdev->refresh_rate" is already the number of jiffies to wait. Fixes: 8992da44c6805d53 ("auxdisplay: ht16k33: Driver for LED controller") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* dt-bindings: auxdisplay: ht16k33: Keyscan function should be optionalRobin van der Gracht2021-01-251-8/+6
| | | | | | | | | | | | Keyscan should be optional to support simple LED matrix displays (output only). Reported-by: Michael Kaplan <M.KAPLAN@evva.com> Signed-off-by: Robin van der Gracht <robin@protonic.nl> [geert: Rebased] Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: panel: Remove redundant charlcd_ops structuresLars Poeschel2020-11-161-38/+4
| | | | | | | | The three struct charlcd_ops contain the same data, so we only need one of this structures. The other two are removed. Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: panel: Fix missing print function pointerLars Poeschel2020-11-161-0/+3
| | | | | | | | | | | charlcd drivers need to provide some print function to charlcd. For hd44780 based panel driver this function was missing. We provide the generic hd44780_common_print function which should be suitable. Fixes: b26deabb1d915fe87d395081bbd3058b938dee89 ("auxdisplay: hd44780_common_print") Reported-by: kernel test robot <oliver.sang@intel.com> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: fix platform_no_drv_owner.cocci warningskernel test robot2020-11-141-1/+0
| | | | | | | | | | | | | | drivers/auxdisplay/lcd2s.c:373:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") CC: Lars Poeschel <poeschel@lemonage.de> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: kernel test robot <lkp@intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: fix use after free in lcd2s_i2c_remove()Dan Carpenter2020-11-091-1/+1
| | | | | | | | The kfree() needs to be moved down a line to prevent a use after free. Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: hd44780_common: Fix build errorLars Poeschel2020-11-091-2/+1
| | | | | | | | | | | | | | When building the hd44780_common driver without a driver that actually uses it like panel or hd44780 you get a build error, because hd44780_common uses charlcd, but did not select it. Its users did select it. This is fixed now. hd4478_common now selects charlcd in Kconfig and panel and hd44780 do not. They only select hd44780_common. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: add a driver for lcd2s character displayLars Poeschel2020-11-043-0/+414
| | | | | | | | This driver allows to use a lcd2s 20x4 character display from Modtronix engineering as an auxdisplay charlcd device. Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: charlcd: Do not print chars at end of lineLars Poeschel2020-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Skip printing characters at the end of a display line. This fits to the behaviour we already had, that the cursor is nailed to the last position of a line. This might slightly change behaviour. On hd44780 displays with one or two lines the previous implementation did still write characters to the buffer of the display even if they are currently not visible. The shift_display command could be used to set the "viewing window" to a new position in the buffer and then you could see the characters previously written. This described behaviour does not work for hd44780 displays with more than two display lines. There simply is not enough buffer. So the behaviour was a bit inconsistent across different displays. The new behaviour is to stop writing characters at the end of a visible line, even if there would be room in the buffer. This allows us to have an easy implementation, that should behave equal on all supported displays. This is not hd44780 hardware dependent anymore. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Change gotoxy calling interfaceLars Poeschel2020-11-044-16/+13
| | | | | | | | | | | | Change the calling interface for gotoxy from supplying the x and y coordinates in the charlcd struct to explicitly supplying x and y in the function arguments. This is more intuitive and allows for moving the cursor to positions independent from the position saved in the charlcd struct. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>