Skip to contentSkip to conversation

auxdisplay: ht16k33: Driver for LED controller.

PATCH Superseded Robin van der Gracht 2 participants 3 messages Feb 9, 2016 – Feb 15, 2016

Subsystems (5)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Robin van der Gracht

author maintainer
#0 lore raw

PATCH v2 1/1 auxdisplay: ht16k33: Driver for LED controller.

This is a driver for the Holtek HT16K33 LED controller with keyscan.

---
Changes in v2:
- Fixed build error reported by kbuild test robot by including mm.h

 .../devicetree/bindings/display/ht16k33.txt        |  42 ++
 drivers/auxdisplay/Kconfig                         |   9 +
 drivers/auxdisplay/Makefile                        |   1 +
 drivers/auxdisplay/ht16k33.c                       | 573 +++++++++++++++++++++
 4 files changed, 625 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/ht16k33.txt
 create mode 100644 drivers/auxdisplay/ht16k33.c
Documentation/devicetree/bindings/display/ht16k33.txt new file +42 -0
new file mode 100644
index 0000000..45fbabb
@@ -0,0 +1,42 @@
+Holtek ht16k33 RAM mapping 16*8 LED controller driver with keyscan
+-------------------------------------------------------------------------------
+
+Required properties:
+- compatible:			"ht,ht16k33"
+- reg:					I2C slave address of the chip.
+- interrupt-parent: 	A phandle pointing to the interrupt controller
+						serving the interrupt for this chip.
+- interrupts:			Interrupt specification for the key pressed interrupt.
+- refresh-rate:			Display update interval in HZ.
+- debounce-delay-ms:	Debouncing interval time in microseconds.
+- linux,keymap:			The keymap for keys as described in the binding
+						document (devicetree/bindings/input/matrix-keymap.txt).
+
+Optional properties:
+- linux,no-autorepeat:	Disable keyrepeat.
+- default-brightness:	Initial brightness setting [0-15] (15 if not set).
+
+Example:
+
+&i2c1 {
+	ht16k33: ht16k33@70 {
+		compatible = "ht,ht16k33";
+		reg = <0x70>;
+		refresh-rate = <20>;
+		debounce-delay-ms = <50>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <5 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
+		linux,keymap = <
+			   MATRIX_KEY(2, 0, KEY_F6)
+			   MATRIX_KEY(3, 0, KEY_F8)
+			   MATRIX_KEY(4, 0, KEY_F0)
+			   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)
+			   >;
+	   };
+};
drivers/auxdisplay/Kconfig +9 -0
index c07e725..75ad4f5 100644
@@ -119,4 +119,13 @@ config CFAG12864B_RATE
 	  If you compile this as a module, you can still override this
 	  value using the module parameters.
 
+config HT16K33
+	tristate "Holtek Ht16K33 LED controller with keyscan"
+	depends on FB && OF && I2C && INPUT
+	select INPUT_MATRIXKMAP
+	select FB_BACKLIGHT
+	help
+	  Say yes here to add support for Holtek HT16K33, RAM mapping 16*8
+	  LED controller driver with keyscan.
+
 endif # AUXDISPLAY
drivers/auxdisplay/Makefile +1 -0
index 8a8936a..d7c9ef5 100644
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_KS0108)		+= ks0108.o
 obj-$(CONFIG_CFAG12864B)	+= cfag12864b.o cfag12864bfb.o
+obj-$(CONFIG_HT16K33)		+= ht16k33.o
drivers/auxdisplay/ht16k33.c new file +573 -0

573 lines not on this page · raw message

Signature · 1 line
2.5.0
maintainer
#1 lore raw
Quoted 21 lines · Robin van der Gracht

This is a driver for the Holtek HT16K33 LED controller with keyscan.

---
Changes in v2:
- Fixed build error reported by kbuild test robot by including mm.h

 .../devicetree/bindings/display/ht16k33.txt        |  42 ++
 drivers/auxdisplay/Kconfig                         |   9 +
 drivers/auxdisplay/Makefile                        |   1 +
 drivers/auxdisplay/ht16k33.c                       | 573 +++++++++++++++++++++
 4 files changed, 625 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/ht16k33.txt
 create mode 100644 drivers/auxdisplay/ht16k33.c
Documentation/devicetree/bindings/display/ht16k33.txt new file +0 -0
new file mode 100644
index 0000000..45fbabb

Documentation/devicetree/bindings/display/ht16k33.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/display/ht16k33.txt new file +10 -0
@@ -0,0 +1,42 @@
+Holtek ht16k33 RAM mapping 16*8 LED controller driver with keyscan
+-------------------------------------------------------------------------------
+
+Required properties:
+- compatible:			"ht,ht16k33"
+- reg:					I2C slave address of the chip.
+- interrupt-parent: 	A phandle pointing to the interrupt controller
+						serving the interrupt for this chip.
+- interrupts:			Interrupt specification for the key pressed interrupt.
+- refresh-rate:			Display update interval in HZ.

Add units: "-hz"

Documentation/devicetree/bindings/display/ht16k33.txt line 13

Quoted 3 lines
Documentation/devicetree/bindings/display/ht16k33.txt new file +3 -0
+- debounce-delay-ms:	Debouncing interval time in microseconds.
+- linux,keymap:			The keymap for keys as described in the binding
+						document (devicetree/bindings/input/matrix-keymap.txt).

The alignment of the descriptions here seem to be random. Please line them up.

Documentation/devicetree/bindings/display/ht16k33.txt line 17

Quoted 4 lines
Documentation/devicetree/bindings/display/ht16k33.txt new file +4 -0
+
+Optional properties:
+- linux,no-autorepeat:	Disable keyrepeat.
+- default-brightness:	Initial brightness setting [0-15] (15 if not set).

default-brightness-level seem a bit more common.

Quoted 15 lines
Documentation/devicetree/bindings/display/ht16k33.txt new file +15 -0
+
+Example:
+
+&i2c1 {
+	ht16k33: ht16k33@70 {
+		compatible = "ht,ht16k33";
+		reg = <0x70>;
+		refresh-rate = <20>;
+		debounce-delay-ms = <50>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <5 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
+		linux,keymap = <
+			   MATRIX_KEY(2, 0, KEY_F6)
+			   MATRIX_KEY(3, 0, KEY_F8)
+			   MATRIX_KEY(4, 0, KEY_F0)

Documentation/devicetree/bindings/display/ht16k33.txt line 42

Quoted 10 lines
Documentation/devicetree/bindings/display/ht16k33.txt new file +10 -0
+			   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)
+			   >;
+	   };
+};

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#2 lore raw
Quoted 48 lines · On Fri, 12 Feb 2016 09:12:43 -0600 Rob Herring…
Quoted 32 lines · Robin van der Gracht

This is a driver for the Holtek HT16K33 LED controller with keyscan.

---
Changes in v2:
- Fixed build error reported by kbuild test robot by including
mm.h

 .../devicetree/bindings/display/ht16k33.txt        |  42 ++
 drivers/auxdisplay/Kconfig                         |   9 +
 drivers/auxdisplay/Makefile                        |   1 +
 drivers/auxdisplay/ht16k33.c                       | 573
+++++++++++++++++++++ 4 files changed, 625 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/display/ht16k33.txt create mode 100644 drivers/auxdisplay/ht16k33.c

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/display/ht16k33.txt new file mode 100644 index 0000000..45fbabb

Documentation/devicetree/bindings/display/ht16k33.txt new file +6 -0
@@ -0,0 +1,42 @@
+Holtek ht16k33 RAM mapping 16*8 LED controller driver with keyscan
+-------------------------------------------------------------------------------
+
+Required properties:
+- compatible:			"ht,ht16k33"
+- reg:					I2C slave address of

the chip. +- interrupt-parent: A phandle pointing to the
interrupt controller

Documentation/devicetree/bindings/display/ht16k33.txt new file +1 -0
+						serving the
Quoted 3 lines

interrupt for this chip. +- interrupts:
Interrupt specification for the key pressed interrupt. +-
refresh-rate: Display update interval in HZ.

Add units: "-hz"

Quoted 5 lines

+- debounce-delay-ms: Debouncing interval time in
microseconds. +- linux,keymap: The keymap
for keys as described in the binding

Documentation/devicetree/bindings/display/ht16k33.txt new file +1 -0
+						document

(devicetree/bindings/input/matrix-keymap.txt).

The alignment of the descriptions here seem to be random. Please line them up.

Quoted 8 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/ht16k33.txt new file +4 -0
+
+Optional properties:
+- linux,no-autorepeat:	Disable keyrepeat.
+- default-brightness:	Initial brightness setting [0-15] (15

if not set).

default-brightness-level seem a bit more common.

Thanks for reviewing Rob. I'll take your comments into account and resend an adjusted patch.

Best regards,

Signature · 9 lines
Robin van der Gracht
Protonic Holland
tel.: +31 (0) 229 212928
fax.: +31 (0) 229 210930
Factorij 36 / 1689 AL Zwaag
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html