Files
OpenCellular/include/usb_api.h
Bill Richardson 104f811e67 cleanup: fix all the header guards
This unifies all the EC header files to use __CROS_EC_FILENAME_H
as the include guard. Well, except for test/ util/ and extra/
which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively.

BUG=chromium:496895
BRANCH=none
TEST=make buildall -j

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029
Reviewed-on: https://chromium-review.googlesource.com/278121
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-06-18 19:07:00 +00:00

46 lines
1.4 KiB
C

/* Copyright (c) 2014 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.
*
* USB API definitions.
*
* This file includes definitions needed by common code that wants to control
* the state of the USB peripheral, but doesn't need to know about the specific
* implementation.
*/
#ifndef __CROS_EC_USB_API_H
#define __CROS_EC_USB_API_H
/*
* Initialize the USB peripheral, enabling its clock and configuring the DP/DN
* GPIOs correctly. This function is called via an init hook (unless the board
* defined CONFIG_USB_INHIBIT_INIT), but may need to be called again if
* usb_release is called. This function will call usb_connect by default
* unless CONFIG_USB_INHIBIT_CONNECT is defined.
*/
void usb_init(void);
/* Check if USB peripheral is enabled. */
int usb_is_enabled(void);
/*
* Enable the pullup on the DP line to signal that this device exists to the
* host and to start the enumeration process.
*/
void usb_connect(void);
/*
* Disable the pullup on the DP line. This causes the device to be disconnected
* from the host.
*/
void usb_disconnect(void);
/*
* Disconnect from the host by calling usb_disconnect and then turn off the USB
* peripheral, releasing its GPIOs and disabling its clock.
*/
void usb_release(void);
#endif /* __CROS_EC_USB_API_H */