The complex patch with which MohammadAG had his success
[h-e-n] / drivers / usb / musb / isp1704.h
1 /*
2  * isp1704.h - ISP 1704 Register
3  *
4  * Copyright (C) 2008 Nokia Corporation
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * version 2 as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18  * 02110-1301 USA
19  *
20  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
21  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
23  * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32
33 #ifndef __ISP1704_H__
34 #define __ISP1704_H__
35
36 #define ISP1704_VENDOR_ID_LOW           0x00
37 #define ISP1704_VENDOR_ID_HIGH          0x01
38 #define ISP1704_PRODUCT_ID_LOW          0x02
39 #define ISP1704_PRODUCT_ID_HIGH         0x03
40 #define ISP1704_FUNC_CTRL               0x04
41 #define ISP1704_OTG_CTRL                0x0a
42 #define ISP1704_USB_INTRISE             0x0d
43 #define ISP1704_USB_INTFALL             0x10
44 #define ISP1704_USB_INTSTAT   0x13
45 #define ISP1704_DEBUG                   0x15
46 #define ISP1704_SCRATCH                 0x16
47 #define ISP1704_PWR_CTRL                0x3d
48
49 /* Function control */
50 #define ISP1704_FUNC_CTRL_FULL_SPEED    (1 << 0)
51 #define ISP1704_FUNC_CTRL_XCVRSELECT    0x3
52 #define ISP1704_FUNC_CTRL_XCVRSELECT_SHIFT      (1 << 0)
53 #define ISP1704_FUNC_CTRL_TERMSELECT    (1 << 2)
54 #define ISP1704_FUNC_CTRL_OPMODE        (1 << 3)
55 #define ISP1704_FUNC_CTRL_OPMODE_SHIFT  3
56 #define ISP1704_FUNC_CTRL_RESET         (1 << 5)
57 #define ISP1704_FUNC_CTRL_SUSPENDM      (1 << 6)
58
59 /* OTG Control */
60 #define ISP1704_OTG_CTRL_IDPULLUP       (1 << 0)
61 #define ISP1704_OTG_CTRL_DP_PULLDOWN    (1 << 1)
62 #define ISP1704_OTG_CTRL_DM_PULLDOWN    (1 << 2)
63 #define ISP1704_OTG_CTRL_DISCHRG_VBUS   (1 << 3)
64 #define ISP1704_OTG_CTRL_CHRG_VBUS      (1 << 4)
65 #define ISP1704_OTG_CTRL_DRV_VBUS_EXT   (1 << 6)
66 #define ISP1704_OTG_CTRL_USB_EXT_VBUS   (1 << 7)
67
68 /* Debug */
69 #define ISP1704_DEBUG_LINESTATE0        (1 << 0)
70 #define ISP1704_DEBUG_LINESTATE1        (1 << 1)
71
72 /* Power control */
73 #define ISP1704_PWR_CTRL_SWCTRL         (1 << 0)
74 #define ISP1704_PWR_CTRL_DET_COMP       (1 << 1)
75 #define ISP1704_PWR_CTRL_BVALID_RISE    (1 << 2)
76 #define ISP1704_PWR_CTRL_BVALID_FALL    (1 << 3)
77 #define ISP1704_PWR_CTRL_DP_WKPU_EN     (1 << 4)
78 #define ISP1704_PWR_CTRL_VDAT_DET       (1 << 5)
79 #define ISP1704_PWR_CTRL_DPVSRC_EN      (1 << 6)
80 #define ISP1704_PWR_CTRL_HWDETECT       (1 << 7)
81
82 #endif  /* __ISP1704_H__ */