From 9ab780d295da1268b7360552da295fae4e432e4b Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Thu, 26 Jun 2014 11:43:29 -0700 Subject: USB Power: Invert ILIM control line with 'smart simple' charging The ILIM control line is inverted before reaching the USB charge controllers when they are cross-connected to allow only one port to deliver the HIGH current limit at a time. BUG=chrome-os-partner:29053 BRANCH=ToT TEST=Verify, with a multimeter, that ILIM (pin 4) on a TPS2546 is 3.3V when the chargemode is set to CDP Change-Id: I2f720d04b959417ae96687d7e30ee60270eeccb9 Original-Change-Id: Idd89dcfc117f1f3393ded1887e8d1cb27ba367ad Signed-off-by: Dave Parker Reviewed-on: https://chromium-review.googlesource.com/205811 Reviewed-by: Vic Yang Reviewed-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/208161 --- common/usb_port_power_smart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/usb_port_power_smart.c b/common/usb_port_power_smart.c index 7e6fdeee80..76990fa8da 100644 --- a/common/usb_port_power_smart.c +++ b/common/usb_port_power_smart.c @@ -63,14 +63,14 @@ static void usb_charge_set_enabled(int port_id, int en) static void usb_charge_set_ilim(int port_id, int sel) { #ifdef CONFIG_USB_PORT_POWER_SMART_SIMPLE - /* ILIM_SEL signal is shared too */ - gpio_set_level(GPIO_USB_ILIM_SEL, sel); + /* ILIM_SEL signal is shared and inverted */ + gpio_set_level(GPIO_USB_ILIM_SEL, sel ? 0 : 1); #else if (port_id == 0) gpio_set_level(GPIO_USB1_ILIM_SEL, sel); else gpio_set_level(GPIO_USB2_ILIM_SEL, sel); -#endif +#endif /* CONFIG_USB_PORT_POWER_SMART_SIMPLE */ } static void usb_charge_all_ports_on(void) -- cgit v1.2.1