Skip to content

Commit

Permalink
Merge tag 'auxdisplay-for-linus-v5.15-rc1' of git://github.com/ojeda/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Sep 12, 2021
2 parents f306b90 + 24ebc04 commit d41adc4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 21 deletions.
31 changes: 30 additions & 1 deletion Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ maintainers:
description:
The Hitachi HD44780 Character LCD Controller is commonly used on character
LCDs that can display one or more lines of text. It exposes an M6800 bus
interface, which can be used in either 4-bit or 8-bit mode.
interface, which can be used in either 4-bit or 8-bit mode. By using a
GPIO expander it is possible to use the driver with one of the popular I2C
expander boards based on the PCF8574 available for these displays. For
an example see below.

properties:
compatible:
Expand Down Expand Up @@ -94,3 +97,29 @@ examples:
display-height-chars = <2>;
display-width-chars = <16>;
};
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pcf8574: pcf8574@27 {
compatible = "nxp,pcf8574";
reg = <0x27>;
gpio-controller;
#gpio-cells = <2>;
};
};
hd44780 {
compatible = "hit,hd44780";
display-height-chars = <2>;
display-width-chars = <16>;
data-gpios = <&pcf8574 4 0>,
<&pcf8574 5 0>,
<&pcf8574 6 0>,
<&pcf8574 7 0>;
enable-gpios = <&pcf8574 2 0>;
rs-gpios = <&pcf8574 0 0>;
rw-gpios = <&pcf8574 1 0>;
backlight-gpios = <&pcf8574 3 0>;
};
2 changes: 1 addition & 1 deletion drivers/auxdisplay/cfag12864b.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/

static unsigned int cfag12864b_rate = CONFIG_CFAG12864B_RATE;
module_param(cfag12864b_rate, uint, S_IRUGO);
module_param(cfag12864b_rate, uint, 0444);
MODULE_PARM_DESC(cfag12864b_rate,
"Refresh rate (hertz)");

Expand Down
4 changes: 1 addition & 3 deletions drivers/auxdisplay/charlcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,7 @@ static int panel_notify_sys(struct notifier_block *this, unsigned long code,
}

static struct notifier_block panel_notifier = {
panel_notify_sys,
NULL,
0
.notifier_call = panel_notify_sys,
};

int charlcd_register(struct charlcd *lcd)
Expand Down
2 changes: 1 addition & 1 deletion drivers/auxdisplay/hd44780.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ static int hd44780_remove(struct platform_device *pdev)
{
struct charlcd *lcd = platform_get_drvdata(pdev);

kfree(lcd->drvdata);
charlcd_unregister(lcd);
kfree(lcd->drvdata);

kfree(lcd);
return 0;
Expand Down
18 changes: 3 additions & 15 deletions drivers/auxdisplay/ks0108.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
*/

static unsigned int ks0108_port = CONFIG_KS0108_PORT;
module_param(ks0108_port, uint, S_IRUGO);
module_param(ks0108_port, uint, 0444);
MODULE_PARM_DESC(ks0108_port, "Parallel port where the LCD is connected");

static unsigned int ks0108_delay = CONFIG_KS0108_DELAY;
module_param(ks0108_delay, uint, S_IRUGO);
module_param(ks0108_delay, uint, 0444);
MODULE_PARM_DESC(ks0108_delay, "Delay between each control writing (microseconds)");

/*
Expand Down Expand Up @@ -167,19 +167,7 @@ static struct parport_driver ks0108_parport_driver = {
.detach = ks0108_parport_detach,
.devmodel = true,
};

static int __init ks0108_init(void)
{
return parport_register_driver(&ks0108_parport_driver);
}

static void __exit ks0108_exit(void)
{
parport_unregister_driver(&ks0108_parport_driver);
}

module_init(ks0108_init);
module_exit(ks0108_exit);
module_parport_driver(ks0108_parport_driver);

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

0 comments on commit d41adc4

Please sign in to comment.