linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] auxdisplay: deconfuse configuration
@ 2019-03-01 18:48 Mans Rullgard
  2019-03-01 18:48 ` [PATCH 2/3] auxdisplay: charlcd: simplify init message display Mans Rullgard
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Mans Rullgard @ 2019-03-01 18:48 UTC (permalink / raw)
  To: Miguel Ojeda Sandonis; +Cc: linux-kernel

The auxdisplay Kconfig is confusing.  It creates two separate menus
even though the settings are closely related.  Moreover, the options
for setting the boot message depend on CONFIG_PARPORT even though they
are used by drivers that do not.

Clear up the confustion by moving the "Parallel port LCD/Keypad" menu
under auxdisplay where it logically belongs.  Change the boot message
options to depend only on CONFIG_CHARLCD, making them accessible also
when only the HD44780 is selected.

Since the "Parallel port LCD/Keypad" driver now has a new dependency
on CONFIG_AUXDISPLAY, rename its Kconfig symbol and keep the old one
such that make oldconfig will not disable the driver.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/auxdisplay/Kconfig  | 17 ++++++++++++-----
 drivers/auxdisplay/Makefile |  2 +-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
index 57410f9c5d44..7d3fe27d6868 100644
--- a/drivers/auxdisplay/Kconfig
+++ b/drivers/auxdisplay/Kconfig
@@ -164,9 +164,7 @@ config ARM_CHARLCD
 	  line and the Linux version on the second line, but that's
 	  still useful.
 
-endif # AUXDISPLAY
-
-menuconfig PANEL
+menuconfig PARPORT_PANEL
 	tristate "Parallel port LCD/Keypad Panel support"
 	depends on PARPORT
 	select CHARLCD
@@ -178,7 +176,7 @@ menuconfig PANEL
 	  compiled as a module, or linked into the kernel and started at boot.
 	  If you don't understand what all this is about, say N.
 
-if PANEL
+if PARPORT_PANEL
 
 config PANEL_PARPORT
 	int "Default parallel port number (0=LPT1)"
@@ -419,8 +417,11 @@ config PANEL_LCD_PIN_BL
 
 	  Default for the 'BL' pin in custom profile is '0' (uncontrolled).
 
+endif # PARPORT_PANEL
+
 config PANEL_CHANGE_MESSAGE
 	bool "Change LCD initialization message ?"
+	depends on CHARLCD
 	default "n"
 	---help---
 	  This allows you to replace the boot message indicating the kernel version
@@ -444,7 +445,13 @@ 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.
 
-endif # PANEL
+endif # AUXDISPLAY
+
+config PANEL
+	tristate "Parallel port LCD/Keypad Panel support (OLD OPTION)"
+	depends on PARPORT
+	select AUXDISPLAY
+	select PARPORT_PANEL
 
 config CHARLCD
 	tristate "Character LCD core support" if COMPILE_TEST
diff --git a/drivers/auxdisplay/Makefile b/drivers/auxdisplay/Makefile
index 7ac6776ca3f6..cf54b5efb07e 100644
--- a/drivers/auxdisplay/Makefile
+++ b/drivers/auxdisplay/Makefile
@@ -10,4 +10,4 @@ obj-$(CONFIG_CFAG12864B)	+= cfag12864b.o cfag12864bfb.o
 obj-$(CONFIG_IMG_ASCII_LCD)	+= img-ascii-lcd.o
 obj-$(CONFIG_HD44780)		+= hd44780.o
 obj-$(CONFIG_HT16K33)		+= ht16k33.o
-obj-$(CONFIG_PANEL)             += panel.o
+obj-$(CONFIG_PARPORT_PANEL)	+= panel.o
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/3] auxdisplay: charlcd: simplify init message display
  2019-03-01 18:48 [PATCH 1/3] auxdisplay: deconfuse configuration Mans Rullgard
@ 2019-03-01 18:48 ` Mans Rullgard
  2019-03-06 10:03   ` Miguel Ojeda
  2019-03-01 18:48 ` [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable Mans Rullgard
  2019-03-06 10:14 ` [PATCH 1/3] auxdisplay: deconfuse configuration Miguel Ojeda
  2 siblings, 1 reply; 16+ messages in thread
From: Mans Rullgard @ 2019-03-01 18:48 UTC (permalink / raw)
  To: Miguel Ojeda Sandonis; +Cc: linux-kernel

If CONFIG_PANEL_CHANGE_MESSAGE is set, CONFIG_PANEL_BOOT_MESSAGE will
also be defined, so the double ifdef is pointless.  Simplify the code
further by using an intermediate macro rather duplicating most of the
line.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/auxdisplay/charlcd.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 60e0b772673f..db0356dca2d7 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -763,6 +763,12 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
 	}
 }
 
+#ifdef CONFIG_PANEL_BOOT_MESSAGE
+#define LCD_INIT_TEXT CONFIG_PANEL_BOOT_MESSAGE
+#else
+#define LCD_INIT_TEXT "Linux-" UTS_RELEASE "\n"
+#endif
+
 /* initialize the LCD driver */
 static int charlcd_init(struct charlcd *lcd)
 {
@@ -784,13 +790,8 @@ static int charlcd_init(struct charlcd *lcd)
 		return ret;
 
 	/* display a short message */
-#ifdef CONFIG_PANEL_CHANGE_MESSAGE
-#ifdef CONFIG_PANEL_BOOT_MESSAGE
-	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" CONFIG_PANEL_BOOT_MESSAGE);
-#endif
-#else
-	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*Linux-" UTS_RELEASE "\n");
-#endif
+	charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" LCD_INIT_TEXT);
+
 	/* clear the display on the next device opening */
 	priv->must_clear = true;
 	charlcd_home(lcd);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  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-01 18:48 ` Mans Rullgard
  2019-03-06  9:56   ` Miguel Ojeda
  2019-03-12 15:45   ` Andy Shevchenko
  2019-03-06 10:14 ` [PATCH 1/3] auxdisplay: deconfuse configuration Miguel Ojeda
  2 siblings, 2 replies; 16+ messages in thread
From: Mans Rullgard @ 2019-03-01 18:48 UTC (permalink / raw)
  To: Miguel Ojeda Sandonis; +Cc: linux-kernel

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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  2019-03-01 18:48 ` [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable Mans Rullgard
@ 2019-03-06  9:56   ` 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
  1 sibling, 2 replies; 16+ messages in thread
From: Miguel Ojeda @ 2019-03-06  9:56 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: linux-kernel, Willy Tarreau, Geert Uytterhoeven

On Fri, Mar 1, 2019 at 7:48 PM Mans Rullgard <mans@mansr.com> wrote:
>
> +#ifdef CONFIG_CHARLCD_BL_ON
> +#define LCD_INIT_BL "\x1b[L+"
> +#elif defined (CONFIG_CHARLCD_BL_FLASH)

Style nitpick: no space after "elif defined". Do you mind if I change
it before sending it to linux-next? Otherwise, looks fine to me.
Thanks!

CC'ing Willy in case he wants to take a look for charlcd.c

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/3] auxdisplay: charlcd: simplify init message display
  2019-03-01 18:48 ` [PATCH 2/3] auxdisplay: charlcd: simplify init message display Mans Rullgard
@ 2019-03-06 10:03   ` Miguel Ojeda
  0 siblings, 0 replies; 16+ messages in thread
From: Miguel Ojeda @ 2019-03-06 10:03 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: linux-kernel, Willy Tarreau, Geert Uytterhoeven

On Fri, Mar 1, 2019 at 7:48 PM Mans Rullgard <mans@mansr.com> wrote:
>
>         /* display a short message */
> -#ifdef CONFIG_PANEL_CHANGE_MESSAGE
> -       charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" CONFIG_PANEL_BOOT_MESSAGE);
> -#else
> -       charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*Linux-" UTS_RELEASE "\n");
> -#endif
> +       charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" LCD_INIT_TEXT);
> +

Nice simplification, thanks!

CC'ing Willy & Geert in case they want to take a look for charlcd.c

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  2019-03-06  9:56   ` Miguel Ojeda
@ 2019-03-06 10:03     ` Miguel Ojeda
  2019-03-06 14:49     ` Måns Rullgård
  1 sibling, 0 replies; 16+ messages in thread
From: Miguel Ojeda @ 2019-03-06 10:03 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: linux-kernel, Willy Tarreau, Geert Uytterhoeven

On Wed, Mar 6, 2019 at 10:56 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> CC'ing Willy in case he wants to take a look for charlcd.c

(and Geert, sorry!)

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/3] auxdisplay: deconfuse configuration
  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-01 18:48 ` [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable Mans Rullgard
@ 2019-03-06 10:14 ` Miguel Ojeda
  2019-03-06 15:08   ` Måns Rullgård
  2019-03-23 14:28   ` Miguel Ojeda
  2 siblings, 2 replies; 16+ messages in thread
From: Miguel Ojeda @ 2019-03-06 10:14 UTC (permalink / raw)
  To: Mans Rullgard
  Cc: linux-kernel, Ksenija Stanojevic, Willy Tarreau, Geert Uytterhoeven

On Fri, Mar 1, 2019 at 7:48 PM Mans Rullgard <mans@mansr.com> wrote:
>
> The auxdisplay Kconfig is confusing.  It creates two separate menus
> even though the settings are closely related.  Moreover, the options
> for setting the boot message depend on CONFIG_PARPORT even though they
> are used by drivers that do not.
>
> Clear up the confustion by moving the "Parallel port LCD/Keypad" menu

"confustion" -> "confusion"

> under auxdisplay where it logically belongs.  Change the boot message
> options to depend only on CONFIG_CHARLCD, making them accessible also
> when only the HD44780 is selected.
>
> Since the "Parallel port LCD/Keypad" driver now has a new dependency
> on CONFIG_AUXDISPLAY, rename its Kconfig symbol and keep the old one
> such that make oldconfig will not disable the driver.
>
> Signed-off-by: Mans Rullgard <mans@mansr.com>
> ---
>  drivers/auxdisplay/Kconfig  | 17 ++++++++++++-----
>  drivers/auxdisplay/Makefile |  2 +-
>  2 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
> index 57410f9c5d44..7d3fe27d6868 100644
> --- a/drivers/auxdisplay/Kconfig
> +++ b/drivers/auxdisplay/Kconfig
> @@ -164,9 +164,7 @@ config ARM_CHARLCD
>           line and the Linux version on the second line, but that's
>           still useful.
>
> -endif # AUXDISPLAY
> -
> -menuconfig PANEL
> +menuconfig PARPORT_PANEL

Do we want the PARPORT_ prefix here but not on the suboptions?

Also, having PANEL_PARPORT and PARPORT_PANEL seems confusing...

>         tristate "Parallel port LCD/Keypad Panel support"
>         depends on PARPORT
>         select CHARLCD
> @@ -178,7 +176,7 @@ menuconfig PANEL
>           compiled as a module, or linked into the kernel and started at boot.
>           If you don't understand what all this is about, say N.
>
> -if PANEL
> +if PARPORT_PANEL
>
>  config PANEL_PARPORT
>         int "Default parallel port number (0=LPT1)"
> @@ -419,8 +417,11 @@ config PANEL_LCD_PIN_BL
>
>           Default for the 'BL' pin in custom profile is '0' (uncontrolled).
>
> +endif # PARPORT_PANEL
> +
>  config PANEL_CHANGE_MESSAGE
>         bool "Change LCD initialization message ?"
> +       depends on CHARLCD
>         default "n"
>         ---help---
>           This allows you to replace the boot message indicating the kernel version
> @@ -444,7 +445,13 @@ 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.
>
> -endif # PANEL
> +endif # AUXDISPLAY
> +
> +config PANEL
> +       tristate "Parallel port LCD/Keypad Panel support (OLD OPTION)"

Hm... what do you mean by "OLD OPTION"? Should we keep it? (I don't
see any other place using this marking).

> +       depends on PARPORT
> +       select AUXDISPLAY
> +       select PARPORT_PANEL

I agree the menu was a bit convoluted and we didn't get to clean it.

Since you are touching the panel.c options, CC'ing the maintainers
(please do run get_maintainer.pl in that case!)

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  2019-03-06  9:56   ` Miguel Ojeda
  2019-03-06 10:03     ` Miguel Ojeda
@ 2019-03-06 14:49     ` Måns Rullgård
  1 sibling, 0 replies; 16+ messages in thread
From: Måns Rullgård @ 2019-03-06 14:49 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: linux-kernel, Willy Tarreau, Geert Uytterhoeven

Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> writes:

> On Fri, Mar 1, 2019 at 7:48 PM Mans Rullgard <mans@mansr.com> wrote:
>>
>> +#ifdef CONFIG_CHARLCD_BL_ON
>> +#define LCD_INIT_BL "\x1b[L+"
>> +#elif defined (CONFIG_CHARLCD_BL_FLASH)
>
> Style nitpick: no space after "elif defined". Do you mind if I change
> it before sending it to linux-next? Otherwise, looks fine to me.
> Thanks!

Of course I don't mind.

-- 
Måns Rullgård

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/3] auxdisplay: deconfuse configuration
  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
  1 sibling, 0 replies; 16+ messages in thread
From: Måns Rullgård @ 2019-03-06 15:08 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: linux-kernel, Ksenija Stanojevic, Willy Tarreau, Geert Uytterhoeven

Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> writes:

> On Fri, Mar 1, 2019 at 7:48 PM Mans Rullgard <mans@mansr.com> wrote:
>>
>> The auxdisplay Kconfig is confusing.  It creates two separate menus
>> even though the settings are closely related.  Moreover, the options
>> for setting the boot message depend on CONFIG_PARPORT even though they
>> are used by drivers that do not.
>>
>> Clear up the confustion by moving the "Parallel port LCD/Keypad" menu
>
> "confustion" -> "confusion"

Darn, must have been confused while typing.

>> under auxdisplay where it logically belongs.  Change the boot message
>> options to depend only on CONFIG_CHARLCD, making them accessible also
>> when only the HD44780 is selected.
>>
>> Since the "Parallel port LCD/Keypad" driver now has a new dependency
>> on CONFIG_AUXDISPLAY, rename its Kconfig symbol and keep the old one
>> such that make oldconfig will not disable the driver.
>>
>> Signed-off-by: Mans Rullgard <mans@mansr.com>
>> ---
>>  drivers/auxdisplay/Kconfig  | 17 ++++++++++++-----
>>  drivers/auxdisplay/Makefile |  2 +-
>>  2 files changed, 13 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
>> index 57410f9c5d44..7d3fe27d6868 100644
>> --- a/drivers/auxdisplay/Kconfig
>> +++ b/drivers/auxdisplay/Kconfig
>> @@ -164,9 +164,7 @@ config ARM_CHARLCD
>>           line and the Linux version on the second line, but that's
>>           still useful.
>>
>> -endif # AUXDISPLAY
>> -
>> -menuconfig PANEL
>> +menuconfig PARPORT_PANEL
>
> Do we want the PARPORT_ prefix here but not on the suboptions?

I was trying to bring some sanity to it without changing more than
necessary.

> Also, having PANEL_PARPORT and PARPORT_PANEL seems confusing...

It is...

>>         tristate "Parallel port LCD/Keypad Panel support"
>>         depends on PARPORT
>>         select CHARLCD
>> @@ -178,7 +176,7 @@ menuconfig PANEL
>>           compiled as a module, or linked into the kernel and started at boot.
>>           If you don't understand what all this is about, say N.
>>
>> -if PANEL
>> +if PARPORT_PANEL
>>
>>  config PANEL_PARPORT
>>         int "Default parallel port number (0=LPT1)"
>> @@ -419,8 +417,11 @@ config PANEL_LCD_PIN_BL
>>
>>           Default for the 'BL' pin in custom profile is '0' (uncontrolled).
>>
>> +endif # PARPORT_PANEL
>> +
>>  config PANEL_CHANGE_MESSAGE
>>         bool "Change LCD initialization message ?"
>> +       depends on CHARLCD
>>         default "n"
>>         ---help---
>>           This allows you to replace the boot message indicating the kernel version
>> @@ -444,7 +445,13 @@ 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.
>>
>> -endif # PANEL
>> +endif # AUXDISPLAY
>> +
>> +config PANEL
>> +       tristate "Parallel port LCD/Keypad Panel support (OLD OPTION)"
>
> Hm... what do you mean by "OLD OPTION"? Should we keep it? (I don't
> see any other place using this marking).

The option is there so 'make oldconfig' on existing configurations
doesn't silently drop that driver since it now depends on AUXDISPLAY.
There have been similar cases when shuffling options.  Maybe they used a
different tag.  We could of course let the three people using that
driver deal with it themselves.

>> +       depends on PARPORT
>> +       select AUXDISPLAY
>> +       select PARPORT_PANEL
>
> I agree the menu was a bit convoluted and we didn't get to clean it.
>
> Since you are touching the panel.c options, CC'ing the maintainers
> (please do run get_maintainer.pl in that case!)

I always run get_maintainer.pl on patches.  Sometimes it isn't clever
enough to figure out all the people who might be interested.

-- 
Måns Rullgård

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  2019-03-01 18:48 ` [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable Mans Rullgard
  2019-03-06  9:56   ` Miguel Ojeda
@ 2019-03-12 15:45   ` Andy Shevchenko
  2019-03-12 15:48     ` Måns Rullgård
  1 sibling, 1 reply; 16+ messages in thread
From: Andy Shevchenko @ 2019-03-12 15:45 UTC (permalink / raw)
  To: Mans Rullgard; +Cc: Miguel Ojeda Sandonis, Linux Kernel Mailing List

On Fri, Mar 1, 2019 at 9:14 PM Mans Rullgard <mans@mansr.com> wrote:
>
> 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

LGTM, but I don't agree on this default. I would prefer either on or
off, not flashing for sure.
Though it seems the case before the patch...

> +
> +       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

I would rather put here defined(_OFF)...

> +#define LCD_INIT_BL "\x1b[L-"

...and do

#else
#define LCD_INIT_BL "" // or whatever stands for as-is

> +#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
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  2019-03-12 15:45   ` Andy Shevchenko
@ 2019-03-12 15:48     ` Måns Rullgård
  2019-03-17  7:43       ` Miguel Ojeda
  0 siblings, 1 reply; 16+ messages in thread
From: Måns Rullgård @ 2019-03-12 15:48 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Miguel Ojeda Sandonis, Linux Kernel Mailing List

Andy Shevchenko <andy.shevchenko@gmail.com> writes:

> On Fri, Mar 1, 2019 at 9:14 PM Mans Rullgard <mans@mansr.com> wrote:
>>
>> 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
>
> LGTM, but I don't agree on this default. I would prefer either on or
> off, not flashing for sure.
> Though it seems the case before the patch...

The current code unconditionally flashes the light once.  I though it
best to keep that behaviour as default, even if it's not seen as ideal.

-- 
Måns Rullgård

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  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
  0 siblings, 1 reply; 16+ messages in thread
From: Miguel Ojeda @ 2019-03-17  7:43 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: Andy Shevchenko, Linux Kernel Mailing List

On Tue, Mar 12, 2019 at 4:48 PM Måns Rullgård <mans@mansr.com> wrote:
>
> The current code unconditionally flashes the light once.  I though it
> best to keep that behaviour as default, even if it's not seen as ideal.

Sent into -next. If no one else says anything after a few days, I will
send the series for -rc2.

By the way, what about the other comment Andy mentioned? i.e.
"defined(_OFF)" (in case you missed to answer it).

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
  2019-03-17  7:43       ` Miguel Ojeda
@ 2019-03-17 16:52         ` Måns Rullgård
  0 siblings, 0 replies; 16+ messages in thread
From: Måns Rullgård @ 2019-03-17 16:52 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Andy Shevchenko, Linux Kernel Mailing List

Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> writes:

> On Tue, Mar 12, 2019 at 4:48 PM Måns Rullgård <mans@mansr.com> wrote:
>>
>> The current code unconditionally flashes the light once.  I though it
>> best to keep that behaviour as default, even if it's not seen as ideal.
>
> Sent into -next. If no one else says anything after a few days, I will
> send the series for -rc2.
>
> By the way, what about the other comment Andy mentioned? i.e.
> "defined(_OFF)" (in case you missed to answer it).

With a correct config, there should be no difference.  If someone
managed to create a config without any of the alternatives selected,
a compiler error would result.  I don't really have much of an opinion
on which behaviour is preferable in that situation.

-- 
Måns Rullgård

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/3] auxdisplay: deconfuse configuration
  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
  1 sibling, 1 reply; 16+ messages in thread
From: Miguel Ojeda @ 2019-03-23 14:28 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Mans Rullgard, Ksenija Stanojevic, Willy Tarreau,
	Geert Uytterhoeven

On Wed, Mar 6, 2019 at 11:14 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Since you are touching the panel.c options, CC'ing the maintainers
> (please do run get_maintainer.pl in that case!)

I was preparing the PR for -rc2 and I just noticed we didn't CC Randy
which was the last one changing the Kconfig. CC'ing now in case he
wants to take a look before I send the PR.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/3] auxdisplay: deconfuse configuration
  2019-03-23 14:28   ` Miguel Ojeda
@ 2019-03-23 14:50     ` Randy Dunlap
  2019-03-23 15:00       ` Miguel Ojeda
  0 siblings, 1 reply; 16+ messages in thread
From: Randy Dunlap @ 2019-03-23 14:50 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: linux-kernel, Mans Rullgard, Ksenija Stanojevic, Willy Tarreau,
	Geert Uytterhoeven

On 3/23/19 7:28 AM, Miguel Ojeda wrote:
> On Wed, Mar 6, 2019 at 11:14 AM Miguel Ojeda
> <miguel.ojeda.sandonis@gmail.com> wrote:
>>
>> Since you are touching the panel.c options, CC'ing the maintainers
>> (please do run get_maintainer.pl in that case!)
> 
> I was preparing the PR for -rc2 and I just noticed we didn't CC Randy
> which was the last one changing the Kconfig. CC'ing now in case he
> wants to take a look before I send the PR.
> 
> Cheers,
> Miguel

Hi,

I haven't seen any issues with this in linux-next, so go ahead, please.


cheers.
-- 
~Randy

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/3] auxdisplay: deconfuse configuration
  2019-03-23 14:50     ` Randy Dunlap
@ 2019-03-23 15:00       ` Miguel Ojeda
  0 siblings, 0 replies; 16+ messages in thread
From: Miguel Ojeda @ 2019-03-23 15:00 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Mans Rullgard, Ksenija Stanojevic, Willy Tarreau,
	Geert Uytterhoeven

On Sat, Mar 23, 2019 at 3:51 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> I haven't seen any issues with this in linux-next, so go ahead, please.

Thanks for the very quick answer, Randy!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-03-23 15:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable Mans Rullgard
2019-03-06  9:56   ` 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

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).