From a673a273a6a84d6b1df141c3d74d43a0624762f2 Mon Sep 17 00:00:00 2001 From: Eric Yilun Lin Date: Fri, 24 Jun 2022 16:28:25 +0800 Subject: nx20p348x: expose public header move i2c device register address and function declarations into public header. BUG=b:227359727 TEST=zmake BRANCH=none Change-Id: I51c967c53c3052196bc51964a7ca2f7d104a1781 Signed-off-by: Eric Yilun Lin Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3721942 Commit-Queue: Eric Yilun Lin Reviewed-by: Ting Shen Tested-by: Eric Yilun Lin --- driver/ppc/nx20p348x.h | 21 +-------------------- include/driver/ppc/nx20p348x_public.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 include/driver/ppc/nx20p348x_public.h diff --git a/driver/ppc/nx20p348x.h b/driver/ppc/nx20p348x.h index ebda50da39..5188ea3f76 100644 --- a/driver/ppc/nx20p348x.h +++ b/driver/ppc/nx20p348x.h @@ -9,16 +9,7 @@ #define __CROS_EC_NX20P348X_H #include "common.h" - -#define NX20P3483_ADDR0_FLAGS 0x70 -#define NX20P3483_ADDR1_FLAGS 0x71 -#define NX20P3483_ADDR2_FLAGS 0x72 -#define NX20P3483_ADDR3_FLAGS 0x73 - -#define NX20P3481_ADDR0_FLAGS 0x74 -#define NX20P3481_ADDR1_FLAGS 0x75 -#define NX20P3481_ADDR2_FLAGS 0x76 -#define NX20P3481_ADDR3_FLAGS 0x77 +#include "ppc/nx20p348x_public.h" /* * This PPC hard-codes the over voltage protect of Vbus at 6.8V in dead-battery @@ -121,16 +112,6 @@ #define NX20P348X_INT2_OC_HVSRC BIT(1) #define NX20P348X_INT2_OV_HVSRC BIT(0) -struct ppc_drv; -extern const struct ppc_drv nx20p348x_drv; - -/** - * Interrupt Handler for the NX20P348x. - * - * @param port: The Type-C port which triggered the interrupt. - */ -void nx20p348x_interrupt(int port); - /** * Board override for NX20P348X init. * diff --git a/include/driver/ppc/nx20p348x_public.h b/include/driver/ppc/nx20p348x_public.h new file mode 100644 index 0000000000..e08f010c83 --- /dev/null +++ b/include/driver/ppc/nx20p348x_public.h @@ -0,0 +1,33 @@ +/* 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. + */ + +/* TI NX20P348X USB-C Power Path Controller */ + +#ifndef __CROS_EC_DRIVER_PPC_NX20P348X_PUBLIC_H +#define __CROS_EC_DRIVER_PPC_NX20P348X_PUBLIC_H + +#include "usbc_ppc.h" + +#define NX20P3483_ADDR0_FLAGS 0x70 +#define NX20P3483_ADDR1_FLAGS 0x71 +#define NX20P3483_ADDR2_FLAGS 0x72 +#define NX20P3483_ADDR3_FLAGS 0x73 + +#define NX20P3481_ADDR0_FLAGS 0x74 +#define NX20P3481_ADDR1_FLAGS 0x75 +#define NX20P3481_ADDR2_FLAGS 0x76 +#define NX20P3481_ADDR3_FLAGS 0x77 + +extern const struct ppc_drv nx20p348x_drv; + + +/** + * Interrupt Handler for the NX20P348x. + * + * @param port: The Type-C port which triggered the interrupt. + */ +void nx20p348x_interrupt(int port); + +#endif /* __CROS_EC_DRIVER_PPC_NX20P348X_PUBLIC_H */ -- cgit v1.2.1