All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion
@ 2021-01-18 12:35 Geert Uytterhoeven
  2021-01-18 12:35 ` [PATCH 1/3] dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2021-01-18 12:35 UTC (permalink / raw)
  To: Robin van der Gracht, Rob Herring, Miguel Ojeda Sandonis
  Cc: devicetree, linux-kernel, Geert Uytterhoeven

	Hi Robin, Rob, Miguel,

This patch series contains various updates for the Holtek HT16K33 LED
controller with keyscan DT bindings and driver:
  1. Make the keypad function optional, from an old patch by Robin that seem to
     have fallen through the cracks,
  2. Fix the default brightness range,
  3. Convert DT bindings to json-schema.

Thanks!

Geert Uytterhoeven (2):
  dt-bindings: auxdisplay: ht16k33: Fix default-brightness-level range
  dt-bindings: auxdisplay: ht16k33: Convert to json-schema

Robin van der Gracht (1):
  dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional

 .../bindings/auxdisplay/holtek,ht16k33.yaml   | 77 +++++++++++++++++++
 .../devicetree/bindings/display/ht16k33.txt   | 40 ----------
 MAINTAINERS                                   |  2 +-
 drivers/auxdisplay/ht16k33.c                  | 14 ++--
 4 files changed, 84 insertions(+), 49 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/ht16k33.txt

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional
  2021-01-18 12:35 [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion Geert Uytterhoeven
@ 2021-01-18 12:35 ` Geert Uytterhoeven
  2021-01-25 21:19   ` Miguel Ojeda
  2021-01-18 12:35 ` [PATCH 2/3] dt-bindings: auxdisplay: ht16k33: Fix default-brightness-level range Geert Uytterhoeven
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2021-01-18 12:35 UTC (permalink / raw)
  To: Robin van der Gracht, Rob Herring, Miguel Ojeda Sandonis
  Cc: devicetree, linux-kernel, Michael Kaplan, Geert Uytterhoeven

From: Robin van der Gracht <robin@protonic.nl>

Keyscan should be optional to support simple LED matrix displays (output
only).

Reported-by: Michael Kaplan <M.KAPLAN@evva.com>
Signed-off-by: Robin van der Gracht <robin@protonic.nl>
[geert: Rebased]
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 .../devicetree/bindings/display/ht16k33.txt        | 11 +++++++----
 drivers/auxdisplay/ht16k33.c                       | 14 ++++++--------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/ht16k33.txt b/Documentation/devicetree/bindings/display/ht16k33.txt
index d5a8b070b46779a4..3d602f5b9eb6bb74 100644
--- a/Documentation/devicetree/bindings/display/ht16k33.txt
+++ b/Documentation/devicetree/bindings/display/ht16k33.txt
@@ -4,16 +4,19 @@ Holtek ht16k33 RAM mapping 16*8 LED controller driver with keyscan
 Required properties:
 - compatible:		"holtek,ht16k33"
 - reg:			I2C slave address of the chip.
-- interrupts:		Interrupt specification for the key pressed interrupt.
 - refresh-rate-hz:	Display update interval in HZ.
-- debounce-delay-ms:	Debouncing interval time in milliseconds.
-- 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-level: Initial brightness level [0-15] (default: 15).
 
+- Keypad
+ Supply the 'interrupts' property to enable the keyscan feature.
+ - interrupts:		Interrupt specification for the key pressed interrupt.
+ - debounce-delay-ms:	Debouncing interval time in milliseconds.
+ - linux,keymap: 	The keymap for keys as described in the binding
+			document (devicetree/bindings/input/matrix-keymap.txt).
+
 Example:
 
 &i2c1 {
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index d951d54b26f5239b..444f3b1019e3d425 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -402,11 +402,6 @@ static int ht16k33_probe(struct i2c_client *client,
 		return -EIO;
 	}
 
-	if (client->irq <= 0) {
-		dev_err(&client->dev, "No IRQ specified\n");
-		return -EINVAL;
-	}
-
 	priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
@@ -459,9 +454,12 @@ static int ht16k33_probe(struct i2c_client *client,
 	if (err)
 		goto err_fbdev_info;
 
-	err = ht16k33_keypad_probe(client, &priv->keypad);
-	if (err)
-		goto err_fbdev_unregister;
+	/* Keypad */
+	if (client->irq > 0) {
+		err = ht16k33_keypad_probe(client, &priv->keypad);
+		if (err)
+			goto err_fbdev_unregister;
+	}
 
 	/* Backlight */
 	memset(&bl_props, 0, sizeof(struct backlight_properties));
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] dt-bindings: auxdisplay: ht16k33: Fix default-brightness-level range
  2021-01-18 12:35 [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion Geert Uytterhoeven
  2021-01-18 12:35 ` [PATCH 1/3] dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional Geert Uytterhoeven
@ 2021-01-18 12:35 ` Geert Uytterhoeven
  2021-01-25 21:20   ` Miguel Ojeda
  2021-01-18 12:35 ` [PATCH 3/3] dt-bindings: auxdisplay: ht16k33: Convert to json-schema Geert Uytterhoeven
  2021-01-18 13:36 ` [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion robin
  3 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2021-01-18 12:35 UTC (permalink / raw)
  To: Robin van der Gracht, Rob Herring, Miguel Ojeda Sandonis
  Cc: devicetree, linux-kernel, Geert Uytterhoeven

V4 changed the range from 0..15 to 1..16 in the driver, to match the
dimming set hardware register, but forgot to update the DT binding
documentation.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
v3: https://lore.kernel.org/linux-devicetree/1455788642-4289-1-git-send-email-robin@protonic.nl/
v4: https://lore.kernel.org/linux-devicetree/ae23cf26135a586440419aaa764f3a70de913c4a.1458140954.git.robin@protonic.nl/
---
 Documentation/devicetree/bindings/display/ht16k33.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/ht16k33.txt b/Documentation/devicetree/bindings/display/ht16k33.txt
index 3d602f5b9eb6bb74..ec43776970164921 100644
--- a/Documentation/devicetree/bindings/display/ht16k33.txt
+++ b/Documentation/devicetree/bindings/display/ht16k33.txt
@@ -8,7 +8,7 @@ Required properties:
 
 Optional properties:
 - linux,no-autorepeat:	Disable keyrepeat.
-- default-brightness-level: Initial brightness level [0-15] (default: 15).
+- default-brightness-level: Initial brightness level [1-16] (default: 16).
 
 - Keypad
  Supply the 'interrupts' property to enable the keyscan feature.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] dt-bindings: auxdisplay: ht16k33: Convert to json-schema
  2021-01-18 12:35 [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion Geert Uytterhoeven
  2021-01-18 12:35 ` [PATCH 1/3] dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional Geert Uytterhoeven
  2021-01-18 12:35 ` [PATCH 2/3] dt-bindings: auxdisplay: ht16k33: Fix default-brightness-level range Geert Uytterhoeven
@ 2021-01-18 12:35 ` Geert Uytterhoeven
  2021-01-25 21:20   ` Miguel Ojeda
  2021-01-18 13:36 ` [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion robin
  3 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2021-01-18 12:35 UTC (permalink / raw)
  To: Robin van der Gracht, Rob Herring, Miguel Ojeda Sandonis
  Cc: devicetree, linux-kernel, Geert Uytterhoeven

Convert the Holtek HT16K33 LED controller with keyscan Device Tree
binding documentation to json-schema.

Move the file from display to auxdisplay.
Update the example:
  - Sort properties in order of documentation,
  - Group tuples using angle brackets to improve human readability and
    enable automatic validation.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 .../bindings/auxdisplay/holtek,ht16k33.yaml   | 77 +++++++++++++++++++
 .../devicetree/bindings/display/ht16k33.txt   | 43 -----------
 MAINTAINERS                                   |  2 +-
 3 files changed, 78 insertions(+), 44 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml
 delete mode 100644 Documentation/devicetree/bindings/display/ht16k33.txt

diff --git a/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml b/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml
new file mode 100644
index 0000000000000000..64ffff460026040f
--- /dev/null
+++ b/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/auxdisplay/holtek,ht16k33.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Holtek HT16K33 RAM mapping 16*8 LED controller with keyscan
+
+maintainers:
+  - Robin van der Gracht <robin@protonic.nl>
+
+allOf:
+  - $ref: "/schemas/input/matrix-keymap.yaml#"
+
+properties:
+  compatible:
+    const: holtek,ht16k33
+
+  reg:
+    maxItems: 1
+
+  refresh-rate-hz:
+    maxItems: 1
+    description: Display update interval in Hertz
+
+  interrupts:
+    maxItems: 1
+
+  debounce-delay-ms:
+    maxItems: 1
+    description: Debouncing interval time in milliseconds
+
+  linux,keymap: true
+
+  linux,no-autorepeat:
+    description: Disable keyrepeat
+
+  default-brightness-level:
+    minimum: 1
+    maximum: 16
+    default: 16
+    description: Initial brightness level
+
+required:
+  - compatible
+  - reg
+  - refresh-rate-hz
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/input/input.h>
+    i2c1 {
+            #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)>;
+            };
+      };
diff --git a/Documentation/devicetree/bindings/display/ht16k33.txt b/Documentation/devicetree/bindings/display/ht16k33.txt
deleted file mode 100644
index ec43776970164921..0000000000000000
--- a/Documentation/devicetree/bindings/display/ht16k33.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-Holtek ht16k33 RAM mapping 16*8 LED controller driver with keyscan
--------------------------------------------------------------------------------
-
-Required properties:
-- compatible:		"holtek,ht16k33"
-- reg:			I2C slave address of the chip.
-- refresh-rate-hz:	Display update interval in HZ.
-
-Optional properties:
-- linux,no-autorepeat:	Disable keyrepeat.
-- default-brightness-level: Initial brightness level [1-16] (default: 16).
-
-- Keypad
- Supply the 'interrupts' property to enable the keyscan feature.
- - interrupts:		Interrupt specification for the key pressed interrupt.
- - debounce-delay-ms:	Debouncing interval time in milliseconds.
- - linux,keymap: 	The keymap for keys as described in the binding
-			document (devicetree/bindings/input/matrix-keymap.txt).
-
-Example:
-
-&i2c1 {
-	ht16k33: ht16k33@70 {
-		compatible = "holtek,ht16k33";
-		reg = <0x70>;
-		refresh-rate-hz = <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_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)
-		>;
-	};
-};
diff --git a/MAINTAINERS b/MAINTAINERS
index cc1e6a5ee6e67357..aeb209ad82496d06 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8160,7 +8160,7 @@ F:	net/hsr/
 HT16K33 LED CONTROLLER DRIVER
 M:	Robin van der Gracht <robin@protonic.nl>
 S:	Maintained
-F:	Documentation/devicetree/bindings/display/ht16k33.txt
+F:	Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml
 F:	drivers/auxdisplay/ht16k33.c
 
 HTCPEN TOUCHSCREEN DRIVER
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion
  2021-01-18 12:35 [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2021-01-18 12:35 ` [PATCH 3/3] dt-bindings: auxdisplay: ht16k33: Convert to json-schema Geert Uytterhoeven
@ 2021-01-18 13:36 ` robin
  2021-01-23 12:47   ` Miguel Ojeda
  3 siblings, 1 reply; 9+ messages in thread
From: robin @ 2021-01-18 13:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Miguel Ojeda Sandonis, devicetree, linux-kernel

Hi Geert,

Thank you for (re-)submitting your patches!

On 2021-01-18 13:35, Geert Uytterhoeven wrote:
> Hi Robin, Rob, Miguel,
> 
> This patch series contains various updates for the Holtek HT16K33 LED
> controller with keyscan DT bindings and driver:
>   1. Make the keypad function optional, from an old patch by Robin that 
> seem to
>      have fallen through the cracks,

Thanks for digging this up. Not sure why this was dropped. I still think 
it's usefull.

>   2. Fix the default brightness range,

Seems to match MIN/MAX_BRIGHTNESS now.
Acked-by: Robin van der Gracht <robin@protonic.nl>

Robin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion
  2021-01-18 13:36 ` [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion robin
@ 2021-01-23 12:47   ` Miguel Ojeda
  0 siblings, 0 replies; 9+ messages in thread
From: Miguel Ojeda @ 2021-01-23 12:47 UTC (permalink / raw)
  To: Robin van der Gracht
  Cc: Geert Uytterhoeven, Rob Herring, devicetree, linux-kernel

On Mon, Jan 18, 2021 at 2:36 PM robin <robin@protonic.nl> wrote:
>
> Thanks for digging this up. Not sure why this was dropped. I still think
> it's usefull.

Not intentional -- probably slipped, sorry.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional
  2021-01-18 12:35 ` [PATCH 1/3] dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional Geert Uytterhoeven
@ 2021-01-25 21:19   ` Miguel Ojeda
  0 siblings, 0 replies; 9+ messages in thread
From: Miguel Ojeda @ 2021-01-25 21:19 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Robin van der Gracht, Rob Herring, devicetree, linux-kernel,
	Michael Kaplan

On Mon, Jan 18, 2021 at 1:35 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> From: Robin van der Gracht <robin@protonic.nl>
>
> Keyscan should be optional to support simple LED matrix displays (output
> only).

Applied to -next, thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] dt-bindings: auxdisplay: ht16k33: Fix default-brightness-level range
  2021-01-18 12:35 ` [PATCH 2/3] dt-bindings: auxdisplay: ht16k33: Fix default-brightness-level range Geert Uytterhoeven
@ 2021-01-25 21:20   ` Miguel Ojeda
  0 siblings, 0 replies; 9+ messages in thread
From: Miguel Ojeda @ 2021-01-25 21:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Robin van der Gracht, Rob Herring, devicetree, linux-kernel

On Mon, Jan 18, 2021 at 1:35 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> V4 changed the range from 0..15 to 1..16 in the driver, to match the
> dimming set hardware register, but forgot to update the DT binding
> documentation.

Applied to -next, thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] dt-bindings: auxdisplay: ht16k33: Convert to json-schema
  2021-01-18 12:35 ` [PATCH 3/3] dt-bindings: auxdisplay: ht16k33: Convert to json-schema Geert Uytterhoeven
@ 2021-01-25 21:20   ` Miguel Ojeda
  0 siblings, 0 replies; 9+ messages in thread
From: Miguel Ojeda @ 2021-01-25 21:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Robin van der Gracht, Rob Herring, devicetree, linux-kernel

On Mon, Jan 18, 2021 at 1:35 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Convert the Holtek HT16K33 LED controller with keyscan Device Tree
> binding documentation to json-schema.

Applied to -next, thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-25 21:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 12:35 [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion Geert Uytterhoeven
2021-01-18 12:35 ` [PATCH 1/3] dt-bindings: auxdisplay: ht16k33: Keyscan function should be optional Geert Uytterhoeven
2021-01-25 21:19   ` Miguel Ojeda
2021-01-18 12:35 ` [PATCH 2/3] dt-bindings: auxdisplay: ht16k33: Fix default-brightness-level range Geert Uytterhoeven
2021-01-25 21:20   ` Miguel Ojeda
2021-01-18 12:35 ` [PATCH 3/3] dt-bindings: auxdisplay: ht16k33: Convert to json-schema Geert Uytterhoeven
2021-01-25 21:20   ` Miguel Ojeda
2021-01-18 13:36 ` [PATCH 0/3] auxdisplay: ht16k33: Improvement, fix, and json-schema conversion robin
2021-01-23 12:47   ` Miguel Ojeda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.