From: Mans Rullgard <mans@mansr.com>
To: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
Date: Fri, 1 Mar 2019 18:48:16 +0000 [thread overview]
Message-ID: <20190301184816.784-3-mans@mansr.com> (raw)
In-Reply-To: <20190301184816.784-1-mans@mansr.com>
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>
---
drivers/auxdisplay/Kconfig | 21 +++++++++++++++++++++
drivers/auxdisplay/charlcd.c | 10 +++++++++-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
index 7d3fe27d6868..c52c738e554a 100644
--- a/drivers/auxdisplay/Kconfig
+++ b/drivers/auxdisplay/Kconfig
@@ -445,6 +445,27 @@ config PANEL_BOOT_MESSAGE
An empty message will only clear the display at driver init time. Any other
printf()-formatted message is valid with newline and escape codes.
+choice
+ prompt "Backlight initial state"
+ default CHARLCD_BL_FLASH
+
+ config CHARLCD_BL_OFF
+ bool "Off"
+ help
+ Backlight is initially turned off
+
+ config CHARLCD_BL_ON
+ bool "On"
+ help
+ Backlight is initially turned on
+
+ config CHARLCD_BL_FLASH
+ bool "Flash"
+ help
+ Backlight is flashed briefly on init
+
+endchoice
+
endif # AUXDISPLAY
config PANEL
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index db0356dca2d7..ff8c53c082ff 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -769,6 +769,14 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
#define LCD_INIT_TEXT "Linux-" UTS_RELEASE "\n"
#endif
+#ifdef CONFIG_CHARLCD_BL_ON
+#define LCD_INIT_BL "\x1b[L+"
+#elif defined (CONFIG_CHARLCD_BL_FLASH)
+#define LCD_INIT_BL "\x1b[L*"
+#else
+#define LCD_INIT_BL "\x1b[L-"
+#endif
+
/* initialize the LCD driver */
static int charlcd_init(struct charlcd *lcd)
{
@@ -790,7 +798,7 @@ static int charlcd_init(struct charlcd *lcd)
return ret;
/* display a short message */
- charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" LCD_INIT_TEXT);
+ charlcd_puts(lcd, "\x1b[Lc\x1b[Lb" LCD_INIT_BL LCD_INIT_TEXT);
/* clear the display on the next device opening */
priv->must_clear = true;
--
2.20.1
next prev parent reply other threads:[~2019-03-01 18:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 18:48 [PATCH 1/3] auxdisplay: deconfuse configuration Mans Rullgard
2019-03-01 18:48 ` [PATCH 2/3] auxdisplay: charlcd: simplify init message display Mans Rullgard
2019-03-06 10:03 ` Miguel Ojeda
2019-03-01 18:48 ` Mans Rullgard [this message]
2019-03-06 9:56 ` [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable Miguel Ojeda
2019-03-06 10:03 ` Miguel Ojeda
2019-03-06 14:49 ` Måns Rullgård
2019-03-12 15:45 ` Andy Shevchenko
2019-03-12 15:48 ` Måns Rullgård
2019-03-17 7:43 ` Miguel Ojeda
2019-03-17 16:52 ` Måns Rullgård
2019-03-06 10:14 ` [PATCH 1/3] auxdisplay: deconfuse configuration Miguel Ojeda
2019-03-06 15:08 ` Måns Rullgård
2019-03-23 14:28 ` Miguel Ojeda
2019-03-23 14:50 ` Randy Dunlap
2019-03-23 15:00 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190301184816.784-3-mans@mansr.com \
--to=mans@mansr.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).