|
20 | 20 | #include <generated/utsrelease.h>
|
21 | 21 |
|
22 | 22 | #include "charlcd.h"
|
23 |
| -#include "hd44780_common.h" |
24 | 23 |
|
25 | 24 | /* Keep the backlight on this many seconds for each flash */
|
26 | 25 | #define LCD_BL_TEMPO_PERIOD 4
|
@@ -112,16 +111,14 @@ static void charlcd_home(struct charlcd *lcd)
|
112 | 111 |
|
113 | 112 | static void charlcd_print(struct charlcd *lcd, char c)
|
114 | 113 | {
|
115 |
| - struct hd44780_common *hdc = lcd->drvdata; |
116 |
| - |
117 | 114 | if (lcd->char_conv)
|
118 | 115 | c = lcd->char_conv[(unsigned char)c];
|
119 | 116 |
|
120 | 117 | if (!lcd->ops->print(lcd, c))
|
121 | 118 | lcd->addr.x++;
|
122 | 119 |
|
123 | 120 | /* prevents the cursor from wrapping onto the next line */
|
124 |
| - if (lcd->addr.x == hdc->bwidth) |
| 121 | + if (lcd->addr.x == lcd->width) |
125 | 122 | lcd->ops->gotoxy(lcd);
|
126 | 123 | }
|
127 | 124 |
|
@@ -195,7 +192,6 @@ static bool parse_xy(const char *s, unsigned long *x, unsigned long *y)
|
195 | 192 | static inline int handle_lcd_special_code(struct charlcd *lcd)
|
196 | 193 | {
|
197 | 194 | struct charlcd_priv *priv = charlcd_to_priv(lcd);
|
198 |
| - struct hd44780_common *hdc = lcd->drvdata; |
199 | 195 |
|
200 | 196 | /* LCD special codes */
|
201 | 197 |
|
@@ -323,7 +319,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
|
323 | 319 |
|
324 | 320 | xs = lcd->addr.x;
|
325 | 321 | ys = lcd->addr.y;
|
326 |
| - for (x = lcd->addr.x; x < hdc->bwidth; x++) |
| 322 | + for (x = lcd->addr.x; x < lcd->width; x++) |
327 | 323 | lcd->ops->print(lcd, ' ');
|
328 | 324 |
|
329 | 325 | /* restore cursor position */
|
@@ -366,7 +362,6 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
|
366 | 362 | static void charlcd_write_char(struct charlcd *lcd, char c)
|
367 | 363 | {
|
368 | 364 | struct charlcd_priv *priv = charlcd_to_priv(lcd);
|
369 |
| - struct hd44780_common *hdc = lcd->drvdata; |
370 | 365 |
|
371 | 366 | /* first, we'll test if we're in escape mode */
|
372 | 367 | if ((c != '\n') && priv->esc_seq.len >= 0) {
|
@@ -407,7 +402,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c)
|
407 | 402 | * flush the remainder of the current line and
|
408 | 403 | * go to the beginning of the next line
|
409 | 404 | */
|
410 |
| - for (; lcd->addr.x < hdc->bwidth; lcd->addr.x++) |
| 405 | + for (; lcd->addr.x < lcd->width; lcd->addr.x++) |
411 | 406 | lcd->ops->print(lcd, ' ');
|
412 | 407 |
|
413 | 408 | lcd->addr.x = 0;
|
|
0 commit comments