summaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay/hd44780_common.c
Commit message (Collapse)AuthorAgeFilesLines
* auxdisplay: hd44780: move cursor home after clear display commandHugo Villeneuve2023-08-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The DISPLAY_CLEAR command on the NewHaven NHD-0220DZW-AG5 display does NOT change the DDRAM address to 00h (home position) like the standard Hitachi HD44780 controller. As a consequence, the starting position of the initial string LCD_INIT_TEXT is not guaranteed to be at 0,0 depending on where the cursor was before the DISPLAY_CLEAR command. Extract of DISPLAY_CLEAR command from datasheets of: Hitachi HD44780: ... It then sets DDRAM address 0 into the address counter... NewHaven NHD-0220DZW-AG5 datasheet: ... This instruction does not change the DDRAM Address Move the cursor home after sending DISPLAY_CLEAR command to support non-standard LCDs. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: David Reaver <me@davidreaver.com> Link: https://lore.kernel.org/r/20230722180925.1408885-1-hugo@hugovil.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Change gotoxy calling interfaceLars Poeschel2020-11-041-9/+6
| | | | | | | | | | | | 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>
* auxdisplay: hd44780_common: Reduce clear_display timeoutLars Poeschel2020-11-041-2/+2
| | | | | | | | | | | | Digging in the hd44780 datasheet revealed that the timeout needed after clearing the whole display is only 1,64ms not 15ms. So we can reduce that timeout. Link: https://lore.kernel.org/lkml/20200922092121.GG16421@1wt.eu/ Link: https://www.crystalfontz.com/controllers/Hitachi/HD44780/433/ Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Move char redefine code to hd44780_commonLars Poeschel2020-11-041-0/+57
| | | | | | | | | | | Take the code to redefine characters out of charlcd and move it to hd44780_common, as this is hd44780 specific. There is now a function hd44780_common_redefine_char that drivers use and charlcd calls it through its ops function pointer. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: implement various hd44780_common_ functionsLars Poeschel2020-11-041-0/+131
| | | | | | | | | | | | | | | | | | This implements various hd44780_common_ functions for hd44780 compatible display drivers to use. charlcd then calls these functions through its ops function pointer. The functions namely are: - hd44780_common_shift_cursor - hd44780_common_display_shift - hd44780_common_display - hd44780_common_cursor - hd44780_common_blink - hd44780_common_fontsize - hd44780_common_lines Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Move init_display to hd44780_commonLars Poeschel2020-11-041-0/+88
| | | | | | | | | | The init_display function is moved over to hd44780_common. charlcd uses it via its ops function pointer and drivers initialize the ops with the common hd44780_common_init_display function. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Move clear_display to hd44780_commonLars Poeschel2020-11-041-0/+21
| | | | | | | | | | | | This moves the clear_display function from charlcd to hd44780_common. This is one more step to make charlcd independent from device specific code. The two hd44780 drivers use the new function from hd44780_common and charlcd calls this function through its function pointer in its ops structure. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: add home to charlcd_opsLars Poeschel2020-11-041-0/+8
| | | | | | | | | | This adds a home function to the charlcd_ops struct and offer an implementation for hd44780_common. This implementation is used by our two hd44780 drivers. This is to make charlcd device independent. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: provide hd44780_common_gotoxyLars Poeschel2020-11-041-0/+23
| | | | | | | | | Provide a hd44780_common_gotoxy function and a pointer in the ops for charlcd to use to move the cursor. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: hd44780_common_printLars Poeschel2020-11-041-0/+14
| | | | | | | | | | | | We create a hd44780_common_print function. It is derived from the original charlcd_print. charlcd_print becomes a device independent print function, that then only calls via its ops function pointers, into the print function offered by drivers. Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Move ifwidth to struct hd44780_commonLars Poeschel2020-11-041-0/+1
| | | | | | | | | | Move struct charlcd member ifwidth to our new struct hd44780_common. ifwidth is hd44780 device specific and is used by two drivers at the moment, so we move it to a common place, where both can use this. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Move hwidth and bwidth to struct hd44780_commonLars Poeschel2020-11-041-0/+2
| | | | | | | | | | hwidth is for the hardware buffer size and bwidth is for the buffer width of one single line. This is specific to the hd44780 displays and so it is moved out from charlcd to struct hd44780_common. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
* auxdisplay: Introduce hd44780_common.[ch]Lars Poeschel2020-11-041-0/+19
There is some hd44780 specific code in charlcd and this code is used by multiple drivers. To make charlcd independent from this device specific code this has to be moved to a place where the multiple drivers can share their common code. This common place is now introduced as hd44780_common. Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>