summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-11-14 16:34:16 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-16 12:18:43 +0000
commit427adac454da3718fda4de7532c599504bdc3924 (patch)
tree56435c793392e26e06fa65516b7729321ade9408
parent4e5c08ec698bd54eeac6099e8d0d27db071fdf00 (diff)
downloadchrome-ec-427adac454da3718fda4de7532c599504bdc3924.tar.gz
zephyr: max695x: rework the binding, various cleanups
Various cleanups on the max695x driver: - rename the binding to the Zephyr canonical vendor,device format - move the example in the binding description - make the PLATFORM_EC_MAX695X_SEVEN_SEGMENT_DISPLAY option automatic and drop the explicit config entries - find the node by compatible and drop the nodelabel - drop the label property BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I9b90d1b8bb3e3df9b76b2631a24f51133c4b73f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022154 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--zephyr/Kconfig.led2
-rw-r--r--zephyr/dts/bindings/led/maxim,max695x.yaml18
-rw-r--r--zephyr/dts/bindings/led/maxim,seven-seg-display.yaml19
-rw-r--r--zephyr/program/intelrvp/adlrvp/adlrvp_mchp/adlrvp_mchp.dts5
-rw-r--r--zephyr/program/intelrvp/adlrvp/adlrvp_mchp/prj.conf3
-rw-r--r--zephyr/program/intelrvp/adlrvp/adlrvp_npcx/adlrvp_npcx.dts5
-rw-r--r--zephyr/program/intelrvp/adlrvp/prj.conf3
-rw-r--r--zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/mtlrvp_npcx.dts5
-rw-r--r--zephyr/program/intelrvp/mtlrvp/prj.conf3
-rw-r--r--zephyr/shim/include/config_chip.h2
10 files changed, 27 insertions, 38 deletions
diff --git a/zephyr/Kconfig.led b/zephyr/Kconfig.led
index d3d50ccc56..90f59f2fff 100644
--- a/zephyr/Kconfig.led
+++ b/zephyr/Kconfig.led
@@ -167,6 +167,8 @@ endif # PLATFORM_EC_LED_COMMON
config PLATFORM_EC_MAX695X_SEVEN_SEGMENT_DISPLAY
bool "MAX695X Seven Segment Display"
+ default y
+ depends on DT_HAS_MAXIM_MAX695X_ENABLED
help
Enable this to support MAX6958/MAX6959 7-Segment LED Display.
The MAX6958/MAX6959 is a compact multiplexed common - cathode display
diff --git a/zephyr/dts/bindings/led/maxim,max695x.yaml b/zephyr/dts/bindings/led/maxim,max695x.yaml
new file mode 100644
index 0000000000..a219512b0d
--- /dev/null
+++ b/zephyr/dts/bindings/led/maxim,max695x.yaml
@@ -0,0 +1,18 @@
+# Copyright 2022 The ChromiumOS Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+description: |
+ MAX6958/MAX6959 7-Segment LED Display
+
+ Example configuration
+
+ max695x@38 {
+ compatible = "maxim,max695x";
+ reg = <0x38>;
+ };
+
+
+compatible: "maxim,max695x"
+
+include: i2c-device.yaml
diff --git a/zephyr/dts/bindings/led/maxim,seven-seg-display.yaml b/zephyr/dts/bindings/led/maxim,seven-seg-display.yaml
deleted file mode 100644
index d66a0cdca2..0000000000
--- a/zephyr/dts/bindings/led/maxim,seven-seg-display.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2022 The ChromiumOS Authors
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-description: MAX6958/MAX6959 7-Segment LED Display
-
-compatible: "maxim,seven-seg-display"
-
-include: i2c-device.yaml
-
-#
-# examples:
-#
-# seven_seg_display: max695x-seven-seg-display@38 {
-# compatible = "maxim,seven-seg-display";
-# reg = <0x38>;
-# label = "MAX695X_SEVEN_SEG_DISPLAY";
-# };
-#
diff --git a/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/adlrvp_mchp.dts b/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/adlrvp_mchp.dts
index 527a62e776..39fd720290 100644
--- a/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/adlrvp_mchp.dts
+++ b/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/adlrvp_mchp.dts
@@ -80,10 +80,9 @@
<&pca95xx 10 0>, <&pca95xx 9 0>, <&pca95xx 8 0>;
};
- seven_seg_display: max695x-seven-seg-display@38 {
- compatible = "maxim,seven-seg-display";
+ max695x@38 {
+ compatible = "maxim,max695x";
reg = <0x38>;
- label = "MAX695X_SEVEN_SEG_DISPLAY";
};
charger: isl9241@9 {
diff --git a/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/prj.conf b/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/prj.conf
index bca7262642..f38982e87d 100644
--- a/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/prj.conf
+++ b/zephyr/program/intelrvp/adlrvp/adlrvp_mchp/prj.conf
@@ -70,9 +70,6 @@ CONFIG_PLATFORM_EC_DEDICATED_CHARGE_PORT=y
# H1 issues second reset
CONFIG_PLATFORM_EC_BOARD_RESET_AFTER_POWER_ON=n
-# 7-Segment Display
-CONFIG_PLATFORM_EC_MAX695X_SEVEN_SEGMENT_DISPLAY=n
-
# Debug options
# Enable flash console commands
CONFIG_PLATFORM_EC_CONSOLE_CMD_FLASH=y
diff --git a/zephyr/program/intelrvp/adlrvp/adlrvp_npcx/adlrvp_npcx.dts b/zephyr/program/intelrvp/adlrvp/adlrvp_npcx/adlrvp_npcx.dts
index 79723beabd..b8fbd6656d 100644
--- a/zephyr/program/intelrvp/adlrvp/adlrvp_npcx/adlrvp_npcx.dts
+++ b/zephyr/program/intelrvp/adlrvp/adlrvp_npcx/adlrvp_npcx.dts
@@ -112,10 +112,9 @@
<&pca95xx 10 0>, <&pca95xx 9 0>, <&pca95xx 8 0>;
};
- seven_seg_display: max695x-seven-seg-display@38 {
- compatible = "maxim,seven-seg-display";
+ max695x@38 {
+ compatible = "maxim,max695x";
reg = <0x38>;
- label = "MAX695X_SEVEN_SEG_DISPLAY";
};
charger: isl9241@9 {
diff --git a/zephyr/program/intelrvp/adlrvp/prj.conf b/zephyr/program/intelrvp/adlrvp/prj.conf
index c2d4425d73..64cf5a2a4a 100644
--- a/zephyr/program/intelrvp/adlrvp/prj.conf
+++ b/zephyr/program/intelrvp/adlrvp/prj.conf
@@ -63,8 +63,5 @@ CONFIG_PLATFORM_EC_USBC_RETIMER_INTEL_BB=y
# IOEX
CONFIG_PLATFORM_EC_IOEX_PCA9675=y
-# 7-Segment Display
-CONFIG_PLATFORM_EC_MAX695X_SEVEN_SEGMENT_DISPLAY=y
-
# eSPI
CONFIG_PLATFORM_EC_HOST_INTERFACE_ESPI_DEFAULT_VW_WIDTH_US=150
diff --git a/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/mtlrvp_npcx.dts b/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/mtlrvp_npcx.dts
index 44f283071b..25ad865dd7 100644
--- a/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/mtlrvp_npcx.dts
+++ b/zephyr/program/intelrvp/mtlrvp/mtlrvpp_npcx/mtlrvp_npcx.dts
@@ -105,10 +105,9 @@
reg = <0x39>;
};
- seven_seg_display: max695x-seven-seg-display@38 {
- compatible = "maxim,seven-seg-display";
+ max695x@38 {
+ compatible = "maxim,max695x";
reg = <0x38>;
- label = "MAX695X_SEVEN_SEG_DISPLAY";
};
charger: isl9241@9 {
diff --git a/zephyr/program/intelrvp/mtlrvp/prj.conf b/zephyr/program/intelrvp/mtlrvp/prj.conf
index 3b0b0fa32e..281d40a271 100644
--- a/zephyr/program/intelrvp/mtlrvp/prj.conf
+++ b/zephyr/program/intelrvp/mtlrvp/prj.conf
@@ -67,6 +67,3 @@ CONFIG_PLATFORM_EC_USB_PD_USB4=y
CONFIG_PLATFORM_EC_USB_PD_INT_SHARED=y
CONFIG_PLATFORM_EC_USB_PD_PORT_0_SHARED=y
CONFIG_PLATFORM_EC_USB_PD_PORT_1_SHARED=y
-
-# 7-Segment Display
-CONFIG_PLATFORM_EC_MAX695X_SEVEN_SEGMENT_DISPLAY=y
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 7b3abce82e..fc0e434403 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -2107,7 +2107,7 @@ extern char mock_jump_data[sizeof(struct jump_data) + 256];
#undef CONFIG_MAX695X_SEVEN_SEGMENT_DISPLAY
#ifdef CONFIG_PLATFORM_EC_MAX695X_SEVEN_SEGMENT_DISPLAY
#define CONFIG_MAX695X_SEVEN_SEGMENT_DISPLAY
-#define PORT80_I2C_ADDR DT_REG_ADDR(DT_NODELABEL(seven_seg_display))
+#define PORT80_I2C_ADDR DT_REG_ADDR(DT_INST(0, maxim_max695x))
#endif
#undef CONFIG_CMD_SEVEN_SEG_DISPLAY