Skip to content

Commit

Permalink
Merge tag 'auxdisplay-v6.9-1' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  ...
  • Loading branch information
Linus Torvalds committed Mar 14, 2024
2 parents 480e035 + 5d9e129 commit b345ff6
Show file tree
Hide file tree
Showing 18 changed files with 886 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ additionalProperties: false
examples:
- |
lcd@10008000 {
compatible = "arm,versatile-lcd";
reg = <0x10008000 0x1000>;
compatible = "arm,versatile-lcd";
reg = <0x10008000 0x1000>;
};
55 changes: 55 additions & 0 deletions Documentation/devicetree/bindings/auxdisplay/gpio-7-segment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/auxdisplay/gpio-7-segment.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO based LED segment display

maintainers:
- Chris Packham <chris.packham@alliedtelesis.co.nz>

properties:
compatible:
const: gpio-7-segment

segment-gpios:
description: |
An array of GPIOs one per segment. The first GPIO corresponds to the A
segment, the seventh GPIO corresponds to the G segment. Some LED blocks
also have a decimal point which can be specified as an optional eighth
segment.
-a-
| |
f b
| |
-g-
| |
e c
| |
-d- dp
minItems: 7
maxItems: 8

required:
- segment-gpios

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
led-7seg {
compatible = "gpio-7-segment";
segment-gpios = <&gpio 0 GPIO_ACTIVE_LOW>,
<&gpio 1 GPIO_ACTIVE_LOW>,
<&gpio 2 GPIO_ACTIVE_LOW>,
<&gpio 3 GPIO_ACTIVE_LOW>,
<&gpio 4 GPIO_ACTIVE_LOW>,
<&gpio 5 GPIO_ACTIVE_LOW>,
<&gpio 6 GPIO_ACTIVE_LOW>;
};
68 changes: 35 additions & 33 deletions Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,42 +84,44 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
auxdisplay {
compatible = "hit,hd44780";
data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>,
<&hc595 1 GPIO_ACTIVE_HIGH>,
<&hc595 2 GPIO_ACTIVE_HIGH>,
<&hc595 3 GPIO_ACTIVE_HIGH>;
enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
display-height-chars = <2>;
display-width-chars = <16>;
display-controller {
compatible = "hit,hd44780";
data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>,
<&hc595 1 GPIO_ACTIVE_HIGH>,
<&hc595 2 GPIO_ACTIVE_HIGH>,
<&hc595 3 GPIO_ACTIVE_HIGH>;
enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
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>;
};
#address-cells = <1>;
#size-cells = <0>;
pcf8574: gpio-expander@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>;
display-controller {
compatible = "hit,hd44780";
display-height-chars = <2>;
display-width-chars = <16>;
data-gpios = <&pcf8574 4 GPIO_ACTIVE_HIGH>,
<&pcf8574 5 GPIO_ACTIVE_HIGH>,
<&pcf8574 6 GPIO_ACTIVE_HIGH>,
<&pcf8574 7 GPIO_ACTIVE_HIGH>;
enable-gpios = <&pcf8574 2 GPIO_ACTIVE_HIGH>;
rs-gpios = <&pcf8574 0 GPIO_ACTIVE_HIGH>;
rw-gpios = <&pcf8574 1 GPIO_ACTIVE_HIGH>;
backlight-gpios = <&pcf8574 3 GPIO_ACTIVE_HIGH>;
};
54 changes: 27 additions & 27 deletions Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,31 @@ examples:
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
ht16k33: ht16k33@70 {
compatible = "holtek,ht16k33";
reg = <0x70>;
refresh-rate-hz = <20>;
interrupt-parent = <&gpio4>;
interrupts = <5 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
debounce-delay-ms = <50>;
linux,keymap = <MATRIX_KEY(2, 0, KEY_F6)>,
<MATRIX_KEY(3, 0, KEY_F8)>,
<MATRIX_KEY(4, 0, KEY_F10)>,
<MATRIX_KEY(5, 0, KEY_F4)>,
<MATRIX_KEY(6, 0, KEY_F2)>,
<MATRIX_KEY(2, 1, KEY_F5)>,
<MATRIX_KEY(3, 1, KEY_F7)>,
<MATRIX_KEY(4, 1, KEY_F9)>,
<MATRIX_KEY(5, 1, KEY_F3)>,
<MATRIX_KEY(6, 1, KEY_F1)>;
led {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_BACKLIGHT;
linux,default-trigger = "backlight";
};
#address-cells = <1>;
#size-cells = <0>;
display-controller@70 {
compatible = "holtek,ht16k33";
reg = <0x70>;
refresh-rate-hz = <20>;
interrupt-parent = <&gpio4>;
interrupts = <5 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
debounce-delay-ms = <50>;
linux,keymap = <MATRIX_KEY(2, 0, KEY_F6)>,
<MATRIX_KEY(3, 0, KEY_F8)>,
<MATRIX_KEY(4, 0, KEY_F10)>,
<MATRIX_KEY(5, 0, KEY_F4)>,
<MATRIX_KEY(6, 0, KEY_F2)>,
<MATRIX_KEY(2, 1, KEY_F5)>,
<MATRIX_KEY(3, 1, KEY_F7)>,
<MATRIX_KEY(4, 1, KEY_F9)>,
<MATRIX_KEY(5, 1, KEY_F3)>,
<MATRIX_KEY(6, 1, KEY_F1)>;
led {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_BACKLIGHT;
linux,default-trigger = "backlight";
};
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ additionalProperties: false
examples:
- |
lcd: lcd@17fff000 {
compatible = "img,boston-lcd";
reg = <0x17fff000 0x8>;
compatible = "img,boston-lcd";
reg = <0x17fff000 0x8>;
};
44 changes: 44 additions & 0 deletions Documentation/devicetree/bindings/auxdisplay/maxim,max6959.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/auxdisplay/maxim,max6959.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MAX6958/6959 7-segment LED display controller

maintainers:
- Andy Shevchenko <andriy.shevchenko@linux.intel.com>

description:
The Maxim MAX6958/6959 7-segment LED display controller provides
an I2C interface to up to four 7-segment LED digits. The MAX6959,
in comparison to MAX6958, adds input support. Type of the chip can
be autodetected via specific register read, and hence the features
may be enabled in the driver at run-time, in case they are requested
via Device Tree. A given hardware is simple and does not provide
any additional pins, such as reset or power enable.

properties:
compatible:
const: maxim,max6959

reg:
maxItems: 1

required:
- compatible
- reg

additionalProperties: false

examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
display-controller@38 {
compatible = "maxim,max6959";
reg = <0x38>;
};
};
8 changes: 6 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3389,11 +3389,15 @@ F: drivers/base/auxiliary.c
F: include/linux/auxiliary_bus.h

AUXILIARY DISPLAY DRIVERS
M: Miguel Ojeda <ojeda@kernel.org>
S: Maintained
M: Andy Shevchenko <andy@kernel.org>
R: Geert Uytterhoeven <geert@linux-m68k.org>
S: Odd Fixes
T: git git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay.git
F: Documentation/devicetree/bindings/auxdisplay/
F: drivers/auxdisplay/
F: include/linux/cfag12864b.h
F: include/uapi/linux/map_to_14segment.h
F: include/uapi/linux/map_to_7segment.h

AVIA HX711 ANALOG DIGITAL CONVERTER IIO DRIVER
M: Andreas Klinger <ak@it-klinger.de>
Expand Down
25 changes: 25 additions & 0 deletions drivers/auxdisplay/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ config HT16K33
Say yes here to add support for Holtek HT16K33, RAM mapping 16*8
LED controller driver with keyscan.

config MAX6959
tristate "Maxim MAX6958/6959 7-segment LED controller"
depends on I2C
select REGMAP_I2C
select LINEDISP
help
If you say yes here you get support for the following Maxim chips
(I2C 7-segment LED display controller):
- MAX6958
- MAX6959 (input support)

This driver can also be built as a module. If so, the module
will be called max6959.

config LCD2S
tristate "lcd2s 20x4 character display over I2C console"
depends on I2C
Expand All @@ -197,6 +211,17 @@ config ARM_CHARLCD
line and the Linux version on the second line, but that's
still useful.

config SEG_LED_GPIO
tristate "Generic 7-segment LED display"
depends on GPIOLIB || COMPILE_TEST
select LINEDISP
help
This driver supports a generic 7-segment LED display made up
of GPIO pins connected to the individual segments.

This driver can also be built as a module. If so, the module
will be called seg-led-gpio.

menuconfig PARPORT_PANEL
tristate "Parallel port LCD/Keypad Panel support"
depends on PARPORT
Expand Down
2 changes: 2 additions & 0 deletions drivers/auxdisplay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ obj-$(CONFIG_HT16K33) += ht16k33.o
obj-$(CONFIG_PARPORT_PANEL) += panel.o
obj-$(CONFIG_LCD2S) += lcd2s.o
obj-$(CONFIG_LINEDISP) += line-display.o
obj-$(CONFIG_MAX6959) += max6959.o
obj-$(CONFIG_SEG_LED_GPIO) += seg-led-gpio.o
6 changes: 2 additions & 4 deletions drivers/auxdisplay/cfag12864bfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,19 @@ static int cfag12864bfb_probe(struct platform_device *device)
return ret;
}

static int cfag12864bfb_remove(struct platform_device *device)
static void cfag12864bfb_remove(struct platform_device *device)
{
struct fb_info *info = platform_get_drvdata(device);

if (info) {
unregister_framebuffer(info);
framebuffer_release(info);
}

return 0;
}

static struct platform_driver cfag12864bfb_driver = {
.probe = cfag12864bfb_probe,
.remove = cfag12864bfb_remove,
.remove_new = cfag12864bfb_remove,
.driver = {
.name = CFAG12864BFB_NAME,
},
Expand Down
5 changes: 2 additions & 3 deletions drivers/auxdisplay/hd44780.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int hd44780_probe(struct platform_device *pdev)
return ret;
}

static int hd44780_remove(struct platform_device *pdev)
static void hd44780_remove(struct platform_device *pdev)
{
struct charlcd *lcd = platform_get_drvdata(pdev);
struct hd44780_common *hdc = lcd->drvdata;
Expand All @@ -329,7 +329,6 @@ static int hd44780_remove(struct platform_device *pdev)
kfree(lcd->drvdata);

kfree(lcd);
return 0;
}

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

static struct platform_driver hd44780_driver = {
.probe = hd44780_probe,
.remove = hd44780_remove,
.remove_new = hd44780_remove,
.driver = {
.name = "hd44780",
.of_match_table = hd44780_of_match,
Expand Down
Loading

0 comments on commit b345ff6

Please sign in to comment.