Skip to content

Commit 6e49eea

Browse files
poeschelojeda
authored andcommitted
auxdisplay: charlcd: replace last device specific stuff
These are the last bits left in charlcd.c that are device specific and they are removed now. In detail this is: * bwidth, which is the width of the display buffer per line. This is replaced by width of the display. * hwidth, which is the size of the display buffer as a whole. This is replaced by looping all chars of a line by all lines. * the hd44780_common header include can go away. Reviewed-by: Willy Tarreau <[email protected]> Signed-off-by: Lars Poeschel <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 377cf2c commit 6e49eea

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/auxdisplay/charlcd.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <generated/utsrelease.h>
2121

2222
#include "charlcd.h"
23-
#include "hd44780_common.h"
2423

2524
/* Keep the backlight on this many seconds for each flash */
2625
#define LCD_BL_TEMPO_PERIOD 4
@@ -112,16 +111,14 @@ static void charlcd_home(struct charlcd *lcd)
112111

113112
static void charlcd_print(struct charlcd *lcd, char c)
114113
{
115-
struct hd44780_common *hdc = lcd->drvdata;
116-
117114
if (lcd->char_conv)
118115
c = lcd->char_conv[(unsigned char)c];
119116

120117
if (!lcd->ops->print(lcd, c))
121118
lcd->addr.x++;
122119

123120
/* prevents the cursor from wrapping onto the next line */
124-
if (lcd->addr.x == hdc->bwidth)
121+
if (lcd->addr.x == lcd->width)
125122
lcd->ops->gotoxy(lcd);
126123
}
127124

@@ -195,7 +192,6 @@ static bool parse_xy(const char *s, unsigned long *x, unsigned long *y)
195192
static inline int handle_lcd_special_code(struct charlcd *lcd)
196193
{
197194
struct charlcd_priv *priv = charlcd_to_priv(lcd);
198-
struct hd44780_common *hdc = lcd->drvdata;
199195

200196
/* LCD special codes */
201197

@@ -323,7 +319,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
323319

324320
xs = lcd->addr.x;
325321
ys = lcd->addr.y;
326-
for (x = lcd->addr.x; x < hdc->bwidth; x++)
322+
for (x = lcd->addr.x; x < lcd->width; x++)
327323
lcd->ops->print(lcd, ' ');
328324

329325
/* restore cursor position */
@@ -366,7 +362,6 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
366362
static void charlcd_write_char(struct charlcd *lcd, char c)
367363
{
368364
struct charlcd_priv *priv = charlcd_to_priv(lcd);
369-
struct hd44780_common *hdc = lcd->drvdata;
370365

371366
/* first, we'll test if we're in escape mode */
372367
if ((c != '\n') && priv->esc_seq.len >= 0) {
@@ -407,7 +402,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c)
407402
* flush the remainder of the current line and
408403
* go to the beginning of the next line
409404
*/
410-
for (; lcd->addr.x < hdc->bwidth; lcd->addr.x++)
405+
for (; lcd->addr.x < lcd->width; lcd->addr.x++)
411406
lcd->ops->print(lcd, ' ');
412407

413408
lcd->addr.x = 0;

0 commit comments

Comments
 (0)