2017-11-03 10:28:30 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2010-05-03 06:13:01 +00:00
|
|
|
/*
|
|
|
|
* ulpi.h -- ULPI defines and function prorotypes
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Nokia Corporation
|
|
|
|
*
|
|
|
|
* This software is distributed under the terms of the GNU General
|
|
|
|
* Public License ("GPL") as published by the Free Software Foundation,
|
|
|
|
* version 2 of that License.
|
|
|
|
*/
|
|
|
|
|
2009-10-15 14:09:35 +00:00
|
|
|
#ifndef __LINUX_USB_ULPI_H
|
|
|
|
#define __LINUX_USB_ULPI_H
|
|
|
|
|
2010-07-08 08:33:01 +00:00
|
|
|
#include <linux/usb/otg.h>
|
2015-05-13 12:26:42 +00:00
|
|
|
#include <linux/ulpi/regs.h>
|
|
|
|
|
2010-05-03 06:13:01 +00:00
|
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
|
2010-07-15 13:00:16 +00:00
|
|
|
/*
|
|
|
|
* ULPI Flags
|
|
|
|
*/
|
|
|
|
#define ULPI_OTG_ID_PULLUP (1 << 0)
|
|
|
|
#define ULPI_OTG_DP_PULLDOWN_DIS (1 << 1)
|
|
|
|
#define ULPI_OTG_DM_PULLDOWN_DIS (1 << 2)
|
|
|
|
#define ULPI_OTG_DISCHRGVBUS (1 << 3)
|
|
|
|
#define ULPI_OTG_CHRGVBUS (1 << 4)
|
|
|
|
#define ULPI_OTG_DRVVBUS (1 << 5)
|
|
|
|
#define ULPI_OTG_DRVVBUS_EXT (1 << 6)
|
|
|
|
#define ULPI_OTG_EXTVBUSIND (1 << 7)
|
|
|
|
|
|
|
|
#define ULPI_IC_6PIN_SERIAL (1 << 8)
|
|
|
|
#define ULPI_IC_3PIN_SERIAL (1 << 9)
|
|
|
|
#define ULPI_IC_CARKIT (1 << 10)
|
|
|
|
#define ULPI_IC_CLKSUSPM (1 << 11)
|
|
|
|
#define ULPI_IC_AUTORESUME (1 << 12)
|
|
|
|
#define ULPI_IC_EXTVBUS_INDINV (1 << 13)
|
|
|
|
#define ULPI_IC_IND_PASSTHRU (1 << 14)
|
|
|
|
#define ULPI_IC_PROTECT_DIS (1 << 15)
|
|
|
|
|
|
|
|
#define ULPI_FC_HS (1 << 16)
|
|
|
|
#define ULPI_FC_FS (1 << 17)
|
|
|
|
#define ULPI_FC_LS (1 << 18)
|
|
|
|
#define ULPI_FC_FS4LS (1 << 19)
|
|
|
|
#define ULPI_FC_TERMSEL (1 << 20)
|
|
|
|
#define ULPI_FC_OP_NORM (1 << 21)
|
|
|
|
#define ULPI_FC_OP_NODRV (1 << 22)
|
|
|
|
#define ULPI_FC_OP_DIS_NRZI (1 << 23)
|
|
|
|
#define ULPI_FC_OP_NSYNC_NEOP (1 << 24)
|
|
|
|
#define ULPI_FC_RST (1 << 25)
|
|
|
|
#define ULPI_FC_SUSPM (1 << 26)
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
|
2013-03-20 13:35:44 +00:00
|
|
|
#if IS_ENABLED(CONFIG_USB_ULPI)
|
2012-02-13 11:24:13 +00:00
|
|
|
struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
|
2009-10-15 14:09:35 +00:00
|
|
|
unsigned int flags);
|
2020-01-06 01:34:06 +00:00
|
|
|
|
|
|
|
struct usb_phy *devm_otg_ulpi_create(struct device *dev,
|
|
|
|
struct usb_phy_io_ops *ops,
|
|
|
|
unsigned int flags);
|
2013-03-20 13:35:44 +00:00
|
|
|
#else
|
|
|
|
static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
|
|
|
|
unsigned int flags)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2020-01-06 01:34:06 +00:00
|
|
|
|
|
|
|
static inline struct usb_phy *devm_otg_ulpi_create(struct device *dev,
|
|
|
|
struct usb_phy_io_ops *ops,
|
|
|
|
unsigned int flags)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2013-03-20 13:35:44 +00:00
|
|
|
#endif
|
2009-10-15 14:09:35 +00:00
|
|
|
|
2011-03-10 00:28:54 +00:00
|
|
|
#ifdef CONFIG_USB_ULPI_VIEWPORT
|
|
|
|
/* access ops for controllers with a viewport register */
|
2012-02-13 11:24:13 +00:00
|
|
|
extern struct usb_phy_io_ops ulpi_viewport_access_ops;
|
2011-03-10 00:28:54 +00:00
|
|
|
#endif
|
|
|
|
|
2009-10-15 14:09:35 +00:00
|
|
|
#endif /* __LINUX_USB_ULPI_H */
|