#include <generated/utsrelease.h>
#include "charlcd.h"
-#include "hd44780_common.h"
/* Keep the backlight on this many seconds for each flash */
#define LCD_BL_TEMPO_PERIOD 4
static void charlcd_print(struct charlcd *lcd, char c)
{
- struct hd44780_common *hdc = lcd->drvdata;
-
if (lcd->char_conv)
c = lcd->char_conv[(unsigned char)c];
lcd->addr.x++;
/* prevents the cursor from wrapping onto the next line */
- if (lcd->addr.x == hdc->bwidth)
+ if (lcd->addr.x == lcd->width)
lcd->ops->gotoxy(lcd);
}
static inline int handle_lcd_special_code(struct charlcd *lcd)
{
struct charlcd_priv *priv = charlcd_to_priv(lcd);
- struct hd44780_common *hdc = lcd->drvdata;
/* LCD special codes */
xs = lcd->addr.x;
ys = lcd->addr.y;
- for (x = lcd->addr.x; x < hdc->bwidth; x++)
+ for (x = lcd->addr.x; x < lcd->width; x++)
lcd->ops->print(lcd, ' ');
/* restore cursor position */
static void charlcd_write_char(struct charlcd *lcd, char c)
{
struct charlcd_priv *priv = charlcd_to_priv(lcd);
- struct hd44780_common *hdc = lcd->drvdata;
/* first, we'll test if we're in escape mode */
if ((c != '\n') && priv->esc_seq.len >= 0) {
* flush the remainder of the current line and
* go to the beginning of the next line
*/
- for (; lcd->addr.x < hdc->bwidth; lcd->addr.x++)
+ for (; lcd->addr.x < lcd->width; lcd->addr.x++)
lcd->ops->print(lcd, ' ');
lcd->addr.x = 0;