\hypertarget{musb__otg__allwinner_8c_source}{}\doxysection{musb\+\_\+otg\+\_\+allwinner.\+c}
\label{musb__otg__allwinner_8c_source}\index{dev/usb/controller/musb\_otg\_allwinner.c@{dev/usb/controller/musb\_otg\_allwinner.c}}
\mbox{\hyperlink{musb__otg__allwinner_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2016 Jared McNeill <jmcneill@invisible.ca>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00003}00003 \textcolor{comment}{ * Copyright (c) 2018 Andrew Turner <andrew@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00004}00004 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00006}00006 \textcolor{comment}{ * This software was developed by SRI International and the University of}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00007}00007 \textcolor{comment}{ * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-\/10-\/C-\/0237}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00008}00008 \textcolor{comment}{ * ("{}CTSRD"{}), as part of the DARPA CRASH research programme.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00010}00010 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00011}00011 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00012}00012 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00013}00013 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00015}00015 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00016}00016 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00017}00017 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00019}00019 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00020}00020 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00021}00021 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00022}00022 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00023}00023 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00024}00024 \textcolor{comment}{ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00025}00025 \textcolor{comment}{ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00026}00026 \textcolor{comment}{ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00027}00027 \textcolor{comment}{ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00028}00028 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00029}00029 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00030}00030 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00031}00031 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00032}00032 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00034}00034 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00035}00035 \textcolor{comment}{ * Allwinner USB Dual-\/Role Device (DRD) controller}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00036}00036 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00039}\mbox{\hyperlink{musb__otg__allwinner_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00039}} \mbox{\hyperlink{musb__otg__allwinner_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <dev/ofw/ofw\_bus.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <dev/ofw/ofw\_bus\_subr.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__core_8h}{dev/usb/usb\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__busdma_8h}{dev/usb/usb\_busdma.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__util_8h}{dev/usb/usb\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__controller_8h}{dev/usb/usb\_controller.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__bus_8h}{dev/usb/usb\_bus.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{musb__otg_8h}{dev/usb/controller/musb\_otg.h}}>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <dev/extres/clk/clk.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <dev/extres/hwreset/hwreset.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <dev/extres/phy/phy.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <dev/extres/phy/phy\_usb.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00070}00070 \textcolor{preprocessor}{\#ifdef \_\_arm\_\_}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00071}00071 \textcolor{preprocessor}{\#include <arm/allwinner/aw\_machdep.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <arm/allwinner/a10\_sramc.h>}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00073}00073 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00075}\mbox{\hyperlink{musb__otg__allwinner_8c_a052e52309ed267ed6a4dccb6f24b2447}{00075}} \textcolor{preprocessor}{\#define DRD\_EP\_MAX              5}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00076}\mbox{\hyperlink{musb__otg__allwinner_8c_ad6201d15f9c2c88d0cc64f830b815f98}{00076}} \textcolor{preprocessor}{\#define DRD\_EP\_MAX\_H3           4}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00078}\mbox{\hyperlink{musb__otg__allwinner_8c_a4613c6a0d67e4902130ea0094dec9cd9}{00078}} \textcolor{preprocessor}{\#define MUSB2\_REG\_AWIN\_VEND0    0x0043}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00079}\mbox{\hyperlink{musb__otg__allwinner_8c_a39ec88e2d8f2a9ededdc4d2651d66110}{00079}} \textcolor{preprocessor}{\#define VEND0\_PIO\_MODE          0}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00081}00081 \textcolor{preprocessor}{\#if defined(\_\_arm\_\_)}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00082}00082 \textcolor{preprocessor}{\#define bs\_parent\_space(bs)     ((bs)-\/>bs\_parent)}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00083}00083 \textcolor{keyword}{typedef} bus\_space\_tag\_t awusb\_bs\_tag;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00084}00084 \textcolor{preprocessor}{\#elif defined(\_\_aarch64\_\_)}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00085}00085 \textcolor{preprocessor}{\#define bs\_parent\_space(bs)     (bs)}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00086}00086 \textcolor{keyword}{typedef} \textcolor{keywordtype}{void} *          awusb\_bs\_tag;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00087}00087 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00089}\mbox{\hyperlink{musb__otg__allwinner_8c_a2c2c59bae4c27222d98ef80f0b7e6298}{00089}} \textcolor{preprocessor}{\#define AWUSB\_OKAY              0x01}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00090}\mbox{\hyperlink{musb__otg__allwinner_8c_a83b248d3e24a0c4de8a3963744fdaea5}{00090}} \textcolor{preprocessor}{\#define AWUSB\_NO\_CONFDATA       0x02}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00091}\mbox{\hyperlink{musb__otg__allwinner_8c_ab1bb129b8c62d8033fbb3adf82f284a0}{00091}} \textcolor{keyword}{static} \textcolor{keyword}{struct }ofw\_compat\_data \mbox{\hyperlink{musb__otg__allwinner_8c_ab1bb129b8c62d8033fbb3adf82f284a0}{compat\_data}}[] = \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00092}00092         \{ \textcolor{stringliteral}{"{}allwinner,sun4i-\/a10-\/musb"{}},   \mbox{\hyperlink{musb__otg__allwinner_8c_a2c2c59bae4c27222d98ef80f0b7e6298}{AWUSB\_OKAY}} \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00093}00093         \{ \textcolor{stringliteral}{"{}allwinner,sun6i-\/a31-\/musb"{}},   \mbox{\hyperlink{musb__otg__allwinner_8c_a2c2c59bae4c27222d98ef80f0b7e6298}{AWUSB\_OKAY}} \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00094}00094         \{ \textcolor{stringliteral}{"{}allwinner,sun8i-\/a33-\/musb"{}},   \mbox{\hyperlink{musb__otg__allwinner_8c_a2c2c59bae4c27222d98ef80f0b7e6298}{AWUSB\_OKAY}} | \mbox{\hyperlink{musb__otg__allwinner_8c_a83b248d3e24a0c4de8a3963744fdaea5}{AWUSB\_NO\_CONFDATA}} \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00095}00095         \{ \textcolor{stringliteral}{"{}allwinner,sun8i-\/h3-\/musb"{}},    \mbox{\hyperlink{musb__otg__allwinner_8c_a2c2c59bae4c27222d98ef80f0b7e6298}{AWUSB\_OKAY}} | \mbox{\hyperlink{musb__otg__allwinner_8c_a83b248d3e24a0c4de8a3963744fdaea5}{AWUSB\_NO\_CONFDATA}} \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00096}00096         \{ NULL,                         0 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00097}00097 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00099}\mbox{\hyperlink{musb__otg__allwinner_8c_aaf7f2f101e6838ff9f5c29db2dcaa9f1}{00099}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmusb__otg__ep__cfg}{musb\_otg\_ep\_cfg}} \mbox{\hyperlink{musb__otg__allwinner_8c_aaf7f2f101e6838ff9f5c29db2dcaa9f1}{musbotg\_ep\_allwinner}}[] = \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00100}00100         \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00101}00101                 .\mbox{\hyperlink{structmusb__otg__ep__cfg_a50dfaf99f881059accd2ea46df5bf1e1}{ep\_end}} = \mbox{\hyperlink{musb__otg__allwinner_8c_a052e52309ed267ed6a4dccb6f24b2447}{DRD\_EP\_MAX}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00102}00102                 .ep\_fifosz\_shift = 9,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00103}00103                 .ep\_fifosz\_reg = \mbox{\hyperlink{musb__otg_8h_aaed98e1843777014b5d74e3e4cfe6a5c}{MUSB2\_VAL\_FIFOSZ\_512}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00104}00104         \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00105}00105         \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00106}00106                 .ep\_end = -\/1,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00107}00107         \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00108}00108 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00110}\mbox{\hyperlink{musb__otg__allwinner_8c_a65a8dfcec739535b1d27104386c8fad1}{00110}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmusb__otg__ep__cfg}{musb\_otg\_ep\_cfg}} \mbox{\hyperlink{musb__otg__allwinner_8c_a65a8dfcec739535b1d27104386c8fad1}{musbotg\_ep\_allwinner\_h3}}[] = \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00111}00111         \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00112}00112                 .\mbox{\hyperlink{structmusb__otg__ep__cfg_a50dfaf99f881059accd2ea46df5bf1e1}{ep\_end}} = \mbox{\hyperlink{musb__otg__allwinner_8c_ad6201d15f9c2c88d0cc64f830b815f98}{DRD\_EP\_MAX\_H3}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00113}00113                 .ep\_fifosz\_shift = 9,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00114}00114                 .ep\_fifosz\_reg = \mbox{\hyperlink{musb__otg_8h_aaed98e1843777014b5d74e3e4cfe6a5c}{MUSB2\_VAL\_FIFOSZ\_512}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00115}00115         \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00116}00116         \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00117}00117                 .ep\_end = -\/1,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00118}00118         \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00119}00119 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00121}\mbox{\hyperlink{structawusbdrd__softc}{00121}} \textcolor{keyword}{struct }\mbox{\hyperlink{structawusbdrd__softc}{awusbdrd\_softc}} \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00122}\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{00122}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmusbotg__softc}{musbotg\_softc}}       \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00123}\mbox{\hyperlink{structawusbdrd__softc_ae59bf2fd76e96b4d33f1cc351ef324a1}{00123}}         \textcolor{keyword}{struct }resource         *\mbox{\hyperlink{structawusbdrd__softc_ae59bf2fd76e96b4d33f1cc351ef324a1}{res}}[2];}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00124}\mbox{\hyperlink{structawusbdrd__softc_ac2eb9ad052df67ea528d018ae326d9a5}{00124}}         clk\_t                   \mbox{\hyperlink{structawusbdrd__softc_ac2eb9ad052df67ea528d018ae326d9a5}{clk}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00125}\mbox{\hyperlink{structawusbdrd__softc_a4ed8def1533f38680c40135a5d2d3492}{00125}}         hwreset\_t               \mbox{\hyperlink{structawusbdrd__softc_a4ed8def1533f38680c40135a5d2d3492}{reset}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00126}\mbox{\hyperlink{structawusbdrd__softc_a4b25d2b3e5ae6491c85b4aff0cf2ab2d}{00126}}         phy\_t                   \mbox{\hyperlink{structawusbdrd__softc_a4b25d2b3e5ae6491c85b4aff0cf2ab2d}{phy}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00127}\mbox{\hyperlink{structawusbdrd__softc_aeb76244ca01b201ebe77816f51498291}{00127}}         \textcolor{keyword}{struct }bus\_space        \mbox{\hyperlink{structawusbdrd__softc_aeb76244ca01b201ebe77816f51498291}{bs}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00128}\mbox{\hyperlink{structawusbdrd__softc_a5f60727053baa73557b4409bbd644d08}{00128}}         \textcolor{keywordtype}{int}                     \mbox{\hyperlink{structawusbdrd__softc_a5f60727053baa73557b4409bbd644d08}{flags}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00129}00129 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00131}\mbox{\hyperlink{musb__otg__allwinner_8c_a2289834de30059062b3b24c93f17fec4}{00131}} \textcolor{keyword}{static} \textcolor{keyword}{struct }resource\_spec \mbox{\hyperlink{musb__otg__allwinner_8c_a2289834de30059062b3b24c93f17fec4}{awusbdrd\_spec}}[] = \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00132}00132         \{ SYS\_RES\_MEMORY,       0,      RF\_ACTIVE \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00133}00133         \{ SYS\_RES\_IRQ,          0,      RF\_ACTIVE \},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00134}00134         \{ -\/1, 0 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00135}00135 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00137}\mbox{\hyperlink{musb__otg__allwinner_8c_a9dc910a84dd6c74ad3c08c20e124b880}{00137}} \textcolor{preprocessor}{\#define REMAPFLAG       0x8000}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00138}\mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{00138}} \textcolor{preprocessor}{\#define REGDECL(a, b)   [(a)] = ((b) | REMAPFLAG)}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00140}00140 \textcolor{comment}{/* Allwinner USB DRD register mappings */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00141}\mbox{\hyperlink{musb__otg__allwinner_8c_a32dff9725a02fe8efc428d753c28fe62}{00141}} \textcolor{keyword}{static} \textcolor{keyword}{const} uint16\_t \mbox{\hyperlink{musb__otg__allwinner_8c_a32dff9725a02fe8efc428d753c28fe62}{awusbdrd\_regmap}}[] = \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00142}00142         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a9d57ce3a2386b1a08f1cb8a4291db092}{MUSB2\_REG\_EPFIFO}}(0),     0x0000),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00143}00143         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a9d57ce3a2386b1a08f1cb8a4291db092}{MUSB2\_REG\_EPFIFO}}(1),     0x0004),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00144}00144         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a9d57ce3a2386b1a08f1cb8a4291db092}{MUSB2\_REG\_EPFIFO}}(2),     0x0008),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00145}00145         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a9d57ce3a2386b1a08f1cb8a4291db092}{MUSB2\_REG\_EPFIFO}}(3),     0x000c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00146}00146         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a9d57ce3a2386b1a08f1cb8a4291db092}{MUSB2\_REG\_EPFIFO}}(4),     0x0010),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00147}00147         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a9d57ce3a2386b1a08f1cb8a4291db092}{MUSB2\_REG\_EPFIFO}}(5),     0x0014),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00148}00148         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ac16c97c65fb8893438efd2e4f96614fc}{MUSB2\_REG\_POWER}},  0x0040),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00149}00149         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_aabd3a2555a4e7f1955927df12a3b0151}{MUSB2\_REG\_DEVCTL}},        0x0041),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00150}00150         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_af02be81864c6da38ef8b1411c9b810ce}{MUSB2\_REG\_EPINDEX}},      0x0042),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00151}00151         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a3ade4f4b051d61c1306511722e733c1b}{MUSB2\_REG\_INTTX}},  0x0044),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00152}00152         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_aa69e8febd771058a9506809f4b6fc513}{MUSB2\_REG\_INTRX}},  0x0046),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00153}00153         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a4154814d4802b97ab00d7a6ea99ba49a}{MUSB2\_REG\_INTTXE}},        0x0048),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00154}00154         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ad3b21f445a2b075fd8a37e42b10c2c5b}{MUSB2\_REG\_INTRXE}},        0x004a),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00155}00155         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a92da91648fde9d97956c56fd48e82098}{MUSB2\_REG\_INTUSB}},        0x004c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00156}00156         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a9e2b5ef5e972e985618aab92872e7eec}{MUSB2\_REG\_INTUSBE}},      0x0050),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00157}00157         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_aa225ceac3df3ff7c6b1aa907e17d1286}{MUSB2\_REG\_FRAME}},  0x0054),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00158}00158         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a752df19ccfe5f9c32b11b4fa41de748b}{MUSB2\_REG\_TESTMODE}},    0x007c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00159}00159         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a5c19d06ce847b79582a2dd52620fe2d3}{MUSB2\_REG\_TXMAXP}},        0x0080),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00160}00160         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a1ee053832a03d8c7bf2eb3de4fc1624e}{MUSB2\_REG\_TXCSRL}},        0x0082),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00161}00161         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ac1fa2fbcb401c8afd9f473866daffffe}{MUSB2\_REG\_TXCSRH}},        0x0083),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00162}00162         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a6e50bd3d050a035c1301e59d641cf216}{MUSB2\_REG\_RXMAXP}},        0x0084),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00163}00163         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a45043d95e6180647b8fb717233500ae0}{MUSB2\_REG\_RXCSRL}},        0x0086),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00164}00164         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a36709d1c1280ca7f5b151be85487052d}{MUSB2\_REG\_RXCSRH}},        0x0087),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00165}00165         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a7ec5360731c584bde3fbb3b39c271883}{MUSB2\_REG\_RXCOUNT}},      0x0088),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00166}00166         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab75cf527e9284fc2403ee465bd74516f}{MUSB2\_REG\_TXTI}},            0x008c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00167}00167         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a56faf3ead0c8bcced41a309b8945f5dc}{MUSB2\_REG\_TXNAKLIMIT}},        0x008d),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00168}00168         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a1e5f103f826b19be0814ca305f0120e4}{MUSB2\_REG\_RXNAKLIMIT}},        0x008f),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00169}00169         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ad16ec9b788e2ce54739bdd66163b1405}{MUSB2\_REG\_RXTI}},            0x008e),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00170}00170         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a8f26f2144ad9e2c86f9eff190c63c6de}{MUSB2\_REG\_TXFIFOSZ}},    0x0090),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00171}00171         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a5cb8103eed69af0939bc92d49ffabde9}{MUSB2\_REG\_TXFIFOADD}},  0x0092),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00172}00172         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a4d9ce8e032af8def71e7ccd1865c7261}{MUSB2\_REG\_RXFIFOSZ}},    0x0094),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00173}00173         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a3b87422241d923465ebc03e795e75f52}{MUSB2\_REG\_RXFIFOADD}},  0x0096),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00174}00174         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_aa6580ec7abf1a4cadeafafa98d7628ba}{MUSB2\_REG\_FADDR}},  0x0098),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00175}00175         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab788a7d27fbca54751df44ad46844041}{MUSB2\_REG\_TXFADDR}}(0),   0x0098),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00176}00176         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_afac5c7896b1b8fa9601d4055b549afd8}{MUSB2\_REG\_TXHADDR}}(0),   0x009a),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00177}00177         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_acc8ecd6e2870fc7c6afd07aeb9004e03}{MUSB2\_REG\_TXHUBPORT}}(0),       0x009b),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00178}00178         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a8363c6d8a609926925f578fa4b275142}{MUSB2\_REG\_RXFADDR}}(0),   0x009c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00179}00179         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_abdbb5a3f0da47f04b35344dc9d9d6a48}{MUSB2\_REG\_RXHADDR}}(0),   0x009e),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00180}00180         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a32743598146a7f29410b1981743e6613}{MUSB2\_REG\_RXHUBPORT}}(0),       0x009f),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00181}00181         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab788a7d27fbca54751df44ad46844041}{MUSB2\_REG\_TXFADDR}}(1),   0x0098),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00182}00182         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_afac5c7896b1b8fa9601d4055b549afd8}{MUSB2\_REG\_TXHADDR}}(1),   0x009a),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00183}00183         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_acc8ecd6e2870fc7c6afd07aeb9004e03}{MUSB2\_REG\_TXHUBPORT}}(1),       0x009b),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00184}00184         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a8363c6d8a609926925f578fa4b275142}{MUSB2\_REG\_RXFADDR}}(1),   0x009c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00185}00185         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_abdbb5a3f0da47f04b35344dc9d9d6a48}{MUSB2\_REG\_RXHADDR}}(1),   0x009e),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00186}00186         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a32743598146a7f29410b1981743e6613}{MUSB2\_REG\_RXHUBPORT}}(1),       0x009f),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00187}00187         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab788a7d27fbca54751df44ad46844041}{MUSB2\_REG\_TXFADDR}}(2),   0x0098),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00188}00188         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_afac5c7896b1b8fa9601d4055b549afd8}{MUSB2\_REG\_TXHADDR}}(2),   0x009a),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00189}00189         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_acc8ecd6e2870fc7c6afd07aeb9004e03}{MUSB2\_REG\_TXHUBPORT}}(2),       0x009b),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00190}00190         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a8363c6d8a609926925f578fa4b275142}{MUSB2\_REG\_RXFADDR}}(2),   0x009c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00191}00191         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_abdbb5a3f0da47f04b35344dc9d9d6a48}{MUSB2\_REG\_RXHADDR}}(2),   0x009e),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00192}00192         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a32743598146a7f29410b1981743e6613}{MUSB2\_REG\_RXHUBPORT}}(2),       0x009f),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00193}00193         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab788a7d27fbca54751df44ad46844041}{MUSB2\_REG\_TXFADDR}}(3),   0x0098),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00194}00194         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_afac5c7896b1b8fa9601d4055b549afd8}{MUSB2\_REG\_TXHADDR}}(3),   0x009a),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00195}00195         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_acc8ecd6e2870fc7c6afd07aeb9004e03}{MUSB2\_REG\_TXHUBPORT}}(3),       0x009b),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00196}00196         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a8363c6d8a609926925f578fa4b275142}{MUSB2\_REG\_RXFADDR}}(3),   0x009c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00197}00197         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_abdbb5a3f0da47f04b35344dc9d9d6a48}{MUSB2\_REG\_RXHADDR}}(3),   0x009e),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00198}00198         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a32743598146a7f29410b1981743e6613}{MUSB2\_REG\_RXHUBPORT}}(3),       0x009f),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00199}00199         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab788a7d27fbca54751df44ad46844041}{MUSB2\_REG\_TXFADDR}}(4),   0x0098),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00200}00200         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_afac5c7896b1b8fa9601d4055b549afd8}{MUSB2\_REG\_TXHADDR}}(4),   0x009a),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00201}00201         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_acc8ecd6e2870fc7c6afd07aeb9004e03}{MUSB2\_REG\_TXHUBPORT}}(4),       0x009b),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00202}00202         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a8363c6d8a609926925f578fa4b275142}{MUSB2\_REG\_RXFADDR}}(4),   0x009c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00203}00203         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_abdbb5a3f0da47f04b35344dc9d9d6a48}{MUSB2\_REG\_RXHADDR}}(4),   0x009e),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00204}00204         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a32743598146a7f29410b1981743e6613}{MUSB2\_REG\_RXHUBPORT}}(4),       0x009f),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00205}00205         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab788a7d27fbca54751df44ad46844041}{MUSB2\_REG\_TXFADDR}}(5),   0x0098),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00206}00206         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_afac5c7896b1b8fa9601d4055b549afd8}{MUSB2\_REG\_TXHADDR}}(5),   0x009a),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00207}00207         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_acc8ecd6e2870fc7c6afd07aeb9004e03}{MUSB2\_REG\_TXHUBPORT}}(5),       0x009b),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00208}00208         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a8363c6d8a609926925f578fa4b275142}{MUSB2\_REG\_RXFADDR}}(5),   0x009c),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00209}00209         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_abdbb5a3f0da47f04b35344dc9d9d6a48}{MUSB2\_REG\_RXHADDR}}(5),   0x009e),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00210}00210         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_a32743598146a7f29410b1981743e6613}{MUSB2\_REG\_RXHUBPORT}}(5),       0x009f),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00211}00211         \mbox{\hyperlink{musb__otg__allwinner_8c_ac1acf8811184a0c2d7703f849fcafff5}{REGDECL}}(\mbox{\hyperlink{musb__otg_8h_ab62cde3823c51edf9ffc0436c6169655}{MUSB2\_REG\_CONFDATA}},    0x00c0),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00212}00212 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00214}00214 \textcolor{keyword}{static} bus\_size\_t}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00215}\mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{00215}} \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(bus\_size\_t o)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00216}00216 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00217}00217         bus\_size\_t v;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00219}00219         KASSERT(o < nitems(\mbox{\hyperlink{musb__otg__allwinner_8c_a32dff9725a02fe8efc428d753c28fe62}{awusbdrd\_regmap}}),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00220}00220             (\textcolor{stringliteral}{"{}\%s: Invalid register \%\#lx"{}}, \_\_func\_\_, o));}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00221}00221         \textcolor{keywordflow}{if} (o >= nitems(\mbox{\hyperlink{musb__otg__allwinner_8c_a32dff9725a02fe8efc428d753c28fe62}{awusbdrd\_regmap}}))}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00222}00222                 \textcolor{keywordflow}{return} (o);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00224}00224         v = \mbox{\hyperlink{musb__otg__allwinner_8c_a32dff9725a02fe8efc428d753c28fe62}{awusbdrd\_regmap}}[o];}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00226}00226         KASSERT((v \& \mbox{\hyperlink{musb__otg__allwinner_8c_a9dc910a84dd6c74ad3c08c20e124b880}{REMAPFLAG}}) != 0, (\textcolor{stringliteral}{"{}\%s: reg \%\#lx not in regmap"{}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00227}00227             \_\_func\_\_, o));}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00229}00229         \textcolor{keywordflow}{return} (v \& \string~\mbox{\hyperlink{musb__otg__allwinner_8c_a9dc910a84dd6c74ad3c08c20e124b880}{REMAPFLAG}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00230}00230 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00231}00231 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00232}00232 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00233}\mbox{\hyperlink{musb__otg__allwinner_8c_ae43533073ca977ceeb6203876bc719d3}{00233}} \mbox{\hyperlink{musb__otg__allwinner_8c_ae43533073ca977ceeb6203876bc719d3}{awusbdrd\_filt}}(bus\_size\_t o)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00234}00234 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00235}00235         \textcolor{keywordflow}{switch} (o) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00236}00236         \textcolor{keywordflow}{case} \mbox{\hyperlink{musb__otg_8h_ac66dd1dd0bf1d04c84335f4779c99e5b}{MUSB2\_REG\_MISC}}:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00237}00237         \textcolor{keywordflow}{case} \mbox{\hyperlink{musb__otg_8h_a068eed4968065d06a8f158fdc377e95b}{MUSB2\_REG\_RXDBDIS}}:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00238}00238         \textcolor{keywordflow}{case} \mbox{\hyperlink{musb__otg_8h_a850fd031f28094e27499ef0eeaa73bcb}{MUSB2\_REG\_TXDBDIS}}:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00239}00239                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00240}00240         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00241}00241                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00242}00242         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00243}00243 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00245}00245 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00246}\mbox{\hyperlink{musb__otg__allwinner_8c_a6e099956126559a669759803254a68df}{00246}} \mbox{\hyperlink{musb__otg__allwinner_8c_a6e099956126559a669759803254a68df}{awusbdrd\_bs\_r\_1}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00247}00247 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00248}00248         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00249}00249 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00250}00250         \textcolor{keywordflow}{switch} (o) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00251}00251         \textcolor{keywordflow}{case} \mbox{\hyperlink{musb__otg_8h_aff943a558305dcb09a32b1144e33a2df}{MUSB2\_REG\_HWVERS}}:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00252}00252                 \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* no known equivalent */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00253}00253         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00255}00255         \textcolor{keywordflow}{return} (bus\_space\_read\_1(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o)));}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00256}00256 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00257}00257 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00258}00258 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00259}\mbox{\hyperlink{musb__otg__allwinner_8c_a2c68ac6ac53361b008d1261a00299b23}{00259}} \mbox{\hyperlink{musb__otg__allwinner_8c_a2c68ac6ac53361b008d1261a00299b23}{awusbdrd\_bs\_r\_1\_noconf}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00260}00260 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00262}00262         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00263}00263 \textcolor{comment}{         * There is no confdata register on some SoCs, return the same}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00264}00264 \textcolor{comment}{         * magic value as Linux.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00265}00265 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00266}00266         \textcolor{keywordflow}{if} (o == \mbox{\hyperlink{musb__otg_8h_ab62cde3823c51edf9ffc0436c6169655}{MUSB2\_REG\_CONFDATA}})}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00267}00267                 \textcolor{keywordflow}{return} (0xde);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00269}00269         \textcolor{keywordflow}{return} (\mbox{\hyperlink{musb__otg__allwinner_8c_a6e099956126559a669759803254a68df}{awusbdrd\_bs\_r\_1}}(t, h, o));}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00270}00270 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00273}00273 \textcolor{keyword}{static} uint16\_t}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00274}\mbox{\hyperlink{musb__otg__allwinner_8c_aa7ecc23d5b136e229b93f1f50f0b7865}{00274}} \mbox{\hyperlink{musb__otg__allwinner_8c_aa7ecc23d5b136e229b93f1f50f0b7865}{awusbdrd\_bs\_r\_2}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00275}00275 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00276}00276         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00278}00278         \textcolor{keywordflow}{if} (\mbox{\hyperlink{musb__otg__allwinner_8c_ae43533073ca977ceeb6203876bc719d3}{awusbdrd\_filt}}(o) != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00279}00279                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00280}00280         \textcolor{keywordflow}{return} bus\_space\_read\_2(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o));}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00281}00281 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00283}00283 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00284}\mbox{\hyperlink{musb__otg__allwinner_8c_a0248dbc6eef7f4ecb21d4056d854c6ce}{00284}} \mbox{\hyperlink{musb__otg__allwinner_8c_a0248dbc6eef7f4ecb21d4056d854c6ce}{awusbdrd\_bs\_w\_1}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00285}00285     uint8\_t v)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00286}00286 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00287}00287         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00289}00289         \textcolor{keywordflow}{if} (\mbox{\hyperlink{musb__otg__allwinner_8c_ae43533073ca977ceeb6203876bc719d3}{awusbdrd\_filt}}(o) != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00290}00290                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00292}00292         bus\_space\_write\_1(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o), v);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00293}00293 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00295}00295 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00296}\mbox{\hyperlink{musb__otg__allwinner_8c_a9f4b818671bb29b76c76851b59ac55ec}{00296}} \mbox{\hyperlink{musb__otg__allwinner_8c_a9f4b818671bb29b76c76851b59ac55ec}{awusbdrd\_bs\_w\_2}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00297}00297     uint16\_t v)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00298}00298 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00299}00299         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00301}00301         \textcolor{keywordflow}{if} (\mbox{\hyperlink{musb__otg__allwinner_8c_ae43533073ca977ceeb6203876bc719d3}{awusbdrd\_filt}}(o) != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00302}00302                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00304}00304         bus\_space\_write\_2(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o), v);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00305}00305 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00307}00307 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00308}\mbox{\hyperlink{musb__otg__allwinner_8c_a7f8455137902459a42c2edfc939a7b87}{00308}} \mbox{\hyperlink{musb__otg__allwinner_8c_a7f8455137902459a42c2edfc939a7b87}{awusbdrd\_bs\_rm\_1}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00309}00309     uint8\_t *d, bus\_size\_t c)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00310}00310 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00311}00311         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00313}00313         bus\_space\_read\_multi\_1(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o), d, c);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00314}00314 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00316}00316 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00317}\mbox{\hyperlink{musb__otg__allwinner_8c_acc2728f8609e7a8bf661ed201fa0f9f9}{00317}} \mbox{\hyperlink{musb__otg__allwinner_8c_acc2728f8609e7a8bf661ed201fa0f9f9}{awusbdrd\_bs\_rm\_4}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00318}00318     uint32\_t *d, bus\_size\_t c)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00319}00319 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00320}00320         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00322}00322         bus\_space\_read\_multi\_4(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o), d, c);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00323}00323 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00325}00325 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00326}\mbox{\hyperlink{musb__otg__allwinner_8c_aa2beaeb12f790f1f1d20d1a4e8c7b02e}{00326}} \mbox{\hyperlink{musb__otg__allwinner_8c_aa2beaeb12f790f1f1d20d1a4e8c7b02e}{awusbdrd\_bs\_wm\_1}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00327}00327     \textcolor{keyword}{const} uint8\_t *d, bus\_size\_t c)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00328}00328 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00329}00329         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00331}00331         \textcolor{keywordflow}{if} (\mbox{\hyperlink{musb__otg__allwinner_8c_ae43533073ca977ceeb6203876bc719d3}{awusbdrd\_filt}}(o) != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00332}00332                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00333}00333 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00334}00334         bus\_space\_write\_multi\_1(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o), d, c);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00335}00335 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00337}00337 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00338}\mbox{\hyperlink{musb__otg__allwinner_8c_a89033c6964e3a067e146fa2f894595e6}{00338}} \mbox{\hyperlink{musb__otg__allwinner_8c_a89033c6964e3a067e146fa2f894595e6}{awusbdrd\_bs\_wm\_4}}(awusb\_bs\_tag t, bus\_space\_handle\_t h, bus\_size\_t o,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00339}00339     \textcolor{keyword}{const} uint32\_t *d, bus\_size\_t c)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00340}00340 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00341}00341         \textcolor{keyword}{const} \textcolor{keyword}{struct }bus\_space *bs = t;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00342}00342 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00343}00343         \textcolor{keywordflow}{if} (\mbox{\hyperlink{musb__otg__allwinner_8c_ae43533073ca977ceeb6203876bc719d3}{awusbdrd\_filt}}(o) != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00344}00344                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00346}00346         bus\_space\_write\_multi\_4(bs\_parent\_space(bs), h, \mbox{\hyperlink{musb__otg__allwinner_8c_a278b192f87c4f2f8357d1921b321c486}{awusbdrd\_reg}}(o), d, c);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00347}00347 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00349}00349 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00350}\mbox{\hyperlink{musb__otg__allwinner_8c_a5a71d28fd8900b8402d1e9f19fdc5cde}{00350}} \mbox{\hyperlink{musb__otg__allwinner_8c_a5a71d28fd8900b8402d1e9f19fdc5cde}{awusbdrd\_intr}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00351}00351 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00352}00352         \textcolor{keyword}{struct }\mbox{\hyperlink{structawusbdrd__softc}{awusbdrd\_softc}} *\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}} = arg;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00353}00353         uint8\_t intusb;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00354}00354         uint16\_t inttx, intrx;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00355}00355 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00356}00356         intusb = \mbox{\hyperlink{musb__otg_8h_a12437f19bf85946fb0a2eb2d98977408}{MUSB2\_READ\_1}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc, \mbox{\hyperlink{musb__otg_8h_a92da91648fde9d97956c56fd48e82098}{MUSB2\_REG\_INTUSB}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00357}00357         inttx = \mbox{\hyperlink{musb__otg_8h_ad06f9642c6aa018184bc9d00be293861}{MUSB2\_READ\_2}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc, \mbox{\hyperlink{musb__otg_8h_a3ade4f4b051d61c1306511722e733c1b}{MUSB2\_REG\_INTTX}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00358}00358         intrx = \mbox{\hyperlink{musb__otg_8h_ad06f9642c6aa018184bc9d00be293861}{MUSB2\_READ\_2}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc, \mbox{\hyperlink{musb__otg_8h_aa69e8febd771058a9506809f4b6fc513}{MUSB2\_REG\_INTRX}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00359}00359         \textcolor{keywordflow}{if} (intusb == 0 \&\& inttx == 0 \&\& intrx == 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00360}00360                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00362}00362         \textcolor{keywordflow}{if} (intusb)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00363}00363                 \mbox{\hyperlink{musb__otg_8h_a7ed75973d2bd9ba0fd7a3ad7a28a6dea}{MUSB2\_WRITE\_1}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc, \mbox{\hyperlink{musb__otg_8h_a92da91648fde9d97956c56fd48e82098}{MUSB2\_REG\_INTUSB}}, intusb);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00364}00364         \textcolor{keywordflow}{if} (inttx)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00365}00365                 \mbox{\hyperlink{musb__otg_8h_a7fa04b0b12caaadd9b529c47e0e52b05}{MUSB2\_WRITE\_2}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc, \mbox{\hyperlink{musb__otg_8h_a3ade4f4b051d61c1306511722e733c1b}{MUSB2\_REG\_INTTX}}, inttx);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00366}00366         \textcolor{keywordflow}{if} (intrx)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00367}00367                 \mbox{\hyperlink{musb__otg_8h_a7fa04b0b12caaadd9b529c47e0e52b05}{MUSB2\_WRITE\_2}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc, \mbox{\hyperlink{musb__otg_8h_aa69e8febd771058a9506809f4b6fc513}{MUSB2\_REG\_INTRX}}, intrx);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00369}00369         \mbox{\hyperlink{musb__otg_8c_acb38dc6b27da40b2de86de18106f5fef}{musbotg\_interrupt}}(arg, intrx, inttx, intusb);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00370}00370 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00372}00372 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00373}\mbox{\hyperlink{musb__otg__allwinner_8c_a0b7e6799908b663a950e178a3eb7e86b}{00373}} \mbox{\hyperlink{musb__otg__allwinner_8c_a0b7e6799908b663a950e178a3eb7e86b}{awusbdrd\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00374}00374 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00375}00375         \textcolor{keywordflow}{if} (!ofw\_bus\_status\_okay(dev))}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00376}00376                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00377}00377 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00378}00378         \textcolor{keywordflow}{if} (ofw\_bus\_search\_compatible(dev, \mbox{\hyperlink{musb__otg__allwinner_8c_ab1bb129b8c62d8033fbb3adf82f284a0}{compat\_data}})-\/>ocd\_data == 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00379}00379                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00380}00380 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00381}00381         device\_set\_desc(dev, \textcolor{stringliteral}{"{}Allwinner USB DRD"{}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00382}00382         \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00383}00383 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00384}00384 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00385}00385 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00386}\mbox{\hyperlink{musb__otg__allwinner_8c_a98d9c8d3289e6e9a3c701120016b8570}{00386}} \mbox{\hyperlink{musb__otg__allwinner_8c_a98d9c8d3289e6e9a3c701120016b8570}{awusbdrd\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00387}00387 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00388}00388         \textcolor{keywordtype}{char} usb\_mode[24];}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00389}00389         \textcolor{keyword}{struct }\mbox{\hyperlink{structawusbdrd__softc}{awusbdrd\_softc}} *\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00390}00390         uint8\_t musb\_mode;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00391}00391         \textcolor{keywordtype}{int} phy\_mode;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00392}00392         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00394}00394         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}} = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00395}00395         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>flags = ofw\_bus\_search\_compatible(dev, \mbox{\hyperlink{musb__otg__allwinner_8c_ab1bb129b8c62d8033fbb3adf82f284a0}{compat\_data}})-\/>ocd\_data;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00397}00397         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = bus\_alloc\_resources(dev, \mbox{\hyperlink{musb__otg__allwinner_8c_a2289834de30059062b3b24c93f17fec4}{awusbdrd\_spec}}, \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00398}00398         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00399}00399                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00401}00401         musb\_mode = \mbox{\hyperlink{musb__otg_8h_a9c7e43e44523cbb92161efc1aca7326a}{MUSB2\_HOST\_MODE}};     \textcolor{comment}{/* default */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00402}00402         phy\_mode = PHY\_USB\_MODE\_HOST;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00403}00403         \textcolor{keywordflow}{if} (OF\_getprop(ofw\_bus\_get\_node(dev), \textcolor{stringliteral}{"{}dr\_mode"{}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00404}00404             \&usb\_mode, \textcolor{keyword}{sizeof}(usb\_mode)) > 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00405}00405                 usb\_mode[\textcolor{keyword}{sizeof}(usb\_mode) -\/ 1] = 0;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00406}00406                 \textcolor{keywordflow}{if} (strcasecmp(usb\_mode, \textcolor{stringliteral}{"{}host"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00407}00407                         musb\_mode = \mbox{\hyperlink{musb__otg_8h_a9c7e43e44523cbb92161efc1aca7326a}{MUSB2\_HOST\_MODE}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00408}00408                         phy\_mode = PHY\_USB\_MODE\_HOST;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00409}00409                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcasecmp(usb\_mode, \textcolor{stringliteral}{"{}peripheral"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00410}00410                         musb\_mode = \mbox{\hyperlink{musb__otg_8h_a3109825c14123927ce707671c1342686}{MUSB2\_DEVICE\_MODE}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00411}00411                         phy\_mode = PHY\_USB\_MODE\_DEVICE;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00412}00412                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcasecmp(usb\_mode, \textcolor{stringliteral}{"{}otg"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00413}00413                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00414}00414 \textcolor{comment}{                         * XXX phy has PHY\_USB\_MODE\_OTG, but MUSB does not have}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00415}00415 \textcolor{comment}{                         * it.  It's not clear how to propagate mode changes}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00416}00416 \textcolor{comment}{                         * from phy layer (that detects them) to MUSB.}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00417}00417 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00418}00418                         musb\_mode = \mbox{\hyperlink{musb__otg_8h_a3109825c14123927ce707671c1342686}{MUSB2\_DEVICE\_MODE}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00419}00419                         phy\_mode = PHY\_USB\_MODE\_DEVICE;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00420}00420                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00421}00421                         device\_printf(dev, \textcolor{stringliteral}{"{}Invalid FDT dr\_mode: \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00422}00422                             usb\_mode);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00423}00423                 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00424}00424         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00426}00426         \textcolor{comment}{/* AHB gate clock is required */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00427}00427         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = clk\_get\_by\_ofw\_index(dev, 0, 0, \&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>clk);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00428}00428         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00429}00429                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00431}00431         \textcolor{comment}{/* AHB reset is only present on some SoCs */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00432}00432         (void)hwreset\_get\_by\_ofw\_idx(dev, 0, 0, \&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00434}00434         \textcolor{comment}{/* Enable clocks */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00435}00435         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = clk\_enable(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>clk);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00436}00436         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00437}00437                 device\_printf(dev, \textcolor{stringliteral}{"{}failed to enable clock: \%d\(\backslash\)n"{}}, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00438}00438                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00439}00439         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00440}00440         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset != NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00441}00441                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = hwreset\_deassert(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00442}00442                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00443}00443                         device\_printf(dev, \textcolor{stringliteral}{"{}failed to de-\/assert reset: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00444}00444                             \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00445}00445                         \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00446}00446                 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00447}00447         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00449}00449         \textcolor{comment}{/* XXX not sure if this is universally needed. */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00450}00450         (void)phy\_get\_by\_ofw\_name(dev, 0, \textcolor{stringliteral}{"{}usb"{}}, \&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00451}00451         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy != NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00452}00452                 device\_printf(dev, \textcolor{stringliteral}{"{}setting phy mode \%d\(\backslash\)n"{}}, phy\_mode);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00453}00453                 \textcolor{keywordflow}{if} (musb\_mode == \mbox{\hyperlink{musb__otg_8h_a9c7e43e44523cbb92161efc1aca7326a}{MUSB2\_HOST\_MODE}}) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00454}00454                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = phy\_enable(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00455}00455                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00456}00456                                 device\_printf(dev, \textcolor{stringliteral}{"{}Could not enable phy\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00457}00457                                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00458}00458                         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00459}00459                 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00460}00460                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = phy\_usb\_set\_mode(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy, phy\_mode);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00461}00461                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00462}00462                         device\_printf(dev, \textcolor{stringliteral}{"{}Could not set phy mode\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00463}00463                         \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00464}00464                 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00465}00465         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00467}00467         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}} = dev;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00468}00468         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a9412f3e10804046f19d5e8ab00a38b59}{devices}} = \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_a4bddac18691b4acc2ec123ae7e7fe926}{sc\_devices}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00469}00469         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_ac665d059dd509782705e2eb35fdc9c58}{devices\_max}} = \mbox{\hyperlink{musb__otg_8h_a644d05c6b2fc305237e0ac02f78d3379}{MUSB2\_MAX\_DEVICES}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00470}00470         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_af7cf6d04a3d928e28be8825b637fab68}{dma\_bits}} = 32;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00472}00472         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__controller_8c_a736f5aa67bd8014944a1dc24fbf3fbb5}{usb\_bus\_mem\_alloc\_all}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}, \mbox{\hyperlink{usb__busdma_8h_acec0356df4d4a6905c59303652de41ad}{USB\_GET\_DMA\_TAG}}(dev),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00473}00473             NULL);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00474}00474         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00475}00475                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENOMEM;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00476}00476                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00477}00477         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00479}00479 \textcolor{preprocessor}{\#if defined(\_\_arm\_\_)}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00480}00480         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_parent = rman\_get\_bustag(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res[0]);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00481}00481 \textcolor{preprocessor}{\#elif defined(\_\_aarch64\_\_)}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00482}00482         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_cookie = rman\_get\_bustag(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res[0]);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00483}00483 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00484}00484 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00485}00485         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>flags \& \mbox{\hyperlink{musb__otg__allwinner_8c_a83b248d3e24a0c4de8a3963744fdaea5}{AWUSB\_NO\_CONFDATA}}) == \mbox{\hyperlink{musb__otg__allwinner_8c_a83b248d3e24a0c4de8a3963744fdaea5}{AWUSB\_NO\_CONFDATA}})}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00486}00486                 \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_r\_1 = \mbox{\hyperlink{musb__otg__allwinner_8c_a2c68ac6ac53361b008d1261a00299b23}{awusbdrd\_bs\_r\_1\_noconf}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00487}00487         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00488}00488                 \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_r\_1 = \mbox{\hyperlink{musb__otg__allwinner_8c_a6e099956126559a669759803254a68df}{awusbdrd\_bs\_r\_1}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00489}00489         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_r\_2 = \mbox{\hyperlink{musb__otg__allwinner_8c_aa7ecc23d5b136e229b93f1f50f0b7865}{awusbdrd\_bs\_r\_2}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00490}00490         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_w\_1 = \mbox{\hyperlink{musb__otg__allwinner_8c_a0248dbc6eef7f4ecb21d4056d854c6ce}{awusbdrd\_bs\_w\_1}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00491}00491         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_w\_2 = \mbox{\hyperlink{musb__otg__allwinner_8c_a9f4b818671bb29b76c76851b59ac55ec}{awusbdrd\_bs\_w\_2}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00492}00492         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_rm\_1 = \mbox{\hyperlink{musb__otg__allwinner_8c_a7f8455137902459a42c2edfc939a7b87}{awusbdrd\_bs\_rm\_1}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00493}00493         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_rm\_4 = \mbox{\hyperlink{musb__otg__allwinner_8c_acc2728f8609e7a8bf661ed201fa0f9f9}{awusbdrd\_bs\_rm\_4}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00494}00494         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_wm\_1 = \mbox{\hyperlink{musb__otg__allwinner_8c_aa2beaeb12f790f1f1d20d1a4e8c7b02e}{awusbdrd\_bs\_wm\_1}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00495}00495         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs.bs\_wm\_4 = \mbox{\hyperlink{musb__otg__allwinner_8c_a89033c6964e3a067e146fa2f894595e6}{awusbdrd\_bs\_wm\_4}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00496}00496 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00497}00497         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_a6b746f449105edb53f79042c3e89fa6c}{sc\_io\_tag}} = \&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>bs;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00498}00498         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_a769e2971cce710a5c0ab92400b85ed71}{sc\_io\_hdl}} = rman\_get\_bushandle(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res[0]);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00499}00499         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_af6e62f4c4e21af801ce4705d49f85c69}{sc\_io\_size}} = rman\_get\_size(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res[0]);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00500}00500 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00501}00501         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}} = device\_add\_child(dev, \textcolor{stringliteral}{"{}usbus"{}}, -\/1);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00502}00502         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00503}00503                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENXIO;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00504}00504                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00505}00505         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00506}00506         device\_set\_ivars(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}}, \&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00507}00507         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ab3b9e4dcae8471dddf0a6ab5f5afba99}{sc\_id}} = 0;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00508}00508         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_a6cc9d1daafc0857c318b6894ece13f50}{sc\_platform\_data}} = \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00509}00509         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ac6561fe5fe109d9028fc5d0e75cee2fb}{sc\_mode}} = musb\_mode;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00510}00510         \textcolor{keywordflow}{if} (ofw\_bus\_is\_compatible(dev, \textcolor{stringliteral}{"{}allwinner,sun8i-\/h3-\/musb"{}})) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00511}00511                 \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae40fce2b471885241fe443fb31654293}{sc\_ep\_cfg}} = \mbox{\hyperlink{musb__otg__allwinner_8c_a65a8dfcec739535b1d27104386c8fad1}{musbotg\_ep\_allwinner\_h3}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00512}00512                 \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae13505b445e122893aeea9b406d39fb7}{sc\_ep\_max}} = \mbox{\hyperlink{musb__otg__allwinner_8c_ad6201d15f9c2c88d0cc64f830b815f98}{DRD\_EP\_MAX\_H3}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00513}00513         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00514}00514                 \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae40fce2b471885241fe443fb31654293}{sc\_ep\_cfg}} = \mbox{\hyperlink{musb__otg__allwinner_8c_aaf7f2f101e6838ff9f5c29db2dcaa9f1}{musbotg\_ep\_allwinner}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00515}00515                 \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae13505b445e122893aeea9b406d39fb7}{sc\_ep\_max}} = \mbox{\hyperlink{musb__otg__allwinner_8c_a052e52309ed267ed6a4dccb6f24b2447}{DRD\_EP\_MAX}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00516}00516         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00517}00517 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00518}00518         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = bus\_setup\_intr(dev, \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res[1], INTR\_MPSAFE | INTR\_TYPE\_BIO,}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00519}00519             NULL, \mbox{\hyperlink{musb__otg__allwinner_8c_a5a71d28fd8900b8402d1e9f19fdc5cde}{awusbdrd\_intr}}, \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}, \&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_a1c93938451881304937809a407ff2f26}{sc\_intr\_hdl}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00520}00520         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00521}00521                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00523}00523         \textcolor{comment}{/* Enable PIO mode */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00524}00524         bus\_write\_1(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res[0], \mbox{\hyperlink{musb__otg__allwinner_8c_a4613c6a0d67e4902130ea0094dec9cd9}{MUSB2\_REG\_AWIN\_VEND0}}, \mbox{\hyperlink{musb__otg__allwinner_8c_a39ec88e2d8f2a9ededdc4d2651d66110}{VEND0\_PIO\_MODE}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00526}00526 \textcolor{preprocessor}{\#ifdef \_\_arm\_\_}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00527}00527         \textcolor{comment}{/* Map SRAMD area to USB0 (sun4i/sun7i only) */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00528}00528         \textcolor{keywordflow}{switch} (allwinner\_soc\_family()) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00529}00529         \textcolor{keywordflow}{case} ALLWINNERSOC\_SUN4I:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00530}00530         \textcolor{keywordflow}{case} ALLWINNERSOC\_SUN7I:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00531}00531                 a10\_map\_to\_otg();}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00532}00532                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00533}00533         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00534}00534 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00536}00536         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{musb__otg_8c_af5320d1ff67efea1a4fd404a50cb6f7c}{musbotg\_init}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00537}00537         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00538}00538                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00540}00540         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = device\_probe\_and\_attach(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00541}00541         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00542}00542                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00543}00543 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00544}00544         \mbox{\hyperlink{musb__otg_8c_abf775c1a5a389eacac9b9e580e4a84e6}{musbotg\_vbus\_interrupt}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc, 1);     \textcolor{comment}{/* XXX VBUS */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00545}00545 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00546}00546         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00547}00547 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00548}00548 \mbox{\hyperlink{if__runreg_8h_a041c8b8d78f50876bc74559cb40f00f4}{fail}}:}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00549}00549         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy != NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00550}00550                 \textcolor{keywordflow}{if} (musb\_mode == \mbox{\hyperlink{musb__otg_8h_a9c7e43e44523cbb92161efc1aca7326a}{MUSB2\_HOST\_MODE}})}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00551}00551                         (void)phy\_disable(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00552}00552                 phy\_release(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00553}00553         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00554}00554         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset != NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00555}00555                 hwreset\_assert(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00556}00556                 hwreset\_release(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00557}00557         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00558}00558         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>clk != NULL)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00559}00559                 clk\_release(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>clk);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00560}00560         bus\_release\_resources(dev, \mbox{\hyperlink{musb__otg__allwinner_8c_a2289834de30059062b3b24c93f17fec4}{awusbdrd\_spec}}, \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00561}00561         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00562}00562 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00564}00564 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00565}\mbox{\hyperlink{musb__otg__allwinner_8c_a933c7a515d3a9d05de9d292094407ecb}{00565}} \mbox{\hyperlink{musb__otg__allwinner_8c_a933c7a515d3a9d05de9d292094407ecb}{awusbdrd\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00566}00566 \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00567}00567         \textcolor{keyword}{struct }\mbox{\hyperlink{structawusbdrd__softc}{awusbdrd\_softc}} *\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00568}00568         device\_t bdev;}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00569}00569         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00570}00570 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00571}00571         \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}} = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00572}00572 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00573}00573         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00574}00574                 bdev = \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00575}00575                 device\_detach(bdev);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00576}00576                 device\_delete\_child(dev, bdev);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00577}00577         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00578}00578 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00579}00579         \mbox{\hyperlink{musb__otg_8c_a6217a26fb3f6aa729d7302943ae823ad}{musbotg\_uninit}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00580}00580         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = bus\_teardown\_intr(dev, \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res[1], \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_a1c93938451881304937809a407ff2f26}{sc\_intr\_hdl}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00581}00581         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00582}00582                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00584}00584         \mbox{\hyperlink{usb__controller_8c_a0a85a587a062a4af3f1df6fc298a02b2}{usb\_bus\_mem\_free\_all}}(\&\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ae42d2045e611ad0e94fbc6026f92cf78}{sc\_bus}}, NULL);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00585}00585 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00586}00586         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy != NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00587}00587                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>sc.\mbox{\hyperlink{structmusbotg__softc_ac6561fe5fe109d9028fc5d0e75cee2fb}{sc\_mode}} == \mbox{\hyperlink{musb__otg_8h_a9c7e43e44523cbb92161efc1aca7326a}{MUSB2\_HOST\_MODE}})}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00588}00588                         phy\_disable(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00589}00589                 phy\_release(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>phy);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00590}00590         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00591}00591         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset != NULL) \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00592}00592                 \textcolor{keywordflow}{if} (hwreset\_assert(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset) != 0)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00593}00593                         device\_printf(dev, \textcolor{stringliteral}{"{}failed to assert reset\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00594}00594                 hwreset\_release(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>reset);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00595}00595         \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00596}00596         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>clk != NULL)}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00597}00597                 clk\_release(\mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>clk);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00599}00599         bus\_release\_resources(dev, \mbox{\hyperlink{musb__otg__allwinner_8c_a2289834de30059062b3b24c93f17fec4}{awusbdrd\_spec}}, \mbox{\hyperlink{structawusbdrd__softc_a93609d9701d8353c8ead4697ce0399b9}{sc}}-\/>res);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00601}00601         device\_delete\_children(dev);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00602}00602 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00603}00603         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00604}00604 \}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00606}\mbox{\hyperlink{musb__otg__allwinner_8c_a1d7c92a907041edab4b9388dc7400b50}{00606}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{musb__otg__allwinner_8c_a1d7c92a907041edab4b9388dc7400b50}{awusbdrd\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00607}00607         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00608}00608         DEVMETHOD(device\_probe,         \mbox{\hyperlink{musb__otg__allwinner_8c_a0b7e6799908b663a950e178a3eb7e86b}{awusbdrd\_probe}}),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00609}00609         DEVMETHOD(device\_attach,        \mbox{\hyperlink{musb__otg__allwinner_8c_a98d9c8d3289e6e9a3c701120016b8570}{awusbdrd\_attach}}),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00610}00610         DEVMETHOD(device\_detach,        \mbox{\hyperlink{musb__otg__allwinner_8c_a933c7a515d3a9d05de9d292094407ecb}{awusbdrd\_detach}}),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00611}00611         DEVMETHOD(device\_suspend,       bus\_generic\_suspend),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00612}00612         DEVMETHOD(device\_resume,        bus\_generic\_resume),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00613}00613         DEVMETHOD(device\_shutdown,      bus\_generic\_shutdown),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00614}00614 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00615}00615         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00616}00616 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00618}\mbox{\hyperlink{musb__otg__allwinner_8c_a1360601fb1ec52a5f048036d055eb4f2}{00618}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{musb__otg__allwinner_8c_a1360601fb1ec52a5f048036d055eb4f2}{awusbdrd\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00619}00619         .name = \textcolor{stringliteral}{"{}musbotg"{}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00620}00620         .methods = \mbox{\hyperlink{musb__otg__allwinner_8c_a1d7c92a907041edab4b9388dc7400b50}{awusbdrd\_methods}},}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00621}00621         .size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structawusbdrd__softc}{awusbdrd\_softc}}),}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00622}00622 \};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00623}00623 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00624}\mbox{\hyperlink{musb__otg__allwinner_8c_a251fedd01562ec13e7e3cbe0f63c0b19}{00624}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{musb__otg__allwinner_8c_a251fedd01562ec13e7e3cbe0f63c0b19}{awusbdrd\_devclass}};}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00626}\mbox{\hyperlink{musb__otg__allwinner_8c_a752b9caf5be98afe6e24a82ae8de6d9d}{00626}} \mbox{\hyperlink{musb__otg__allwinner_8c_a752b9caf5be98afe6e24a82ae8de6d9d}{DRIVER\_MODULE}}(musbotg, simplebus, \mbox{\hyperlink{musb__otg__allwinner_8c_a1360601fb1ec52a5f048036d055eb4f2}{awusbdrd\_driver}}, \mbox{\hyperlink{musb__otg__allwinner_8c_a251fedd01562ec13e7e3cbe0f63c0b19}{awusbdrd\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{musb__otg__allwinner_8c_source_l00627}\mbox{\hyperlink{musb__otg__allwinner_8c_acc7f55be39a77baee2a55eedc786b87d}{00627}} \mbox{\hyperlink{musb__otg__allwinner_8c_acc7f55be39a77baee2a55eedc786b87d}{MODULE\_DEPEND}}(musbotg, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}

\end{DoxyCode}
