linux/include/linux/ulpi/regs.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_ULPI_REGS_H
#define __LINUX_ULPI_REGS_H

/*
 * Macros for Set and Clear
 * See ULPI 1.1 specification to find the registers with Set and Clear offsets
 */
#define ULPI_SET(a)
#define ULPI_CLR(a)

/*
 * Register Map
 */
#define ULPI_VENDOR_ID_LOW
#define ULPI_VENDOR_ID_HIGH
#define ULPI_PRODUCT_ID_LOW
#define ULPI_PRODUCT_ID_HIGH
#define ULPI_FUNC_CTRL
#define ULPI_IFC_CTRL
#define ULPI_OTG_CTRL
#define ULPI_USB_INT_EN_RISE
#define ULPI_USB_INT_EN_FALL
#define ULPI_USB_INT_STS
#define ULPI_USB_INT_LATCH
#define ULPI_DEBUG
#define ULPI_SCRATCH
/* Optional Carkit Registers */
#define ULPI_CARKIT_CTRL
#define ULPI_CARKIT_INT_DELAY
#define ULPI_CARKIT_INT_EN
#define ULPI_CARKIT_INT_STS
#define ULPI_CARKIT_INT_LATCH
#define ULPI_CARKIT_PLS_CTRL
/* Other Optional Registers */
#define ULPI_TX_POS_WIDTH
#define ULPI_TX_NEG_WIDTH
#define ULPI_POLARITY_RECOVERY
/* Access Extended Register Set */
#define ULPI_ACCESS_EXTENDED
/* Vendor Specific */
#define ULPI_VENDOR_SPECIFIC
/* Extended Registers */
#define ULPI_EXT_VENDOR_SPECIFIC

/*
 * Register Bits
 */

/* Function Control */
#define ULPI_FUNC_CTRL_XCVRSEL
#define ULPI_FUNC_CTRL_XCVRSEL_MASK
#define ULPI_FUNC_CTRL_HIGH_SPEED
#define ULPI_FUNC_CTRL_FULL_SPEED
#define ULPI_FUNC_CTRL_LOW_SPEED
#define ULPI_FUNC_CTRL_FS4LS
#define ULPI_FUNC_CTRL_TERMSELECT
#define ULPI_FUNC_CTRL_OPMODE
#define ULPI_FUNC_CTRL_OPMODE_MASK
#define ULPI_FUNC_CTRL_OPMODE_NORMAL
#define ULPI_FUNC_CTRL_OPMODE_NONDRIVING
#define ULPI_FUNC_CTRL_OPMODE_DISABLE_NRZI
#define ULPI_FUNC_CTRL_OPMODE_NOSYNC_NOEOP
#define ULPI_FUNC_CTRL_RESET
#define ULPI_FUNC_CTRL_SUSPENDM

/* Interface Control */
#define ULPI_IFC_CTRL_6_PIN_SERIAL_MODE
#define ULPI_IFC_CTRL_3_PIN_SERIAL_MODE
#define ULPI_IFC_CTRL_CARKITMODE
#define ULPI_IFC_CTRL_CLOCKSUSPENDM
#define ULPI_IFC_CTRL_AUTORESUME
#define ULPI_IFC_CTRL_EXTERNAL_VBUS
#define ULPI_IFC_CTRL_PASSTHRU
#define ULPI_IFC_CTRL_PROTECT_IFC_DISABLE

/* OTG Control */
#define ULPI_OTG_CTRL_ID_PULLUP
#define ULPI_OTG_CTRL_DP_PULLDOWN
#define ULPI_OTG_CTRL_DM_PULLDOWN
#define ULPI_OTG_CTRL_DISCHRGVBUS
#define ULPI_OTG_CTRL_CHRGVBUS
#define ULPI_OTG_CTRL_DRVVBUS
#define ULPI_OTG_CTRL_DRVVBUS_EXT
#define ULPI_OTG_CTRL_EXTVBUSIND

/* USB Interrupt Enable Rising,
 * USB Interrupt Enable Falling,
 * USB Interrupt Status and
 * USB Interrupt Latch
 */
#define ULPI_INT_HOST_DISCONNECT
#define ULPI_INT_VBUS_VALID
#define ULPI_INT_SESS_VALID
#define ULPI_INT_SESS_END
#define ULPI_INT_IDGRD

/* Debug */
#define ULPI_DEBUG_LINESTATE0
#define ULPI_DEBUG_LINESTATE1

/* Carkit Control */
#define ULPI_CARKIT_CTRL_CARKITPWR
#define ULPI_CARKIT_CTRL_IDGNDDRV
#define ULPI_CARKIT_CTRL_TXDEN
#define ULPI_CARKIT_CTRL_RXDEN
#define ULPI_CARKIT_CTRL_SPKLEFTEN
#define ULPI_CARKIT_CTRL_SPKRIGHTEN
#define ULPI_CARKIT_CTRL_MICEN

/* Carkit Interrupt Enable */
#define ULPI_CARKIT_INT_EN_IDFLOAT_RISE
#define ULPI_CARKIT_INT_EN_IDFLOAT_FALL
#define ULPI_CARKIT_INT_EN_CARINTDET
#define ULPI_CARKIT_INT_EN_DP_RISE
#define ULPI_CARKIT_INT_EN_DP_FALL

/* Carkit Interrupt Status and
 * Carkit Interrupt Latch
 */
#define ULPI_CARKIT_INT_IDFLOAT
#define ULPI_CARKIT_INT_CARINTDET
#define ULPI_CARKIT_INT_DP

/* Carkit Pulse Control*/
#define ULPI_CARKIT_PLS_CTRL_TXPLSEN
#define ULPI_CARKIT_PLS_CTRL_RXPLSEN
#define ULPI_CARKIT_PLS_CTRL_SPKRLEFT_BIASEN
#define ULPI_CARKIT_PLS_CTRL_SPKRRIGHT_BIASEN

#endif /* __LINUX_ULPI_REGS_H */