ckfwq/linux-3.0.4/drivers/usb/gsc3280_otg/gsc3280_otg_adp.h

73 lines
3.2 KiB
C

/* ==========================================================================
* BLX HS OTG Linux Software Driver and documentation (hereinafter,
* "Software") is an Unsupported proprietary work of BLX, Inc. unless
* otherwise expressly agreed to in writing between BLX and you.
*
* The Software IS NOT an item of Licensed Software or Licensed Product under
* any End User Software License Agreement or Agreement for Licensed Product
* with BLX or any supplement thereto. You are permitted to use and
* redistribute this Software in source and binary forms, with or without
* modification, provided that redistributions of source code must retain this
* notice. You may not view, use, disclose, copy or distribute this file or
* any information contained herein except pursuant to this license grant from
* BLX. If you do not agree with this notice, including the disclaimer
* below, then you are not authorized to use the Software.
*
* THIS SOFTWARE IS BEING DISTRIBUTED BY BLX SOLELY ON AN "AS IS" BASIS
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL BLX BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
* ========================================================================== */
#ifndef __GSC3280_OTG_ADP_H__
#define __GSC3280_OTG_ADP_H__
/**
* @file
*
* This file contains the Attach Detect Protocol interfaces and defines
* (functions) and structures for Linux.
*
*/
#define GSC3280_OTG_ADP_UNATTACHED 0
#define GSC3280_OTG_ADP_ATTACHED 1
#define GSC3280_OTG_ADP_UNKOWN 2
typedef struct gsc3280_otg_adp {
uint32_t initial_probe;
int32_t probe_timer_values[2];
uint32_t probe_enabled;
uint32_t sense_enabled;
gsc3280_timer_t *sense_timer;
uint32_t sense_timer_started;
gsc3280_timer_t *vbuson_timer;
uint32_t vbuson_timer_started;
uint32_t attached;
} gsc3280_otg_adp_t;
/**
* Attach Detect Protocol functions
*/
extern void gsc3280_otg_adp_write_reg(gsc3280_otg_core_if_t * core_if, uint32_t value);
extern uint32_t gsc3280_otg_adp_read_reg(gsc3280_otg_core_if_t * core_if);
extern uint32_t gsc3280_otg_adp_probe_start(gsc3280_otg_core_if_t * core_if);
extern uint32_t gsc3280_otg_adp_sense_start(gsc3280_otg_core_if_t * core_if);
extern uint32_t gsc3280_otg_adp_probe_stop(gsc3280_otg_core_if_t * core_if);
extern uint32_t gsc3280_otg_adp_sense_stop(gsc3280_otg_core_if_t * core_if);
extern void gsc3280_otg_adp_start(gsc3280_otg_core_if_t * core_if);
extern void gsc3280_otg_adp_init(gsc3280_otg_core_if_t * core_if);
extern void gsc3280_otg_adp_remove(gsc3280_otg_core_if_t * core_if);
extern int32_t gsc3280_otg_adp_handle_intr(gsc3280_otg_core_if_t * core_if);
extern int32_t gsc3280_otg_adp_handle_srp_intr(gsc3280_otg_core_if_t * core_if);
#endif //__GSC3280_OTG_ADP_H__