pd: support CCD provided by an external chip

When the case close debug (CCD) feature is provided by an external chip
(e.g security chip or TCPC), we still need to be able to detect debug
accessory with Rd/Rd (by setting Rp/Rp when VBUS is detected without
seeing Rp).
Add a CONFIG_CASE_CLOSED_DEBUG_EXTERNAL configuration parameter for this
case.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chrome-os-partner:55410
TEST=manual:on Kevin, enable CONFIG_CASE_CLOSED_DEBUG_EXTERNAL,
plug a SuzyQ (with Rd/Rd) and verify that the device in debug mode
when transitioning to S5.

Change-Id: Ie04a000a7b0eb670e3808f7bca1180298dfcd9db
Reviewed-on: https://chromium-review.googlesource.com/363400
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Vincent Palatin
2016-07-26 11:07:52 +02:00
committed by chrome-bot
parent e8a95db059
commit c48408f0ba
2 changed files with 7 additions and 3 deletions

View File

@@ -234,7 +234,8 @@ static inline int pd_is_vbus_present(int port)
static int pd_snk_debug_acc_toggle(int port)
{
#ifdef CONFIG_CASE_CLOSED_DEBUG
#if defined(CONFIG_CASE_CLOSED_DEBUG) || \
defined(CONFIG_CASE_CLOSED_DEBUG_EXTERNAL)
/*
* when we are in SNK_DISCONNECTED and we see VBUS appearing
* (without having seen Rp before), that might be a powered debug
@@ -249,7 +250,8 @@ static int pd_snk_debug_acc_toggle(int port)
static int pd_debug_acc_plugged(int port)
{
#ifdef CONFIG_CASE_CLOSED_DEBUG
#if defined(CONFIG_CASE_CLOSED_DEBUG) || \
defined(CONFIG_CASE_CLOSED_DEBUG_EXTERNAL)
return pd[port].task_state == PD_STATE_SRC_ACCESSORY;
#else
/* Debug accessories not supported */

View File

@@ -312,9 +312,11 @@
#undef CONFIG_BUTTON_COUNT
/*
* Enable case close debug (CCD) mode.
* Enable case close debug (CCD) mode in the EC.
*/
#undef CONFIG_CASE_CLOSED_DEBUG
/* The case close debug (CCD) feature is provided by an external chip. */
#undef CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
/*
* Capsense chip has buttons, too.