Lines Matching +full:ulpi +full:- +full:0
1 // SPDX-License-Identifier: GPL-2.0
18 #include <usb/ulpi.h>
20 /* ULPI viewport control bits */
27 * Wait for the ULPI request to complete
29 * @ulpi_viewport - the address of the viewport
30 * @mask - expected value to wait for
32 * returns 0 on mask match, ULPI_ERROR on time out.
39 while (--timeout) { in ulpi_wait()
40 if ((readl(ulpi_vp->viewport_addr) & mask) == 0) in ulpi_wait()
41 return 0; in ulpi_wait()
50 * Wake the ULPI PHY up for communication
52 * returns 0 on success.
58 if (readl(ulpi_vp->viewport_addr) & ULPI_SS) in ulpi_wakeup()
59 return 0; /* already awake */ in ulpi_wakeup()
61 writel(ULPI_WU, ulpi_vp->viewport_addr); in ulpi_wakeup()
65 printf("ULPI wakeup timed out\n"); in ulpi_wakeup()
71 * Issue a ULPI read/write request
73 * @value - the ULPI request
83 writel(value, ulpi_vp->viewport_addr); in ulpi_request()
87 printf("ULPI request timed out\n"); in ulpi_request()
94 u32 addr = (uintptr_t)reg & 0xFF; in ulpi_write()
95 u32 val = ULPI_RWRUN | ULPI_RWCTRL | addr << 16 | (value & 0xff); in ulpi_write()
97 val |= (ulpi_vp->port_num & 0x7) << 24; in ulpi_write()
104 u32 val = ULPI_RWRUN | ((uintptr_t)reg & 0xFF) << 16; in ulpi_read()
106 val |= (ulpi_vp->port_num & 0x7) << 24; in ulpi_read()
111 return (readl(ulpi_vp->viewport_addr) >> 8) & 0xff; in ulpi_read()