summaryrefslogtreecommitdiff
path: root/baseboard/dragonegg
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-09-05 16:49:02 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-02 05:19:07 -0700
commit391b0506bc1cfff90876e53ba8311cbc3446b2a2 (patch)
tree19a1fbb926538b8766dcf146e684744f3beb62ce /baseboard/dragonegg
parent6532316ae9e4ad998325cceec0e819c465f15972 (diff)
downloadchrome-ec-391b0506bc1cfff90876e53ba8311cbc3446b2a2.tar.gz
DragonEgg: Add support for BC 1.2 detection
This CL adds board specific support for BC 1.2 detection. BUG=b:113267982 BRANCH=none TEST=Tested on DragonEgg with both USB DCP and SDP chargers. Verified HW ramp set charge level when attaching suzyq cable. Change-Id: Ic610d3cea62883325a02a7fc9f244764842e424d Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1208523 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard/dragonegg')
-rw-r--r--baseboard/dragonegg/baseboard.c21
-rw-r--r--baseboard/dragonegg/baseboard.h7
2 files changed, 26 insertions, 2 deletions
diff --git a/baseboard/dragonegg/baseboard.c b/baseboard/dragonegg/baseboard.c
index 9046e8c69c..e4ed7344ab 100644
--- a/baseboard/dragonegg/baseboard.c
+++ b/baseboard/dragonegg/baseboard.c
@@ -8,6 +8,7 @@
#include "charge_state_v2.h"
#include "chipset.h"
#include "console.h"
+#include "driver/bc12/max14637.h"
#include "driver/ppc/nx20p348x.h"
#include "driver/ppc/sn5s330.h"
#include "driver/ppc/syv682x.h"
@@ -223,6 +224,26 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = {
},
};
+/******************************************************************************/
+/* BC 1.2 chip Configuration */
+const struct max14637_config_t max14637_config[CONFIG_USB_PD_PORT_COUNT] = {
+ {
+ .chip_enable_pin = GPIO_USB_C0_BC12_VBUS_ON_ODL,
+ .chg_det_pin = GPIO_USB_C0_BC12_CHG_MAX,
+ .flags = MAX14637_FLAGS_ENABLE_ACTIVE_LOW,
+ },
+ {
+ .chip_enable_pin = GPIO_USB_C1_BC12_VBUS_ON_ODL,
+ .chg_det_pin = GPIO_USB_C1_BC12_CHG_MAX,
+ .flags = MAX14637_FLAGS_ENABLE_ACTIVE_LOW,
+ },
+ {
+ .chip_enable_pin = GPIO_USB_C2_BC12_VBUS_ON_ODL,
+ .chg_det_pin = GPIO_USB_C2_BC12_CHG_MAX,
+ .flags = MAX14637_FLAGS_ENABLE_ACTIVE_LOW,
+ },
+};
+
/* Power Delivery and charging functions */
void baseboard_tcpc_init(void)
diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h
index d9b272b7dd..53b1a894da 100644
--- a/baseboard/dragonegg/baseboard.h
+++ b/baseboard/dragonegg/baseboard.h
@@ -36,8 +36,7 @@
/* Common charger defines */
#define CONFIG_CHARGE_MANAGER
-/* TODO (b/111309500): Enable this option when support for MAX14637 is added */
-/* #define CONFIG_CHARGE_RAMP_HW */
+#define CONFIG_CHARGE_RAMP_HW
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ25710
#define CONFIG_CHARGER_DISCHARGE_ON_AC
@@ -56,6 +55,10 @@
#define CONFIG_BATTERY_REVIVE_DISCONNECT
#define CONFIG_BATTERY_SMART
+/* BC 1.2 Detection */
+#define CONFIG_BC12_DETECT_MAX14637
+#define CONFIG_USB_CHARGER
+
/* USB Type C and USB PD defines */
#undef CONFIG_USB_PD_TCPC_LOW_POWER
#undef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE