~ubuntu-branches/ubuntu/saucy/u-boot/saucy

« back to all changes in this revision

Viewing changes to include/usb/ulpi.h

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2012-05-01 18:07:19 UTC
  • mfrom: (16.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20120501180719-rjntk3287im4a0ns
Tags: 2012.04.01-1
* New upstream version.
  - Update mipsel-native-endianness.diff.
  - Update no-error-on-set-but-unused-variables.diff (partially merged).
  - Drop kirkwood_spi-irq_mask.diff (merged).
  - Drop kirkwood-disable-l2c.diff (merged).

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#endif
29
29
 
30
30
/*
 
31
 * ulpi view port address and
 
32
 * Port_number that can be passed.
 
33
 * Any additional data to be passed can
 
34
 * be extended from this structure
 
35
 */
 
36
struct ulpi_viewport {
 
37
        u32 viewport_addr;
 
38
        u32 port_num;
 
39
};
 
40
 
 
41
/*
31
42
 * Initialize the ULPI transciever and check the interface integrity.
32
 
 * @ulpi_viewport -  the address of the ULPI viewport register.
 
43
 * @ulpi_vp -  structure containing ULPI viewport data
33
44
 *
34
45
 * returns 0 on success, ULPI_ERROR on failure.
35
46
 */
36
 
int ulpi_init(u32 ulpi_viewport);
 
47
int ulpi_init(struct ulpi_viewport *ulpi_vp);
37
48
 
38
49
/*
39
50
 * Select transceiver speed.
41
52
 *                ULPI_FC_LOW_SPEED,  ULPI_FC_FS4LS
42
53
 * returns 0 on success, ULPI_ERROR on failure.
43
54
 */
44
 
int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed);
 
55
int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed);
45
56
 
46
57
/*
47
58
 * Enable/disable VBUS.
50
61
 *
51
62
 * returns 0 on success, ULPI_ERROR on failure.
52
63
 */
53
 
int ulpi_enable_vbus(u32 ulpi_viewport, int on, int ext_power, int ext_ind);
 
64
int ulpi_enable_vbus(struct ulpi_viewport *ulpi_vp,
 
65
                        int on, int ext_power, int ext_ind);
54
66
 
55
67
/*
56
68
 * Enable/disable pull-down resistors on D+ and D- USB lines.
57
69
 *
58
70
 * returns 0 on success, ULPI_ERROR on failure.
59
71
 */
60
 
int ulpi_set_pd(u32 ulpi_viewport, int enable);
 
72
int ulpi_set_pd(struct ulpi_viewport *ulpi_vp, int enable);
61
73
 
62
74
/*
63
75
 * Select OpMode.
66
78
 *
67
79
 * returns 0 on success, ULPI_ERROR on failure.
68
80
 */
69
 
int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode);
 
81
int ulpi_opmode_sel(struct ulpi_viewport *ulpi_vp, unsigned opmode);
70
82
 
71
83
/*
72
84
 * Switch to Serial Mode.
78
90
 * Switches immediately to Serial Mode.
79
91
 * To return from Serial Mode, STP line needs to be asserted.
80
92
 */
81
 
int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode);
 
93
int ulpi_serial_mode_enable(struct ulpi_viewport *ulpi_vp, unsigned smode);
82
94
 
83
95
/*
84
96
 * Put PHY into low power mode.
89
101
 * STP line must be driven low to keep the PHY in suspend.
90
102
 * To resume the PHY, STP line needs to be asserted.
91
103
 */
92
 
int ulpi_suspend(u32 ulpi_viewport);
 
104
int ulpi_suspend(struct ulpi_viewport *ulpi_vp);
93
105
 
94
106
/*
95
107
 * Reset the transceiver. ULPI interface and registers are not affected.
96
108
 *
97
109
 * returns 0 on success, ULPI_ERROR on failure.
98
110
 */
99
 
int ulpi_reset(u32 ulpi_viewport);
 
111
int ulpi_reset(struct ulpi_viewport *ulpi_vp);
100
112
 
101
113
 
102
114
/* ULPI access methods below must be implemented for each ULPI viewport. */
108
120
 *
109
121
 * returns 0 on success, ULPI_ERROR on failure.
110
122
 */
111
 
int ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value);
 
123
int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value);
112
124
 
113
125
/*
114
126
 * Read the ULPI PHY register content via the viewport.
116
128
 *
117
129
 * returns register content on success, ULPI_ERROR on failure.
118
130
 */
119
 
u32 ulpi_read(u32 ulpi_viewport, u8 *reg);
 
131
u32 ulpi_read(struct ulpi_viewport *ulpi_vp, u8 *reg);
120
132
 
121
133
/*
122
134
 * Wait for the reset to complete.
123
135
 * The Link must not attempt to access the PHY until the reset has
124
136
 * completed and DIR line is de-asserted.
125
137
 */
126
 
int ulpi_reset_wait(u32 ulpi_viewport);
 
138
int ulpi_reset_wait(struct ulpi_viewport *ulpi_vp);
127
139
 
128
140
/* Access Extended Register Set (indicator) */
129
141
#define ACCESS_EXT_REGS_OFFSET  0x2f    /* read-write */