linux/include/linux/usb/ulpi.h

// SPDX-License-Identifier: GPL-2.0
/*
 * ulpi.h -- ULPI defines and function prorotypes
 *
 * Copyright (C) 2010 Nokia Corporation
 */

#ifndef __LINUX_USB_ULPI_H
#define __LINUX_USB_ULPI_H

#include <linux/usb/otg.h>
#include <linux/ulpi/regs.h>

/*-------------------------------------------------------------------------*/

/*
 * ULPI Flags
 */
#define ULPI_OTG_ID_PULLUP
#define ULPI_OTG_DP_PULLDOWN_DIS
#define ULPI_OTG_DM_PULLDOWN_DIS
#define ULPI_OTG_DISCHRGVBUS
#define ULPI_OTG_CHRGVBUS
#define ULPI_OTG_DRVVBUS
#define ULPI_OTG_DRVVBUS_EXT
#define ULPI_OTG_EXTVBUSIND

#define ULPI_IC_6PIN_SERIAL
#define ULPI_IC_3PIN_SERIAL
#define ULPI_IC_CARKIT
#define ULPI_IC_CLKSUSPM
#define ULPI_IC_AUTORESUME
#define ULPI_IC_EXTVBUS_INDINV
#define ULPI_IC_IND_PASSTHRU
#define ULPI_IC_PROTECT_DIS

#define ULPI_FC_HS
#define ULPI_FC_FS
#define ULPI_FC_LS
#define ULPI_FC_FS4LS
#define ULPI_FC_TERMSEL
#define ULPI_FC_OP_NORM
#define ULPI_FC_OP_NODRV
#define ULPI_FC_OP_DIS_NRZI
#define ULPI_FC_OP_NSYNC_NEOP
#define ULPI_FC_RST
#define ULPI_FC_SUSPM

/*-------------------------------------------------------------------------*/

#if IS_ENABLED(CONFIG_USB_ULPI)
struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
					unsigned int flags);

struct usb_phy *devm_otg_ulpi_create(struct device *dev,
				     struct usb_phy_io_ops *ops,
				     unsigned int flags);
#else
static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
					      unsigned int flags)
{
	return NULL;
}

static inline struct usb_phy *devm_otg_ulpi_create(struct device *dev,
						   struct usb_phy_io_ops *ops,
						   unsigned int flags)
{
	return NULL;
}
#endif

#ifdef CONFIG_USB_ULPI_VIEWPORT
/* access ops for controllers with a viewport register */
extern struct usb_phy_io_ops ulpi_viewport_access_ops;
#endif

#endif /* __LINUX_USB_ULPI_H */