linux/drivers/usb/chipidea/otg_fsm.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2014 Freescale Semiconductor, Inc.
 *
 * Author: Jun Li
 */

#ifndef __DRIVERS_USB_CHIPIDEA_OTG_FSM_H
#define __DRIVERS_USB_CHIPIDEA_OTG_FSM_H

#include <linux/usb/otg-fsm.h>

/*
 *  A-DEVICE timing  constants
 */

/* Wait for VBUS Rise  */
#define TA_WAIT_VRISE
/* Wait for VBUS Fall  */
#define TA_WAIT_VFALL
/* Wait for B-Connect */
#define TA_WAIT_BCON
/* A-Idle to B-Disconnect */
#define TA_AIDL_BDIS
/* B-Idle to A-Disconnect */
#define TA_BIDL_ADIS

/*
 * B-device timing constants
 */

/* Data-Line Pulse Time*/
#define TB_DATA_PLS
/* SRP Fail Time  */
#define TB_SRP_FAIL
/* A-SE0 to B-Reset  */
#define TB_ASE0_BRST
/* SE0 Time Before SRP */
#define TB_SE0_SRP
/* SSEND time before SRP */
#define TB_SSEND_SRP

#define TB_AIDL_BDIS

#if IS_ENABLED(CONFIG_USB_OTG_FSM)

int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
int ci_otg_fsm_work(struct ci_hdrc *ci);
irqreturn_t ci_otg_fsm_irq(struct ci_hdrc *ci);
void ci_hdrc_otg_fsm_start(struct ci_hdrc *ci);
void ci_hdrc_otg_fsm_remove(struct ci_hdrc *ci);

#else

static inline int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)
{
	return 0;
}

static inline int ci_otg_fsm_work(struct ci_hdrc *ci)
{
	return -ENXIO;
}

static inline irqreturn_t ci_otg_fsm_irq(struct ci_hdrc *ci)
{
	return IRQ_NONE;
}

static inline void ci_hdrc_otg_fsm_start(struct ci_hdrc *ci)
{

}

static inline void ci_hdrc_otg_fsm_remove(struct ci_hdrc *ci)
{

}

#endif

#endif /* __DRIVERS_USB_CHIPIDEA_OTG_FSM_H */