summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2022-08-02 17:44:23 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-04 02:14:04 +0000
commit003821cc5ccca9c6d3da1a4ed8316a08d9287005 (patch)
treea40853d43ebea6b23bf668f759a648548775e6bd
parent7264165cade97f213a2ef2c83cc06fd003008ba1 (diff)
downloadchrome-ec-003821cc5ccca9c6d3da1a4ed8316a08d9287005.tar.gz
usb_mux/anx7447: use anx7447 usb_mux driver
Anx7447 is not able to use tcpci_usb_mux_driver, so fix this by using anx7447_usb_mux_driver instead. Also, add property hpd-update-enable for anx7447_tcpc_update_hpd_status. BUG=b:227359727 b:238170235 TEST=Kingler C0 is able to DP out BRANCH=none Change-Id: I34d04a2d434f0140b326c9ae41b6b5c6cd8b0a80 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3801772 Commit-Queue: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r--zephyr/dts/bindings/usbc/mux/analogix,usbc-mux-anx7447.yaml10
-rw-r--r--zephyr/shim/include/usbc/anx7447_usb_mux.h22
-rw-r--r--zephyr/shim/include/usbc/tcpci_usb_mux.h2
-rw-r--r--zephyr/shim/include/usbc/usb_muxes.h3
4 files changed, 29 insertions, 8 deletions
diff --git a/zephyr/dts/bindings/usbc/mux/analogix,usbc-mux-anx7447.yaml b/zephyr/dts/bindings/usbc/mux/analogix,usbc-mux-anx7447.yaml
index 17ad0fcb04..497e535370 100644
--- a/zephyr/dts/bindings/usbc/mux/analogix,usbc-mux-anx7447.yaml
+++ b/zephyr/dts/bindings/usbc/mux/analogix,usbc-mux-anx7447.yaml
@@ -4,12 +4,12 @@
description: USBC ANX7447 USB MUX
-include: cros-ec,usbc-mux-tcpci.yaml
+include: cros-ec,usbc-mux.yaml
compatible: "analogix,usbc-mux-anx7447"
properties:
- hpd-update:
- required: false
- enum:
- - anx7447_tcpc_update_hpd_status
+ hpd-update-enable:
+ type: boolean
+ description: |
+ Enable anx7447 hpd update callback
diff --git a/zephyr/shim/include/usbc/anx7447_usb_mux.h b/zephyr/shim/include/usbc/anx7447_usb_mux.h
new file mode 100644
index 0000000000..017be9d604
--- /dev/null
+++ b/zephyr/shim/include/usbc/anx7447_usb_mux.h
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+#ifndef __ZEPHYR_SHIM_ANX7447_USB_MUX_H
+#define __ZEPHYR_SHIM_ANX7447_USB_MUX_H
+
+#include "tcpm/anx7447_public.h"
+
+#define ANX7447_USB_MUX_COMPAT analogix_usbc_mux_anx7447
+
+#define USB_MUX_CONFIG_ANX7447(mux_id, port_id, idx) \
+ { \
+ USB_MUX_COMMON_FIELDS(mux_id, port_id, idx), \
+ .driver = &anx7447_usb_mux_driver, \
+ .hpd_update = COND_CODE_1( \
+ DT_PROP(mux_id, hpd_update_enable), \
+ (&anx7447_tcpc_update_hpd_status), (NULL)), \
+ }
+
+#endif /* __ZEPHYR_SHIM_ANX7447_USB_MUX_H */
diff --git a/zephyr/shim/include/usbc/tcpci_usb_mux.h b/zephyr/shim/include/usbc/tcpci_usb_mux.h
index 1f98bafc23..74a2fe8ffc 100644
--- a/zephyr/shim/include/usbc/tcpci_usb_mux.h
+++ b/zephyr/shim/include/usbc/tcpci_usb_mux.h
@@ -7,11 +7,9 @@
#define __ZEPHYR_SHIM_TCPCI_USB_MUX_H
#include "dt-bindings/usbc_mux.h"
-#include "tcpm/anx7447_public.h"
#include "tcpm/ps8xxx_public.h"
#include "tcpm/tcpci.h"
-#define ANX7447_USB_MUX_COMPAT analogix_usbc_mux_anx7447
#define TCPCI_TCPM_USB_MUX_COMPAT cros_ec_usbc_mux_tcpci
#define PS8XXX_USB_MUX_COMPAT parade_usbc_mux_ps8xxx
diff --git a/zephyr/shim/include/usbc/usb_muxes.h b/zephyr/shim/include/usbc/usb_muxes.h
index 61422a743b..f7cfd7159b 100644
--- a/zephyr/shim/include/usbc/usb_muxes.h
+++ b/zephyr/shim/include/usbc/usb_muxes.h
@@ -9,6 +9,7 @@
#include <zephyr/devicetree.h>
#include <zephyr/sys/util_macro.h>
#include "usb_mux.h"
+#include "usbc/anx7447_usb_mux.h"
#include "usbc/anx7483_usb_mux.h"
#include "usbc/bb_retimer_usb_mux.h"
#include "usbc/it5205_usb_mux.h"
@@ -22,7 +23,7 @@
* element of list has to have (compatible, config) format.
*/
#define USB_MUX_DRIVERS \
- (ANX7447_USB_MUX_COMPAT, USB_MUX_CONFIG_TCPCI_TCPM), \
+ (ANX7447_USB_MUX_COMPAT, USB_MUX_CONFIG_ANX7447), \
(ANX7483_USB_MUX_COMPAT, USB_MUX_CONFIG_ANX7483), \
(BB_RETIMER_USB_MUX_COMPAT, USB_MUX_CONFIG_BB_RETIMER), \
(IT5205_USB_MUX_COMPAT, USB_MUX_CONFIG_IT5205), \