phy-tegra-usb.c 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091
  1. /*
  2. * Copyright (C) 2010 Google, Inc.
  3. * Copyright (C) 2013 NVIDIA Corporation
  4. *
  5. * Author:
  6. * Erik Gilling <konkers@google.com>
  7. * Benoit Goby <benoit@android.com>
  8. * Venu Byravarasu <vbyravarasu@nvidia.com>
  9. *
  10. * This software is licensed under the terms of the GNU General Public
  11. * License version 2, as published by the Free Software Foundation, and
  12. * may be copied, distributed, and modified under those terms.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. */
  20. #include <linux/resource.h>
  21. #include <linux/delay.h>
  22. #include <linux/slab.h>
  23. #include <linux/err.h>
  24. #include <linux/export.h>
  25. #include <linux/module.h>
  26. #include <linux/platform_device.h>
  27. #include <linux/io.h>
  28. #include <linux/gpio.h>
  29. #include <linux/of.h>
  30. #include <linux/of_device.h>
  31. #include <linux/of_gpio.h>
  32. #include <linux/usb/otg.h>
  33. #include <linux/usb/ulpi.h>
  34. #include <linux/usb/of.h>
  35. #include <linux/usb/ehci_def.h>
  36. #include <linux/usb/tegra_usb_phy.h>
  37. #include <linux/regulator/consumer.h>
  38. #define ULPI_VIEWPORT 0x170
  39. /* PORTSC PTS/PHCD bits, Tegra20 only */
  40. #define TEGRA_USB_PORTSC1 0x184
  41. #define TEGRA_USB_PORTSC1_PTS(x) (((x) & 0x3) << 30)
  42. #define TEGRA_USB_PORTSC1_PHCD (1 << 23)
  43. /* HOSTPC1 PTS/PHCD bits, Tegra30 and above */
  44. #define TEGRA_USB_HOSTPC1_DEVLC 0x1b4
  45. #define TEGRA_USB_HOSTPC1_DEVLC_PTS(x) (((x) & 0x7) << 29)
  46. #define TEGRA_USB_HOSTPC1_DEVLC_PHCD (1 << 22)
  47. /* Bits of PORTSC1, which will get cleared by writing 1 into them */
  48. #define TEGRA_PORTSC1_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC)
  49. #define USB_SUSP_CTRL 0x400
  50. #define USB_WAKE_ON_CNNT_EN_DEV (1 << 3)
  51. #define USB_WAKE_ON_DISCON_EN_DEV (1 << 4)
  52. #define USB_SUSP_CLR (1 << 5)
  53. #define USB_PHY_CLK_VALID (1 << 7)
  54. #define UTMIP_RESET (1 << 11)
  55. #define UHSIC_RESET (1 << 11)
  56. #define UTMIP_PHY_ENABLE (1 << 12)
  57. #define ULPI_PHY_ENABLE (1 << 13)
  58. #define USB_SUSP_SET (1 << 14)
  59. #define USB_WAKEUP_DEBOUNCE_COUNT(x) (((x) & 0x7) << 16)
  60. #define USB1_LEGACY_CTRL 0x410
  61. #define USB1_NO_LEGACY_MODE (1 << 0)
  62. #define USB1_VBUS_SENSE_CTL_MASK (3 << 1)
  63. #define USB1_VBUS_SENSE_CTL_VBUS_WAKEUP (0 << 1)
  64. #define USB1_VBUS_SENSE_CTL_AB_SESS_VLD_OR_VBUS_WAKEUP \
  65. (1 << 1)
  66. #define USB1_VBUS_SENSE_CTL_AB_SESS_VLD (2 << 1)
  67. #define USB1_VBUS_SENSE_CTL_A_SESS_VLD (3 << 1)
  68. #define ULPI_TIMING_CTRL_0 0x424
  69. #define ULPI_OUTPUT_PINMUX_BYP (1 << 10)
  70. #define ULPI_CLKOUT_PINMUX_BYP (1 << 11)
  71. #define ULPI_TIMING_CTRL_1 0x428
  72. #define ULPI_DATA_TRIMMER_LOAD (1 << 0)
  73. #define ULPI_DATA_TRIMMER_SEL(x) (((x) & 0x7) << 1)
  74. #define ULPI_STPDIRNXT_TRIMMER_LOAD (1 << 16)
  75. #define ULPI_STPDIRNXT_TRIMMER_SEL(x) (((x) & 0x7) << 17)
  76. #define ULPI_DIR_TRIMMER_LOAD (1 << 24)
  77. #define ULPI_DIR_TRIMMER_SEL(x) (((x) & 0x7) << 25)
  78. #define UTMIP_PLL_CFG1 0x804
  79. #define UTMIP_XTAL_FREQ_COUNT(x) (((x) & 0xfff) << 0)
  80. #define UTMIP_PLLU_ENABLE_DLY_COUNT(x) (((x) & 0x1f) << 27)
  81. #define UTMIP_XCVR_CFG0 0x808
  82. #define UTMIP_XCVR_SETUP(x) (((x) & 0xf) << 0)
  83. #define UTMIP_XCVR_SETUP_MSB(x) ((((x) & 0x70) >> 4) << 22)
  84. #define UTMIP_XCVR_LSRSLEW(x) (((x) & 0x3) << 8)
  85. #define UTMIP_XCVR_LSFSLEW(x) (((x) & 0x3) << 10)
  86. #define UTMIP_FORCE_PD_POWERDOWN (1 << 14)
  87. #define UTMIP_FORCE_PD2_POWERDOWN (1 << 16)
  88. #define UTMIP_FORCE_PDZI_POWERDOWN (1 << 18)
  89. #define UTMIP_XCVR_LSBIAS_SEL (1 << 21)
  90. #define UTMIP_XCVR_HSSLEW(x) (((x) & 0x3) << 4)
  91. #define UTMIP_XCVR_HSSLEW_MSB(x) ((((x) & 0x1fc) >> 2) << 25)
  92. #define UTMIP_BIAS_CFG0 0x80c
  93. #define UTMIP_OTGPD (1 << 11)
  94. #define UTMIP_BIASPD (1 << 10)
  95. #define UTMIP_HSSQUELCH_LEVEL(x) (((x) & 0x3) << 0)
  96. #define UTMIP_HSDISCON_LEVEL(x) (((x) & 0x3) << 2)
  97. #define UTMIP_HSDISCON_LEVEL_MSB(x) ((((x) & 0x4) >> 2) << 24)
  98. #define UTMIP_HSRX_CFG0 0x810
  99. #define UTMIP_ELASTIC_LIMIT(x) (((x) & 0x1f) << 10)
  100. #define UTMIP_IDLE_WAIT(x) (((x) & 0x1f) << 15)
  101. #define UTMIP_HSRX_CFG1 0x814
  102. #define UTMIP_HS_SYNC_START_DLY(x) (((x) & 0x1f) << 1)
  103. #define UTMIP_TX_CFG0 0x820
  104. #define UTMIP_FS_PREABMLE_J (1 << 19)
  105. #define UTMIP_HS_DISCON_DISABLE (1 << 8)
  106. #define UTMIP_MISC_CFG0 0x824
  107. #define UTMIP_DPDM_OBSERVE (1 << 26)
  108. #define UTMIP_DPDM_OBSERVE_SEL(x) (((x) & 0xf) << 27)
  109. #define UTMIP_DPDM_OBSERVE_SEL_FS_J UTMIP_DPDM_OBSERVE_SEL(0xf)
  110. #define UTMIP_DPDM_OBSERVE_SEL_FS_K UTMIP_DPDM_OBSERVE_SEL(0xe)
  111. #define UTMIP_DPDM_OBSERVE_SEL_FS_SE1 UTMIP_DPDM_OBSERVE_SEL(0xd)
  112. #define UTMIP_DPDM_OBSERVE_SEL_FS_SE0 UTMIP_DPDM_OBSERVE_SEL(0xc)
  113. #define UTMIP_SUSPEND_EXIT_ON_EDGE (1 << 22)
  114. #define UTMIP_MISC_CFG1 0x828
  115. #define UTMIP_PLL_ACTIVE_DLY_COUNT(x) (((x) & 0x1f) << 18)
  116. #define UTMIP_PLLU_STABLE_COUNT(x) (((x) & 0xfff) << 6)
  117. #define UTMIP_DEBOUNCE_CFG0 0x82c
  118. #define UTMIP_BIAS_DEBOUNCE_A(x) (((x) & 0xffff) << 0)
  119. #define UTMIP_BAT_CHRG_CFG0 0x830
  120. #define UTMIP_PD_CHRG (1 << 0)
  121. #define UTMIP_SPARE_CFG0 0x834
  122. #define FUSE_SETUP_SEL (1 << 3)
  123. #define UTMIP_XCVR_CFG1 0x838
  124. #define UTMIP_FORCE_PDDISC_POWERDOWN (1 << 0)
  125. #define UTMIP_FORCE_PDCHRP_POWERDOWN (1 << 2)
  126. #define UTMIP_FORCE_PDDR_POWERDOWN (1 << 4)
  127. #define UTMIP_XCVR_TERM_RANGE_ADJ(x) (((x) & 0xf) << 18)
  128. #define UTMIP_BIAS_CFG1 0x83c
  129. #define UTMIP_BIAS_PDTRK_COUNT(x) (((x) & 0x1f) << 3)
  130. /* For Tegra30 and above only, the address is different in Tegra20 */
  131. #define USB_USBMODE 0x1f8
  132. #define USB_USBMODE_MASK (3 << 0)
  133. #define USB_USBMODE_HOST (3 << 0)
  134. #define USB_USBMODE_DEVICE (2 << 0)
  135. static DEFINE_SPINLOCK(utmip_pad_lock);
  136. static int utmip_pad_count;
  137. struct tegra_xtal_freq {
  138. int freq;
  139. u8 enable_delay;
  140. u8 stable_count;
  141. u8 active_delay;
  142. u8 xtal_freq_count;
  143. u16 debounce;
  144. };
  145. static const struct tegra_xtal_freq tegra_freq_table[] = {
  146. {
  147. .freq = 12000000,
  148. .enable_delay = 0x02,
  149. .stable_count = 0x2F,
  150. .active_delay = 0x04,
  151. .xtal_freq_count = 0x76,
  152. .debounce = 0x7530,
  153. },
  154. {
  155. .freq = 13000000,
  156. .enable_delay = 0x02,
  157. .stable_count = 0x33,
  158. .active_delay = 0x05,
  159. .xtal_freq_count = 0x7F,
  160. .debounce = 0x7EF4,
  161. },
  162. {
  163. .freq = 19200000,
  164. .enable_delay = 0x03,
  165. .stable_count = 0x4B,
  166. .active_delay = 0x06,
  167. .xtal_freq_count = 0xBB,
  168. .debounce = 0xBB80,
  169. },
  170. {
  171. .freq = 26000000,
  172. .enable_delay = 0x04,
  173. .stable_count = 0x66,
  174. .active_delay = 0x09,
  175. .xtal_freq_count = 0xFE,
  176. .debounce = 0xFDE8,
  177. },
  178. };
  179. static void set_pts(struct tegra_usb_phy *phy, u8 pts_val)
  180. {
  181. void __iomem *base = phy->regs;
  182. unsigned long val;
  183. if (phy->soc_config->has_hostpc) {
  184. val = readl(base + TEGRA_USB_HOSTPC1_DEVLC);
  185. val &= ~TEGRA_USB_HOSTPC1_DEVLC_PTS(~0);
  186. val |= TEGRA_USB_HOSTPC1_DEVLC_PTS(pts_val);
  187. writel(val, base + TEGRA_USB_HOSTPC1_DEVLC);
  188. } else {
  189. val = readl(base + TEGRA_USB_PORTSC1) & ~TEGRA_PORTSC1_RWC_BITS;
  190. val &= ~TEGRA_USB_PORTSC1_PTS(~0);
  191. val |= TEGRA_USB_PORTSC1_PTS(pts_val);
  192. writel(val, base + TEGRA_USB_PORTSC1);
  193. }
  194. }
  195. static void set_phcd(struct tegra_usb_phy *phy, bool enable)
  196. {
  197. void __iomem *base = phy->regs;
  198. unsigned long val;
  199. if (phy->soc_config->has_hostpc) {
  200. val = readl(base + TEGRA_USB_HOSTPC1_DEVLC);
  201. if (enable)
  202. val |= TEGRA_USB_HOSTPC1_DEVLC_PHCD;
  203. else
  204. val &= ~TEGRA_USB_HOSTPC1_DEVLC_PHCD;
  205. writel(val, base + TEGRA_USB_HOSTPC1_DEVLC);
  206. } else {
  207. val = readl(base + TEGRA_USB_PORTSC1) & ~PORT_RWC_BITS;
  208. if (enable)
  209. val |= TEGRA_USB_PORTSC1_PHCD;
  210. else
  211. val &= ~TEGRA_USB_PORTSC1_PHCD;
  212. writel(val, base + TEGRA_USB_PORTSC1);
  213. }
  214. }
  215. static int utmip_pad_open(struct tegra_usb_phy *phy)
  216. {
  217. phy->pad_clk = devm_clk_get(phy->u_phy.dev, "utmi-pads");
  218. if (IS_ERR(phy->pad_clk)) {
  219. pr_err("%s: can't get utmip pad clock\n", __func__);
  220. return PTR_ERR(phy->pad_clk);
  221. }
  222. return 0;
  223. }
  224. static void utmip_pad_power_on(struct tegra_usb_phy *phy)
  225. {
  226. unsigned long val, flags;
  227. void __iomem *base = phy->pad_regs;
  228. struct tegra_utmip_config *config = phy->config;
  229. clk_prepare_enable(phy->pad_clk);
  230. spin_lock_irqsave(&utmip_pad_lock, flags);
  231. if (utmip_pad_count++ == 0) {
  232. val = readl(base + UTMIP_BIAS_CFG0);
  233. val &= ~(UTMIP_OTGPD | UTMIP_BIASPD);
  234. if (phy->soc_config->requires_extra_tuning_parameters) {
  235. val &= ~(UTMIP_HSSQUELCH_LEVEL(~0) |
  236. UTMIP_HSDISCON_LEVEL(~0) |
  237. UTMIP_HSDISCON_LEVEL_MSB(~0));
  238. val |= UTMIP_HSSQUELCH_LEVEL(config->hssquelch_level);
  239. val |= UTMIP_HSDISCON_LEVEL(config->hsdiscon_level);
  240. val |= UTMIP_HSDISCON_LEVEL_MSB(config->hsdiscon_level);
  241. }
  242. writel(val, base + UTMIP_BIAS_CFG0);
  243. }
  244. spin_unlock_irqrestore(&utmip_pad_lock, flags);
  245. clk_disable_unprepare(phy->pad_clk);
  246. }
  247. static int utmip_pad_power_off(struct tegra_usb_phy *phy)
  248. {
  249. unsigned long val, flags;
  250. void __iomem *base = phy->pad_regs;
  251. if (!utmip_pad_count) {
  252. pr_err("%s: utmip pad already powered off\n", __func__);
  253. return -EINVAL;
  254. }
  255. clk_prepare_enable(phy->pad_clk);
  256. spin_lock_irqsave(&utmip_pad_lock, flags);
  257. if (--utmip_pad_count == 0) {
  258. val = readl(base + UTMIP_BIAS_CFG0);
  259. val |= UTMIP_OTGPD | UTMIP_BIASPD;
  260. writel(val, base + UTMIP_BIAS_CFG0);
  261. }
  262. spin_unlock_irqrestore(&utmip_pad_lock, flags);
  263. clk_disable_unprepare(phy->pad_clk);
  264. return 0;
  265. }
  266. static int utmi_wait_register(void __iomem *reg, u32 mask, u32 result)
  267. {
  268. unsigned long timeout = 2000;
  269. do {
  270. if ((readl(reg) & mask) == result)
  271. return 0;
  272. udelay(1);
  273. timeout--;
  274. } while (timeout);
  275. return -1;
  276. }
  277. static void utmi_phy_clk_disable(struct tegra_usb_phy *phy)
  278. {
  279. unsigned long val;
  280. void __iomem *base = phy->regs;
  281. if (phy->is_legacy_phy) {
  282. val = readl(base + USB_SUSP_CTRL);
  283. val |= USB_SUSP_SET;
  284. writel(val, base + USB_SUSP_CTRL);
  285. udelay(10);
  286. val = readl(base + USB_SUSP_CTRL);
  287. val &= ~USB_SUSP_SET;
  288. writel(val, base + USB_SUSP_CTRL);
  289. } else
  290. set_phcd(phy, true);
  291. if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID, 0) < 0)
  292. pr_err("%s: timeout waiting for phy to stabilize\n", __func__);
  293. }
  294. static void utmi_phy_clk_enable(struct tegra_usb_phy *phy)
  295. {
  296. unsigned long val;
  297. void __iomem *base = phy->regs;
  298. if (phy->is_legacy_phy) {
  299. val = readl(base + USB_SUSP_CTRL);
  300. val |= USB_SUSP_CLR;
  301. writel(val, base + USB_SUSP_CTRL);
  302. udelay(10);
  303. val = readl(base + USB_SUSP_CTRL);
  304. val &= ~USB_SUSP_CLR;
  305. writel(val, base + USB_SUSP_CTRL);
  306. } else
  307. set_phcd(phy, false);
  308. if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID,
  309. USB_PHY_CLK_VALID))
  310. pr_err("%s: timeout waiting for phy to stabilize\n", __func__);
  311. }
  312. static int utmi_phy_power_on(struct tegra_usb_phy *phy)
  313. {
  314. unsigned long val;
  315. void __iomem *base = phy->regs;
  316. struct tegra_utmip_config *config = phy->config;
  317. val = readl(base + USB_SUSP_CTRL);
  318. val |= UTMIP_RESET;
  319. writel(val, base + USB_SUSP_CTRL);
  320. if (phy->is_legacy_phy) {
  321. val = readl(base + USB1_LEGACY_CTRL);
  322. val |= USB1_NO_LEGACY_MODE;
  323. writel(val, base + USB1_LEGACY_CTRL);
  324. }
  325. val = readl(base + UTMIP_TX_CFG0);
  326. val |= UTMIP_FS_PREABMLE_J;
  327. writel(val, base + UTMIP_TX_CFG0);
  328. val = readl(base + UTMIP_HSRX_CFG0);
  329. val &= ~(UTMIP_IDLE_WAIT(~0) | UTMIP_ELASTIC_LIMIT(~0));
  330. val |= UTMIP_IDLE_WAIT(config->idle_wait_delay);
  331. val |= UTMIP_ELASTIC_LIMIT(config->elastic_limit);
  332. writel(val, base + UTMIP_HSRX_CFG0);
  333. val = readl(base + UTMIP_HSRX_CFG1);
  334. val &= ~UTMIP_HS_SYNC_START_DLY(~0);
  335. val |= UTMIP_HS_SYNC_START_DLY(config->hssync_start_delay);
  336. writel(val, base + UTMIP_HSRX_CFG1);
  337. val = readl(base + UTMIP_DEBOUNCE_CFG0);
  338. val &= ~UTMIP_BIAS_DEBOUNCE_A(~0);
  339. val |= UTMIP_BIAS_DEBOUNCE_A(phy->freq->debounce);
  340. writel(val, base + UTMIP_DEBOUNCE_CFG0);
  341. val = readl(base + UTMIP_MISC_CFG0);
  342. val &= ~UTMIP_SUSPEND_EXIT_ON_EDGE;
  343. writel(val, base + UTMIP_MISC_CFG0);
  344. if (!phy->soc_config->utmi_pll_config_in_car_module) {
  345. val = readl(base + UTMIP_MISC_CFG1);
  346. val &= ~(UTMIP_PLL_ACTIVE_DLY_COUNT(~0) |
  347. UTMIP_PLLU_STABLE_COUNT(~0));
  348. val |= UTMIP_PLL_ACTIVE_DLY_COUNT(phy->freq->active_delay) |
  349. UTMIP_PLLU_STABLE_COUNT(phy->freq->stable_count);
  350. writel(val, base + UTMIP_MISC_CFG1);
  351. val = readl(base + UTMIP_PLL_CFG1);
  352. val &= ~(UTMIP_XTAL_FREQ_COUNT(~0) |
  353. UTMIP_PLLU_ENABLE_DLY_COUNT(~0));
  354. val |= UTMIP_XTAL_FREQ_COUNT(phy->freq->xtal_freq_count) |
  355. UTMIP_PLLU_ENABLE_DLY_COUNT(phy->freq->enable_delay);
  356. writel(val, base + UTMIP_PLL_CFG1);
  357. }
  358. if (phy->mode == USB_DR_MODE_PERIPHERAL) {
  359. val = readl(base + USB_SUSP_CTRL);
  360. val &= ~(USB_WAKE_ON_CNNT_EN_DEV | USB_WAKE_ON_DISCON_EN_DEV);
  361. writel(val, base + USB_SUSP_CTRL);
  362. val = readl(base + UTMIP_BAT_CHRG_CFG0);
  363. val &= ~UTMIP_PD_CHRG;
  364. writel(val, base + UTMIP_BAT_CHRG_CFG0);
  365. } else {
  366. val = readl(base + UTMIP_BAT_CHRG_CFG0);
  367. val |= UTMIP_PD_CHRG;
  368. writel(val, base + UTMIP_BAT_CHRG_CFG0);
  369. }
  370. utmip_pad_power_on(phy);
  371. val = readl(base + UTMIP_XCVR_CFG0);
  372. val &= ~(UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
  373. UTMIP_FORCE_PDZI_POWERDOWN | UTMIP_XCVR_LSBIAS_SEL |
  374. UTMIP_XCVR_SETUP(~0) | UTMIP_XCVR_SETUP_MSB(~0) |
  375. UTMIP_XCVR_LSFSLEW(~0) | UTMIP_XCVR_LSRSLEW(~0));
  376. if (!config->xcvr_setup_use_fuses) {
  377. val |= UTMIP_XCVR_SETUP(config->xcvr_setup);
  378. val |= UTMIP_XCVR_SETUP_MSB(config->xcvr_setup);
  379. }
  380. val |= UTMIP_XCVR_LSFSLEW(config->xcvr_lsfslew);
  381. val |= UTMIP_XCVR_LSRSLEW(config->xcvr_lsrslew);
  382. if (phy->soc_config->requires_extra_tuning_parameters) {
  383. val &= ~(UTMIP_XCVR_HSSLEW(~0) | UTMIP_XCVR_HSSLEW_MSB(~0));
  384. val |= UTMIP_XCVR_HSSLEW(config->xcvr_hsslew);
  385. val |= UTMIP_XCVR_HSSLEW_MSB(config->xcvr_hsslew);
  386. }
  387. writel(val, base + UTMIP_XCVR_CFG0);
  388. val = readl(base + UTMIP_XCVR_CFG1);
  389. val &= ~(UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN |
  390. UTMIP_FORCE_PDDR_POWERDOWN | UTMIP_XCVR_TERM_RANGE_ADJ(~0));
  391. val |= UTMIP_XCVR_TERM_RANGE_ADJ(config->term_range_adj);
  392. writel(val, base + UTMIP_XCVR_CFG1);
  393. val = readl(base + UTMIP_BIAS_CFG1);
  394. val &= ~UTMIP_BIAS_PDTRK_COUNT(~0);
  395. val |= UTMIP_BIAS_PDTRK_COUNT(0x5);
  396. writel(val, base + UTMIP_BIAS_CFG1);
  397. val = readl(base + UTMIP_SPARE_CFG0);
  398. if (config->xcvr_setup_use_fuses)
  399. val |= FUSE_SETUP_SEL;
  400. else
  401. val &= ~FUSE_SETUP_SEL;
  402. writel(val, base + UTMIP_SPARE_CFG0);
  403. if (!phy->is_legacy_phy) {
  404. val = readl(base + USB_SUSP_CTRL);
  405. val |= UTMIP_PHY_ENABLE;
  406. writel(val, base + USB_SUSP_CTRL);
  407. }
  408. val = readl(base + USB_SUSP_CTRL);
  409. val &= ~UTMIP_RESET;
  410. writel(val, base + USB_SUSP_CTRL);
  411. if (phy->is_legacy_phy) {
  412. val = readl(base + USB1_LEGACY_CTRL);
  413. val &= ~USB1_VBUS_SENSE_CTL_MASK;
  414. val |= USB1_VBUS_SENSE_CTL_A_SESS_VLD;
  415. writel(val, base + USB1_LEGACY_CTRL);
  416. val = readl(base + USB_SUSP_CTRL);
  417. val &= ~USB_SUSP_SET;
  418. writel(val, base + USB_SUSP_CTRL);
  419. }
  420. utmi_phy_clk_enable(phy);
  421. if (phy->soc_config->requires_usbmode_setup) {
  422. val = readl(base + USB_USBMODE);
  423. val &= ~USB_USBMODE_MASK;
  424. if (phy->mode == USB_DR_MODE_HOST)
  425. val |= USB_USBMODE_HOST;
  426. else
  427. val |= USB_USBMODE_DEVICE;
  428. writel(val, base + USB_USBMODE);
  429. }
  430. if (!phy->is_legacy_phy)
  431. set_pts(phy, 0);
  432. return 0;
  433. }
  434. static int utmi_phy_power_off(struct tegra_usb_phy *phy)
  435. {
  436. unsigned long val;
  437. void __iomem *base = phy->regs;
  438. utmi_phy_clk_disable(phy);
  439. if (phy->mode == USB_DR_MODE_PERIPHERAL) {
  440. val = readl(base + USB_SUSP_CTRL);
  441. val &= ~USB_WAKEUP_DEBOUNCE_COUNT(~0);
  442. val |= USB_WAKE_ON_CNNT_EN_DEV | USB_WAKEUP_DEBOUNCE_COUNT(5);
  443. writel(val, base + USB_SUSP_CTRL);
  444. }
  445. val = readl(base + USB_SUSP_CTRL);
  446. val |= UTMIP_RESET;
  447. writel(val, base + USB_SUSP_CTRL);
  448. val = readl(base + UTMIP_BAT_CHRG_CFG0);
  449. val |= UTMIP_PD_CHRG;
  450. writel(val, base + UTMIP_BAT_CHRG_CFG0);
  451. val = readl(base + UTMIP_XCVR_CFG0);
  452. val |= UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
  453. UTMIP_FORCE_PDZI_POWERDOWN;
  454. writel(val, base + UTMIP_XCVR_CFG0);
  455. val = readl(base + UTMIP_XCVR_CFG1);
  456. val |= UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN |
  457. UTMIP_FORCE_PDDR_POWERDOWN;
  458. writel(val, base + UTMIP_XCVR_CFG1);
  459. return utmip_pad_power_off(phy);
  460. }
  461. static void utmi_phy_preresume(struct tegra_usb_phy *phy)
  462. {
  463. unsigned long val;
  464. void __iomem *base = phy->regs;
  465. val = readl(base + UTMIP_TX_CFG0);
  466. val |= UTMIP_HS_DISCON_DISABLE;
  467. writel(val, base + UTMIP_TX_CFG0);
  468. }
  469. static void utmi_phy_postresume(struct tegra_usb_phy *phy)
  470. {
  471. unsigned long val;
  472. void __iomem *base = phy->regs;
  473. val = readl(base + UTMIP_TX_CFG0);
  474. val &= ~UTMIP_HS_DISCON_DISABLE;
  475. writel(val, base + UTMIP_TX_CFG0);
  476. }
  477. static void utmi_phy_restore_start(struct tegra_usb_phy *phy,
  478. enum tegra_usb_phy_port_speed port_speed)
  479. {
  480. unsigned long val;
  481. void __iomem *base = phy->regs;
  482. val = readl(base + UTMIP_MISC_CFG0);
  483. val &= ~UTMIP_DPDM_OBSERVE_SEL(~0);
  484. if (port_speed == TEGRA_USB_PHY_PORT_SPEED_LOW)
  485. val |= UTMIP_DPDM_OBSERVE_SEL_FS_K;
  486. else
  487. val |= UTMIP_DPDM_OBSERVE_SEL_FS_J;
  488. writel(val, base + UTMIP_MISC_CFG0);
  489. udelay(1);
  490. val = readl(base + UTMIP_MISC_CFG0);
  491. val |= UTMIP_DPDM_OBSERVE;
  492. writel(val, base + UTMIP_MISC_CFG0);
  493. udelay(10);
  494. }
  495. static void utmi_phy_restore_end(struct tegra_usb_phy *phy)
  496. {
  497. unsigned long val;
  498. void __iomem *base = phy->regs;
  499. val = readl(base + UTMIP_MISC_CFG0);
  500. val &= ~UTMIP_DPDM_OBSERVE;
  501. writel(val, base + UTMIP_MISC_CFG0);
  502. udelay(10);
  503. }
  504. static int ulpi_phy_power_on(struct tegra_usb_phy *phy)
  505. {
  506. int ret;
  507. unsigned long val;
  508. void __iomem *base = phy->regs;
  509. ret = gpio_direction_output(phy->reset_gpio, 0);
  510. if (ret < 0) {
  511. dev_err(phy->u_phy.dev, "gpio %d not set to 0\n",
  512. phy->reset_gpio);
  513. return ret;
  514. }
  515. msleep(5);
  516. ret = gpio_direction_output(phy->reset_gpio, 1);
  517. if (ret < 0) {
  518. dev_err(phy->u_phy.dev, "gpio %d not set to 1\n",
  519. phy->reset_gpio);
  520. return ret;
  521. }
  522. clk_prepare_enable(phy->clk);
  523. msleep(1);
  524. val = readl(base + USB_SUSP_CTRL);
  525. val |= UHSIC_RESET;
  526. writel(val, base + USB_SUSP_CTRL);
  527. val = readl(base + ULPI_TIMING_CTRL_0);
  528. val |= ULPI_OUTPUT_PINMUX_BYP | ULPI_CLKOUT_PINMUX_BYP;
  529. writel(val, base + ULPI_TIMING_CTRL_0);
  530. val = readl(base + USB_SUSP_CTRL);
  531. val |= ULPI_PHY_ENABLE;
  532. writel(val, base + USB_SUSP_CTRL);
  533. val = 0;
  534. writel(val, base + ULPI_TIMING_CTRL_1);
  535. val |= ULPI_DATA_TRIMMER_SEL(4);
  536. val |= ULPI_STPDIRNXT_TRIMMER_SEL(4);
  537. val |= ULPI_DIR_TRIMMER_SEL(4);
  538. writel(val, base + ULPI_TIMING_CTRL_1);
  539. udelay(10);
  540. val |= ULPI_DATA_TRIMMER_LOAD;
  541. val |= ULPI_STPDIRNXT_TRIMMER_LOAD;
  542. val |= ULPI_DIR_TRIMMER_LOAD;
  543. writel(val, base + ULPI_TIMING_CTRL_1);
  544. /* Fix VbusInvalid due to floating VBUS */
  545. ret = usb_phy_io_write(phy->ulpi, 0x40, 0x08);
  546. if (ret) {
  547. pr_err("%s: ulpi write failed\n", __func__);
  548. return ret;
  549. }
  550. ret = usb_phy_io_write(phy->ulpi, 0x80, 0x0B);
  551. if (ret) {
  552. pr_err("%s: ulpi write failed\n", __func__);
  553. return ret;
  554. }
  555. val = readl(base + USB_SUSP_CTRL);
  556. val |= USB_SUSP_CLR;
  557. writel(val, base + USB_SUSP_CTRL);
  558. udelay(100);
  559. val = readl(base + USB_SUSP_CTRL);
  560. val &= ~USB_SUSP_CLR;
  561. writel(val, base + USB_SUSP_CTRL);
  562. return 0;
  563. }
  564. static int ulpi_phy_power_off(struct tegra_usb_phy *phy)
  565. {
  566. clk_disable(phy->clk);
  567. return gpio_direction_output(phy->reset_gpio, 0);
  568. }
  569. static void tegra_usb_phy_close(struct tegra_usb_phy *phy)
  570. {
  571. if (!IS_ERR(phy->vbus))
  572. regulator_disable(phy->vbus);
  573. clk_disable_unprepare(phy->pll_u);
  574. }
  575. static int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
  576. {
  577. if (phy->is_ulpi_phy)
  578. return ulpi_phy_power_on(phy);
  579. else
  580. return utmi_phy_power_on(phy);
  581. }
  582. static int tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
  583. {
  584. if (phy->is_ulpi_phy)
  585. return ulpi_phy_power_off(phy);
  586. else
  587. return utmi_phy_power_off(phy);
  588. }
  589. static int tegra_usb_phy_suspend(struct usb_phy *x, int suspend)
  590. {
  591. struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy);
  592. if (suspend)
  593. return tegra_usb_phy_power_off(phy);
  594. else
  595. return tegra_usb_phy_power_on(phy);
  596. }
  597. static int ulpi_open(struct tegra_usb_phy *phy)
  598. {
  599. int err;
  600. phy->clk = devm_clk_get(phy->u_phy.dev, "ulpi-link");
  601. if (IS_ERR(phy->clk)) {
  602. pr_err("%s: can't get ulpi clock\n", __func__);
  603. return PTR_ERR(phy->clk);
  604. }
  605. err = devm_gpio_request(phy->u_phy.dev, phy->reset_gpio,
  606. "ulpi_phy_reset_b");
  607. if (err < 0) {
  608. dev_err(phy->u_phy.dev, "request failed for gpio: %d\n",
  609. phy->reset_gpio);
  610. return err;
  611. }
  612. err = gpio_direction_output(phy->reset_gpio, 0);
  613. if (err < 0) {
  614. dev_err(phy->u_phy.dev, "gpio %d direction not set to output\n",
  615. phy->reset_gpio);
  616. return err;
  617. }
  618. phy->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, 0);
  619. if (!phy->ulpi) {
  620. dev_err(phy->u_phy.dev, "otg_ulpi_create returned NULL\n");
  621. err = -ENOMEM;
  622. return err;
  623. }
  624. phy->ulpi->io_priv = phy->regs + ULPI_VIEWPORT;
  625. return 0;
  626. }
  627. static int tegra_usb_phy_init(struct tegra_usb_phy *phy)
  628. {
  629. unsigned long parent_rate;
  630. int i;
  631. int err;
  632. phy->pll_u = devm_clk_get(phy->u_phy.dev, "pll_u");
  633. if (IS_ERR(phy->pll_u)) {
  634. pr_err("Can't get pll_u clock\n");
  635. return PTR_ERR(phy->pll_u);
  636. }
  637. err = clk_prepare_enable(phy->pll_u);
  638. if (err)
  639. return err;
  640. parent_rate = clk_get_rate(clk_get_parent(phy->pll_u));
  641. for (i = 0; i < ARRAY_SIZE(tegra_freq_table); i++) {
  642. if (tegra_freq_table[i].freq == parent_rate) {
  643. phy->freq = &tegra_freq_table[i];
  644. break;
  645. }
  646. }
  647. if (!phy->freq) {
  648. pr_err("invalid pll_u parent rate %ld\n", parent_rate);
  649. err = -EINVAL;
  650. goto fail;
  651. }
  652. if (!IS_ERR(phy->vbus)) {
  653. err = regulator_enable(phy->vbus);
  654. if (err) {
  655. dev_err(phy->u_phy.dev,
  656. "failed to enable usb vbus regulator: %d\n",
  657. err);
  658. goto fail;
  659. }
  660. }
  661. if (phy->is_ulpi_phy)
  662. err = ulpi_open(phy);
  663. else
  664. err = utmip_pad_open(phy);
  665. if (err < 0)
  666. goto fail;
  667. return 0;
  668. fail:
  669. clk_disable_unprepare(phy->pll_u);
  670. return err;
  671. }
  672. void tegra_usb_phy_preresume(struct usb_phy *x)
  673. {
  674. struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy);
  675. if (!phy->is_ulpi_phy)
  676. utmi_phy_preresume(phy);
  677. }
  678. EXPORT_SYMBOL_GPL(tegra_usb_phy_preresume);
  679. void tegra_usb_phy_postresume(struct usb_phy *x)
  680. {
  681. struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy);
  682. if (!phy->is_ulpi_phy)
  683. utmi_phy_postresume(phy);
  684. }
  685. EXPORT_SYMBOL_GPL(tegra_usb_phy_postresume);
  686. void tegra_ehci_phy_restore_start(struct usb_phy *x,
  687. enum tegra_usb_phy_port_speed port_speed)
  688. {
  689. struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy);
  690. if (!phy->is_ulpi_phy)
  691. utmi_phy_restore_start(phy, port_speed);
  692. }
  693. EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_start);
  694. void tegra_ehci_phy_restore_end(struct usb_phy *x)
  695. {
  696. struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy);
  697. if (!phy->is_ulpi_phy)
  698. utmi_phy_restore_end(phy);
  699. }
  700. EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_end);
  701. static int read_utmi_param(struct platform_device *pdev, const char *param,
  702. u8 *dest)
  703. {
  704. u32 value;
  705. int err = of_property_read_u32(pdev->dev.of_node, param, &value);
  706. *dest = (u8)value;
  707. if (err < 0)
  708. dev_err(&pdev->dev, "Failed to read USB UTMI parameter %s: %d\n",
  709. param, err);
  710. return err;
  711. }
  712. static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy,
  713. struct platform_device *pdev)
  714. {
  715. struct resource *res;
  716. int err;
  717. struct tegra_utmip_config *config;
  718. tegra_phy->is_ulpi_phy = false;
  719. res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  720. if (!res) {
  721. dev_err(&pdev->dev, "Failed to get UTMI Pad regs\n");
  722. return -ENXIO;
  723. }
  724. tegra_phy->pad_regs = devm_ioremap(&pdev->dev, res->start,
  725. resource_size(res));
  726. if (!tegra_phy->pad_regs) {
  727. dev_err(&pdev->dev, "Failed to remap UTMI Pad regs\n");
  728. return -ENOMEM;
  729. }
  730. tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config),
  731. GFP_KERNEL);
  732. if (!tegra_phy->config)
  733. return -ENOMEM;
  734. config = tegra_phy->config;
  735. err = read_utmi_param(pdev, "nvidia,hssync-start-delay",
  736. &config->hssync_start_delay);
  737. if (err < 0)
  738. return err;
  739. err = read_utmi_param(pdev, "nvidia,elastic-limit",
  740. &config->elastic_limit);
  741. if (err < 0)
  742. return err;
  743. err = read_utmi_param(pdev, "nvidia,idle-wait-delay",
  744. &config->idle_wait_delay);
  745. if (err < 0)
  746. return err;
  747. err = read_utmi_param(pdev, "nvidia,term-range-adj",
  748. &config->term_range_adj);
  749. if (err < 0)
  750. return err;
  751. err = read_utmi_param(pdev, "nvidia,xcvr-lsfslew",
  752. &config->xcvr_lsfslew);
  753. if (err < 0)
  754. return err;
  755. err = read_utmi_param(pdev, "nvidia,xcvr-lsrslew",
  756. &config->xcvr_lsrslew);
  757. if (err < 0)
  758. return err;
  759. if (tegra_phy->soc_config->requires_extra_tuning_parameters) {
  760. err = read_utmi_param(pdev, "nvidia,xcvr-hsslew",
  761. &config->xcvr_hsslew);
  762. if (err < 0)
  763. return err;
  764. err = read_utmi_param(pdev, "nvidia,hssquelch-level",
  765. &config->hssquelch_level);
  766. if (err < 0)
  767. return err;
  768. err = read_utmi_param(pdev, "nvidia,hsdiscon-level",
  769. &config->hsdiscon_level);
  770. if (err < 0)
  771. return err;
  772. }
  773. config->xcvr_setup_use_fuses = of_property_read_bool(
  774. pdev->dev.of_node, "nvidia,xcvr-setup-use-fuses");
  775. if (!config->xcvr_setup_use_fuses) {
  776. err = read_utmi_param(pdev, "nvidia,xcvr-setup",
  777. &config->xcvr_setup);
  778. if (err < 0)
  779. return err;
  780. }
  781. return 0;
  782. }
  783. static const struct tegra_phy_soc_config tegra20_soc_config = {
  784. .utmi_pll_config_in_car_module = false,
  785. .has_hostpc = false,
  786. .requires_usbmode_setup = false,
  787. .requires_extra_tuning_parameters = false,
  788. };
  789. static const struct tegra_phy_soc_config tegra30_soc_config = {
  790. .utmi_pll_config_in_car_module = true,
  791. .has_hostpc = true,
  792. .requires_usbmode_setup = true,
  793. .requires_extra_tuning_parameters = true,
  794. };
  795. static const struct of_device_id tegra_usb_phy_id_table[] = {
  796. { .compatible = "nvidia,tegra30-usb-phy", .data = &tegra30_soc_config },
  797. { .compatible = "nvidia,tegra20-usb-phy", .data = &tegra20_soc_config },
  798. { },
  799. };
  800. MODULE_DEVICE_TABLE(of, tegra_usb_phy_id_table);
  801. static int tegra_usb_phy_probe(struct platform_device *pdev)
  802. {
  803. const struct of_device_id *match;
  804. struct resource *res;
  805. struct tegra_usb_phy *tegra_phy = NULL;
  806. struct device_node *np = pdev->dev.of_node;
  807. enum usb_phy_interface phy_type;
  808. int err;
  809. tegra_phy = devm_kzalloc(&pdev->dev, sizeof(*tegra_phy), GFP_KERNEL);
  810. if (!tegra_phy)
  811. return -ENOMEM;
  812. match = of_match_device(tegra_usb_phy_id_table, &pdev->dev);
  813. if (!match) {
  814. dev_err(&pdev->dev, "Error: No device match found\n");
  815. return -ENODEV;
  816. }
  817. tegra_phy->soc_config = match->data;
  818. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  819. if (!res) {
  820. dev_err(&pdev->dev, "Failed to get I/O memory\n");
  821. return -ENXIO;
  822. }
  823. tegra_phy->regs = devm_ioremap(&pdev->dev, res->start,
  824. resource_size(res));
  825. if (!tegra_phy->regs) {
  826. dev_err(&pdev->dev, "Failed to remap I/O memory\n");
  827. return -ENOMEM;
  828. }
  829. tegra_phy->is_legacy_phy =
  830. of_property_read_bool(np, "nvidia,has-legacy-mode");
  831. phy_type = of_usb_get_phy_mode(np);
  832. switch (phy_type) {
  833. case USBPHY_INTERFACE_MODE_UTMI:
  834. err = utmi_phy_probe(tegra_phy, pdev);
  835. if (err < 0)
  836. return err;
  837. break;
  838. case USBPHY_INTERFACE_MODE_ULPI:
  839. tegra_phy->is_ulpi_phy = true;
  840. tegra_phy->reset_gpio =
  841. of_get_named_gpio(np, "nvidia,phy-reset-gpio", 0);
  842. if (!gpio_is_valid(tegra_phy->reset_gpio)) {
  843. dev_err(&pdev->dev, "invalid gpio: %d\n",
  844. tegra_phy->reset_gpio);
  845. return tegra_phy->reset_gpio;
  846. }
  847. tegra_phy->config = NULL;
  848. break;
  849. default:
  850. dev_err(&pdev->dev, "phy_type is invalid or unsupported\n");
  851. return -EINVAL;
  852. }
  853. if (of_find_property(np, "dr_mode", NULL))
  854. tegra_phy->mode = usb_get_dr_mode(&pdev->dev);
  855. else
  856. tegra_phy->mode = USB_DR_MODE_HOST;
  857. if (tegra_phy->mode == USB_DR_MODE_UNKNOWN) {
  858. dev_err(&pdev->dev, "dr_mode is invalid\n");
  859. return -EINVAL;
  860. }
  861. /* On some boards, the VBUS regulator doesn't need to be controlled */
  862. if (of_find_property(np, "vbus-supply", NULL)) {
  863. tegra_phy->vbus = devm_regulator_get(&pdev->dev, "vbus");
  864. if (IS_ERR(tegra_phy->vbus))
  865. return PTR_ERR(tegra_phy->vbus);
  866. } else {
  867. dev_notice(&pdev->dev, "no vbus regulator");
  868. tegra_phy->vbus = ERR_PTR(-ENODEV);
  869. }
  870. tegra_phy->u_phy.dev = &pdev->dev;
  871. err = tegra_usb_phy_init(tegra_phy);
  872. if (err < 0)
  873. return err;
  874. tegra_phy->u_phy.set_suspend = tegra_usb_phy_suspend;
  875. platform_set_drvdata(pdev, tegra_phy);
  876. err = usb_add_phy_dev(&tegra_phy->u_phy);
  877. if (err < 0) {
  878. tegra_usb_phy_close(tegra_phy);
  879. return err;
  880. }
  881. return 0;
  882. }
  883. static int tegra_usb_phy_remove(struct platform_device *pdev)
  884. {
  885. struct tegra_usb_phy *tegra_phy = platform_get_drvdata(pdev);
  886. usb_remove_phy(&tegra_phy->u_phy);
  887. tegra_usb_phy_close(tegra_phy);
  888. return 0;
  889. }
  890. static struct platform_driver tegra_usb_phy_driver = {
  891. .probe = tegra_usb_phy_probe,
  892. .remove = tegra_usb_phy_remove,
  893. .driver = {
  894. .name = "tegra-phy",
  895. .of_match_table = tegra_usb_phy_id_table,
  896. },
  897. };
  898. module_platform_driver(tegra_usb_phy_driver);
  899. MODULE_DESCRIPTION("Tegra USB PHY driver");
  900. MODULE_LICENSE("GPL v2");