Skip to contentSkip to conversation

auxdisplay: Add support for the Titanmec TM1628 7 segment display controller

PATCH Superseded Heiner Kallweit 5 participants 18 messages Feb 21, 2022 – Feb 22, 2022

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover auxdisplay: Add support for the Titanmec TM1628 7 segment display controller

This series adds support for the Titanmec TM1628 7 segment display controller. It's based on previous RFC work from Andreas Färber. The RFC version placed the driver in the LED subsystem, but this was NAK'ed by the LED maintainer. Therefore I moved the driver to /drivers/auxdisplay what seems most reasonable to me.

To be decided is through which tree this series should go. I'd think SPI would be most suited, but that's a decision I leave up to the respective maintainers.

Further changes to the RFC version:
- Driver can be built also w/o LED class support, for displays that don't have any symbols to be exposed as LED's.
- Simplified the code and rewrote a lot of it.
- Driver is now kind of a MVP, but functionality should be sufficient for most use cases.
- Use the existing 7 segment support in uapi/linux/map_to_7segment.h as suggested by Geert Uytterhoeven.

Note: There's a number of chips from other manufacturers that are
almost identical, e.g. FD628, SM1628. Only difference I saw so far is that they partially support other display modes.
TM1628: 6x12, 7x11
SM1628C: 4x13, 5x12, 6x11, 7x10
For typical displays on devices using these chips this difference shouldn't matter.

Successfully tested on a TX3 Mini TV box that has an SM1628C and a display with 4 digits and 7 symbols.

v2:
- (re-)add Andreas' SoB to two patches
- fix YAML issues
- include ctype.h explicitly
- add info message in probe()

Andreas Färber (2):
spi: gpio: Implement LSB First bitbang support
dt-bindings: vendor-prefixes: Add Titan Micro Electronics

Heiner Kallweit (4):
dt-bindings: auxdisplay: Add Titan Micro Electronics TM1628
docs: ABI: document tm1628 attribute display-text
auxdisplay: add support for Titanmec TM1628 7 segment display
controller
arm64: dts: meson-gxl-s905w-tx3-mini: add support for the 7 segment
display

 .../testing/sysfs-devices-auxdisplay-tm1628   |   7 +
 .../bindings/auxdisplay/titanmec,tm1628.yaml  |  88 ++++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 .../dts/amlogic/meson-gxl-s905w-tx3-mini.dts  |  59 +++
 drivers/auxdisplay/Kconfig                    |  10 +
 drivers/auxdisplay/Makefile                   |   1 +
 drivers/auxdisplay/tm1628.c                   | 376 ++++++++++++++++++
 drivers/spi/spi-bitbang-txrx.h                |  66 +++
 drivers/spi/spi-gpio.c                        |  42 +-
 9 files changed, 642 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-devices-auxdisplay-tm1628
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml
 create mode 100644 drivers/auxdisplay/tm1628.c
Signature · 1 line
2.35.1
#1 lore raw

PATCH v2 1/6 spi: gpio: Implement LSB First bitbang support

From: Andreas Färber <[email protected]>

Add support for slave DT property spi-lsb-first, i.e., SPI_LSB_FIRST mode. Duplicate the inline helpers bitbang_txrx_be_cpha{0,1} as LE versions. Conditionally call them from all the spi-gpio txrx_word callbacks.

Some alternatives to this implementation approach were discussed back then [0], but eventually it was considered reasonable.

[0] https://lore.kernel.org/linux-arm-kernel/[email protected]/

---
 drivers/spi/spi-bitbang-txrx.h | 66 ++++++++++++++++++++++++++++++++++
 drivers/spi/spi-gpio.c         | 42 +++++++++++++++++-----
 2 files changed, 99 insertions(+), 9 deletions(-)
drivers/spi/spi-bitbang-txrx.h +66 -0
index ae61d72c7..267342dfa 100644
@@ -41,6 +41,8 @@
  * chips need ... there may be several reasons you'd need to tweak timings
  * in these routines, not just to make it faster or slower to match a
  * particular CPU clock rate.
+ *
+ * ToDo: Maybe the bitrev macros can be used to improve the code?
  */
 
 static inline u32
@@ -106,3 +108,67 @@ bitbang_txrx_be_cpha1(struct spi_device *spi,
 	}
 	return word;
 }
+
+static inline u32
+bitbang_txrx_le_cpha0(struct spi_device *spi,
+		unsigned int nsecs, unsigned int cpol, unsigned int flags,
+		u32 word, u8 bits)
+{
+	/* if (cpol == 0) this is SPI_MODE_0; else this is SPI_MODE_2 */
+
+	u32 oldbit = !(word & 1);
+	/* clock starts at inactive polarity */
+	for (; likely(bits); bits--) {
+
+		/* setup LSB (to slave) on trailing edge */
+		if ((flags & SPI_MASTER_NO_TX) == 0) {
+			if ((word & 1) != oldbit) {
+				setmosi(spi, word & 1);
+				oldbit = word & 1;
+			}
+		}
+		spidelay(nsecs);	/* T(setup) */
+
+		setsck(spi, !cpol);
+		spidelay(nsecs);
+
+		/* sample LSB (from slave) on leading edge */
+		word >>= 1;
+		if ((flags & SPI_MASTER_NO_RX) == 0)
+			word |= getmiso(spi) << (bits - 1);
+		setsck(spi, cpol);
+	}
+	return word;
+}
+
+static inline u32
+bitbang_txrx_le_cpha1(struct spi_device *spi,
+		unsigned int nsecs, unsigned int cpol, unsigned int flags,
+		u32 word, u8 bits)
+{
+	/* if (cpol == 0) this is SPI_MODE_1; else this is SPI_MODE_3 */
+
+	u32 oldbit = !(word & 1);
+	/* clock starts at inactive polarity */
+	for (; likely(bits); bits--) {
+
+		/* setup LSB (to slave) on leading edge */
+		setsck(spi, !cpol);
+		if ((flags & SPI_MASTER_NO_TX) == 0) {
+			if ((word & 1) != oldbit) {
+				setmosi(spi, word & 1);
+				oldbit = word & 1;
+			}
+		}
+		spidelay(nsecs); /* T(setup) */
+
+		setsck(spi, cpol);
+		spidelay(nsecs);
+
+		/* sample LSB (from slave) on trailing edge */
+		word >>= 1;
+		if ((flags & SPI_MASTER_NO_RX) == 0)
+			word |= getmiso(spi) << (bits - 1);
+	}
+	return word;
+}
drivers/spi/spi-gpio.c +33 -9

93 lines not on this page · raw message

Signature · 1 line
2.35.1
#2 lore raw

PATCH v2 2/6 dt-bindings: vendor-prefixes: Add Titan Micro Electronics

In reply to Heiner Kallweit

From: Andreas Färber <[email protected]>

Assign vendor prefix "titanmec", matching their domain name.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index ebe294516..38bfb462c 100644
@@ -1229,6 +1229,8 @@ patternProperties:
     description: Texas Instruments
   "^tianma,.*":
     description: Tianma Micro-electronics Co., Ltd.
+  "^titanmec,.*":
+    description: Shenzhen Titan Micro Electronics Co., Ltd.
   "^tlm,.*":
     description: Trusted Logic Mobility
   "^tmt,.*":
Signature · 1 line
2.35.1
#3 lore raw

PATCH v2 3/6 dt-bindings: auxdisplay: Add Titan Micro Electronics TM1628

In reply to Heiner Kallweit

Add a YAML schema binding for TM1628 auxdisplay
(7/11-segment LED) controller.

This patch is partially based on previous RFC work from Andreas Färber <[email protected]>.

---
v2:
- (re-)add Andreas' SoB
- fix YAML errors reported by Rob

---
 .../bindings/auxdisplay/titanmec,tm1628.yaml  | 88 +++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml
Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml new file +88 -0
new file mode 100644
index 000000000..da7cc16e7
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/auxdisplay/titanmec,tm1628.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Titan Micro Electronics TM1628 LED controller
+
+maintainers:
+  - Andreas Färber <[email protected]>
+  - Heiner Kallweit <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - titanmec,tm1628
+
+  reg:
+    maxItems: 1
+
+  grid:
+    description:
+      Mapping of display digit position to grid number.
+      This implicitly defines the display size.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    minItems: 1
+    maxItems: 7
+
+  segment-mapping:
+    description:
+      Mapping of 7 segment display segments A-G to bit numbers 1-12.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    minItems: 7
+    maxItems: 7
+
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+
+patternProperties:
+  "^.*@[1-7],([1-9]|1[0-6])$":
+    type: object
+    description: |
+      Properties for a single LED.
+
+    properties:
+      reg:
+        description: |
+          1-based grid number, followed by 1-based segment bit number.
+        maxItems: 1
+
+    required:
+      - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led-controller@0 {
+            compatible = "titanmec,tm1628";
+            reg = <0>;
+            spi-3-wire;
+            spi-lsb-first;
+            spi-max-frequency = <500000>;
+            grid = /bits/ 8 <4 3 2 1>;
+            segment-mapping = /bits/ 8 <4 5 6 1 2 3 7>;
+            #address-cells = <2>;
+            #size-cells = <0>;
+
+            alarmn@5,4 {
+                reg = <5 4>;
+                function = LED_FUNCTION_ALARM;
+            };
+        };
+    };
+...
Signature · 1 line
2.35.1
#7 lore raw

PATCH v2 4/6 docs: ABI: document tm1628 attribute display-text

In reply to Heiner Kallweit

Document the attribute for reading / writing the text to be displayed on the 7 segment display.

---
 Documentation/ABI/testing/sysfs-devices-auxdisplay-tm1628 | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-devices-auxdisplay-tm1628
Documentation/ABI/testing/sysfs-devices-auxdisplay-tm1628 new file +7 -0
new file mode 100644
index 000000000..382757e72
@@ -0,0 +1,7 @@
+What:		/sys/devices/.../display-text
+Date:		February 2022
+Contact:	Heiner Kallweit <[email protected]>
+Description:
+		The text to be displayed on the 7 segment display.
+		Any printable character is allowed as input, but some
+		can not be displayed in a readable way with 7 segments.
Signature · 1 line
2.35.1
#14 lore raw

PATCH v2 6/6 arm64: dts: meson-gxl-s905w-tx3-mini: add support for the 7 segment display

In reply to Heiner Kallweit

This patch adds support for the 7 segment display of the device.

---
 .../dts/amlogic/meson-gxl-s905w-tx3-mini.dts  | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl-s905w-tx3-mini.dts +59 -0
index 6705c2082..20bbd931e 100644
@@ -10,6 +10,7 @@
 
 #include "meson-gxl-s905x.dtsi"
 #include "meson-gx-p23x-q20x.dtsi"
+#include <dt-bindings/leds/common.h>
 
 / {
 	compatible = "oranth,tx3-mini", "amlogic,s905w", "amlogic,meson-gxl";
@@ -19,6 +20,64 @@ memory@0 {
 		device_type = "memory";
 		reg = <0x0 0x0 0x0 0x40000000>; /* 1 GiB or 2 GiB */
 	};
+
+	spi {
+		compatible = "spi-gpio";
+		sck-gpios = <&gpio GPIODV_27  GPIO_ACTIVE_HIGH>;
+		mosi-gpios = <&gpio GPIODV_26 GPIO_ACTIVE_HIGH>;
+		cs-gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
+		num-chipselects = <1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		tm1628: led-controller@0 {
+			compatible = "titanmec,tm1628";
+			reg = <0>;
+			spi-3wire;
+			spi-lsb-first;
+			spi-rx-delay-us = <1>;
+			spi-max-frequency = <500000>;
+			#address-cells = <2>;
+			#size-cells = <0>;
+
+			segment-mapping = /bits/ 8 <4 5 6 1 2 3 7>;
+			grid = /bits/ 8 <4 3 2 1>;
+
+			alarm@5,1 {
+				reg = <5 1>;
+				function = LED_FUNCTION_ALARM;
+			};
+
+			usb@5,2 {
+				reg = <5 2>;
+				function = LED_FUNCTION_USB;
+			};
+			play@5,3 {
+				reg = <5 3>;
+				function = "play";
+			};
+
+			pause@5,4 {
+				reg = <5 4>;
+				function = "pause";
+			};
+
+			colon@5,5 {
+				reg = <5 5>;
+				function = "colon";
+			};
+
+			lan@5,6 {
+				reg = <5 6>;
+				function = LED_FUNCTION_LAN;
+			};
+
+			wlan@5,7 {
+				reg = <5 7>;
+				function = LED_FUNCTION_WLAN;
+			};
+		};
+	};
 };
 
 &ir {
Signature · 1 line
2.35.1
#9 lore raw

PATCH v2 5/6 auxdisplay: add support for Titanmec TM1628 7 segment display controller

In reply to Heiner Kallweit

This patch adds support for the Titanmec TM1628 7 segment display controller. It's based on previous RFC work from Andreas Färber. The RFC version placed the driver in the LED subsystem, but this was NAK'ed by the LED maintainer. Therefore I moved the driver to /drivers/auxdisplay what seems most reasonable to me.

Further changes to the RFC version:
- Driver can be built also w/o LED class support, for displays that don't have any symbols to be exposed as LED's.
- Simplified the code and rewrote a lot of it.
- Driver is now kind of a MVP, but functionality should be sufficient for most use cases.
- Use the existing 7 segment support in uapi/linux/map_to_7segment.h as suggested by Geert Uytterhoeven.

Note: There's a number of chips from other manufacturers that are
almost identical, e.g. FD628, SM1628. Only difference I saw so far is that they partially support other display modes.
TM1628: 6x12, 7x11
SM1628C: 4x13, 5x12, 6x11, 7x10
For typical displays on devices using these chips this difference shouldn't matter.

Successfully tested on a TX3 Mini TV box that has an SM1628C and a display with 4 digits and 7 symbols.

---
v2:
- include ctype.h explicitly
- add info message in probe()
- (re-)add Andreas' SoB

---
 drivers/auxdisplay/Kconfig  |  10 +
 drivers/auxdisplay/Makefile |   1 +
 drivers/auxdisplay/tm1628.c | 376 ++++++++++++++++++++++++++++++++++++
 3 files changed, 387 insertions(+)
 create mode 100644 drivers/auxdisplay/tm1628.c
drivers/auxdisplay/Kconfig +10 -0
index 64012cda4..25ef2e452 100644
@@ -203,6 +203,16 @@ config ARM_CHARLCD
 	  line and the Linux version on the second line, but that's
 	  still useful.
 
+config TM1628
+	tristate "TM1628 driver for LED 7/11 segment displays"
+	depends on SPI
+	depends on OF || COMPILE_TEST
+	help
+	  Say Y to enable support for Titan Micro Electronics TM1628
+	  LED controller.
+	  It's a 3-wire SPI device controlling a two-dimensional grid of
+	  LEDs. Dimming is applied to all outputs through an internal PWM.
+
 menuconfig PARPORT_PANEL
 	tristate "Parallel port LCD/Keypad Panel support"
 	depends on PARPORT
drivers/auxdisplay/Makefile +1 -0
index 6968ed4d3..7728e17e1 100644
@@ -14,3 +14,4 @@ obj-$(CONFIG_HT16K33)		+= ht16k33.o
 obj-$(CONFIG_PARPORT_PANEL)	+= panel.o
 obj-$(CONFIG_LCD2S)		+= lcd2s.o
 obj-$(CONFIG_LINEDISP)		+= line-display.o
+obj-$(CONFIG_TM1628)		+= tm1628.o
drivers/auxdisplay/tm1628.c new file +376 -0

376 lines not on this page · raw message

Signature · 1 line
2.35.1
#15 lore raw
In reply to Heiner Kallweit
Quoted 3 lines · Heiner Kallweit

v2:
- (re-)add Andreas' SoB to two patches

But those were also developed by you too, right? i.e. it should have a Co-developed-by too, otherwise it looks like you only handled the patch:

```
Example of a patch submitted by the From: author::

        <changelog>

        Co-developed-by: First Co-Author <[email protected]>
        Signed-off-by: First Co-Author <[email protected]>
        Co-developed-by: Second Co-Author <[email protected]>
        Signed-off-by: Second Co-Author <[email protected]>
        Signed-off-by: From Author <[email protected]>
```

Cheers,
Miguel

#16 lore raw
Quoted 9 lines · Miguel Ojeda
Quoted 3 lines · Heiner Kallweit

v2:
- (re-)add Andreas' SoB to two patches

But those were also developed by you too, right? i.e. it should have a Co-developed-by too, otherwise it looks like you only handled the patch:

Right, about half of the original code was reworked. Let's see whether and which feedback comes for v2. If a v3 should be needed, I'll follow your suggestion.

Quoted 12 lines
```
Example of a patch submitted by the From: author::

        <changelog>

        Co-developed-by: First Co-Author <[email protected]>
        Signed-off-by: First Co-Author <[email protected]>
        Co-developed-by: Second Co-Author <[email protected]>
        Signed-off-by: Second Co-Author <[email protected]>
        Signed-off-by: From Author <[email protected]>
```
Quoted 2 lines

Cheers,
Miguel

Heiner

#10 lore raw

Re: [PATCH v2 5/6] auxdisplay: add support for Titanmec TM1628 7 segment display controller

In reply to Heiner Kallweit

Hi Heiner,

Quoted 23 lines · Heiner Kallweit

This patch adds support for the Titanmec TM1628 7 segment display controller. It's based on previous RFC work from Andreas Färber. The RFC version placed the driver in the LED subsystem, but this was NAK'ed by the LED maintainer. Therefore I moved the driver to /drivers/auxdisplay what seems most reasonable to me.

Further changes to the RFC version:
- Driver can be built also w/o LED class support, for displays that don't have any symbols to be exposed as LED's.
- Simplified the code and rewrote a lot of it.
- Driver is now kind of a MVP, but functionality should be sufficient for most use cases.
- Use the existing 7 segment support in uapi/linux/map_to_7segment.h as suggested by Geert Uytterhoeven.

Note: There's a number of chips from other manufacturers that are
almost identical, e.g. FD628, SM1628. Only difference I saw so far is that they partially support other display modes.
TM1628: 6x12, 7x11
SM1628C: 4x13, 5x12, 6x11, 7x10
For typical displays on devices using these chips this difference shouldn't matter.

Quoted 6 lines

Successfully tested on a TX3 Mini TV box that has an SM1628C and a display with 4 digits and 7 symbols.

Thanks for your patch!

drivers/auxdisplay/tm1628.c line 112

Quoted 6 lines
drivers/auxdisplay/tm1628.c new file +3 -0
 
+static int tm1628_show_text(struct tm1628 *s)
+{
+       static SEG7_CONVERSION_MAP(map_seg7, MAP_ASCII7SEG_ALPHANUM);

This mapping can not be overridden by the user. Is there any specific reason you didn't make the mapping configurable from sysfs, cfr. map_seg7_{show,store}() in include/uapi/linux/map_to_7segment.h?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#8 lore raw

Re: [PATCH v2 4/6] docs: ABI: document tm1628 attribute display-text

In reply to Heiner Kallweit

Hi Heiner,

Quoted 4 lines · Heiner Kallweit

Document the attribute for reading / writing the text to be displayed on the 7 segment display.

Thanks for your patch!

Documentation/ABI/testing/sysfs-devices-auxdisplay-tm1628 line 7

Quoted 10 lines
Documentation/ABI/testing/sysfs-devices-auxdisplay-tm1628 new file +7 -0
@@ -0,0 +1,7 @@
+What:          /sys/devices/.../display-text
+Date:          February 2022
+Contact:       Heiner Kallweit <[email protected]>
+Description:
+               The text to be displayed on the 7 segment display.
+               Any printable character is allowed as input, but some
+               can not be displayed in a readable way with 7 segments.

Hence you may want to make the mapping configurable, cfr. MAP_TO_SEG7_SYSFS_FILE in include/uapi/linux/map_to_7segment.h?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#11 lore raw

Re: [PATCH v2 5/6] auxdisplay: add support for Titanmec TM1628 7 segment display controller

In reply to Geert Uytterhoeven
Quoted 38 lines · Geert Uytterhoeven

Hi Heiner,

Quoted 23 lines · Heiner Kallweit

This patch adds support for the Titanmec TM1628 7 segment display controller. It's based on previous RFC work from Andreas Färber. The RFC version placed the driver in the LED subsystem, but this was NAK'ed by the LED maintainer. Therefore I moved the driver to /drivers/auxdisplay what seems most reasonable to me.

Further changes to the RFC version:
- Driver can be built also w/o LED class support, for displays that don't have any symbols to be exposed as LED's.
- Simplified the code and rewrote a lot of it.
- Driver is now kind of a MVP, but functionality should be sufficient for most use cases.
- Use the existing 7 segment support in uapi/linux/map_to_7segment.h as suggested by Geert Uytterhoeven.

Note: There's a number of chips from other manufacturers that are
almost identical, e.g. FD628, SM1628. Only difference I saw so far is that they partially support other display modes.
TM1628: 6x12, 7x11
SM1628C: 4x13, 5x12, 6x11, 7x10
For typical displays on devices using these chips this difference shouldn't matter.

Quoted 6 lines

Successfully tested on a TX3 Mini TV box that has an SM1628C and a display with 4 digits and 7 symbols.

Thanks for your patch!

Quoted 2 lines
drivers/auxdisplay/tm1628.c new file +0 -0
Quoted 8 lines

drivers/auxdisplay/tm1628.c line 112

Quoted 3 lines
drivers/auxdisplay/tm1628.c new file +3 -0
+static int tm1628_show_text(struct tm1628 *s)
+{
+       static SEG7_CONVERSION_MAP(map_seg7, MAP_ASCII7SEG_ALPHANUM);

This mapping can not be overridden by the user. Is there any specific reason you didn't make the mapping configurable from sysfs, cfr. map_seg7_{show,store}() in include/uapi/linux/map_to_7segment.h?

The more features an initial driver version includes, the more discussion topics pop up and make it less likely that we end up with at least something. I think there's a reason why the driver was resting since the initial attempt 2 yrs ago. Therefore I'd like to keep it as a MVP.
If somebody should have the need for add-on features, then they can be added later.

Quoted 4 lines

Gr{oetje,eeting}s,

Geert

Heiner

Quoted 6 lines

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#12 lore raw

Re: [PATCH v2 5/6] auxdisplay: add support for Titanmec TM1628 7 segment display controller

Quoted 48 lines · Heiner Kallweit
Quoted 38 lines · Geert Uytterhoeven

Hi Heiner,

Quoted 23 lines · Heiner Kallweit

This patch adds support for the Titanmec TM1628 7 segment display controller. It's based on previous RFC work from Andreas Färber. The RFC version placed the driver in the LED subsystem, but this was NAK'ed by the LED maintainer. Therefore I moved the driver to /drivers/auxdisplay what seems most reasonable to me.

Further changes to the RFC version:
- Driver can be built also w/o LED class support, for displays that don't have any symbols to be exposed as LED's.
- Simplified the code and rewrote a lot of it.
- Driver is now kind of a MVP, but functionality should be sufficient for most use cases.
- Use the existing 7 segment support in uapi/linux/map_to_7segment.h as suggested by Geert Uytterhoeven.

Note: There's a number of chips from other manufacturers that are
almost identical, e.g. FD628, SM1628. Only difference I saw so far is that they partially support other display modes.
TM1628: 6x12, 7x11
SM1628C: 4x13, 5x12, 6x11, 7x10
For typical displays on devices using these chips this difference shouldn't matter.

Quoted 6 lines

Successfully tested on a TX3 Mini TV box that has an SM1628C and a display with 4 digits and 7 symbols.

Thanks for your patch!

Quoted 2 lines
drivers/auxdisplay/tm1628.c new file +0 -0
Quoted 8 lines

drivers/auxdisplay/tm1628.c line 112

Quoted 3 lines
drivers/auxdisplay/tm1628.c new file +3 -0
+static int tm1628_show_text(struct tm1628 *s)
+{
+       static SEG7_CONVERSION_MAP(map_seg7, MAP_ASCII7SEG_ALPHANUM);

This mapping can not be overridden by the user. Is there any specific reason you didn't make the mapping configurable from sysfs, cfr. map_seg7_{show,store}() in include/uapi/linux/map_to_7segment.h?

Quoted 6 lines

The more features an initial driver version includes, the more discussion topics pop up and make it less likely that we end up with at least something. I think there's a reason why the driver was resting since the initial attempt 2 yrs ago. Therefore I'd like to keep it as a MVP.
If somebody should have the need for add-on features, then they can be added later.

As I pointed out in your v1, I did implement all that already, as was requested by Geert on my RFC:

https://github.com/afaerber/linux/commit/bbecf951348c7de8ba922c6c002a09369b717d82

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Ivo Totev
HRB 36809 (AG Nürnberg)
#17 lore raw
In reply to Heiner Kallweit
Quoted 6 lines · Heiner Kallweit
Quoted 5 lines · Miguel Ojeda
Quoted 3 lines · Heiner Kallweit

v2:
- (re-)add Andreas' SoB to two patches

Quoted 8 lines
Quoted 4 lines

But those were also developed by you too, right? i.e. it should have a Co-developed-by too, otherwise it looks like you only handled the patch:

Right, about half of the original code was reworked. Let's see whether and which feedback comes for v2. If a v3 should be needed, I'll follow your suggestion.

The dispute is that he apparently only looked at my RFC but didn't ask me or check himself for newer code, which there was.

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Ivo Totev
HRB 36809 (AG Nürnberg)
#13 lore raw

Re: [PATCH v2 5/6] auxdisplay: add support for Titanmec TM1628 7 segment display controller

In reply to Andreas Färber
Quoted 56 lines · Andreas Färber
Quoted 48 lines · Heiner Kallweit
Quoted 38 lines · Geert Uytterhoeven

Hi Heiner,

Quoted 23 lines · Heiner Kallweit

This patch adds support for the Titanmec TM1628 7 segment display controller. It's based on previous RFC work from Andreas Färber. The RFC version placed the driver in the LED subsystem, but this was NAK'ed by the LED maintainer. Therefore I moved the driver to /drivers/auxdisplay what seems most reasonable to me.

Further changes to the RFC version:
- Driver can be built also w/o LED class support, for displays that don't have any symbols to be exposed as LED's.
- Simplified the code and rewrote a lot of it.
- Driver is now kind of a MVP, but functionality should be sufficient for most use cases.
- Use the existing 7 segment support in uapi/linux/map_to_7segment.h as suggested by Geert Uytterhoeven.

Note: There's a number of chips from other manufacturers that are
almost identical, e.g. FD628, SM1628. Only difference I saw so far is that they partially support other display modes.
TM1628: 6x12, 7x11
SM1628C: 4x13, 5x12, 6x11, 7x10
For typical displays on devices using these chips this difference shouldn't matter.

Quoted 6 lines

Successfully tested on a TX3 Mini TV box that has an SM1628C and a display with 4 digits and 7 symbols.

Thanks for your patch!

Quoted 2 lines
drivers/auxdisplay/tm1628.c new file +0 -0
Quoted 8 lines

drivers/auxdisplay/tm1628.c line 112

Quoted 3 lines
drivers/auxdisplay/tm1628.c new file +3 -0
+static int tm1628_show_text(struct tm1628 *s)
+{
+       static SEG7_CONVERSION_MAP(map_seg7, MAP_ASCII7SEG_ALPHANUM);

This mapping can not be overridden by the user. Is there any specific reason you didn't make the mapping configurable from sysfs, cfr. map_seg7_{show,store}() in include/uapi/linux/map_to_7segment.h?

Quoted 6 lines

The more features an initial driver version includes, the more discussion topics pop up and make it less likely that we end up with at least something. I think there's a reason why the driver was resting since the initial attempt 2 yrs ago. Therefore I'd like to keep it as a MVP.
If somebody should have the need for add-on features, then they can be added later.

Quoted 5 lines

As I pointed out in your v1, I did implement all that already, as was requested by Geert on my RFC:

https://github.com/afaerber/linux/commit/bbecf951348c7de8ba922c6c002a09369b717d82

I don't want to prove how many API's I master, but give users what they need. And that's simply:
- control symbols from kernel or user space -> LED class sysfs attributes / triggers
- write text (mainly numbers) to display -> sysfs attribute
And this with a minimum of code to facilitate maintenance.
As confirmed by Christian the proposed version gives him what he needs.

If there should be actually a demand for features like dimming control, then it can be added later (e.g. you could add it based on the code you wrote already).

Quoted 3 lines

Regards,
Andreas

Heiner

maintainer
#4 lore raw

Re: [PATCH v2 3/6] dt-bindings: auxdisplay: Add Titan Micro Electronics TM1628

In reply to Heiner Kallweit
Quoted 8 lines · Heiner Kallweit

Add a YAML schema binding for TM1628 auxdisplay
(7/11-segment LED) controller.

This patch is partially based on previous RFC work from Andreas Färber <[email protected]>.

Quoted 9 lines

---
v2:
- (re-)add Andreas' SoB
- fix YAML errors reported by Rob

---
 .../bindings/auxdisplay/titanmec,tm1628.yaml  | 88 +++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.example.dt.yaml: led-controller@0: 'spi-3-wire', 'spi-lsb-first', 'spi-max-frequency' do not match any of the regexes: '^.*@[1-7],([1-9]|1[0-6])$', 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1595730

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

#5 lore raw

Re: [PATCH v2 3/6] dt-bindings: auxdisplay: Add Titan Micro Electronics TM1628

Quoted 35 lines · Rob Herring
Quoted 8 lines · Heiner Kallweit

Add a YAML schema binding for TM1628 auxdisplay
(7/11-segment LED) controller.

This patch is partially based on previous RFC work from Andreas Färber <[email protected]>.

Quoted 9 lines

---
v2:
- (re-)add Andreas' SoB
- fix YAML errors reported by Rob

---
 .../bindings/auxdisplay/titanmec,tm1628.yaml  | 88 +++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.example.dt.yaml: led-controller@0: 'spi-3-wire', 'spi-lsb-first', 'spi-max-frequency' do not match any of the regexes: '^.*@[1-7],([1-9]|1[0-6])$', 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1595730

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

Quoted 8 lines

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

When I run "make DT_CHECKER_FLAGS=-m dt_binding_check" then this error isn't reported. I have:

Quoted 1 line

yamllint -v

yamllint 1.26.2

Quoted 1 line

dt-doc-validate --version

2022.2.dev1+gf677c85

Quoted 1 line

pip show dtschema

Name: dtschema
Version: 2022.2.dev1+gf677c85
Summary: DeviceTree validation schema and tools
Home-page: https://github.com/devicetree-org/dt-schema
Author: Rob Herring
Author-email: [email protected]
License: BSD
Location: /usr/lib/python3.10/site-packages
Requires: ruamel.yaml, jsonschema, rfc3987 Required-by:

What else could be messing?

If it matters: I'm building on latest linux-next.

#6 lore raw

Re: [PATCH v2 3/6] dt-bindings: auxdisplay: Add Titan Micro Electronics TM1628

Quoted 65 lines · Heiner Kallweit
Quoted 35 lines · Rob Herring
Quoted 8 lines · Heiner Kallweit

Add a YAML schema binding for TM1628 auxdisplay
(7/11-segment LED) controller.

This patch is partially based on previous RFC work from Andreas Färber <[email protected]>.

Quoted 9 lines

---
v2:
- (re-)add Andreas' SoB
- fix YAML errors reported by Rob

---
 .../bindings/auxdisplay/titanmec,tm1628.yaml  | 88 +++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.example.dt.yaml: led-controller@0: 'spi-3-wire', 'spi-lsb-first', 'spi-max-frequency' do not match any of the regexes: '^.*@[1-7],([1-9]|1[0-6])$', 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/auxdisplay/titanmec,tm1628.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1595730

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

Quoted 8 lines

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

When I run "make DT_CHECKER_FLAGS=-m dt_binding_check" then this error isn't reported. I have:

Quoted 1 line

yamllint -v

yamllint 1.26.2

Quoted 1 line

dt-doc-validate --version

2022.2.dev1+gf677c85

Quoted 1 line

pip show dtschema

Name: dtschema
Version: 2022.2.dev1+gf677c85
Summary: DeviceTree validation schema and tools
Home-page: https://github.com/devicetree-org/dt-schema
Author: Rob Herring
Author-email: [email protected]
License: BSD
Location: /usr/lib/python3.10/site-packages
Requires: ruamel.yaml, jsonschema, rfc3987 Required-by:

Quoted 3 lines

What else could be messing?

If it matters: I'm building on latest linux-next.

I was able to reproduce the error eventually.