Heikki Krogerus | 3a229eb | 2010-05-03 09:13:01 +0300 | [diff] [blame] | 1 | /* |
| 2 | * ulpi.h -- ULPI defines and function prorotypes |
| 3 | * |
| 4 | * Copyright (C) 2010 Nokia Corporation |
| 5 | * |
| 6 | * This software is distributed under the terms of the GNU General |
| 7 | * Public License ("GPL") as published by the Free Software Foundation, |
| 8 | * version 2 of that License. |
| 9 | */ |
| 10 | |
Daniel Mack | 2d57a95 | 2009-10-15 17:09:35 +0300 | [diff] [blame] | 11 | #ifndef __LINUX_USB_ULPI_H |
| 12 | #define __LINUX_USB_ULPI_H |
| 13 | |
Ajay Kumar Gupta | 5128993 | 2010-07-08 14:03:01 +0530 | [diff] [blame] | 14 | #include <linux/usb/otg.h> |
Heikki Krogerus | 289fcff | 2015-05-13 15:26:42 +0300 | [diff] [blame] | 15 | #include <linux/ulpi/regs.h> |
| 16 | |
Heikki Krogerus | 3a229eb | 2010-05-03 09:13:01 +0300 | [diff] [blame] | 17 | /*-------------------------------------------------------------------------*/ |
| 18 | |
| 19 | /* |
Igor Grinberg | 13dd0c9 | 2010-07-15 16:00:16 +0300 | [diff] [blame] | 20 | * ULPI Flags |
| 21 | */ |
| 22 | #define ULPI_OTG_ID_PULLUP (1 << 0) |
| 23 | #define ULPI_OTG_DP_PULLDOWN_DIS (1 << 1) |
| 24 | #define ULPI_OTG_DM_PULLDOWN_DIS (1 << 2) |
| 25 | #define ULPI_OTG_DISCHRGVBUS (1 << 3) |
| 26 | #define ULPI_OTG_CHRGVBUS (1 << 4) |
| 27 | #define ULPI_OTG_DRVVBUS (1 << 5) |
| 28 | #define ULPI_OTG_DRVVBUS_EXT (1 << 6) |
| 29 | #define ULPI_OTG_EXTVBUSIND (1 << 7) |
| 30 | |
| 31 | #define ULPI_IC_6PIN_SERIAL (1 << 8) |
| 32 | #define ULPI_IC_3PIN_SERIAL (1 << 9) |
| 33 | #define ULPI_IC_CARKIT (1 << 10) |
| 34 | #define ULPI_IC_CLKSUSPM (1 << 11) |
| 35 | #define ULPI_IC_AUTORESUME (1 << 12) |
| 36 | #define ULPI_IC_EXTVBUS_INDINV (1 << 13) |
| 37 | #define ULPI_IC_IND_PASSTHRU (1 << 14) |
| 38 | #define ULPI_IC_PROTECT_DIS (1 << 15) |
| 39 | |
| 40 | #define ULPI_FC_HS (1 << 16) |
| 41 | #define ULPI_FC_FS (1 << 17) |
| 42 | #define ULPI_FC_LS (1 << 18) |
| 43 | #define ULPI_FC_FS4LS (1 << 19) |
| 44 | #define ULPI_FC_TERMSEL (1 << 20) |
| 45 | #define ULPI_FC_OP_NORM (1 << 21) |
| 46 | #define ULPI_FC_OP_NODRV (1 << 22) |
| 47 | #define ULPI_FC_OP_DIS_NRZI (1 << 23) |
| 48 | #define ULPI_FC_OP_NSYNC_NEOP (1 << 24) |
| 49 | #define ULPI_FC_RST (1 << 25) |
| 50 | #define ULPI_FC_SUSPM (1 << 26) |
| 51 | |
| 52 | /*-------------------------------------------------------------------------*/ |
| 53 | |
Fabio Estevam | 7fa4cd1 | 2013-03-20 10:35:44 -0300 | [diff] [blame] | 54 | #if IS_ENABLED(CONFIG_USB_ULPI) |
Heikki Krogerus | 298b083 | 2012-02-13 13:24:13 +0200 | [diff] [blame] | 55 | struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, |
Daniel Mack | 2d57a95 | 2009-10-15 17:09:35 +0300 | [diff] [blame] | 56 | unsigned int flags); |
Fabio Estevam | 7fa4cd1 | 2013-03-20 10:35:44 -0300 | [diff] [blame] | 57 | #else |
| 58 | static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, |
| 59 | unsigned int flags) |
| 60 | { |
| 61 | return NULL; |
| 62 | } |
| 63 | #endif |
Daniel Mack | 2d57a95 | 2009-10-15 17:09:35 +0300 | [diff] [blame] | 64 | |
Benoit Goby | ee398ba | 2011-03-09 16:28:54 -0800 | [diff] [blame] | 65 | #ifdef CONFIG_USB_ULPI_VIEWPORT |
| 66 | /* access ops for controllers with a viewport register */ |
Heikki Krogerus | 298b083 | 2012-02-13 13:24:13 +0200 | [diff] [blame] | 67 | extern struct usb_phy_io_ops ulpi_viewport_access_ops; |
Benoit Goby | ee398ba | 2011-03-09 16:28:54 -0800 | [diff] [blame] | 68 | #endif |
| 69 | |
Daniel Mack | 2d57a95 | 2009-10-15 17:09:35 +0300 | [diff] [blame] | 70 | #endif /* __LINUX_USB_ULPI_H */ |