Skip to content

Commit b345ff6

Browse files
committed
Merge tag 'auxdisplay-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay
Pull auxdisplay updates from Andy Shevchenko: - New driver for GPIO based 7-segment LED display (Chris Packham) - New driver for Maxim MAX6958/6959 I²C 7-segment LED display controller - Refactor linedisp library to make the above happen - Update Holtek HT16k33 driver to follow the linedisp refactoring - Convert .remove to return void in platform drivers (Uwe Kleine-König) - Fix DT schemas (Krzysztof Kozlowski) - Refresh MAINTAINERS database * tag 'auxdisplay-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay: (27 commits) auxdisplay: img-ascii-lcd: Convert to platform remove callback returning void auxdisplay: hd44780: Convert to platform remove callback returning void auxdisplay: cfag12864bfb: Convert to platform remove callback returning void auxdisplay: seg-led-gpio: Import linedisp namespace dt-bindings: auxdisplay: Add bindings for generic 7-segment LED auxdisplay: Add 7-segment LED display driver auxdisplay: Add driver for MAX695x 7-segment LED controllers dt-bindings: auxdisplay: Add Maxim MAX6958/6959 auxdisplay: ht16k33: Drop struct ht16k33_seg auxdisplay: ht16k33: Switch to use line display character mapping auxdisplay: ht16k33: Define a few helper macros auxdisplay: ht16k33: Move ht16k33_linedisp_ops down auxdisplay: ht16k33: Add default to switch-cases auxdisplay: linedisp: Allocate buffer for the string auxdisplay: linedisp: Add support for overriding character mapping auxdisplay: linedisp: Provide struct linedisp_ops for future extension auxdisplay: linedisp: Move exported symbols to a namespace auxdisplay: linedisp: Add missing header(s) auxdisplay: linedisp: Unshadow error codes in ->store() auxdisplay: linedisp: Use unique number for id ...
2 parents 480e035 + 5d9e129 commit b345ff6

18 files changed

+886
-336
lines changed

Documentation/devicetree/bindings/auxdisplay/arm,versatile-lcd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ additionalProperties: false
3939
examples:
4040
- |
4141
lcd@10008000 {
42-
compatible = "arm,versatile-lcd";
43-
reg = <0x10008000 0x1000>;
42+
compatible = "arm,versatile-lcd";
43+
reg = <0x10008000 0x1000>;
4444
};
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/auxdisplay/gpio-7-segment.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: GPIO based LED segment display
8+
9+
maintainers:
10+
- Chris Packham <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: gpio-7-segment
15+
16+
segment-gpios:
17+
description: |
18+
An array of GPIOs one per segment. The first GPIO corresponds to the A
19+
segment, the seventh GPIO corresponds to the G segment. Some LED blocks
20+
also have a decimal point which can be specified as an optional eighth
21+
segment.
22+
23+
-a-
24+
| |
25+
f b
26+
| |
27+
-g-
28+
| |
29+
e c
30+
| |
31+
-d- dp
32+
33+
minItems: 7
34+
maxItems: 8
35+
36+
required:
37+
- segment-gpios
38+
39+
additionalProperties: false
40+
41+
examples:
42+
- |
43+
44+
#include <dt-bindings/gpio/gpio.h>
45+
46+
led-7seg {
47+
compatible = "gpio-7-segment";
48+
segment-gpios = <&gpio 0 GPIO_ACTIVE_LOW>,
49+
<&gpio 1 GPIO_ACTIVE_LOW>,
50+
<&gpio 2 GPIO_ACTIVE_LOW>,
51+
<&gpio 3 GPIO_ACTIVE_LOW>,
52+
<&gpio 4 GPIO_ACTIVE_LOW>,
53+
<&gpio 5 GPIO_ACTIVE_LOW>,
54+
<&gpio 6 GPIO_ACTIVE_LOW>;
55+
};

Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -84,42 +84,44 @@ additionalProperties: false
8484
examples:
8585
- |
8686
#include <dt-bindings/gpio/gpio.h>
87-
auxdisplay {
88-
compatible = "hit,hd44780";
89-
90-
data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>,
91-
<&hc595 1 GPIO_ACTIVE_HIGH>,
92-
<&hc595 2 GPIO_ACTIVE_HIGH>,
93-
<&hc595 3 GPIO_ACTIVE_HIGH>;
94-
enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
95-
rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
96-
97-
display-height-chars = <2>;
98-
display-width-chars = <16>;
87+
display-controller {
88+
compatible = "hit,hd44780";
89+
90+
data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>,
91+
<&hc595 1 GPIO_ACTIVE_HIGH>,
92+
<&hc595 2 GPIO_ACTIVE_HIGH>,
93+
<&hc595 3 GPIO_ACTIVE_HIGH>;
94+
enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
95+
rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
96+
97+
display-height-chars = <2>;
98+
display-width-chars = <16>;
9999
};
100+
100101
- |
101102
#include <dt-bindings/gpio/gpio.h>
102103
i2c {
103-
#address-cells = <1>;
104-
#size-cells = <0>;
105-
106-
pcf8574: pcf8574@27 {
107-
compatible = "nxp,pcf8574";
108-
reg = <0x27>;
109-
gpio-controller;
110-
#gpio-cells = <2>;
111-
};
104+
#address-cells = <1>;
105+
#size-cells = <0>;
106+
107+
pcf8574: gpio-expander@27 {
108+
compatible = "nxp,pcf8574";
109+
reg = <0x27>;
110+
gpio-controller;
111+
#gpio-cells = <2>;
112+
};
112113
};
113-
hd44780 {
114-
compatible = "hit,hd44780";
115-
display-height-chars = <2>;
116-
display-width-chars = <16>;
117-
data-gpios = <&pcf8574 4 0>,
118-
<&pcf8574 5 0>,
119-
<&pcf8574 6 0>,
120-
<&pcf8574 7 0>;
121-
enable-gpios = <&pcf8574 2 0>;
122-
rs-gpios = <&pcf8574 0 0>;
123-
rw-gpios = <&pcf8574 1 0>;
124-
backlight-gpios = <&pcf8574 3 0>;
114+
115+
display-controller {
116+
compatible = "hit,hd44780";
117+
display-height-chars = <2>;
118+
display-width-chars = <16>;
119+
data-gpios = <&pcf8574 4 GPIO_ACTIVE_HIGH>,
120+
<&pcf8574 5 GPIO_ACTIVE_HIGH>,
121+
<&pcf8574 6 GPIO_ACTIVE_HIGH>,
122+
<&pcf8574 7 GPIO_ACTIVE_HIGH>;
123+
enable-gpios = <&pcf8574 2 GPIO_ACTIVE_HIGH>;
124+
rs-gpios = <&pcf8574 0 GPIO_ACTIVE_HIGH>;
125+
rw-gpios = <&pcf8574 1 GPIO_ACTIVE_HIGH>;
126+
backlight-gpios = <&pcf8574 3 GPIO_ACTIVE_HIGH>;
125127
};

Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,31 +74,31 @@ examples:
7474
#include <dt-bindings/input/input.h>
7575
#include <dt-bindings/leds/common.h>
7676
i2c {
77-
#address-cells = <1>;
78-
#size-cells = <0>;
79-
80-
ht16k33: ht16k33@70 {
81-
compatible = "holtek,ht16k33";
82-
reg = <0x70>;
83-
refresh-rate-hz = <20>;
84-
interrupt-parent = <&gpio4>;
85-
interrupts = <5 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
86-
debounce-delay-ms = <50>;
87-
linux,keymap = <MATRIX_KEY(2, 0, KEY_F6)>,
88-
<MATRIX_KEY(3, 0, KEY_F8)>,
89-
<MATRIX_KEY(4, 0, KEY_F10)>,
90-
<MATRIX_KEY(5, 0, KEY_F4)>,
91-
<MATRIX_KEY(6, 0, KEY_F2)>,
92-
<MATRIX_KEY(2, 1, KEY_F5)>,
93-
<MATRIX_KEY(3, 1, KEY_F7)>,
94-
<MATRIX_KEY(4, 1, KEY_F9)>,
95-
<MATRIX_KEY(5, 1, KEY_F3)>,
96-
<MATRIX_KEY(6, 1, KEY_F1)>;
97-
98-
led {
99-
color = <LED_COLOR_ID_RED>;
100-
function = LED_FUNCTION_BACKLIGHT;
101-
linux,default-trigger = "backlight";
102-
};
77+
#address-cells = <1>;
78+
#size-cells = <0>;
79+
80+
display-controller@70 {
81+
compatible = "holtek,ht16k33";
82+
reg = <0x70>;
83+
refresh-rate-hz = <20>;
84+
interrupt-parent = <&gpio4>;
85+
interrupts = <5 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
86+
debounce-delay-ms = <50>;
87+
linux,keymap = <MATRIX_KEY(2, 0, KEY_F6)>,
88+
<MATRIX_KEY(3, 0, KEY_F8)>,
89+
<MATRIX_KEY(4, 0, KEY_F10)>,
90+
<MATRIX_KEY(5, 0, KEY_F4)>,
91+
<MATRIX_KEY(6, 0, KEY_F2)>,
92+
<MATRIX_KEY(2, 1, KEY_F5)>,
93+
<MATRIX_KEY(3, 1, KEY_F7)>,
94+
<MATRIX_KEY(4, 1, KEY_F9)>,
95+
<MATRIX_KEY(5, 1, KEY_F3)>,
96+
<MATRIX_KEY(6, 1, KEY_F1)>;
97+
98+
led {
99+
color = <LED_COLOR_ID_RED>;
100+
function = LED_FUNCTION_BACKLIGHT;
101+
linux,default-trigger = "backlight";
103102
};
104-
};
103+
};
104+
};

Documentation/devicetree/bindings/auxdisplay/img,ascii-lcd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ additionalProperties: false
5050
examples:
5151
- |
5252
lcd: lcd@17fff000 {
53-
compatible = "img,boston-lcd";
54-
reg = <0x17fff000 0x8>;
53+
compatible = "img,boston-lcd";
54+
reg = <0x17fff000 0x8>;
5555
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/auxdisplay/maxim,max6959.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MAX6958/6959 7-segment LED display controller
8+
9+
maintainers:
10+
- Andy Shevchenko <[email protected]>
11+
12+
description:
13+
The Maxim MAX6958/6959 7-segment LED display controller provides
14+
an I2C interface to up to four 7-segment LED digits. The MAX6959,
15+
in comparison to MAX6958, adds input support. Type of the chip can
16+
be autodetected via specific register read, and hence the features
17+
may be enabled in the driver at run-time, in case they are requested
18+
via Device Tree. A given hardware is simple and does not provide
19+
any additional pins, such as reset or power enable.
20+
21+
properties:
22+
compatible:
23+
const: maxim,max6959
24+
25+
reg:
26+
maxItems: 1
27+
28+
required:
29+
- compatible
30+
- reg
31+
32+
additionalProperties: false
33+
34+
examples:
35+
- |
36+
i2c {
37+
#address-cells = <1>;
38+
#size-cells = <0>;
39+
40+
display-controller@38 {
41+
compatible = "maxim,max6959";
42+
reg = <0x38>;
43+
};
44+
};

MAINTAINERS

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,11 +3389,15 @@ F: drivers/base/auxiliary.c
33893389
F: include/linux/auxiliary_bus.h
33903390

33913391
AUXILIARY DISPLAY DRIVERS
3392-
M: Miguel Ojeda <[email protected]>
3393-
S: Maintained
3392+
M: Andy Shevchenko <[email protected]>
3393+
R: Geert Uytterhoeven <[email protected]>
3394+
S: Odd Fixes
3395+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay.git
33943396
F: Documentation/devicetree/bindings/auxdisplay/
33953397
F: drivers/auxdisplay/
33963398
F: include/linux/cfag12864b.h
3399+
F: include/uapi/linux/map_to_14segment.h
3400+
F: include/uapi/linux/map_to_7segment.h
33973401

33983402
AVIA HX711 ANALOG DIGITAL CONVERTER IIO DRIVER
33993403
M: Andreas Klinger <[email protected]>

drivers/auxdisplay/Kconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,20 @@ config HT16K33
177177
Say yes here to add support for Holtek HT16K33, RAM mapping 16*8
178178
LED controller driver with keyscan.
179179

180+
config MAX6959
181+
tristate "Maxim MAX6958/6959 7-segment LED controller"
182+
depends on I2C
183+
select REGMAP_I2C
184+
select LINEDISP
185+
help
186+
If you say yes here you get support for the following Maxim chips
187+
(I2C 7-segment LED display controller):
188+
- MAX6958
189+
- MAX6959 (input support)
190+
191+
This driver can also be built as a module. If so, the module
192+
will be called max6959.
193+
180194
config LCD2S
181195
tristate "lcd2s 20x4 character display over I2C console"
182196
depends on I2C
@@ -197,6 +211,17 @@ config ARM_CHARLCD
197211
line and the Linux version on the second line, but that's
198212
still useful.
199213

214+
config SEG_LED_GPIO
215+
tristate "Generic 7-segment LED display"
216+
depends on GPIOLIB || COMPILE_TEST
217+
select LINEDISP
218+
help
219+
This driver supports a generic 7-segment LED display made up
220+
of GPIO pins connected to the individual segments.
221+
222+
This driver can also be built as a module. If so, the module
223+
will be called seg-led-gpio.
224+
200225
menuconfig PARPORT_PANEL
201226
tristate "Parallel port LCD/Keypad Panel support"
202227
depends on PARPORT

drivers/auxdisplay/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ obj-$(CONFIG_HT16K33) += ht16k33.o
1414
obj-$(CONFIG_PARPORT_PANEL) += panel.o
1515
obj-$(CONFIG_LCD2S) += lcd2s.o
1616
obj-$(CONFIG_LINEDISP) += line-display.o
17+
obj-$(CONFIG_MAX6959) += max6959.o
18+
obj-$(CONFIG_SEG_LED_GPIO) += seg-led-gpio.o

drivers/auxdisplay/cfag12864bfb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,19 @@ static int cfag12864bfb_probe(struct platform_device *device)
9696
return ret;
9797
}
9898

99-
static int cfag12864bfb_remove(struct platform_device *device)
99+
static void cfag12864bfb_remove(struct platform_device *device)
100100
{
101101
struct fb_info *info = platform_get_drvdata(device);
102102

103103
if (info) {
104104
unregister_framebuffer(info);
105105
framebuffer_release(info);
106106
}
107-
108-
return 0;
109107
}
110108

111109
static struct platform_driver cfag12864bfb_driver = {
112110
.probe = cfag12864bfb_probe,
113-
.remove = cfag12864bfb_remove,
111+
.remove_new = cfag12864bfb_remove,
114112
.driver = {
115113
.name = CFAG12864BFB_NAME,
116114
},

drivers/auxdisplay/hd44780.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static int hd44780_probe(struct platform_device *pdev)
319319
return ret;
320320
}
321321

322-
static int hd44780_remove(struct platform_device *pdev)
322+
static void hd44780_remove(struct platform_device *pdev)
323323
{
324324
struct charlcd *lcd = platform_get_drvdata(pdev);
325325
struct hd44780_common *hdc = lcd->drvdata;
@@ -329,7 +329,6 @@ static int hd44780_remove(struct platform_device *pdev)
329329
kfree(lcd->drvdata);
330330

331331
kfree(lcd);
332-
return 0;
333332
}
334333

335334
static const struct of_device_id hd44780_of_match[] = {
@@ -340,7 +339,7 @@ MODULE_DEVICE_TABLE(of, hd44780_of_match);
340339

341340
static struct platform_driver hd44780_driver = {
342341
.probe = hd44780_probe,
343-
.remove = hd44780_remove,
342+
.remove_new = hd44780_remove,
344343
.driver = {
345344
.name = "hd44780",
346345
.of_match_table = hd44780_of_match,

0 commit comments

Comments
 (0)