Skip to content

Commit d41adc4

Browse files
committed
Merge tag 'auxdisplay-for-linus-v5.15-rc1' of git://github.com/ojeda/linux
Pull auxdisplay updates from Miguel Ojeda: "An assortment of improvements for auxdisplay: - Replace symbolic permissions with octal permissions (Jinchao Wang) - ks0108: Switch to use module_parport_driver() (Andy Shevchenko) - charlcd: Drop unneeded initializers and switch to C99 style (Andy Shevchenko) - hd44780: Fix oops on module unloading (Lars Poeschel) - Add I2C gpio expander example (Ralf Schlatterbeck)" * tag 'auxdisplay-for-linus-v5.15-rc1' of git://github.com/ojeda/linux: auxdisplay: Replace symbolic permissions with octal permissions auxdisplay: ks0108: Switch to use module_parport_driver() auxdisplay: charlcd: Drop unneeded initializers and switch to C99 style auxdisplay: hd44780: Fix oops on module unloading auxdisplay: Add I2C gpio expander example
2 parents f306b90 + 24ebc04 commit d41adc4

File tree

5 files changed

+36
-21
lines changed

5 files changed

+36
-21
lines changed

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ maintainers:
1212
description:
1313
The Hitachi HD44780 Character LCD Controller is commonly used on character
1414
LCDs that can display one or more lines of text. It exposes an M6800 bus
15-
interface, which can be used in either 4-bit or 8-bit mode.
15+
interface, which can be used in either 4-bit or 8-bit mode. By using a
16+
GPIO expander it is possible to use the driver with one of the popular I2C
17+
expander boards based on the PCF8574 available for these displays. For
18+
an example see below.
1619

1720
properties:
1821
compatible:
@@ -94,3 +97,29 @@ examples:
9497
display-height-chars = <2>;
9598
display-width-chars = <16>;
9699
};
100+
- |
101+
#include <dt-bindings/gpio/gpio.h>
102+
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+
};
112+
};
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>;
125+
};

drivers/auxdisplay/cfag12864b.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434

3535
static unsigned int cfag12864b_rate = CONFIG_CFAG12864B_RATE;
36-
module_param(cfag12864b_rate, uint, S_IRUGO);
36+
module_param(cfag12864b_rate, uint, 0444);
3737
MODULE_PARM_DESC(cfag12864b_rate,
3838
"Refresh rate (hertz)");
3939

drivers/auxdisplay/charlcd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,7 @@ static int panel_notify_sys(struct notifier_block *this, unsigned long code,
637637
}
638638

639639
static struct notifier_block panel_notifier = {
640-
panel_notify_sys,
641-
NULL,
642-
0
640+
.notifier_call = panel_notify_sys,
643641
};
644642

645643
int charlcd_register(struct charlcd *lcd)

drivers/auxdisplay/hd44780.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ static int hd44780_remove(struct platform_device *pdev)
323323
{
324324
struct charlcd *lcd = platform_get_drvdata(pdev);
325325

326-
kfree(lcd->drvdata);
327326
charlcd_unregister(lcd);
327+
kfree(lcd->drvdata);
328328

329329
kfree(lcd);
330330
return 0;

drivers/auxdisplay/ks0108.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
*/
2929

3030
static unsigned int ks0108_port = CONFIG_KS0108_PORT;
31-
module_param(ks0108_port, uint, S_IRUGO);
31+
module_param(ks0108_port, uint, 0444);
3232
MODULE_PARM_DESC(ks0108_port, "Parallel port where the LCD is connected");
3333

3434
static unsigned int ks0108_delay = CONFIG_KS0108_DELAY;
35-
module_param(ks0108_delay, uint, S_IRUGO);
35+
module_param(ks0108_delay, uint, 0444);
3636
MODULE_PARM_DESC(ks0108_delay, "Delay between each control writing (microseconds)");
3737

3838
/*
@@ -167,19 +167,7 @@ static struct parport_driver ks0108_parport_driver = {
167167
.detach = ks0108_parport_detach,
168168
.devmodel = true,
169169
};
170-
171-
static int __init ks0108_init(void)
172-
{
173-
return parport_register_driver(&ks0108_parport_driver);
174-
}
175-
176-
static void __exit ks0108_exit(void)
177-
{
178-
parport_unregister_driver(&ks0108_parport_driver);
179-
}
180-
181-
module_init(ks0108_init);
182-
module_exit(ks0108_exit);
170+
module_parport_driver(ks0108_parport_driver);
183171

184172
MODULE_LICENSE("GPL v2");
185173
MODULE_AUTHOR("Miguel Ojeda <[email protected]>");

0 commit comments

Comments
 (0)