common: lcd: extend lcd api by function lcd_get_position_cursor()
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 2 Apr 2014 13:21:06 +0000 (15:21 +0200)
committerPrzemyslaw Marczak <p.marczak@samsung.com>
Thu, 3 Apr 2014 07:54:20 +0000 (09:54 +0200)
This commit change the name of function lcd_position_cursor()
to lcd_set_position_cursor() and adds its complementary function
lcd_get_position_cursor().
This change is useful e.g. when user wants overwrite some lines,
words or even just a letter on lcd console screen.

Other changes:
- update previous lcd_position_cursor() calls

Change-Id: I4a102c236f2d2d5c238e9790382e4b9454e3c361
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Vadim Bendebury <vbendeb@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
board/samsung/common/misc.c
common/lcd.c
include/lcd.h

index bb27045e504fc32eb62b754773bd611c59569d02..d07702a299e46f7ef1f2bc6713766d10067773e6 100644 (file)
@@ -158,7 +158,7 @@ static void display_board_info(void)
 #endif
        vidinfo_t *vid = &panel_info;
 
-       lcd_position_cursor(4, 4);
+       lcd_set_position_cursor(4, 4);
 
        lcd_printf("%s\n\t", U_BOOT_VERSION);
        lcd_puts("\n\t\tBoard Info:\n");
@@ -320,7 +320,7 @@ static void download_menu(void)
 
 static void display_mode_info(void)
 {
-       lcd_position_cursor(4, 4);
+       lcd_set_position_cursor(4, 4);
        lcd_printf("%s\n", U_BOOT_VERSION);
        lcd_puts("\nDownload Mode Menu\n");
 #ifdef CONFIG_SYS_BOARD
index 19b86b7c55013abc621621aaf94f06fe095d63dc..513e784af6a7bbb82cf99e73cdec4bb462a7d77f 100644 (file)
@@ -1135,12 +1135,18 @@ static int on_splashimage(const char *name, const char *value, enum env_op op,
 U_BOOT_ENV_CALLBACK(splashimage, on_splashimage);
 #endif
 
-void lcd_position_cursor(unsigned col, unsigned row)
+void lcd_set_position_cursor(unsigned col, unsigned row)
 {
        console_col = min(col, CONSOLE_COLS - 1);
        console_row = min(row, CONSOLE_ROWS - 1);
 }
 
+void lcd_get_position_cursor(unsigned *col, unsigned *row)
+{
+       *col = console_col;
+       *row = console_row;
+}
+
 int lcd_get_pixel_width(void)
 {
        return panel_info.vl_col;
index 5f84cd3c5b2ccad57c78fdf01419f0e50e2b11db..dc8dc3d869b7e5b3fecb74794fd3280f7a9dd879 100644 (file)
@@ -302,7 +302,15 @@ int lcd_get_screen_columns(void);
  * @param col  Column to place cursor (0 = left side)
  * @param row  Row to place cursor (0 = top line)
  */
-void lcd_position_cursor(unsigned col, unsigned row);
+void lcd_set_position_cursor(unsigned col, unsigned row);
+
+/**
+ * Get the position of the text cursor
+ *
+ * @param *col Pointer to store cursor placement column (0 = left side)
+ * @param *row Pointer to store cursor placement row (0 = top line)
+ */
+void lcd_get_position_cursor(unsigned *col, unsigned *row);
 
 /* Allow boards to customize the information displayed */
 void lcd_show_board_info(void);