New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 616580 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

ec: pd: Cleanup CONFIG_USB_PD_TCPM_VBUS + related defines

Project Member Reported by sha...@chromium.org, Jun 1 2016

Issue description

We now have four ways of detecting VBUS:

- Through TCPC (CONFIG_USB_PD_TCPM_VBUS)
- Through charger DC input pins (need at least one input per port)
- Through regular interrupt-enabled GPIOs (no define)
- None, for special devices only (CONFIG_USB_PD_NO_VBUS_DETECT)

Let's add a define for each case, and enforce the selection of only one of them:

+#undef CONFIG_USB_PD_VBUS_DETECT_TCPC
+#undef CONFIG_USB_PD_VBUS_DETECT_CHARGER
+#undef CONFIG_USB_PD_VBUS_DETECT_GPIO
+#undef CONFIG_USB_PD_VBUS_DETECT_NONE

 
Cc: scollyer@chromium.org
Checking this closer, CONFIG_USB_PD_TCPM_VBUS has overloaded meaning.

- It's used for discreet TCPCs (glados_pd, usb_pd_tcpc.c) which we expect to keep track of VBUS state independently, so it can be queried by an external TCPM.
- It's used in the meaning I described above -- "use the TCPC to detect VBUS for us".

I'll create a new config to better describe the first meaning.
Components: OS>Firmware>EC
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/54261224660e9deb980c8d39b74f144f01edf68a

commit 54261224660e9deb980c8d39b74f144f01edf68a
Author: Shawn Nematbakhsh <shawnn@chromium.org>
Date: Wed Jun 01 23:23:30 2016

cleanup: pd: Define VBUS detection source

Previously CONFIG_USB_PD_TCPM_VBUS had two uses which were independent:

- When operating as a TCPC, it indicated that the VBUS level should be
  tracked (through GPIO inputs) and sent to the external TCPM when
  appropriate.
- When operating as a TCPM, it indicated that the VBUS level should be
  obtained by querying the TCPC.

These two independent uses have been split into
CONFIG_USB_PD_TCPC_TRACK_VBUS and CONFIG_USB_PD_VBUS_DETECT_TCPC, which
sould be more clear.

In addition, CONFIG_USB_PD_VBUS_DETECT_* CONFIGs have been added for
other means of VBUS detection.

BUG= chromium:616580 
BRANCH=None
TEST=Verify kevin continues to boot + charge.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I936821481d6577e17e3e9c61ff97c037574d6923
Reviewed-on: https://chromium-review.googlesource.com/348950
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>

[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/driver/usb_switch_pi3usb9281.c
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/honeybuns/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/elm/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/zinger/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/glados_pd/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/ryu/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/driver/tcpm/anx74xx.c
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/reef/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/driver/tcpm/fusb302.c
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/it83xx_evb/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/dingdong/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/hoho/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/include/config.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/plankton/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/samus_pd/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/common/usb_charger.c
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/strago/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/lucid/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/chell/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/oak/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/twinkie/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/common/usb_pd_tcpc.c
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/driver/tcpm/tcpci.c
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/common/usb_pd_protocol.c
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/kevin/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/wheatley/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/amenia/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/board/glados/board.h
[modify] https://crrev.com/54261224660e9deb980c8d39b74f144f01edf68a/driver/tcpm/it83xx.c

Status: Verified (was: Started)

Sign in to add a comment