diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-07 17:01:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-07 17:01:16 -0400 |
commit | 7423fd7a6693e8c1cef6d5033ce3f9b731dbac94 (patch) | |
tree | 4390f26bfe12cbd519587e24ef1b4b38dd61f5d2 | |
parent | edb2a385ec331fda7ecb5502d63e5e8be86b7a84 (diff) | |
parent | 351f683b9823a3d1bffb6e2e3f381601aa0b2671 (diff) |
Merge tag 'auxdisplay-for-linus-v4.18-rc1' of git://github.com/ojeda/linux
Pull auxdisplay updates from Miguel Ojeda:
"Mostly small fixes and cleanups, plus a non-trivial fix for charlcd
- charlcd: fixes and cleanups (Robert Abel and Sean Young)
- Kconfig fixes (Randy Dunlap, Corentin Labbe and Ulf Magnusson)
- cfag12864bfb: const cleanup (Gustavo A. R. Silva)
- Docs/licenses/warnings cleanups"
* tag 'auxdisplay-for-linus-v4.18-rc1' of git://github.com/ojeda/linux:
auxdisplay: Replace licenses with SPDX identifiers
auxdisplay: make PANEL a menuconfig
auxdisplay: fix broken menu
auxdisplay: charlcd: Fix and clean up handling of x/y commands
auxdisplay: charlcd: fix hex literal ranges for graphics command
auxdisplay: charlcd: fix two-line command ^[[LN not marked as processed
auxdisplay: charlcd: replace octal literal with form-feed escape sequence
auxdisplay: charlcd: use null character instead of zero literal to terminate strings
auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changes
auxdisplay: cfag12864bfb: constify fb_fix_screeninfo and fb_var_screeninfo structures
auxdisplay: img-ascii-lcd: fix typo on select SYSCON/MFD_SYSCON
auxdisplay: img-ascii-lcd: kconfig: Remove MIPS_SEAD3 reference
auxdisplay: arm-charlcd: Fix struct charlcd doc line
MAINTAINERS: auxdisplay: remove obsolete webpages
Doc: misc-devices: move lcd-panel-cgram.txt to auxdisplay/
-rw-r--r-- | Documentation/auxdisplay/lcd-panel-cgram.txt (renamed from Documentation/misc-devices/lcd-panel-cgram.txt) | 0 | ||||
-rw-r--r-- | MAINTAINERS | 8 | ||||
-rw-r--r-- | drivers/auxdisplay/Kconfig | 16 | ||||
-rw-r--r-- | drivers/auxdisplay/arm-charlcd.c | 4 | ||||
-rw-r--r-- | drivers/auxdisplay/cfag12864b.c | 16 | ||||
-rw-r--r-- | drivers/auxdisplay/cfag12864bfb.c | 20 | ||||
-rw-r--r-- | drivers/auxdisplay/charlcd.c | 119 | ||||
-rw-r--r-- | drivers/auxdisplay/hd44780.c | 6 | ||||
-rw-r--r-- | drivers/auxdisplay/ht16k33.c | 10 | ||||
-rw-r--r-- | drivers/auxdisplay/ks0108.c | 16 | ||||
-rw-r--r-- | drivers/auxdisplay/panel.c | 6 | ||||
-rw-r--r-- | include/linux/cfag12864b.h | 16 | ||||
-rw-r--r-- | include/linux/ks0108.h | 16 | ||||
-rw-r--r-- | samples/auxdisplay/cfag12864b-example.c | 16 |
14 files changed, 111 insertions, 158 deletions
diff --git a/Documentation/misc-devices/lcd-panel-cgram.txt b/Documentation/auxdisplay/lcd-panel-cgram.txt index 7f82c905763d..7f82c905763d 100644 --- a/Documentation/misc-devices/lcd-panel-cgram.txt +++ b/Documentation/auxdisplay/lcd-panel-cgram.txt | |||
diff --git a/MAINTAINERS b/MAINTAINERS index d96c613d777d..5c29a7dee379 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2533,8 +2533,6 @@ F: kernel/audit* | |||
2533 | 2533 | ||
2534 | AUXILIARY DISPLAY DRIVERS | 2534 | AUXILIARY DISPLAY DRIVERS |
2535 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> | 2535 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> |
2536 | W: http://miguelojeda.es/auxdisplay.htm | ||
2537 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
2538 | S: Maintained | 2536 | S: Maintained |
2539 | F: drivers/auxdisplay/ | 2537 | F: drivers/auxdisplay/ |
2540 | F: include/linux/cfag12864b.h | 2538 | F: include/linux/cfag12864b.h |
@@ -3384,16 +3382,12 @@ F: include/linux/usb/wusb* | |||
3384 | 3382 | ||
3385 | CFAG12864B LCD DRIVER | 3383 | CFAG12864B LCD DRIVER |
3386 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> | 3384 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> |
3387 | W: http://miguelojeda.es/auxdisplay.htm | ||
3388 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
3389 | S: Maintained | 3385 | S: Maintained |
3390 | F: drivers/auxdisplay/cfag12864b.c | 3386 | F: drivers/auxdisplay/cfag12864b.c |
3391 | F: include/linux/cfag12864b.h | 3387 | F: include/linux/cfag12864b.h |
3392 | 3388 | ||
3393 | CFAG12864BFB LCD FRAMEBUFFER DRIVER | 3389 | CFAG12864BFB LCD FRAMEBUFFER DRIVER |
3394 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> | 3390 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> |
3395 | W: http://miguelojeda.es/auxdisplay.htm | ||
3396 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
3397 | S: Maintained | 3391 | S: Maintained |
3398 | F: drivers/auxdisplay/cfag12864bfb.c | 3392 | F: drivers/auxdisplay/cfag12864bfb.c |
3399 | F: include/linux/cfag12864b.h | 3393 | F: include/linux/cfag12864b.h |
@@ -7977,8 +7971,6 @@ F: kernel/kprobes.c | |||
7977 | 7971 | ||
7978 | KS0108 LCD CONTROLLER DRIVER | 7972 | KS0108 LCD CONTROLLER DRIVER |
7979 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> | 7973 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> |
7980 | W: http://miguelojeda.es/auxdisplay.htm | ||
7981 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
7982 | S: Maintained | 7974 | S: Maintained |
7983 | F: Documentation/auxdisplay/ks0108 | 7975 | F: Documentation/auxdisplay/ks0108 |
7984 | F: drivers/auxdisplay/ks0108.c | 7976 | F: drivers/auxdisplay/ks0108.c |
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index 2c2ed9cf8796..57410f9c5d44 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -14,9 +14,6 @@ menuconfig AUXDISPLAY | |||
14 | 14 | ||
15 | If you say N, all options in this submenu will be skipped and disabled. | 15 | If you say N, all options in this submenu will be skipped and disabled. |
16 | 16 | ||
17 | config CHARLCD | ||
18 | tristate "Character LCD core support" if COMPILE_TEST | ||
19 | |||
20 | if AUXDISPLAY | 17 | if AUXDISPLAY |
21 | 18 | ||
22 | config HD44780 | 19 | config HD44780 |
@@ -137,8 +134,8 @@ config CFAG12864B_RATE | |||
137 | config IMG_ASCII_LCD | 134 | config IMG_ASCII_LCD |
138 | tristate "Imagination Technologies ASCII LCD Display" | 135 | tristate "Imagination Technologies ASCII LCD Display" |
139 | depends on HAS_IOMEM | 136 | depends on HAS_IOMEM |
140 | default y if MIPS_MALTA || MIPS_SEAD3 | 137 | default y if MIPS_MALTA |
141 | select SYSCON | 138 | select MFD_SYSCON |
142 | help | 139 | help |
143 | Enable this to support the simple ASCII LCD displays found on | 140 | Enable this to support the simple ASCII LCD displays found on |
144 | development boards such as the MIPS Boston, MIPS Malta & MIPS SEAD3 | 141 | development boards such as the MIPS Boston, MIPS Malta & MIPS SEAD3 |
@@ -157,8 +154,6 @@ config HT16K33 | |||
157 | Say yes here to add support for Holtek HT16K33, RAM mapping 16*8 | 154 | Say yes here to add support for Holtek HT16K33, RAM mapping 16*8 |
158 | LED controller driver with keyscan. | 155 | LED controller driver with keyscan. |
159 | 156 | ||
160 | endif # AUXDISPLAY | ||
161 | |||
162 | config ARM_CHARLCD | 157 | config ARM_CHARLCD |
163 | bool "ARM Ltd. Character LCD Driver" | 158 | bool "ARM Ltd. Character LCD Driver" |
164 | depends on PLAT_VERSATILE | 159 | depends on PLAT_VERSATILE |
@@ -169,7 +164,9 @@ config ARM_CHARLCD | |||
169 | line and the Linux version on the second line, but that's | 164 | line and the Linux version on the second line, but that's |
170 | still useful. | 165 | still useful. |
171 | 166 | ||
172 | config PANEL | 167 | endif # AUXDISPLAY |
168 | |||
169 | menuconfig PANEL | ||
173 | tristate "Parallel port LCD/Keypad Panel support" | 170 | tristate "Parallel port LCD/Keypad Panel support" |
174 | depends on PARPORT | 171 | depends on PARPORT |
175 | select CHARLCD | 172 | select CHARLCD |
@@ -448,3 +445,6 @@ config PANEL_BOOT_MESSAGE | |||
448 | printf()-formatted message is valid with newline and escape codes. | 445 | printf()-formatted message is valid with newline and escape codes. |
449 | 446 | ||
450 | endif # PANEL | 447 | endif # PANEL |
448 | |||
449 | config CHARLCD | ||
450 | tristate "Character LCD core support" if COMPILE_TEST | ||
diff --git a/drivers/auxdisplay/arm-charlcd.c b/drivers/auxdisplay/arm-charlcd.c index b3176ee92b90..296fb30dfa00 100644 --- a/drivers/auxdisplay/arm-charlcd.c +++ b/drivers/auxdisplay/arm-charlcd.c | |||
@@ -1,10 +1,10 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Driver for the on-board character LCD found on some ARM reference boards | 3 | * Driver for the on-board character LCD found on some ARM reference boards |
3 | * This is basically an Hitachi HD44780 LCD with a custom IP block to drive it | 4 | * This is basically an Hitachi HD44780 LCD with a custom IP block to drive it |
4 | * http://en.wikipedia.org/wiki/HD44780_Character_LCD | 5 | * http://en.wikipedia.org/wiki/HD44780_Character_LCD |
5 | * Currently it will just display the text "ARM Linux" and the linux version | 6 | * Currently it will just display the text "ARM Linux" and the linux version |
6 | * | 7 | * |
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | * Author: Linus Walleij <triad@df.lth.se> | 8 | * Author: Linus Walleij <triad@df.lth.se> |
9 | */ | 9 | */ |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
@@ -54,12 +54,14 @@ | |||
54 | #define HD_BUSY_FLAG 0x80U | 54 | #define HD_BUSY_FLAG 0x80U |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * struct charlcd - Private data structure | ||
57 | * @dev: a pointer back to containing device | 58 | * @dev: a pointer back to containing device |
58 | * @phybase: the offset to the controller in physical memory | 59 | * @phybase: the offset to the controller in physical memory |
59 | * @physize: the size of the physical page | 60 | * @physize: the size of the physical page |
60 | * @virtbase: the offset to the controller in virtual memory | 61 | * @virtbase: the offset to the controller in virtual memory |
61 | * @irq: reserved interrupt number | 62 | * @irq: reserved interrupt number |
62 | * @complete: completion structure for the last LCD command | 63 | * @complete: completion structure for the last LCD command |
64 | * @init_work: delayed work structure to initialize the display on boot | ||
63 | */ | 65 | */ |
64 | struct charlcd { | 66 | struct charlcd { |
65 | struct device *dev; | 67 | struct device *dev; |
diff --git a/drivers/auxdisplay/cfag12864b.c b/drivers/auxdisplay/cfag12864b.c index 41ce4bd96813..6bd2f65e116a 100644 --- a/drivers/auxdisplay/cfag12864b.c +++ b/drivers/auxdisplay/cfag12864b.c | |||
@@ -1,26 +1,12 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Filename: cfag12864b.c | 3 | * Filename: cfag12864b.c |
3 | * Version: 0.1.0 | 4 | * Version: 0.1.0 |
4 | * Description: cfag12864b LCD driver | 5 | * Description: cfag12864b LCD driver |
5 | * License: GPLv2 | ||
6 | * Depends: ks0108 | 6 | * Depends: ks0108 |
7 | * | 7 | * |
8 | * Author: Copyright (C) Miguel Ojeda Sandonis | 8 | * Author: Copyright (C) Miguel Ojeda Sandonis |
9 | * Date: 2006-10-31 | 9 | * Date: 2006-10-31 |
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | */ | 10 | */ |
25 | 11 | ||
26 | #include <linux/init.h> | 12 | #include <linux/init.h> |
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c index a3874034e2ce..40c8a552a478 100644 --- a/drivers/auxdisplay/cfag12864bfb.c +++ b/drivers/auxdisplay/cfag12864bfb.c | |||
@@ -1,26 +1,12 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Filename: cfag12864bfb.c | 3 | * Filename: cfag12864bfb.c |
3 | * Version: 0.1.0 | 4 | * Version: 0.1.0 |
4 | * Description: cfag12864b LCD framebuffer driver | 5 | * Description: cfag12864b LCD framebuffer driver |
5 | * License: GPLv2 | ||
6 | * Depends: cfag12864b | 6 | * Depends: cfag12864b |
7 | * | 7 | * |
8 | * Author: Copyright (C) Miguel Ojeda Sandonis | 8 | * Author: Copyright (C) Miguel Ojeda Sandonis |
9 | * Date: 2006-10-31 | 9 | * Date: 2006-10-31 |
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | */ | 10 | */ |
25 | 11 | ||
26 | #include <linux/init.h> | 12 | #include <linux/init.h> |
@@ -37,7 +23,7 @@ | |||
37 | 23 | ||
38 | #define CFAG12864BFB_NAME "cfag12864bfb" | 24 | #define CFAG12864BFB_NAME "cfag12864bfb" |
39 | 25 | ||
40 | static struct fb_fix_screeninfo cfag12864bfb_fix = { | 26 | static const struct fb_fix_screeninfo cfag12864bfb_fix = { |
41 | .id = "cfag12864b", | 27 | .id = "cfag12864b", |
42 | .type = FB_TYPE_PACKED_PIXELS, | 28 | .type = FB_TYPE_PACKED_PIXELS, |
43 | .visual = FB_VISUAL_MONO10, | 29 | .visual = FB_VISUAL_MONO10, |
@@ -48,7 +34,7 @@ static struct fb_fix_screeninfo cfag12864bfb_fix = { | |||
48 | .accel = FB_ACCEL_NONE, | 34 | .accel = FB_ACCEL_NONE, |
49 | }; | 35 | }; |
50 | 36 | ||
51 | static struct fb_var_screeninfo cfag12864bfb_var = { | 37 | static const struct fb_var_screeninfo cfag12864bfb_var = { |
52 | .xres = CFAG12864B_WIDTH, | 38 | .xres = CFAG12864B_WIDTH, |
53 | .yres = CFAG12864B_HEIGHT, | 39 | .yres = CFAG12864B_HEIGHT, |
54 | .xres_virtual = CFAG12864B_WIDTH, | 40 | .xres_virtual = CFAG12864B_WIDTH, |
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 642afd88870b..8673fc2b9eb8 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c | |||
@@ -1,16 +1,13 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Character LCD driver for Linux | 3 | * Character LCD driver for Linux |
3 | * | 4 | * |
4 | * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu> | 5 | * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu> |
5 | * Copyright (C) 2016-2017 Glider bvba | 6 | * Copyright (C) 2016-2017 Glider bvba |
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | 7 | */ |
12 | 8 | ||
13 | #include <linux/atomic.h> | 9 | #include <linux/atomic.h> |
10 | #include <linux/ctype.h> | ||
14 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
15 | #include <linux/fs.h> | 12 | #include <linux/fs.h> |
16 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
@@ -192,10 +189,11 @@ static void charlcd_print(struct charlcd *lcd, char c) | |||
192 | c = lcd->char_conv[(unsigned char)c]; | 189 | c = lcd->char_conv[(unsigned char)c]; |
193 | lcd->ops->write_data(lcd, c); | 190 | lcd->ops->write_data(lcd, c); |
194 | priv->addr.x++; | 191 | priv->addr.x++; |
192 | |||
193 | /* prevents the cursor from wrapping onto the next line */ | ||
194 | if (priv->addr.x == lcd->bwidth) | ||
195 | charlcd_gotoxy(lcd); | ||
195 | } | 196 | } |
196 | /* prevents the cursor from wrapping onto the next line */ | ||
197 | if (priv->addr.x == lcd->bwidth) | ||
198 | charlcd_gotoxy(lcd); | ||
199 | } | 197 | } |
200 | 198 | ||
201 | static void charlcd_clear_fast(struct charlcd *lcd) | 199 | static void charlcd_clear_fast(struct charlcd *lcd) |
@@ -293,6 +291,79 @@ static int charlcd_init_display(struct charlcd *lcd) | |||
293 | } | 291 | } |
294 | 292 | ||
295 | /* | 293 | /* |
294 | * Parses an unsigned integer from a string, until a non-digit character | ||
295 | * is found. The empty string is not accepted. No overflow checks are done. | ||
296 | * | ||
297 | * Returns whether the parsing was successful. Only in that case | ||
298 | * the output parameters are written to. | ||
299 | * | ||
300 | * TODO: If the kernel adds an inplace version of kstrtoul(), this function | ||
301 | * could be easily replaced by that. | ||
302 | */ | ||
303 | static bool parse_n(const char *s, unsigned long *res, const char **next_s) | ||
304 | { | ||
305 | if (!isdigit(*s)) | ||
306 | return false; | ||
307 | |||
308 | *res = 0; | ||
309 | while (isdigit(*s)) { | ||
310 | *res = *res * 10 + (*s - '0'); | ||
311 | ++s; | ||
312 | } | ||
313 | |||
314 | *next_s = s; | ||
315 | return true; | ||
316 | } | ||
317 | |||
318 | /* | ||
319 | * Parses a movement command of the form "(.*);", where the group can be | ||
320 | * any number of subcommands of the form "(x|y)[0-9]+". | ||
321 | * | ||
322 | * Returns whether the command is valid. The position arguments are | ||
323 | * only written if the parsing was successful. | ||
324 | * | ||
325 | * For instance: | ||
326 | * - ";" returns (<original x>, <original y>). | ||
327 | * - "x1;" returns (1, <original y>). | ||
328 | * - "y2x1;" returns (1, 2). | ||
329 | * - "x12y34x56;" returns (56, 34). | ||
330 | * - "" fails. | ||
331 | * - "x" fails. | ||
332 | * - "x;" fails. | ||
333 | * - "x1" fails. | ||
334 | * - "xy12;" fails. | ||
335 | * - "x12yy12;" fails. | ||
336 | * - "xx" fails. | ||
337 | */ | ||
338 | static bool parse_xy(const char *s, unsigned long *x, unsigned long *y) | ||
339 | { | ||
340 | unsigned long new_x = *x; | ||
341 | unsigned long new_y = *y; | ||
342 | |||
343 | for (;;) { | ||
344 | if (!*s) | ||
345 | return false; | ||
346 | |||
347 | if (*s == ';') | ||
348 | break; | ||
349 | |||
350 | if (*s == 'x') { | ||
351 | if (!parse_n(s + 1, &new_x, &s)) | ||
352 | return false; | ||
353 | } else if (*s == 'y') { | ||
354 | if (!parse_n(s + 1, &new_y, &s)) | ||
355 | return false; | ||
356 | } else { | ||
357 | return false; | ||
358 | } | ||
359 | } | ||
360 | |||
361 | *x = new_x; | ||
362 | *y = new_y; | ||
363 | return true; | ||
364 | } | ||
365 | |||
366 | /* | ||
296 | * These are the file operation function for user access to /dev/lcd | 367 | * These are the file operation function for user access to /dev/lcd |
297 | * This function can also be called from inside the kernel, by | 368 | * This function can also be called from inside the kernel, by |
298 | * setting file and ppos to NULL. | 369 | * setting file and ppos to NULL. |
@@ -362,6 +433,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) | |||
362 | break; | 433 | break; |
363 | case 'N': /* Two Lines */ | 434 | case 'N': /* Two Lines */ |
364 | priv->flags |= LCD_FLAG_N; | 435 | priv->flags |= LCD_FLAG_N; |
436 | processed = 1; | ||
365 | break; | 437 | break; |
366 | case 'l': /* Shift Cursor Left */ | 438 | case 'l': /* Shift Cursor Left */ |
367 | if (priv->addr.x > 0) { | 439 | if (priv->addr.x > 0) { |
@@ -441,9 +513,9 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) | |||
441 | shift ^= 4; | 513 | shift ^= 4; |
442 | if (*esc >= '0' && *esc <= '9') { | 514 | if (*esc >= '0' && *esc <= '9') { |
443 | value |= (*esc - '0') << shift; | 515 | value |= (*esc - '0') << shift; |
444 | } else if (*esc >= 'A' && *esc <= 'Z') { | 516 | } else if (*esc >= 'A' && *esc <= 'F') { |
445 | value |= (*esc - 'A' + 10) << shift; | 517 | value |= (*esc - 'A' + 10) << shift; |
446 | } else if (*esc >= 'a' && *esc <= 'z') { | 518 | } else if (*esc >= 'a' && *esc <= 'f') { |
447 | value |= (*esc - 'a' + 10) << shift; | 519 | value |= (*esc - 'a' + 10) << shift; |
448 | } else { | 520 | } else { |
449 | esc++; | 521 | esc++; |
@@ -469,24 +541,11 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) | |||
469 | } | 541 | } |
470 | case 'x': /* gotoxy : LxXXX[yYYY]; */ | 542 | case 'x': /* gotoxy : LxXXX[yYYY]; */ |
471 | case 'y': /* gotoxy : LyYYY[xXXX]; */ | 543 | case 'y': /* gotoxy : LyYYY[xXXX]; */ |
472 | if (!strchr(esc, ';')) | 544 | /* If the command is valid, move to the new address */ |
473 | break; | 545 | if (parse_xy(esc, &priv->addr.x, &priv->addr.y)) |
474 | 546 | charlcd_gotoxy(lcd); | |
475 | while (*esc) { | ||
476 | if (*esc == 'x') { | ||
477 | esc++; | ||
478 | if (kstrtoul(esc, 10, &priv->addr.x) < 0) | ||
479 | break; | ||
480 | } else if (*esc == 'y') { | ||
481 | esc++; | ||
482 | if (kstrtoul(esc, 10, &priv->addr.y) < 0) | ||
483 | break; | ||
484 | } else { | ||
485 | break; | ||
486 | } | ||
487 | } | ||
488 | 547 | ||
489 | charlcd_gotoxy(lcd); | 548 | /* Regardless of its validity, mark as processed */ |
490 | processed = 1; | 549 | processed = 1; |
491 | break; | 550 | break; |
492 | } | 551 | } |
@@ -527,7 +586,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c) | |||
527 | if ((c != '\n') && priv->esc_seq.len >= 0) { | 586 | if ((c != '\n') && priv->esc_seq.len >= 0) { |
528 | /* yes, let's add this char to the buffer */ | 587 | /* yes, let's add this char to the buffer */ |
529 | priv->esc_seq.buf[priv->esc_seq.len++] = c; | 588 | priv->esc_seq.buf[priv->esc_seq.len++] = c; |
530 | priv->esc_seq.buf[priv->esc_seq.len] = 0; | 589 | priv->esc_seq.buf[priv->esc_seq.len] = '\0'; |
531 | } else { | 590 | } else { |
532 | /* aborts any previous escape sequence */ | 591 | /* aborts any previous escape sequence */ |
533 | priv->esc_seq.len = -1; | 592 | priv->esc_seq.len = -1; |
@@ -536,7 +595,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c) | |||
536 | case LCD_ESCAPE_CHAR: | 595 | case LCD_ESCAPE_CHAR: |
537 | /* start of an escape sequence */ | 596 | /* start of an escape sequence */ |
538 | priv->esc_seq.len = 0; | 597 | priv->esc_seq.len = 0; |
539 | priv->esc_seq.buf[priv->esc_seq.len] = 0; | 598 | priv->esc_seq.buf[priv->esc_seq.len] = '\0'; |
540 | break; | 599 | break; |
541 | case '\b': | 600 | case '\b': |
542 | /* go back one char and clear it */ | 601 | /* go back one char and clear it */ |
@@ -555,7 +614,7 @@ static void charlcd_write_char(struct charlcd *lcd, char c) | |||
555 | /* back one char again */ | 614 | /* back one char again */ |
556 | lcd->ops->write_cmd(lcd, LCD_CMD_SHIFT); | 615 | lcd->ops->write_cmd(lcd, LCD_CMD_SHIFT); |
557 | break; | 616 | break; |
558 | case '\014': | 617 | case '\f': |
559 | /* quickly clear the display */ | 618 | /* quickly clear the display */ |
560 | charlcd_clear_fast(lcd); | 619 | charlcd_clear_fast(lcd); |
561 | break; | 620 | break; |
diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index 036eec404289..78d8f1986fec 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c | |||
@@ -1,13 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * HD44780 Character LCD driver for Linux | 3 | * HD44780 Character LCD driver for Linux |
3 | * | 4 | * |
4 | * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu> | 5 | * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu> |
5 | * Copyright (C) 2016-2017 Glider bvba | 6 | * Copyright (C) 2016-2017 Glider bvba |
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | 7 | */ |
12 | 8 | ||
13 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index fbfa5b4cc567..a43276c76fc6 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c | |||
@@ -1,18 +1,10 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * HT16K33 driver | 3 | * HT16K33 driver |
3 | * | 4 | * |
4 | * Author: Robin van der Gracht <robin@protonic.nl> | 5 | * Author: Robin van der Gracht <robin@protonic.nl> |
5 | * | 6 | * |
6 | * Copyright: (C) 2016 Protonic Holland. | 7 | * Copyright: (C) 2016 Protonic Holland. |
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | */ | 8 | */ |
17 | 9 | ||
18 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
diff --git a/drivers/auxdisplay/ks0108.c b/drivers/auxdisplay/ks0108.c index 816de9eaac26..abfe3fa9e6f4 100644 --- a/drivers/auxdisplay/ks0108.c +++ b/drivers/auxdisplay/ks0108.c | |||
@@ -1,26 +1,12 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Filename: ks0108.c | 3 | * Filename: ks0108.c |
3 | * Version: 0.1.0 | 4 | * Version: 0.1.0 |
4 | * Description: ks0108 LCD Controller driver | 5 | * Description: ks0108 LCD Controller driver |
5 | * License: GPLv2 | ||
6 | * Depends: parport | 6 | * Depends: parport |
7 | * | 7 | * |
8 | * Author: Copyright (C) Miguel Ojeda Sandonis | 8 | * Author: Copyright (C) Miguel Ojeda Sandonis |
9 | * Date: 2006-10-31 | 9 | * Date: 2006-10-31 |
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | */ | 10 | */ |
25 | 11 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index ec5e8800f8ad..3b25a643058c 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c | |||
@@ -1,13 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Front panel driver for Linux | 3 | * Front panel driver for Linux |
3 | * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu> | 4 | * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu> |
4 | * Copyright (C) 2016-2017 Glider bvba | 5 | * Copyright (C) 2016-2017 Glider bvba |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This code drives an LCD module (/dev/lcd), and a keypad (/dev/keypad) | 7 | * This code drives an LCD module (/dev/lcd), and a keypad (/dev/keypad) |
12 | * connected to a parallel printer port. | 8 | * connected to a parallel printer port. |
13 | * | 9 | * |
diff --git a/include/linux/cfag12864b.h b/include/linux/cfag12864b.h index b454dfce60d9..4060004968c8 100644 --- a/include/linux/cfag12864b.h +++ b/include/linux/cfag12864b.h | |||
@@ -1,25 +1,11 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Filename: cfag12864b.h | 3 | * Filename: cfag12864b.h |
3 | * Version: 0.1.0 | 4 | * Version: 0.1.0 |
4 | * Description: cfag12864b LCD driver header | 5 | * Description: cfag12864b LCD driver header |
5 | * License: GPLv2 | ||
6 | * | 6 | * |
7 | * Author: Copyright (C) Miguel Ojeda Sandonis | 7 | * Author: Copyright (C) Miguel Ojeda Sandonis |
8 | * Date: 2006-10-12 | 8 | * Date: 2006-10-12 |
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | 9 | */ |
24 | 10 | ||
25 | #ifndef _CFAG12864B_H_ | 11 | #ifndef _CFAG12864B_H_ |
diff --git a/include/linux/ks0108.h b/include/linux/ks0108.h index cb311798e0bc..0738389b42b6 100644 --- a/include/linux/ks0108.h +++ b/include/linux/ks0108.h | |||
@@ -1,25 +1,11 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
1 | /* | 2 | /* |
2 | * Filename: ks0108.h | 3 | * Filename: ks0108.h |
3 | * Version: 0.1.0 | 4 | * Version: 0.1.0 |
4 | * Description: ks0108 LCD Controller driver header | 5 | * Description: ks0108 LCD Controller driver header |
5 | * License: GPLv2 | ||
6 | * | 6 | * |
7 | * Author: Copyright (C) Miguel Ojeda Sandonis | 7 | * Author: Copyright (C) Miguel Ojeda Sandonis |
8 | * Date: 2006-10-31 | 8 | * Date: 2006-10-31 |
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | 9 | */ |
24 | 10 | ||
25 | #ifndef _KS0108_H_ | 11 | #ifndef _KS0108_H_ |
diff --git a/samples/auxdisplay/cfag12864b-example.c b/samples/auxdisplay/cfag12864b-example.c index e7823ffb1ca0..85571e90191f 100644 --- a/samples/auxdisplay/cfag12864b-example.c +++ b/samples/auxdisplay/cfag12864b-example.c | |||
@@ -1,25 +1,11 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Filename: cfag12864b-example.c | 3 | * Filename: cfag12864b-example.c |
3 | * Version: 0.1.0 | 4 | * Version: 0.1.0 |
4 | * Description: cfag12864b LCD userspace example program | 5 | * Description: cfag12864b LCD userspace example program |
5 | * License: GPLv2 | ||
6 | * | 6 | * |
7 | * Author: Copyright (C) Miguel Ojeda Sandonis | 7 | * Author: Copyright (C) Miguel Ojeda Sandonis |
8 | * Date: 2006-10-31 | 8 | * Date: 2006-10-31 |
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | 9 | */ |
24 | 10 | ||
25 | /* | 11 | /* |