{
lcd->addr.x = 0;
lcd->addr.y = 0;
- lcd->ops->gotoxy(lcd);
+ lcd->ops->home(lcd);
}
static void charlcd_print(struct charlcd *lcd, char c)
* wrap to the next line at the end of a line.
* @gotoxy: Set cursor to x, y. The x and y values to set the cursor to are
* previously set in addr.x and addr.y by charlcd.
+ * @home: Set cursor to 0, 0. The values in addr.x and addr.y are set to 0, 0 by
+ * charlcd prior to calling this function.
*/
struct charlcd_ops {
void (*clear_fast)(struct charlcd *lcd);
void (*backlight)(struct charlcd *lcd, enum charlcd_onoff on);
int (*print)(struct charlcd *lcd, int c);
int (*gotoxy)(struct charlcd *lcd);
+ int (*home)(struct charlcd *lcd);
};
struct charlcd *charlcd_alloc(void);
.backlight = hd44780_backlight,
.print = hd44780_common_print,
.gotoxy = hd44780_common_gotoxy,
+ .home = hd44780_common_home,
};
/* Send a command to the LCD panel in 4 bit GPIO mode */
.backlight = hd44780_backlight,
.print = hd44780_common_print,
.gotoxy = hd44780_common_gotoxy,
+ .home = hd44780_common_home,
};
static int hd44780_probe(struct platform_device *pdev)
}
EXPORT_SYMBOL_GPL(hd44780_common_gotoxy);
+int hd44780_common_home(struct charlcd *lcd)
+{
+ lcd->addr.x = 0;
+ lcd->addr.y = 0;
+ return hd44780_common_gotoxy(lcd);
+}
+EXPORT_SYMBOL_GPL(hd44780_common_home);
+
struct hd44780_common *hd44780_common_alloc(void)
{
struct hd44780_common *hd;
int hd44780_common_print(struct charlcd *lcd, int c);
int hd44780_common_gotoxy(struct charlcd *lcd);
+int hd44780_common_home(struct charlcd *lcd);
struct hd44780_common *hd44780_common_alloc(void);
.clear_fast = lcd_clear_fast_s,
.backlight = lcd_backlight,
.gotoxy = hd44780_common_gotoxy,
+ .home = hd44780_common_home,
};
static const struct charlcd_ops charlcd_parallel_ops = {
.clear_fast = lcd_clear_fast_p8,
.backlight = lcd_backlight,
.gotoxy = hd44780_common_gotoxy,
+ .home = hd44780_common_home,
};
static const struct charlcd_ops charlcd_tilcd_ops = {
.clear_fast = lcd_clear_fast_tilcd,
.backlight = lcd_backlight,
.gotoxy = hd44780_common_gotoxy,
+ .home = hd44780_common_home,
};
/* initialize the LCD driver */