Commit d41adc4e authored by Linus Torvalds's avatar Linus Torvalds

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
parents f306b90c 24ebc044
...@@ -12,7 +12,10 @@ maintainers: ...@@ -12,7 +12,10 @@ maintainers:
description: description:
The Hitachi HD44780 Character LCD Controller is commonly used on character 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 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: properties:
compatible: compatible:
...@@ -94,3 +97,29 @@ examples: ...@@ -94,3 +97,29 @@ examples:
display-height-chars = <2>; display-height-chars = <2>;
display-width-chars = <16>; 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>;
};
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
*/ */
static unsigned int cfag12864b_rate = CONFIG_CFAG12864B_RATE; 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, MODULE_PARM_DESC(cfag12864b_rate,
"Refresh rate (hertz)"); "Refresh rate (hertz)");
......
...@@ -637,9 +637,7 @@ static int panel_notify_sys(struct notifier_block *this, unsigned long code, ...@@ -637,9 +637,7 @@ static int panel_notify_sys(struct notifier_block *this, unsigned long code,
} }
static struct notifier_block panel_notifier = { static struct notifier_block panel_notifier = {
panel_notify_sys, .notifier_call = panel_notify_sys,
NULL,
0
}; };
int charlcd_register(struct charlcd *lcd) int charlcd_register(struct charlcd *lcd)
......
...@@ -323,8 +323,8 @@ static int hd44780_remove(struct platform_device *pdev) ...@@ -323,8 +323,8 @@ static int hd44780_remove(struct platform_device *pdev)
{ {
struct charlcd *lcd = platform_get_drvdata(pdev); struct charlcd *lcd = platform_get_drvdata(pdev);
kfree(lcd->drvdata);
charlcd_unregister(lcd); charlcd_unregister(lcd);
kfree(lcd->drvdata);
kfree(lcd); kfree(lcd);
return 0; return 0;
......
...@@ -28,11 +28,11 @@ ...@@ -28,11 +28,11 @@
*/ */
static unsigned int ks0108_port = CONFIG_KS0108_PORT; 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"); MODULE_PARM_DESC(ks0108_port, "Parallel port where the LCD is connected");
static unsigned int ks0108_delay = CONFIG_KS0108_DELAY; 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)"); MODULE_PARM_DESC(ks0108_delay, "Delay between each control writing (microseconds)");
/* /*
...@@ -167,19 +167,7 @@ static struct parport_driver ks0108_parport_driver = { ...@@ -167,19 +167,7 @@ static struct parport_driver ks0108_parport_driver = {
.detach = ks0108_parport_detach, .detach = ks0108_parport_detach,
.devmodel = true, .devmodel = true,
}; };
module_parport_driver(ks0108_parport_driver);
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_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Miguel Ojeda <ojeda@kernel.org>"); MODULE_AUTHOR("Miguel Ojeda <ojeda@kernel.org>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment