auxdisplay: deconfuse configuration
PATCH 1/3 auxdisplay: deconfuse configuration
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.
--- drivers/auxdisplay/Kconfig | 17 ++++++++++++----- drivers/auxdisplay/Makefile | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-)
drivers/auxdisplay/Kconfig +12 -5
@@ -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
drivers/auxdisplay/Makefile +1 -1
@@ -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
Signature · 1 line
2.20.1
PATCH 2/3 auxdisplay: charlcd: simplify init message display
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.
--- drivers/auxdisplay/charlcd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/auxdisplay/charlcd.c +8 -7
@@ -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);
Signature · 1 line
2.20.1
Re: [PATCH 2/3] auxdisplay: charlcd: simplify init message display
drivers/auxdisplay/charlcd.c static int charlcd_init(struct charlcd *lcd) · line 794
Quoted 9 lines · Mans Rullgard
/* display a short message */drivers/auxdisplay/charlcd.c +2
-5-#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
PATCH 3/3 auxdisplay: charlcd: make backlight initial state configurable
In reply to Mans RullgardThe 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.
--- drivers/auxdisplay/Kconfig | 21 +++++++++++++++++++++ drivers/auxdisplay/charlcd.c | 10 +++++++++- 2 files changed, 30 insertions(+), 1 deletion(-)
drivers/auxdisplay/Kconfig +21 -0
@@ -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
drivers/auxdisplay/charlcd.c +9 -1
@@ -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;
Signature · 1 line
2.20.1
Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
drivers/auxdisplay/charlcd.c static void charlcd_puts(struct charlcd *lcd, const char *s) · line 774
Quoted 4 lines · Mans Rullgard
drivers/auxdisplay/charlcd.c +3
-0+#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
Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
Quoted 2 lines · Miguel Ojeda
CC'ing Willy in case he wants to take a look for
charlcd.c
(and Geert, sorry!)
Cheers,
Miguel
Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
In reply to Miguel OjedaQuoted 9 lines · Miguel Ojeda
drivers/auxdisplay/charlcd.c static void charlcd_puts(struct charlcd *lcd, const char *s) · line 774
Quoted 4 lines · Mans Rullgard
drivers/auxdisplay/charlcd.c +3
-0+#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.
Signature · 1 line
Måns Rullgård
Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
In reply to Mans RullgardQuoted 16 lines · Mans Rullgard
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 <[email protected]>--- drivers/auxdisplay/Kconfig | 21 +++++++++++++++++++++ drivers/auxdisplay/charlcd.c | 10 +++++++++- 2 files changed, 30 insertions(+), 1 deletion(-)drivers/auxdisplay/Kconfig +0
-0
drivers/auxdisplay/Kconfig config PANEL_BOOT_MESSAGE · line 450
Quoted 6 lines
drivers/auxdisplay/Kconfig +3
-0@@ -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...
Quoted 26 lines
drivers/auxdisplay/Kconfig +18
-0+ + 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 PANELdrivers/auxdisplay/charlcd.c +0
-0
drivers/auxdisplay/charlcd.c static void charlcd_puts(struct charlcd *lcd, const char *s) · line 777
Quoted 9 lines
drivers/auxdisplay/charlcd.c +5
-0@@ -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)...
drivers/auxdisplay/charlcd.c static void charlcd_puts(struct charlcd *lcd, const char *s) · line 777
Quoted 1 line
drivers/auxdisplay/charlcd.c +1
-0+#define LCD_INIT_BL "\x1b[L-"
...and do
#else
#define LCD_INIT_BL "" // or whatever stands for as-is
Quoted 17 lines
drivers/auxdisplay/charlcd.c +2
-0+#endif +/* initialize the LCD driver */ static int charlcd_init (struct charlcd *lcd){
drivers/auxdisplay/charlcd.c +1
-2@@ -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
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
Quoted 20 lines · Andy Shevchenko
Quoted 19 lines · Mans Rullgard
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 <[email protected]>--- drivers/auxdisplay/Kconfig | 21 +++++++++++++++++++++ drivers/auxdisplay/charlcd.c | 10 +++++++++- 2 files changed, 30 insertions(+), 1 deletion(-)drivers/auxdisplay/Kconfig +0
-0@@ -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.
Quoted 7 lines
drivers/auxdisplay/Kconfig config PANEL_BOOT_MESSAGE · line 450
Quoted 3 lines
drivers/auxdisplay/Kconfig +3
-0+choice + prompt "Backlight initial state" + default CHARLCD_BL_FLASHLGTM, 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.
Signature · 1 line
Måns Rullgård
Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
Quoted 3 lines · Måns Rullgård
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
Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable
Quoted 10 lines · Miguel Ojeda
Quoted 3 lines · Måns Rullgård
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.
Signature · 1 line
Måns Rullgård
Quoted 7 lines · Mans Rullgard
The auxdisplay
Kconfigis confusing. It creates two separate menus even though the settings are closely related. Moreover, the options for setting the boot message depend onCONFIG_PARPORTeven though they are used by drivers that do not.Clear up the confustion by moving the "Parallel port LCD/Keypad" menu
"confustion" -> "confusion"
Quoted 19 lines
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 itsKconfigsymbol and keep the old one such that make oldconfig will not disable the driver.Signed-off-by Mans Rullgard <[email protected]>--- drivers/auxdisplay/Kconfig | 17 ++++++++++++----- drivers/auxdisplay/Makefile | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-)drivers/auxdisplay/Kconfig +0
-0
drivers/auxdisplay/Kconfig config ARM_CHARLCD · line 167
Quoted 7 lines
drivers/auxdisplay/Kconfig +1
-3@@ -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...
Quoted 25 lines
drivers/auxdisplay/Kconfig +4
-1tristate "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
drivers/auxdisplay/Kconfig config PANEL_BOOT_MESSAGE · line 451
Quoted 8 lines
drivers/auxdisplay/Kconfig +4
-1@@ -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).
drivers/auxdisplay/Kconfig config PANEL_BOOT_MESSAGE · line 454
Quoted 3 lines
drivers/auxdisplay/Kconfig +3
-0+ 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
Quoted 10 lines · Miguel Ojeda
Quoted 7 lines · Mans Rullgard
The auxdisplay
Kconfigis confusing. It creates two separate menus even though the settings are closely related. Moreover, the options for setting the boot message depend onCONFIG_PARPORTeven 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.
Quoted 22 lines
Quoted 22 lines
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 itsKconfigsymbol and keep the old one such that make oldconfig will not disable the driver.Signed-off-by Mans Rullgard <[email protected]>--- drivers/auxdisplay/Kconfig | 17 ++++++++++++----- drivers/auxdisplay/Makefile | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-)drivers/auxdisplay/Kconfig +0
-0@@ -164,9 +164,7 @@ config ARM_CHARLCD line and the Linux version on the second line, but that's still useful.
Quoted 6 lines
drivers/auxdisplay/Kconfig config ARM_CHARLCD · line 167
Quoted 4 lines
drivers/auxdisplay/Kconfig +1
-3-endif # AUXDISPLAY - -menuconfig PANEL +menuconfig PARPORT_PANELDo 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.
Quoted 1 line
Also, having
PANEL_PARPORTandPARPORT_PANELseems confusing...
It is...
Quoted 28 lines
Quoted 28 lines
drivers/auxdisplay/Kconfig +4
-1tristate "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.
Quoted 8 lines
drivers/auxdisplay/Kconfig config PANEL_BOOT_MESSAGE · line 451
Quoted 5 lines
drivers/auxdisplay/Kconfig +4
-1-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.
Quoted 8 lines
drivers/auxdisplay/Kconfig config PANEL_BOOT_MESSAGE · line 454
Quoted 3 lines
drivers/auxdisplay/Kconfig +3
-0+ depends on PARPORT + select AUXDISPLAY + select PARPORT_PANELI agree the menu was a bit convoluted and we didn't get to clean it.
Since you are touching the
panel.coptions, 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.
Signature · 1 line
Måns Rullgård
Quoted 3 lines · Miguel Ojeda
Since you are touching the
panel.coptions, 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
Quoted 6 lines · Miguel Ojeda
Quoted 3 lines · Miguel Ojeda
Since you are touching the
panel.coptions, CC'ing the maintainers (please do run get_maintainer.pl in that case!)
Quoted 6 lines
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.
Signature · 1 line
~Randy
Quoted 2 lines · Randy Dunlap
I haven't seen any issues with this in linux-next, so go ahead, please.
Thanks for the very quick answer, Randy!
Cheers,
Miguel