Files
OpenCellular/include/usbc_ppc.h
Aseda Aboagye 9c4008e35c ppc: Add common APIs.
It'll be easier to add support for new PPCs if we make a generic API.

BUG=None
BRANCH=None
TEST=make -j buildall

Change-Id: I9aac1750eb4c163eb2b94aa8975c797f86d0a25a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/791499
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-05 22:43:45 -08:00

41 lines
1.0 KiB
C

/* Copyright 2017 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef __CROS_EC_USBC_PPC_H
#define __CROS_EC_USBC_PPC_H
#include "common.h"
/* Common APIs for USB Type-C Power Path Controllers (PPC) */
/**
* Is the port sourcing Vbus?
*
* @param port: The type c port.
* @return 1 if sourcing Vbus, 0 if not.
*/
int ppc_is_sourcing_vbus(int port);
/**
* Allow current to flow into the system.
*
* @param port: The Type-C port's FET to open.
* @param enable: 1: Turn on the FET, 0: turn off the FET.
* @return EC_SUCCESS on success, error otherwise.
*/
int ppc_vbus_sink_enable(int port, int enable);
/**
* Allow current out of the system.
*
* @param port: The Type-C port's FET to open.
* @param enable: 1: Turn on the FET, 0: turn off the FET.
* @return EC_SUCCESS on success, error otherwise.
*/
int ppc_vbus_source_enable(int port, int enable);
#endif /* !defined(__CROS_EC_USBC_PPC_H) */