Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

auxdisplay: charlcd: make backlight initial state configurable

The charlcd driver currently flashes the backlight once on init.
This may not be desirable. Thus, add options for turning the
backlight off or on as well.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>

authored by

Mans Rullgard and committed by
Miguel Ojeda
cc5d04d8 c9171722

+30 -1
+21
drivers/auxdisplay/Kconfig
··· 445 445 An empty message will only clear the display at driver init time. Any other 446 446 printf()-formatted message is valid with newline and escape codes. 447 447 448 + choice 449 + prompt "Backlight initial state" 450 + default CHARLCD_BL_FLASH 451 + 452 + config CHARLCD_BL_OFF 453 + bool "Off" 454 + help 455 + Backlight is initially turned off 456 + 457 + config CHARLCD_BL_ON 458 + bool "On" 459 + help 460 + Backlight is initially turned on 461 + 462 + config CHARLCD_BL_FLASH 463 + bool "Flash" 464 + help 465 + Backlight is flashed briefly on init 466 + 467 + endchoice 468 + 448 469 endif # AUXDISPLAY 449 470 450 471 config PANEL
+9 -1
drivers/auxdisplay/charlcd.c
··· 769 769 #define LCD_INIT_TEXT "Linux-" UTS_RELEASE "\n" 770 770 #endif 771 771 772 + #ifdef CONFIG_CHARLCD_BL_ON 773 + #define LCD_INIT_BL "\x1b[L+" 774 + #elif defined(CONFIG_CHARLCD_BL_FLASH) 775 + #define LCD_INIT_BL "\x1b[L*" 776 + #else 777 + #define LCD_INIT_BL "\x1b[L-" 778 + #endif 779 + 772 780 /* initialize the LCD driver */ 773 781 static int charlcd_init(struct charlcd *lcd) 774 782 { ··· 798 790 return ret; 799 791 800 792 /* display a short message */ 801 - charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" LCD_INIT_TEXT); 793 + charlcd_puts(lcd, "\x1b[Lc\x1b[Lb" LCD_INIT_BL LCD_INIT_TEXT); 802 794 803 795 /* clear the display on the next device opening */ 804 796 priv->must_clear = true;