diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2023-04-13 18:25:45 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-04-19 23:40:20 +0000 |
commit | c4a67f5298a5a3f402bf9f4bc5505b5c4f02f557 (patch) | |
tree | bde985f9dc9af8adaf68ec8106678e35c82e882a /include | |
parent | 806b88d2cd803e2f3ff8b10ef5aed1e265bbebf8 (diff) | |
download | chrome-ec-c4a67f5298a5a3f402bf9f4bc5505b5c4f02f557.tar.gz |
retimer: Use common console command for all Retimers
BUG=b:278138274
BRANCH=none
TEST=Tested on ADL-RVP, retimer console command works
./twister -T zephyr/test/drivers
./twister -T zephyr/test/drivers -s drivers.default
./firmware_builder.py --metrics /tmp/tmp_pc1rc15 build
Change-Id: Idaec9b41f550ad6aafa34400e95ebf00b9c11348
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426790
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 8 | ||||
-rw-r--r-- | include/usb_mux.h | 24 |
2 files changed, 31 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h index b0a809af7f..ee212a8fdc 100644 --- a/include/config.h +++ b/include/config.h @@ -1704,7 +1704,7 @@ #undef CONFIG_CMD_RAND #define CONFIG_CMD_REGULATOR #undef CONFIG_CMD_RESET_FLAGS -#define CONFIG_CMD_RETIMER +#undef CONFIG_CMD_RETIMER #undef CONFIG_CMD_RTC #undef CONFIG_CMD_RTC_ALARM #define CONFIG_CMD_RW @@ -6714,6 +6714,12 @@ #define CONFIG_USB_MUX_AP_ACK_REQUEST #endif /* CONFIG_USBC_RETIMER_INTEL_BB || CONFIG_USBC_RETIMER_INTEL_HB */ +/* Enable retimer console command */ +#if (defined(CONFIG_USBC_RETIMER_INTEL_BB) || \ + defined(CONFIG_USBC_RETIMER_KB800X)) +#define CONFIG_CMD_RETIMER +#endif + /*****************************************************************************/ /* diff --git a/include/usb_mux.h b/include/usb_mux.h index 90edbb98d7..8d3dbc2f7e 100644 --- a/include/usb_mux.h +++ b/include/usb_mux.h @@ -121,6 +121,30 @@ struct usb_mux_driver { * @return EC_SUCCESS on success, non-zero error code on failure. */ int (*set_idle_mode)(const struct usb_mux *me, bool idle); + +#ifdef CONFIG_CMD_RETIMER + /** + * Console command to read the retimer registers + * + * @param me usb_mux + * @param offset Register offset + * @param data Data to be read + * @return EC_SUCCESS on success, non-zero error code on failure. + */ + int (*retimer_read)(const struct usb_mux *me, const uint32_t offset, + uint32_t *data); + + /** + * Console command to write to the retimer registers + * + * @param me usb_mux + * @param offset Register offset + * @param data Data to be written + * @return EC_SUCCESS on success, non-zero error code on failure. + */ + int (*retimer_write)(const struct usb_mux *me, const uint32_t offset, + uint32_t data); +#endif /* CONFIG_CMD_RETIMER */ }; /* Describes a USB mux present in the system */ |