summaryrefslogtreecommitdiff
path: root/board/ryu
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-07-10 17:39:54 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-13 03:18:32 +0000
commit16d40b0b3c567a5e18ea28469a09f860819d3fdd (patch)
treed1ec5c17739e7e0d4aae60ae3b40d845f0ec45e2 /board/ryu
parent79195818caeff76a6eb3a3d4991b095920b55e33 (diff)
downloadchrome-ec-16d40b0b3c567a5e18ea28469a09f860819d3fdd.tar.gz
cleanup: define one set of USB charger voltage and min current
Remove duplicate definitions of USB charger min current across boards and make one set of defines for standard USB charger voltage and minimum USB charger current. BUG=none BRANCH=smaug TEST=make -j buildall Change-Id: Ib842fafb317417c8de9a67d314fdde4c1e47ad9d Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/284956 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/ryu')
-rw-r--r--board/ryu/board.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/board/ryu/board.c b/board/ryu/board.c
index 7fd2178cdc..f11d0c0763 100644
--- a/board/ryu/board.c
+++ b/board/ryu/board.c
@@ -31,6 +31,7 @@
#include "spi.h"
#include "task.h"
#include "usb.h"
+#include "usb_charge.h"
#include "usb_pd.h"
#include "usb_spi.h"
#include "usb-stm32f3.h"
@@ -41,9 +42,6 @@
#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-/* Default input current limit when VBUS is present */
-#define DEFAULT_CURR_LIMIT 500 /* mA */
-
/* VBUS too low threshold */
#define VBUS_LOW_THRESHOLD_MV 4600
@@ -81,8 +79,8 @@ void vbus_evt(enum gpio_signal signal)
* ourselves, then update the VBUS supplier.
*/
if (!vbus_level || !gpio_get_level(GPIO_CHGR_OTG)) {
- charge.voltage = USB_BC12_CHARGE_VOLTAGE;
- charge.current = vbus_level ? DEFAULT_CURR_LIMIT : 0;
+ charge.voltage = USB_CHARGER_VOLTAGE_MV;
+ charge.current = vbus_level ? USB_CHARGER_MIN_CURR_MA : 0;
charge_manager_update_charge(CHARGE_SUPPLIER_VBUS, 0, &charge);
}
@@ -175,7 +173,7 @@ static void board_init(void)
struct charge_port_info charge_none, charge_vbus;
/* Initialize all pericom charge suppliers to 0 */
- charge_none.voltage = USB_BC12_CHARGE_VOLTAGE;
+ charge_none.voltage = USB_CHARGER_VOLTAGE_MV;
charge_none.current = 0;
charge_manager_update_charge(CHARGE_SUPPLIER_PROPRIETARY,
0,
@@ -186,8 +184,8 @@ static void board_init(void)
charge_manager_update_charge(CHARGE_SUPPLIER_OTHER, 0, &charge_none);
/* Initialize VBUS supplier based on whether or not VBUS is present */
- charge_vbus.voltage = USB_BC12_CHARGE_VOLTAGE;
- charge_vbus.current = DEFAULT_CURR_LIMIT;
+ charge_vbus.voltage = USB_CHARGER_VOLTAGE_MV;
+ charge_vbus.current = USB_CHARGER_MIN_CURR_MA;
if (gpio_get_level(GPIO_CHGR_ACOK))
charge_manager_update_charge(CHARGE_SUPPLIER_VBUS, 0,
&charge_vbus);