summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@chromium.org>2019-11-21 07:30:54 -0700
committerCommit Bot <commit-bot@chromium.org>2019-11-25 22:17:24 +0000
commitf9fd94f64d3294c2005048164361e3697d63a7bb (patch)
treed408036789da808cc6be0d2b4b08ad9e8f6c6970 /include
parenta621ea9f352a7fdd5fa41982bfc4c13f1e351f3c (diff)
downloadchrome-ec-f9fd94f64d3294c2005048164361e3697d63a7bb.tar.gz
usbc: make BB virtual mux retimer compatible with non-virtual
Changed the driver interface for BB virtual mux retimer to stop using global functions and use the usb_retimers array instead. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I56befaca1720eb2f4e0599a983629b4df45dc76b Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928121 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h12
-rw-r--r--include/usb_mux.h19
-rw-r--r--include/usb_pd.h2
-rw-r--r--include/usb_retimer.h38
4 files changed, 13 insertions, 58 deletions
diff --git a/include/config.h b/include/config.h
index d9b8afcd8b..add8fcfa0e 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3846,11 +3846,6 @@
* automatically be included. This does not stop a board/basebord.h
* configration from defining these as well.
*/
-
-/* Type-C retimer used with virtual mux */
-#undef CONFIG_USBC_VIRTUAL_MUX_RETIMER
-
-/* Type-C retimer used with real mux */
#undef CONFIG_USBC_MUX_RETIMER
/*
@@ -4748,11 +4743,8 @@
* for convenience. Any retimer driver that also needs USBC MUX Retimers
* will not have to include it in their own board/baseboard.h file.
*/
-#ifdef CONFIG_USBC_RETIMER_INTEL_BB
-#define CONFIG_USBC_VIRTUAL_MUX_RETIMER
-#endif
-
-#ifdef CONFIG_USBC_RETIMER_PI3DPX1207
+#if defined(CONFIG_USBC_RETIMER_INTEL_BB) || \
+ defined(CONFIG_USBC_RETIMER_PI3DPX1207)
#define CONFIG_USBC_MUX_RETIMER
#endif
diff --git a/include/usb_mux.h b/include/usb_mux.h
index 0a5a19a338..c0e781f65d 100644
--- a/include/usb_mux.h
+++ b/include/usb_mux.h
@@ -178,20 +178,23 @@ struct usb_retimer_driver {
struct usb_retimer {
/*
* All of the fields are provided on an as needed basis.
- * If your retimer does not perform I2C operations, then
- * values would not be set. This includes the driver
- * field, which would indicate no retimer driver is to
- * be called. Values that are not specifically popuplated
- * shall be 0/NULL.
+ * If your retimer does not use the provided machanism then
+ * values would not be set (defaulted to 0/NULL). This
+ * defaulting includes the driver field, which would indicate
+ * no retimer driver is to be called.
*/
/* I2C port and slave address */
const int i2c_port;
const uint16_t i2c_addr_flags;
- /* GPIOs for enabling the retimer and DP mode */
- const int gpio_enable;
- const int gpio_dp_enable;
+ /* Retimer control GPIOs */
+ const enum gpio_signal gpio_enable; /* Retimer enable */
+ const enum gpio_signal gpio_dp_enable; /* DP Mode enable */
+
+ const enum gpio_signal usb_ls_en_gpio; /* Load switch enable */
+ const enum gpio_signal retimer_rst_gpio;/* Retimer reset */
+ const enum gpio_signal force_power_gpio;/* Force power (active/low) */
/* Driver interfaces for this retimer */
const struct usb_retimer_driver *driver;
diff --git a/include/usb_pd.h b/include/usb_pd.h
index ca6f63254b..6051706670 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -2275,7 +2275,6 @@ static inline uint8_t board_get_usb_pd_port_count(void)
#endif /* CONFIG_USB_POWER_DELIVERY */
#endif /* CONFIG_USB_PD_PORT_MAX_COUNT */
-#ifdef CONFIG_USBC_VIRTUAL_MUX_RETIMER
/**
* Return true if specified PD port partner is UFP.
*
@@ -2289,7 +2288,6 @@ int pd_partner_is_ufp(int port);
* @param port USB-C port number
*/
int pd_is_debug_acc(int port);
-#endif
/*
* Notify the AP that we have entered into DisplayPort Alternate Mode. This
diff --git a/include/usb_retimer.h b/include/usb_retimer.h
deleted file mode 100644
index 9b750b51bd..0000000000
--- a/include/usb_retimer.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright 2019 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* USB retimer driver */
-
-#ifndef __CROS_EC_USB_RETIMER_H
-#define __CROS_EC_USB_RETIMER_H
-
-#include "usb_mux.h"
-
-/**
- * Set USB retimer state
- *
- * @param port Port number.
- * @param mux_state current MUX state
- * @return Non-zero if fail; otherwise, zero.
- */
-int retimer_set_state(int port, mux_state_t mux_state);
-
-/**
- * USB retimer enter to low power mode.
- *
- * @param port Port number.
- * @return Non-zero if fail; otherwise, zero.
- */
-int retimer_low_power_mode(int port);
-
-/**
- * Initialize USB Retimer to its default state.
- *
- * @param port Port number.
- * @return Non-zero if fail; otherwise, zero.
- */
-int retimer_init(int port);
-
-#endif /* __CROS_EC_USB_RETIMER_H */