usb-host.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. /*
  2. * usb-host.c - OMAP USB Host
  3. *
  4. * This file will contain the board specific details for the
  5. * Synopsys EHCI/OHCI host controller on OMAP3430 and onwards
  6. *
  7. * Copyright (C) 2007-2011 Texas Instruments
  8. * Author: Vikram Pandita <vikram.pandita@ti.com>
  9. * Author: Keshava Munegowda <keshava_mgowda@ti.com>
  10. *
  11. * Generalization by:
  12. * Felipe Balbi <balbi@ti.com>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License version 2 as
  16. * published by the Free Software Foundation.
  17. */
  18. #include <linux/types.h>
  19. #include <linux/errno.h>
  20. #include <linux/delay.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/slab.h>
  23. #include <linux/dma-mapping.h>
  24. #include <linux/regulator/machine.h>
  25. #include <linux/regulator/fixed.h>
  26. #include <linux/string.h>
  27. #include <linux/io.h>
  28. #include <linux/gpio.h>
  29. #include <linux/usb/phy.h>
  30. #include <linux/usb/usb_phy_generic.h>
  31. #include "soc.h"
  32. #include "omap_device.h"
  33. #include "mux.h"
  34. #include "usb.h"
  35. #ifdef CONFIG_MFD_OMAP_USB_HOST
  36. #define OMAP_USBHS_DEVICE "usbhs_omap"
  37. #define OMAP_USBTLL_DEVICE "usbhs_tll"
  38. #define USBHS_UHH_HWMODNAME "usb_host_hs"
  39. #define USBHS_TLL_HWMODNAME "usb_tll_hs"
  40. /* MUX settings for EHCI pins */
  41. /*
  42. * setup_ehci_io_mux - initialize IO pad mux for USBHOST
  43. */
  44. static void __init setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
  45. {
  46. switch (port_mode[0]) {
  47. case OMAP_EHCI_PORT_MODE_PHY:
  48. omap_mux_init_signal("hsusb1_stp", OMAP_PIN_OUTPUT);
  49. omap_mux_init_signal("hsusb1_clk", OMAP_PIN_OUTPUT);
  50. omap_mux_init_signal("hsusb1_dir", OMAP_PIN_INPUT_PULLDOWN);
  51. omap_mux_init_signal("hsusb1_nxt", OMAP_PIN_INPUT_PULLDOWN);
  52. omap_mux_init_signal("hsusb1_data0", OMAP_PIN_INPUT_PULLDOWN);
  53. omap_mux_init_signal("hsusb1_data1", OMAP_PIN_INPUT_PULLDOWN);
  54. omap_mux_init_signal("hsusb1_data2", OMAP_PIN_INPUT_PULLDOWN);
  55. omap_mux_init_signal("hsusb1_data3", OMAP_PIN_INPUT_PULLDOWN);
  56. omap_mux_init_signal("hsusb1_data4", OMAP_PIN_INPUT_PULLDOWN);
  57. omap_mux_init_signal("hsusb1_data5", OMAP_PIN_INPUT_PULLDOWN);
  58. omap_mux_init_signal("hsusb1_data6", OMAP_PIN_INPUT_PULLDOWN);
  59. omap_mux_init_signal("hsusb1_data7", OMAP_PIN_INPUT_PULLDOWN);
  60. break;
  61. case OMAP_EHCI_PORT_MODE_TLL:
  62. omap_mux_init_signal("hsusb1_tll_stp",
  63. OMAP_PIN_INPUT_PULLUP);
  64. omap_mux_init_signal("hsusb1_tll_clk",
  65. OMAP_PIN_INPUT_PULLDOWN);
  66. omap_mux_init_signal("hsusb1_tll_dir",
  67. OMAP_PIN_INPUT_PULLDOWN);
  68. omap_mux_init_signal("hsusb1_tll_nxt",
  69. OMAP_PIN_INPUT_PULLDOWN);
  70. omap_mux_init_signal("hsusb1_tll_data0",
  71. OMAP_PIN_INPUT_PULLDOWN);
  72. omap_mux_init_signal("hsusb1_tll_data1",
  73. OMAP_PIN_INPUT_PULLDOWN);
  74. omap_mux_init_signal("hsusb1_tll_data2",
  75. OMAP_PIN_INPUT_PULLDOWN);
  76. omap_mux_init_signal("hsusb1_tll_data3",
  77. OMAP_PIN_INPUT_PULLDOWN);
  78. omap_mux_init_signal("hsusb1_tll_data4",
  79. OMAP_PIN_INPUT_PULLDOWN);
  80. omap_mux_init_signal("hsusb1_tll_data5",
  81. OMAP_PIN_INPUT_PULLDOWN);
  82. omap_mux_init_signal("hsusb1_tll_data6",
  83. OMAP_PIN_INPUT_PULLDOWN);
  84. omap_mux_init_signal("hsusb1_tll_data7",
  85. OMAP_PIN_INPUT_PULLDOWN);
  86. break;
  87. case OMAP_USBHS_PORT_MODE_UNUSED:
  88. /* FALLTHROUGH */
  89. default:
  90. break;
  91. }
  92. switch (port_mode[1]) {
  93. case OMAP_EHCI_PORT_MODE_PHY:
  94. omap_mux_init_signal("hsusb2_stp", OMAP_PIN_OUTPUT);
  95. omap_mux_init_signal("hsusb2_clk", OMAP_PIN_OUTPUT);
  96. omap_mux_init_signal("hsusb2_dir", OMAP_PIN_INPUT_PULLDOWN);
  97. omap_mux_init_signal("hsusb2_nxt", OMAP_PIN_INPUT_PULLDOWN);
  98. omap_mux_init_signal("hsusb2_data0",
  99. OMAP_PIN_INPUT_PULLDOWN);
  100. omap_mux_init_signal("hsusb2_data1",
  101. OMAP_PIN_INPUT_PULLDOWN);
  102. omap_mux_init_signal("hsusb2_data2",
  103. OMAP_PIN_INPUT_PULLDOWN);
  104. omap_mux_init_signal("hsusb2_data3",
  105. OMAP_PIN_INPUT_PULLDOWN);
  106. omap_mux_init_signal("hsusb2_data4",
  107. OMAP_PIN_INPUT_PULLDOWN);
  108. omap_mux_init_signal("hsusb2_data5",
  109. OMAP_PIN_INPUT_PULLDOWN);
  110. omap_mux_init_signal("hsusb2_data6",
  111. OMAP_PIN_INPUT_PULLDOWN);
  112. omap_mux_init_signal("hsusb2_data7",
  113. OMAP_PIN_INPUT_PULLDOWN);
  114. break;
  115. case OMAP_EHCI_PORT_MODE_TLL:
  116. omap_mux_init_signal("hsusb2_tll_stp",
  117. OMAP_PIN_INPUT_PULLUP);
  118. omap_mux_init_signal("hsusb2_tll_clk",
  119. OMAP_PIN_INPUT_PULLDOWN);
  120. omap_mux_init_signal("hsusb2_tll_dir",
  121. OMAP_PIN_INPUT_PULLDOWN);
  122. omap_mux_init_signal("hsusb2_tll_nxt",
  123. OMAP_PIN_INPUT_PULLDOWN);
  124. omap_mux_init_signal("hsusb2_tll_data0",
  125. OMAP_PIN_INPUT_PULLDOWN);
  126. omap_mux_init_signal("hsusb2_tll_data1",
  127. OMAP_PIN_INPUT_PULLDOWN);
  128. omap_mux_init_signal("hsusb2_tll_data2",
  129. OMAP_PIN_INPUT_PULLDOWN);
  130. omap_mux_init_signal("hsusb2_tll_data3",
  131. OMAP_PIN_INPUT_PULLDOWN);
  132. omap_mux_init_signal("hsusb2_tll_data4",
  133. OMAP_PIN_INPUT_PULLDOWN);
  134. omap_mux_init_signal("hsusb2_tll_data5",
  135. OMAP_PIN_INPUT_PULLDOWN);
  136. omap_mux_init_signal("hsusb2_tll_data6",
  137. OMAP_PIN_INPUT_PULLDOWN);
  138. omap_mux_init_signal("hsusb2_tll_data7",
  139. OMAP_PIN_INPUT_PULLDOWN);
  140. break;
  141. case OMAP_USBHS_PORT_MODE_UNUSED:
  142. /* FALLTHROUGH */
  143. default:
  144. break;
  145. }
  146. switch (port_mode[2]) {
  147. case OMAP_EHCI_PORT_MODE_PHY:
  148. printk(KERN_WARNING "Port3 can't be used in PHY mode\n");
  149. break;
  150. case OMAP_EHCI_PORT_MODE_TLL:
  151. omap_mux_init_signal("hsusb3_tll_stp",
  152. OMAP_PIN_INPUT_PULLUP);
  153. omap_mux_init_signal("hsusb3_tll_clk",
  154. OMAP_PIN_INPUT_PULLDOWN);
  155. omap_mux_init_signal("hsusb3_tll_dir",
  156. OMAP_PIN_INPUT_PULLDOWN);
  157. omap_mux_init_signal("hsusb3_tll_nxt",
  158. OMAP_PIN_INPUT_PULLDOWN);
  159. omap_mux_init_signal("hsusb3_tll_data0",
  160. OMAP_PIN_INPUT_PULLDOWN);
  161. omap_mux_init_signal("hsusb3_tll_data1",
  162. OMAP_PIN_INPUT_PULLDOWN);
  163. omap_mux_init_signal("hsusb3_tll_data2",
  164. OMAP_PIN_INPUT_PULLDOWN);
  165. omap_mux_init_signal("hsusb3_tll_data3",
  166. OMAP_PIN_INPUT_PULLDOWN);
  167. omap_mux_init_signal("hsusb3_tll_data4",
  168. OMAP_PIN_INPUT_PULLDOWN);
  169. omap_mux_init_signal("hsusb3_tll_data5",
  170. OMAP_PIN_INPUT_PULLDOWN);
  171. omap_mux_init_signal("hsusb3_tll_data6",
  172. OMAP_PIN_INPUT_PULLDOWN);
  173. omap_mux_init_signal("hsusb3_tll_data7",
  174. OMAP_PIN_INPUT_PULLDOWN);
  175. break;
  176. case OMAP_USBHS_PORT_MODE_UNUSED:
  177. /* FALLTHROUGH */
  178. default:
  179. break;
  180. }
  181. return;
  182. }
  183. static void __init setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
  184. {
  185. switch (port_mode[0]) {
  186. case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
  187. case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
  188. case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
  189. case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
  190. omap_mux_init_signal("mm1_rxdp",
  191. OMAP_PIN_INPUT_PULLDOWN);
  192. omap_mux_init_signal("mm1_rxdm",
  193. OMAP_PIN_INPUT_PULLDOWN);
  194. /* FALLTHROUGH */
  195. case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
  196. case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
  197. omap_mux_init_signal("mm1_rxrcv",
  198. OMAP_PIN_INPUT_PULLDOWN);
  199. /* FALLTHROUGH */
  200. case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
  201. case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
  202. omap_mux_init_signal("mm1_txen_n", OMAP_PIN_OUTPUT);
  203. /* FALLTHROUGH */
  204. case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
  205. case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
  206. omap_mux_init_signal("mm1_txse0",
  207. OMAP_PIN_INPUT_PULLDOWN);
  208. omap_mux_init_signal("mm1_txdat",
  209. OMAP_PIN_INPUT_PULLDOWN);
  210. break;
  211. case OMAP_USBHS_PORT_MODE_UNUSED:
  212. /* FALLTHROUGH */
  213. default:
  214. break;
  215. }
  216. switch (port_mode[1]) {
  217. case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
  218. case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
  219. case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
  220. case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
  221. omap_mux_init_signal("mm2_rxdp",
  222. OMAP_PIN_INPUT_PULLDOWN);
  223. omap_mux_init_signal("mm2_rxdm",
  224. OMAP_PIN_INPUT_PULLDOWN);
  225. /* FALLTHROUGH */
  226. case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
  227. case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
  228. omap_mux_init_signal("mm2_rxrcv",
  229. OMAP_PIN_INPUT_PULLDOWN);
  230. /* FALLTHROUGH */
  231. case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
  232. case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
  233. omap_mux_init_signal("mm2_txen_n", OMAP_PIN_OUTPUT);
  234. /* FALLTHROUGH */
  235. case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
  236. case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
  237. omap_mux_init_signal("mm2_txse0",
  238. OMAP_PIN_INPUT_PULLDOWN);
  239. omap_mux_init_signal("mm2_txdat",
  240. OMAP_PIN_INPUT_PULLDOWN);
  241. break;
  242. case OMAP_USBHS_PORT_MODE_UNUSED:
  243. /* FALLTHROUGH */
  244. default:
  245. break;
  246. }
  247. switch (port_mode[2]) {
  248. case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
  249. case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
  250. case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
  251. case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
  252. omap_mux_init_signal("mm3_rxdp",
  253. OMAP_PIN_INPUT_PULLDOWN);
  254. omap_mux_init_signal("mm3_rxdm",
  255. OMAP_PIN_INPUT_PULLDOWN);
  256. /* FALLTHROUGH */
  257. case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
  258. case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
  259. omap_mux_init_signal("mm3_rxrcv",
  260. OMAP_PIN_INPUT_PULLDOWN);
  261. /* FALLTHROUGH */
  262. case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
  263. case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
  264. omap_mux_init_signal("mm3_txen_n", OMAP_PIN_OUTPUT);
  265. /* FALLTHROUGH */
  266. case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
  267. case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
  268. omap_mux_init_signal("mm3_txse0",
  269. OMAP_PIN_INPUT_PULLDOWN);
  270. omap_mux_init_signal("mm3_txdat",
  271. OMAP_PIN_INPUT_PULLDOWN);
  272. break;
  273. case OMAP_USBHS_PORT_MODE_UNUSED:
  274. /* FALLTHROUGH */
  275. default:
  276. break;
  277. }
  278. }
  279. void __init usbhs_init(struct usbhs_omap_platform_data *pdata)
  280. {
  281. struct omap_hwmod *uhh_hwm, *tll_hwm;
  282. struct platform_device *pdev;
  283. int bus_id = -1;
  284. if (cpu_is_omap34xx()) {
  285. setup_ehci_io_mux(pdata->port_mode);
  286. setup_ohci_io_mux(pdata->port_mode);
  287. if (omap_rev() <= OMAP3430_REV_ES2_1)
  288. pdata->single_ulpi_bypass = true;
  289. }
  290. uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
  291. if (!uhh_hwm) {
  292. pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
  293. return;
  294. }
  295. tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
  296. if (!tll_hwm) {
  297. pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
  298. return;
  299. }
  300. pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
  301. pdata, sizeof(*pdata));
  302. if (IS_ERR(pdev)) {
  303. pr_err("Could not build hwmod device %s\n",
  304. USBHS_TLL_HWMODNAME);
  305. return;
  306. }
  307. pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
  308. pdata, sizeof(*pdata));
  309. if (IS_ERR(pdev)) {
  310. pr_err("Could not build hwmod devices %s\n",
  311. USBHS_UHH_HWMODNAME);
  312. return;
  313. }
  314. }
  315. #else
  316. void __init usbhs_init(struct usbhs_omap_platform_data *pdata)
  317. {
  318. }
  319. #endif
  320. /* Template for PHY regulators */
  321. static struct fixed_voltage_config hsusb_reg_config = {
  322. /* .supply_name filled later */
  323. .microvolts = 3300000,
  324. .gpio = -1, /* updated later */
  325. .startup_delay = 70000, /* 70msec */
  326. .enable_high = 1, /* updated later */
  327. .enabled_at_boot = 0, /* keep in RESET */
  328. /* .init_data filled later */
  329. };
  330. static const char *nop_name = "usb_phy_generic"; /* NOP PHY driver */
  331. static const char *reg_name = "reg-fixed-voltage"; /* Regulator driver */
  332. /**
  333. * usbhs_add_regulator - Add a gpio based fixed voltage regulator device
  334. * @name: name for the regulator
  335. * @dev_id: device id of the device this regulator supplies power to
  336. * @dev_supply: supply name that the device expects
  337. * @gpio: GPIO number
  338. * @polarity: 1 - Active high, 0 - Active low
  339. */
  340. static int usbhs_add_regulator(char *name, char *dev_id, char *dev_supply,
  341. int gpio, int polarity)
  342. {
  343. struct regulator_consumer_supply *supplies;
  344. struct regulator_init_data *reg_data;
  345. struct fixed_voltage_config *config;
  346. struct platform_device *pdev;
  347. struct platform_device_info pdevinfo;
  348. int ret = -ENOMEM;
  349. supplies = kzalloc(sizeof(*supplies), GFP_KERNEL);
  350. if (!supplies)
  351. return -ENOMEM;
  352. supplies->supply = dev_supply;
  353. supplies->dev_name = dev_id;
  354. reg_data = kzalloc(sizeof(*reg_data), GFP_KERNEL);
  355. if (!reg_data)
  356. goto err_data;
  357. reg_data->constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS;
  358. reg_data->consumer_supplies = supplies;
  359. reg_data->num_consumer_supplies = 1;
  360. config = kmemdup(&hsusb_reg_config, sizeof(hsusb_reg_config),
  361. GFP_KERNEL);
  362. if (!config)
  363. goto err_config;
  364. config->supply_name = kstrdup(name, GFP_KERNEL);
  365. if (!config->supply_name)
  366. goto err_supplyname;
  367. config->gpio = gpio;
  368. config->enable_high = polarity;
  369. config->init_data = reg_data;
  370. /* create a regulator device */
  371. memset(&pdevinfo, 0, sizeof(pdevinfo));
  372. pdevinfo.name = reg_name;
  373. pdevinfo.id = PLATFORM_DEVID_AUTO;
  374. pdevinfo.data = config;
  375. pdevinfo.size_data = sizeof(*config);
  376. pdev = platform_device_register_full(&pdevinfo);
  377. if (IS_ERR(pdev)) {
  378. ret = PTR_ERR(pdev);
  379. pr_err("%s: Failed registering regulator %s for %s : %d\n",
  380. __func__, name, dev_id, ret);
  381. goto err_register;
  382. }
  383. return 0;
  384. err_register:
  385. kfree(config->supply_name);
  386. err_supplyname:
  387. kfree(config);
  388. err_config:
  389. kfree(reg_data);
  390. err_data:
  391. kfree(supplies);
  392. return ret;
  393. }
  394. #define MAX_STR 20
  395. int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
  396. {
  397. char rail_name[MAX_STR];
  398. int i;
  399. struct platform_device *pdev;
  400. char *phy_id;
  401. struct platform_device_info pdevinfo;
  402. struct usb_phy_generic_platform_data nop_pdata;
  403. for (i = 0; i < num_phys; i++) {
  404. if (!phy->port) {
  405. pr_err("%s: Invalid port 0. Must start from 1\n",
  406. __func__);
  407. continue;
  408. }
  409. /* do we need a NOP PHY device ? */
  410. if (!gpio_is_valid(phy->reset_gpio) &&
  411. !gpio_is_valid(phy->vcc_gpio))
  412. continue;
  413. phy_id = kmalloc(MAX_STR, GFP_KERNEL);
  414. if (!phy_id) {
  415. pr_err("%s: kmalloc() failed\n", __func__);
  416. return -ENOMEM;
  417. }
  418. /* set platform data */
  419. memset(&nop_pdata, 0, sizeof(nop_pdata));
  420. if (gpio_is_valid(phy->vcc_gpio))
  421. nop_pdata.needs_vcc = true;
  422. nop_pdata.gpio_reset = phy->reset_gpio;
  423. nop_pdata.type = USB_PHY_TYPE_USB2;
  424. /* create a NOP PHY device */
  425. memset(&pdevinfo, 0, sizeof(pdevinfo));
  426. pdevinfo.name = nop_name;
  427. pdevinfo.id = phy->port;
  428. pdevinfo.data = &nop_pdata;
  429. pdevinfo.size_data =
  430. sizeof(struct usb_phy_generic_platform_data);
  431. scnprintf(phy_id, MAX_STR, "usb_phy_generic.%d",
  432. phy->port);
  433. pdev = platform_device_register_full(&pdevinfo);
  434. if (IS_ERR(pdev)) {
  435. pr_err("%s: Failed to register device %s : %ld\n",
  436. __func__, phy_id, PTR_ERR(pdev));
  437. kfree(phy_id);
  438. continue;
  439. }
  440. usb_bind_phy("ehci-omap.0", phy->port - 1, phy_id);
  441. /* Do we need VCC regulator ? */
  442. if (gpio_is_valid(phy->vcc_gpio)) {
  443. scnprintf(rail_name, MAX_STR, "hsusb%d_vcc", phy->port);
  444. usbhs_add_regulator(rail_name, phy_id, "vcc",
  445. phy->vcc_gpio, phy->vcc_polarity);
  446. }
  447. phy++;
  448. }
  449. return 0;
  450. }