Lines Matching +full:tegra210 +full:- +full:emc
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved.
11 #include <linux/dma-mapping.h>
283 return readl(tegra->fpci_base + offset); in fpci_readl()
289 writel(value, tegra->fpci_base + offset); in fpci_writel()
294 return readl(tegra->ipfs_base + offset); in ipfs_readl()
300 writel(value, tegra->ipfs_base + offset); in ipfs_writel()
327 struct clk *clk = tegra->ss_src_clk; in tegra_xusb_set_ss_clk()
341 new_parent_rate = clk_get_rate(tegra->pll_u_480m); in tegra_xusb_set_ss_clk()
348 err = clk_set_parent(clk, tegra->pll_u_480m); in tegra_xusb_set_ss_clk()
364 err = clk_set_parent(clk, tegra->clk_m); in tegra_xusb_set_ss_clk()
375 dev_err(tegra->dev, "Invalid SS rate: %lu Hz\n", rate); in tegra_xusb_set_ss_clk()
376 return -EINVAL; in tegra_xusb_set_ss_clk()
380 dev_err(tegra->dev, "SS clock doesn't match requested rate\n"); in tegra_xusb_set_ss_clk()
381 return -EINVAL; in tegra_xusb_set_ss_clk()
390 return (value >> start) & ((1 << count) - 1); in extract_field()
428 return (msg->cmd & CMD_TYPE_MASK) << CMD_TYPE_SHIFT | in tegra_xusb_mbox_pack()
429 (msg->data & CMD_DATA_MASK) << CMD_DATA_SHIFT; in tegra_xusb_mbox_pack()
434 msg->cmd = (value >> CMD_TYPE_SHIFT) & CMD_TYPE_MASK; in tegra_xusb_mbox_unpack()
435 msg->data = (value >> CMD_DATA_SHIFT) & CMD_DATA_MASK; in tegra_xusb_mbox_unpack()
461 if (!(msg->cmd == MBOX_CMD_ACK || msg->cmd == MBOX_CMD_NAK)) { in tegra_xusb_mbox_send()
462 value = fpci_readl(tegra, tegra->soc->mbox.owner); in tegra_xusb_mbox_send()
464 dev_err(tegra->dev, "mailbox is busy\n"); in tegra_xusb_mbox_send()
465 return -EBUSY; in tegra_xusb_mbox_send()
468 fpci_writel(tegra, MBOX_OWNER_SW, tegra->soc->mbox.owner); in tegra_xusb_mbox_send()
470 value = fpci_readl(tegra, tegra->soc->mbox.owner); in tegra_xusb_mbox_send()
472 dev_err(tegra->dev, "failed to acquire mailbox\n"); in tegra_xusb_mbox_send()
473 return -EBUSY; in tegra_xusb_mbox_send()
480 fpci_writel(tegra, value, tegra->soc->mbox.data_in); in tegra_xusb_mbox_send()
482 value = fpci_readl(tegra, tegra->soc->mbox.cmd); in tegra_xusb_mbox_send()
484 fpci_writel(tegra, value, tegra->soc->mbox.cmd); in tegra_xusb_mbox_send()
490 value = fpci_readl(tegra, tegra->soc->mbox.owner); in tegra_xusb_mbox_send()
498 value = fpci_readl(tegra, tegra->soc->mbox.owner); in tegra_xusb_mbox_send()
501 return -ETIMEDOUT; in tegra_xusb_mbox_send()
517 dev_err(tegra->dev, "controller firmware hang\n"); in tegra_xusb_mbox_irq()
525 struct tegra_xusb_padctl *padctl = tegra->padctl; in tegra_xusb_mbox_handle()
526 const struct tegra_xusb_soc *soc = tegra->soc; in tegra_xusb_mbox_handle()
527 struct device *dev = tegra->dev; in tegra_xusb_mbox_handle()
536 switch (msg->cmd) { in tegra_xusb_mbox_handle()
539 rsp.data = clk_get_rate(tegra->falcon_clk) / 1000; in tegra_xusb_mbox_handle()
540 if (rsp.data != msg->data) in tegra_xusb_mbox_handle()
549 if (tegra->soc->scale_ss_clock) { in tegra_xusb_mbox_handle()
550 err = tegra_xusb_set_ss_clk(tegra, msg->data * 1000); in tegra_xusb_mbox_handle()
556 rsp.data = clk_get_rate(tegra->ss_src_clk) / 1000; in tegra_xusb_mbox_handle()
559 rsp.data = msg->data; in tegra_xusb_mbox_handle()
566 * TODO: Request bandwidth once EMC scaling is supported. in tegra_xusb_mbox_handle()
573 err = tegra_xusb_padctl_usb3_save_context(padctl, msg->data); in tegra_xusb_mbox_handle()
576 msg->data, err); in tegra_xusb_mbox_handle()
582 rsp.data = msg->data; in tegra_xusb_mbox_handle()
587 if (msg->cmd == MBOX_CMD_STOP_HSIC_IDLE) in tegra_xusb_mbox_handle()
592 mask = extract_field(msg->data, 1 + soc->ports.hsic.offset, in tegra_xusb_mbox_handle()
593 soc->ports.hsic.count); in tegra_xusb_mbox_handle()
610 rsp.data = msg->data; in tegra_xusb_mbox_handle()
615 if (msg->cmd == MBOX_CMD_DISABLE_SS_LFPS_DETECTION) in tegra_xusb_mbox_handle()
620 mask = extract_field(msg->data, 1 + soc->ports.usb3.offset, in tegra_xusb_mbox_handle()
621 soc->ports.usb3.count); in tegra_xusb_mbox_handle()
623 for_each_set_bit(port, &mask, soc->ports.usb3.count) { in tegra_xusb_mbox_handle()
647 rsp.data = msg->data; in tegra_xusb_mbox_handle()
651 dev_warn(dev, "unknown message: %#x\n", msg->cmd); in tegra_xusb_mbox_handle()
670 mutex_lock(&tegra->lock); in tegra_xusb_mbox_thread()
672 if (pm_runtime_suspended(tegra->dev) || tegra->suspended) in tegra_xusb_mbox_thread()
675 value = fpci_readl(tegra, tegra->soc->mbox.data_out); in tegra_xusb_mbox_thread()
678 value = fpci_readl(tegra, tegra->soc->mbox.cmd); in tegra_xusb_mbox_thread()
680 fpci_writel(tegra, value, tegra->soc->mbox.cmd); in tegra_xusb_mbox_thread()
684 fpci_writel(tegra, MBOX_OWNER_NONE, tegra->soc->mbox.owner); in tegra_xusb_mbox_thread()
689 mutex_unlock(&tegra->lock); in tegra_xusb_mbox_thread()
695 u32 regs = tegra->hcd->rsrc_start; in tegra_xusb_config()
698 if (tegra->soc->has_ipfs) { in tegra_xusb_config()
719 if (tegra->soc->has_ipfs) { in tegra_xusb_config()
734 err = clk_prepare_enable(tegra->pll_e); in tegra_xusb_clk_enable()
738 err = clk_prepare_enable(tegra->host_clk); in tegra_xusb_clk_enable()
742 err = clk_prepare_enable(tegra->ss_clk); in tegra_xusb_clk_enable()
746 err = clk_prepare_enable(tegra->falcon_clk); in tegra_xusb_clk_enable()
750 err = clk_prepare_enable(tegra->fs_src_clk); in tegra_xusb_clk_enable()
754 err = clk_prepare_enable(tegra->hs_src_clk); in tegra_xusb_clk_enable()
758 if (tegra->soc->scale_ss_clock) { in tegra_xusb_clk_enable()
767 clk_disable_unprepare(tegra->hs_src_clk); in tegra_xusb_clk_enable()
769 clk_disable_unprepare(tegra->fs_src_clk); in tegra_xusb_clk_enable()
771 clk_disable_unprepare(tegra->falcon_clk); in tegra_xusb_clk_enable()
773 clk_disable_unprepare(tegra->ss_clk); in tegra_xusb_clk_enable()
775 clk_disable_unprepare(tegra->host_clk); in tegra_xusb_clk_enable()
777 clk_disable_unprepare(tegra->pll_e); in tegra_xusb_clk_enable()
783 clk_disable_unprepare(tegra->pll_e); in tegra_xusb_clk_disable()
784 clk_disable_unprepare(tegra->host_clk); in tegra_xusb_clk_disable()
785 clk_disable_unprepare(tegra->ss_clk); in tegra_xusb_clk_disable()
786 clk_disable_unprepare(tegra->falcon_clk); in tegra_xusb_clk_disable()
787 clk_disable_unprepare(tegra->fs_src_clk); in tegra_xusb_clk_disable()
788 clk_disable_unprepare(tegra->hs_src_clk); in tegra_xusb_clk_disable()
796 for (i = 0; i < tegra->num_phys; i++) { in tegra_xusb_phy_enable()
797 err = phy_init(tegra->phys[i]); in tegra_xusb_phy_enable()
801 err = phy_power_on(tegra->phys[i]); in tegra_xusb_phy_enable()
803 phy_exit(tegra->phys[i]); in tegra_xusb_phy_enable()
811 while (i--) { in tegra_xusb_phy_enable()
812 phy_power_off(tegra->phys[i]); in tegra_xusb_phy_enable()
813 phy_exit(tegra->phys[i]); in tegra_xusb_phy_enable()
823 for (i = 0; i < tegra->num_phys; i++) { in tegra_xusb_phy_disable()
824 phy_power_off(tegra->phys[i]); in tegra_xusb_phy_disable()
825 phy_exit(tegra->phys[i]); in tegra_xusb_phy_disable()
832 const struct tegra_xusb_context_soc *soc = tegra->soc->context; in tegra_xusb_init_context()
834 tegra->context.ipfs = devm_kcalloc(tegra->dev, soc->ipfs.num_offsets, in tegra_xusb_init_context()
836 if (!tegra->context.ipfs) in tegra_xusb_init_context()
837 return -ENOMEM; in tegra_xusb_init_context()
839 tegra->context.fpci = devm_kcalloc(tegra->dev, soc->fpci.num_offsets, in tegra_xusb_init_context()
841 if (!tegra->context.fpci) in tegra_xusb_init_context()
842 return -ENOMEM; in tegra_xusb_init_context()
859 err = request_firmware(&fw, tegra->soc->firmware, tegra->dev); in tegra_xusb_request_firmware()
861 dev_err(tegra->dev, "failed to request firmware: %d\n", err); in tegra_xusb_request_firmware()
866 header = (struct tegra_xusb_fw_header *)fw->data; in tegra_xusb_request_firmware()
867 tegra->fw.size = le32_to_cpu(header->fwimg_len); in tegra_xusb_request_firmware()
869 tegra->fw.virt = dma_alloc_coherent(tegra->dev, tegra->fw.size, in tegra_xusb_request_firmware()
870 &tegra->fw.phys, GFP_KERNEL); in tegra_xusb_request_firmware()
871 if (!tegra->fw.virt) { in tegra_xusb_request_firmware()
872 dev_err(tegra->dev, "failed to allocate memory for firmware\n"); in tegra_xusb_request_firmware()
874 return -ENOMEM; in tegra_xusb_request_firmware()
877 header = (struct tegra_xusb_fw_header *)tegra->fw.virt; in tegra_xusb_request_firmware()
878 memcpy(tegra->fw.virt, fw->data, tegra->fw.size); in tegra_xusb_request_firmware()
887 struct xhci_cap_regs __iomem *cap = tegra->regs; in tegra_xusb_load_firmware()
889 struct device *dev = tegra->dev; in tegra_xusb_load_firmware()
897 header = (struct tegra_xusb_fw_header *)tegra->fw.virt; in tegra_xusb_load_firmware()
898 op = tegra->regs + HC_LENGTH(readl(&cap->hc_capbase)); in tegra_xusb_load_firmware()
907 csb_writel(tegra, tegra->fw.size, XUSB_CSB_MP_ILOAD_ATTR); in tegra_xusb_load_firmware()
913 address = tegra->fw.phys + sizeof(*header); in tegra_xusb_load_firmware()
927 code_tag_blocks = DIV_ROUND_UP(le32_to_cpu(header->boot_codetag), in tegra_xusb_load_firmware()
929 code_size_blocks = DIV_ROUND_UP(le32_to_cpu(header->boot_codesize), in tegra_xusb_load_firmware()
943 /* Setup Falcon auto-fill. */ in tegra_xusb_load_firmware()
965 csb_writel(tegra, le32_to_cpu(header->boot_codetag), in tegra_xusb_load_firmware()
974 value = readl(&op->status); in tegra_xusb_load_firmware()
981 value = readl(&op->status); in tegra_xusb_load_firmware()
985 return -EIO; in tegra_xusb_load_firmware()
988 timestamp = le32_to_cpu(header->fwimg_created_time); in tegra_xusb_load_firmware()
998 if (!tegra->use_genpd) in tegra_xusb_powerdomain_remove()
1001 if (!IS_ERR_OR_NULL(tegra->genpd_dev_ss)) in tegra_xusb_powerdomain_remove()
1002 dev_pm_domain_detach(tegra->genpd_dev_ss, true); in tegra_xusb_powerdomain_remove()
1003 if (!IS_ERR_OR_NULL(tegra->genpd_dev_host)) in tegra_xusb_powerdomain_remove()
1004 dev_pm_domain_detach(tegra->genpd_dev_host, true); in tegra_xusb_powerdomain_remove()
1012 tegra->genpd_dev_host = dev_pm_domain_attach_by_name(dev, "xusb_host"); in tegra_xusb_powerdomain_init()
1013 if (IS_ERR(tegra->genpd_dev_host)) { in tegra_xusb_powerdomain_init()
1014 err = PTR_ERR(tegra->genpd_dev_host); in tegra_xusb_powerdomain_init()
1015 dev_err(dev, "failed to get host pm-domain: %d\n", err); in tegra_xusb_powerdomain_init()
1019 tegra->genpd_dev_ss = dev_pm_domain_attach_by_name(dev, "xusb_ss"); in tegra_xusb_powerdomain_init()
1020 if (IS_ERR(tegra->genpd_dev_ss)) { in tegra_xusb_powerdomain_init()
1021 err = PTR_ERR(tegra->genpd_dev_ss); in tegra_xusb_powerdomain_init()
1022 dev_err(dev, "failed to get superspeed pm-domain: %d\n", err); in tegra_xusb_powerdomain_init()
1026 tegra->use_genpd = true; in tegra_xusb_powerdomain_init()
1033 struct device *dev = tegra->dev; in tegra_xusb_unpowergate_partitions()
1036 if (tegra->use_genpd) { in tegra_xusb_unpowergate_partitions()
1037 rc = pm_runtime_get_sync(tegra->genpd_dev_ss); in tegra_xusb_unpowergate_partitions()
1043 rc = pm_runtime_get_sync(tegra->genpd_dev_host); in tegra_xusb_unpowergate_partitions()
1046 pm_runtime_put_sync(tegra->genpd_dev_ss); in tegra_xusb_unpowergate_partitions()
1051 tegra->ss_clk, in tegra_xusb_unpowergate_partitions()
1052 tegra->ss_rst); in tegra_xusb_unpowergate_partitions()
1059 tegra->host_clk, in tegra_xusb_unpowergate_partitions()
1060 tegra->host_rst); in tegra_xusb_unpowergate_partitions()
1073 struct device *dev = tegra->dev; in tegra_xusb_powergate_partitions()
1076 if (tegra->use_genpd) { in tegra_xusb_powergate_partitions()
1077 rc = pm_runtime_put_sync(tegra->genpd_dev_host); in tegra_xusb_powergate_partitions()
1083 rc = pm_runtime_put_sync(tegra->genpd_dev_ss); in tegra_xusb_powergate_partitions()
1086 pm_runtime_get_sync(tegra->genpd_dev_host); in tegra_xusb_powergate_partitions()
1100 tegra->host_clk, in tegra_xusb_powergate_partitions()
1101 tegra->host_rst); in tegra_xusb_powergate_partitions()
1120 dev_err(tegra->dev, "failed to enable messages: %d\n", err); in __tegra_xusb_enable_firmware_messages()
1129 mutex_lock(&tegra->lock); in tegra_xusb_padctl_irq()
1131 if (tegra->suspended) { in tegra_xusb_padctl_irq()
1132 mutex_unlock(&tegra->lock); in tegra_xusb_padctl_irq()
1136 mutex_unlock(&tegra->lock); in tegra_xusb_padctl_irq()
1138 pm_runtime_resume(tegra->dev); in tegra_xusb_padctl_irq()
1147 mutex_lock(&tegra->lock); in tegra_xusb_enable_firmware_messages()
1149 mutex_unlock(&tegra->lock); in tegra_xusb_enable_firmware_messages()
1157 struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); in tegra_xhci_set_port_power()
1158 struct usb_hcd *hcd = main ? xhci->main_hcd : xhci->shared_hcd; in tegra_xhci_set_port_power()
1161 u16 wIndex = main ? tegra->otg_usb2_port + 1 : tegra->otg_usb3_port + 1; in tegra_xhci_set_port_power()
1166 dev_dbg(tegra->dev, "%s():%s %s port power\n", __func__, in tegra_xhci_set_port_power()
1169 hcd->driver->hub_control(hcd, typeReq, USB_PORT_FEAT_POWER, wIndex, in tegra_xhci_set_port_power()
1182 } while (--wait > 0); in tegra_xhci_set_port_power()
1185 dev_info(tegra->dev, "failed to %s %s PP %d\n", in tegra_xhci_set_port_power()
1195 for (i = 0; i < tegra->soc->num_types; i++) { in tegra_xusb_get_phy()
1196 if (!strncmp(tegra->soc->phy_types[i].name, name, in tegra_xusb_get_phy()
1198 return tegra->phys[phy_count+port]; in tegra_xusb_get_phy()
1200 phy_count += tegra->soc->phy_types[i].num; in tegra_xusb_get_phy()
1210 struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); in tegra_xhci_id_work()
1213 tegra->otg_usb2_port); in tegra_xhci_id_work()
1217 dev_dbg(tegra->dev, "host mode %s\n", tegra->host_mode ? "on" : "off"); in tegra_xhci_id_work()
1219 mutex_lock(&tegra->lock); in tegra_xhci_id_work()
1221 if (tegra->host_mode) in tegra_xhci_id_work()
1226 mutex_unlock(&tegra->lock); in tegra_xhci_id_work()
1228 if (tegra->host_mode) { in tegra_xhci_id_work()
1230 if (tegra->otg_usb3_port >= 0) { in tegra_xhci_id_work()
1231 if (tegra->soc->otg_reset_sspi) { in tegra_xhci_id_work()
1234 xhci->shared_hcd, GetPortStatus, in tegra_xhci_id_work()
1235 0, tegra->otg_usb3_port+1, in tegra_xhci_id_work()
1243 msg.data = tegra->otg_usb3_port+1; in tegra_xhci_id_work()
1247 dev_info(tegra->dev, in tegra_xhci_id_work()
1259 if (tegra->otg_usb3_port >= 0) in tegra_xhci_id_work()
1269 return (tegra->usbphy[index] != NULL); in is_usb2_otg_phy()
1274 struct tegra_xusb_padctl *padctl = tegra->padctl; in is_usb3_otg_phy()
1278 for (i = 0; i < tegra->num_usb_phys; i++) { in is_usb3_otg_phy()
1291 if (strcmp(tegra->soc->phy_types[phy_type].name, "hsic") == 0) in is_host_mode_phy()
1294 if (strcmp(tegra->soc->phy_types[phy_type].name, "usb2") == 0) { in is_host_mode_phy()
1296 return ((index == tegra->otg_usb2_port) && tegra->host_mode); in is_host_mode_phy()
1301 if (strcmp(tegra->soc->phy_types[phy_type].name, "usb3") == 0) { in is_host_mode_phy()
1303 return ((index == tegra->otg_usb3_port) && tegra->host_mode); in is_host_mode_phy()
1317 for (i = 0; i < tegra->num_usb_phys; i++) { in tegra_xusb_get_usb2_port()
1318 if (tegra->usbphy[i] && usbphy == tegra->usbphy[i]) in tegra_xusb_get_usb2_port()
1322 return -1; in tegra_xusb_get_usb2_port()
1332 dev_dbg(tegra->dev, "%s(): action is %d", __func__, usbphy->last_event); in tegra_xhci_id_notify()
1334 if ((tegra->host_mode && usbphy->last_event == USB_EVENT_ID) || in tegra_xhci_id_notify()
1335 (!tegra->host_mode && usbphy->last_event != USB_EVENT_ID)) { in tegra_xhci_id_notify()
1336 dev_dbg(tegra->dev, "Same role(%d) received. Ignore", in tegra_xhci_id_notify()
1337 tegra->host_mode); in tegra_xhci_id_notify()
1341 tegra->otg_usb2_port = tegra_xusb_get_usb2_port(tegra, usbphy); in tegra_xhci_id_notify()
1342 tegra->otg_usb3_port = tegra_xusb_padctl_get_usb3_companion( in tegra_xhci_id_notify()
1343 tegra->padctl, in tegra_xhci_id_notify()
1344 tegra->otg_usb2_port); in tegra_xhci_id_notify()
1346 tegra->host_mode = (usbphy->last_event == USB_EVENT_ID) ? true : false; in tegra_xhci_id_notify()
1348 schedule_work(&tegra->id_work); in tegra_xhci_id_notify()
1357 tegra->usbphy = devm_kcalloc(tegra->dev, tegra->num_usb_phys, in tegra_xusb_init_usb_phy()
1358 sizeof(*tegra->usbphy), GFP_KERNEL); in tegra_xusb_init_usb_phy()
1359 if (!tegra->usbphy) in tegra_xusb_init_usb_phy()
1360 return -ENOMEM; in tegra_xusb_init_usb_phy()
1362 INIT_WORK(&tegra->id_work, tegra_xhci_id_work); in tegra_xusb_init_usb_phy()
1363 tegra->id_nb.notifier_call = tegra_xhci_id_notify; in tegra_xusb_init_usb_phy()
1364 tegra->otg_usb2_port = -EINVAL; in tegra_xusb_init_usb_phy()
1365 tegra->otg_usb3_port = -EINVAL; in tegra_xusb_init_usb_phy()
1367 for (i = 0; i < tegra->num_usb_phys; i++) { in tegra_xusb_init_usb_phy()
1373 tegra->usbphy[i] = devm_usb_get_phy_by_node(tegra->dev, in tegra_xusb_init_usb_phy()
1374 phy->dev.of_node, in tegra_xusb_init_usb_phy()
1375 &tegra->id_nb); in tegra_xusb_init_usb_phy()
1376 if (!IS_ERR(tegra->usbphy[i])) { in tegra_xusb_init_usb_phy()
1377 dev_dbg(tegra->dev, "usbphy-%d registered", i); in tegra_xusb_init_usb_phy()
1378 otg_set_host(tegra->usbphy[i]->otg, &tegra->hcd->self); in tegra_xusb_init_usb_phy()
1381 * usb-phy is optional, continue if its not available. in tegra_xusb_init_usb_phy()
1383 tegra->usbphy[i] = NULL; in tegra_xusb_init_usb_phy()
1394 cancel_work_sync(&tegra->id_work); in tegra_xusb_deinit_usb_phy()
1396 for (i = 0; i < tegra->num_usb_phys; i++) in tegra_xusb_deinit_usb_phy()
1397 if (tegra->usbphy[i]) in tegra_xusb_deinit_usb_phy()
1398 otg_set_host(tegra->usbphy[i]->otg, NULL); in tegra_xusb_deinit_usb_phy()
1413 tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); in tegra_xusb_probe()
1415 return -ENOMEM; in tegra_xusb_probe()
1417 tegra->soc = of_device_get_match_data(&pdev->dev); in tegra_xusb_probe()
1418 mutex_init(&tegra->lock); in tegra_xusb_probe()
1419 tegra->dev = &pdev->dev; in tegra_xusb_probe()
1425 tegra->regs = devm_platform_get_and_ioremap_resource(pdev, 0, ®s); in tegra_xusb_probe()
1426 if (IS_ERR(tegra->regs)) in tegra_xusb_probe()
1427 return PTR_ERR(tegra->regs); in tegra_xusb_probe()
1429 tegra->fpci_base = devm_platform_ioremap_resource(pdev, 1); in tegra_xusb_probe()
1430 if (IS_ERR(tegra->fpci_base)) in tegra_xusb_probe()
1431 return PTR_ERR(tegra->fpci_base); in tegra_xusb_probe()
1433 if (tegra->soc->has_ipfs) { in tegra_xusb_probe()
1434 tegra->ipfs_base = devm_platform_ioremap_resource(pdev, 2); in tegra_xusb_probe()
1435 if (IS_ERR(tegra->ipfs_base)) in tegra_xusb_probe()
1436 return PTR_ERR(tegra->ipfs_base); in tegra_xusb_probe()
1439 tegra->xhci_irq = platform_get_irq(pdev, 0); in tegra_xusb_probe()
1440 if (tegra->xhci_irq < 0) in tegra_xusb_probe()
1441 return tegra->xhci_irq; in tegra_xusb_probe()
1443 tegra->mbox_irq = platform_get_irq(pdev, 1); in tegra_xusb_probe()
1444 if (tegra->mbox_irq < 0) in tegra_xusb_probe()
1445 return tegra->mbox_irq; in tegra_xusb_probe()
1447 tegra->padctl = tegra_xusb_padctl_get(&pdev->dev); in tegra_xusb_probe()
1448 if (IS_ERR(tegra->padctl)) in tegra_xusb_probe()
1449 return PTR_ERR(tegra->padctl); in tegra_xusb_probe()
1451 np = of_parse_phandle(pdev->dev.of_node, "nvidia,xusb-padctl", 0); in tegra_xusb_probe()
1453 err = -ENODEV; in tegra_xusb_probe()
1457 tegra->padctl_irq = of_irq_get(np, 0); in tegra_xusb_probe()
1458 if (tegra->padctl_irq <= 0) { in tegra_xusb_probe()
1459 err = (tegra->padctl_irq == 0) ? -ENODEV : tegra->padctl_irq; in tegra_xusb_probe()
1463 tegra->host_clk = devm_clk_get(&pdev->dev, "xusb_host"); in tegra_xusb_probe()
1464 if (IS_ERR(tegra->host_clk)) { in tegra_xusb_probe()
1465 err = PTR_ERR(tegra->host_clk); in tegra_xusb_probe()
1466 dev_err(&pdev->dev, "failed to get xusb_host: %d\n", err); in tegra_xusb_probe()
1470 tegra->falcon_clk = devm_clk_get(&pdev->dev, "xusb_falcon_src"); in tegra_xusb_probe()
1471 if (IS_ERR(tegra->falcon_clk)) { in tegra_xusb_probe()
1472 err = PTR_ERR(tegra->falcon_clk); in tegra_xusb_probe()
1473 dev_err(&pdev->dev, "failed to get xusb_falcon_src: %d\n", err); in tegra_xusb_probe()
1477 tegra->ss_clk = devm_clk_get(&pdev->dev, "xusb_ss"); in tegra_xusb_probe()
1478 if (IS_ERR(tegra->ss_clk)) { in tegra_xusb_probe()
1479 err = PTR_ERR(tegra->ss_clk); in tegra_xusb_probe()
1480 dev_err(&pdev->dev, "failed to get xusb_ss: %d\n", err); in tegra_xusb_probe()
1484 tegra->ss_src_clk = devm_clk_get(&pdev->dev, "xusb_ss_src"); in tegra_xusb_probe()
1485 if (IS_ERR(tegra->ss_src_clk)) { in tegra_xusb_probe()
1486 err = PTR_ERR(tegra->ss_src_clk); in tegra_xusb_probe()
1487 dev_err(&pdev->dev, "failed to get xusb_ss_src: %d\n", err); in tegra_xusb_probe()
1491 tegra->hs_src_clk = devm_clk_get(&pdev->dev, "xusb_hs_src"); in tegra_xusb_probe()
1492 if (IS_ERR(tegra->hs_src_clk)) { in tegra_xusb_probe()
1493 err = PTR_ERR(tegra->hs_src_clk); in tegra_xusb_probe()
1494 dev_err(&pdev->dev, "failed to get xusb_hs_src: %d\n", err); in tegra_xusb_probe()
1498 tegra->fs_src_clk = devm_clk_get(&pdev->dev, "xusb_fs_src"); in tegra_xusb_probe()
1499 if (IS_ERR(tegra->fs_src_clk)) { in tegra_xusb_probe()
1500 err = PTR_ERR(tegra->fs_src_clk); in tegra_xusb_probe()
1501 dev_err(&pdev->dev, "failed to get xusb_fs_src: %d\n", err); in tegra_xusb_probe()
1505 tegra->pll_u_480m = devm_clk_get(&pdev->dev, "pll_u_480m"); in tegra_xusb_probe()
1506 if (IS_ERR(tegra->pll_u_480m)) { in tegra_xusb_probe()
1507 err = PTR_ERR(tegra->pll_u_480m); in tegra_xusb_probe()
1508 dev_err(&pdev->dev, "failed to get pll_u_480m: %d\n", err); in tegra_xusb_probe()
1512 tegra->clk_m = devm_clk_get(&pdev->dev, "clk_m"); in tegra_xusb_probe()
1513 if (IS_ERR(tegra->clk_m)) { in tegra_xusb_probe()
1514 err = PTR_ERR(tegra->clk_m); in tegra_xusb_probe()
1515 dev_err(&pdev->dev, "failed to get clk_m: %d\n", err); in tegra_xusb_probe()
1519 tegra->pll_e = devm_clk_get(&pdev->dev, "pll_e"); in tegra_xusb_probe()
1520 if (IS_ERR(tegra->pll_e)) { in tegra_xusb_probe()
1521 err = PTR_ERR(tegra->pll_e); in tegra_xusb_probe()
1522 dev_err(&pdev->dev, "failed to get pll_e: %d\n", err); in tegra_xusb_probe()
1526 if (!of_property_read_bool(pdev->dev.of_node, "power-domains")) { in tegra_xusb_probe()
1527 tegra->host_rst = devm_reset_control_get(&pdev->dev, in tegra_xusb_probe()
1529 if (IS_ERR(tegra->host_rst)) { in tegra_xusb_probe()
1530 err = PTR_ERR(tegra->host_rst); in tegra_xusb_probe()
1531 dev_err(&pdev->dev, in tegra_xusb_probe()
1536 tegra->ss_rst = devm_reset_control_get(&pdev->dev, "xusb_ss"); in tegra_xusb_probe()
1537 if (IS_ERR(tegra->ss_rst)) { in tegra_xusb_probe()
1538 err = PTR_ERR(tegra->ss_rst); in tegra_xusb_probe()
1539 dev_err(&pdev->dev, "failed to get xusb_ss reset: %d\n", in tegra_xusb_probe()
1544 err = tegra_xusb_powerdomain_init(&pdev->dev, tegra); in tegra_xusb_probe()
1549 tegra->supplies = devm_kcalloc(&pdev->dev, tegra->soc->num_supplies, in tegra_xusb_probe()
1550 sizeof(*tegra->supplies), GFP_KERNEL); in tegra_xusb_probe()
1551 if (!tegra->supplies) { in tegra_xusb_probe()
1552 err = -ENOMEM; in tegra_xusb_probe()
1556 regulator_bulk_set_supply_names(tegra->supplies, in tegra_xusb_probe()
1557 tegra->soc->supply_names, in tegra_xusb_probe()
1558 tegra->soc->num_supplies); in tegra_xusb_probe()
1560 err = devm_regulator_bulk_get(&pdev->dev, tegra->soc->num_supplies, in tegra_xusb_probe()
1561 tegra->supplies); in tegra_xusb_probe()
1563 dev_err(&pdev->dev, "failed to get regulators: %d\n", err); in tegra_xusb_probe()
1567 for (i = 0; i < tegra->soc->num_types; i++) { in tegra_xusb_probe()
1568 if (!strncmp(tegra->soc->phy_types[i].name, "usb2", 4)) in tegra_xusb_probe()
1569 tegra->num_usb_phys = tegra->soc->phy_types[i].num; in tegra_xusb_probe()
1570 tegra->num_phys += tegra->soc->phy_types[i].num; in tegra_xusb_probe()
1573 tegra->phys = devm_kcalloc(&pdev->dev, tegra->num_phys, in tegra_xusb_probe()
1574 sizeof(*tegra->phys), GFP_KERNEL); in tegra_xusb_probe()
1575 if (!tegra->phys) { in tegra_xusb_probe()
1576 err = -ENOMEM; in tegra_xusb_probe()
1580 for (i = 0, k = 0; i < tegra->soc->num_types; i++) { in tegra_xusb_probe()
1583 for (j = 0; j < tegra->soc->phy_types[i].num; j++) { in tegra_xusb_probe()
1584 snprintf(prop, sizeof(prop), "%s-%d", in tegra_xusb_probe()
1585 tegra->soc->phy_types[i].name, j); in tegra_xusb_probe()
1587 phy = devm_phy_optional_get(&pdev->dev, prop); in tegra_xusb_probe()
1589 dev_err(&pdev->dev, in tegra_xusb_probe()
1596 tegra->phys[k++] = phy; in tegra_xusb_probe()
1600 tegra->hcd = usb_create_hcd(&tegra_xhci_hc_driver, &pdev->dev, in tegra_xusb_probe()
1601 dev_name(&pdev->dev)); in tegra_xusb_probe()
1602 if (!tegra->hcd) { in tegra_xusb_probe()
1603 err = -ENOMEM; in tegra_xusb_probe()
1607 tegra->hcd->skip_phy_initialization = 1; in tegra_xusb_probe()
1608 tegra->hcd->regs = tegra->regs; in tegra_xusb_probe()
1609 tegra->hcd->rsrc_start = regs->start; in tegra_xusb_probe()
1610 tegra->hcd->rsrc_len = resource_size(regs); in tegra_xusb_probe()
1620 dev_err(tegra->dev, "failed to enable clocks: %d\n", err); in tegra_xusb_probe()
1624 err = regulator_bulk_enable(tegra->soc->num_supplies, tegra->supplies); in tegra_xusb_probe()
1626 dev_err(tegra->dev, "failed to enable regulators: %d\n", err); in tegra_xusb_probe()
1632 dev_err(&pdev->dev, "failed to enable PHYs: %d\n", err); in tegra_xusb_probe()
1640 err = dma_set_mask_and_coherent(tegra->dev, DMA_BIT_MASK(40)); in tegra_xusb_probe()
1642 dev_err(&pdev->dev, "failed to set DMA mask: %d\n", err); in tegra_xusb_probe()
1648 dev_err(&pdev->dev, "failed to request firmware: %d\n", err); in tegra_xusb_probe()
1660 dev_err(&pdev->dev, "failed to load firmware: %d\n", err); in tegra_xusb_probe()
1664 err = usb_add_hcd(tegra->hcd, tegra->xhci_irq, IRQF_SHARED); in tegra_xusb_probe()
1666 dev_err(&pdev->dev, "failed to add USB HCD: %d\n", err); in tegra_xusb_probe()
1670 device_wakeup_enable(tegra->hcd->self.controller); in tegra_xusb_probe()
1672 xhci = hcd_to_xhci(tegra->hcd); in tegra_xusb_probe()
1674 xhci->shared_hcd = usb_create_shared_hcd(&tegra_xhci_hc_driver, in tegra_xusb_probe()
1675 &pdev->dev, in tegra_xusb_probe()
1676 dev_name(&pdev->dev), in tegra_xusb_probe()
1677 tegra->hcd); in tegra_xusb_probe()
1678 if (!xhci->shared_hcd) { in tegra_xusb_probe()
1679 dev_err(&pdev->dev, "failed to create shared HCD\n"); in tegra_xusb_probe()
1680 err = -ENOMEM; in tegra_xusb_probe()
1684 err = usb_add_hcd(xhci->shared_hcd, tegra->xhci_irq, IRQF_SHARED); in tegra_xusb_probe()
1686 dev_err(&pdev->dev, "failed to add shared HCD: %d\n", err); in tegra_xusb_probe()
1690 err = devm_request_threaded_irq(&pdev->dev, tegra->mbox_irq, in tegra_xusb_probe()
1693 dev_name(&pdev->dev), tegra); in tegra_xusb_probe()
1695 dev_err(&pdev->dev, "failed to request IRQ: %d\n", err); in tegra_xusb_probe()
1699 err = devm_request_threaded_irq(&pdev->dev, tegra->padctl_irq, NULL, tegra_xusb_padctl_irq, in tegra_xusb_probe()
1700 IRQF_ONESHOT, dev_name(&pdev->dev), tegra); in tegra_xusb_probe()
1702 dev_err(&pdev->dev, "failed to request padctl IRQ: %d\n", err); in tegra_xusb_probe()
1708 dev_err(&pdev->dev, "failed to enable messages: %d\n", err); in tegra_xusb_probe()
1714 dev_err(&pdev->dev, "failed to init USB PHY: %d\n", err); in tegra_xusb_probe()
1719 device_init_wakeup(&tegra->hcd->self.root_hub->dev, true); in tegra_xusb_probe()
1720 device_init_wakeup(&xhci->shared_hcd->self.root_hub->dev, true); in tegra_xusb_probe()
1721 device_init_wakeup(tegra->dev, true); in tegra_xusb_probe()
1723 pm_runtime_use_autosuspend(tegra->dev); in tegra_xusb_probe()
1724 pm_runtime_set_autosuspend_delay(tegra->dev, 2000); in tegra_xusb_probe()
1725 pm_runtime_mark_last_busy(tegra->dev); in tegra_xusb_probe()
1726 pm_runtime_set_active(tegra->dev); in tegra_xusb_probe()
1727 pm_runtime_enable(tegra->dev); in tegra_xusb_probe()
1732 usb_remove_hcd(xhci->shared_hcd); in tegra_xusb_probe()
1734 usb_put_hcd(xhci->shared_hcd); in tegra_xusb_probe()
1736 usb_remove_hcd(tegra->hcd); in tegra_xusb_probe()
1740 dma_free_coherent(&pdev->dev, tegra->fw.size, tegra->fw.virt, in tegra_xusb_probe()
1741 tegra->fw.phys); in tegra_xusb_probe()
1745 regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies); in tegra_xusb_probe()
1749 usb_put_hcd(tegra->hcd); in tegra_xusb_probe()
1751 tegra_xusb_powerdomain_remove(&pdev->dev, tegra); in tegra_xusb_probe()
1754 tegra_xusb_padctl_put(tegra->padctl); in tegra_xusb_probe()
1761 struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); in tegra_xusb_remove()
1765 pm_runtime_get_sync(&pdev->dev); in tegra_xusb_remove()
1766 usb_remove_hcd(xhci->shared_hcd); in tegra_xusb_remove()
1767 usb_put_hcd(xhci->shared_hcd); in tegra_xusb_remove()
1768 xhci->shared_hcd = NULL; in tegra_xusb_remove()
1769 usb_remove_hcd(tegra->hcd); in tegra_xusb_remove()
1770 usb_put_hcd(tegra->hcd); in tegra_xusb_remove()
1772 dma_free_coherent(&pdev->dev, tegra->fw.size, tegra->fw.virt, in tegra_xusb_remove()
1773 tegra->fw.phys); in tegra_xusb_remove()
1775 pm_runtime_disable(&pdev->dev); in tegra_xusb_remove()
1776 pm_runtime_put(&pdev->dev); in tegra_xusb_remove()
1780 tegra_xusb_powerdomain_remove(&pdev->dev, tegra); in tegra_xusb_remove()
1784 regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies); in tegra_xusb_remove()
1785 tegra_xusb_padctl_put(tegra->padctl); in tegra_xusb_remove()
1792 struct device *dev = hub->hcd->self.controller; in xhci_hub_ports_suspended()
1797 for (i = 0; i < hub->num_ports; i++) { in xhci_hub_ports_suspended()
1798 value = readl(hub->ports[i]->addr); in xhci_hub_ports_suspended()
1803 dev_info(dev, "%u-%u isn't suspended: %#010x\n", in xhci_hub_ports_suspended()
1804 hub->hcd->self.busnum, i + 1, value); in xhci_hub_ports_suspended()
1814 struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); in tegra_xusb_check_ports()
1815 struct xhci_bus_state *bus_state = &xhci->usb2_rhub.bus_state; in tegra_xusb_check_ports()
1819 if (bus_state->bus_suspended) { in tegra_xusb_check_ports()
1826 spin_lock_irqsave(&xhci->lock, flags); in tegra_xusb_check_ports()
1828 if (!xhci_hub_ports_suspended(&xhci->usb2_rhub) || in tegra_xusb_check_ports()
1829 !xhci_hub_ports_suspended(&xhci->usb3_rhub)) in tegra_xusb_check_ports()
1830 err = -EBUSY; in tegra_xusb_check_ports()
1832 spin_unlock_irqrestore(&xhci->lock, flags); in tegra_xusb_check_ports()
1839 const struct tegra_xusb_context_soc *soc = tegra->soc->context; in tegra_xusb_save_context()
1840 struct tegra_xusb_context *ctx = &tegra->context; in tegra_xusb_save_context()
1843 if (soc->ipfs.num_offsets > 0) { in tegra_xusb_save_context()
1844 for (i = 0; i < soc->ipfs.num_offsets; i++) in tegra_xusb_save_context()
1845 ctx->ipfs[i] = ipfs_readl(tegra, soc->ipfs.offsets[i]); in tegra_xusb_save_context()
1848 if (soc->fpci.num_offsets > 0) { in tegra_xusb_save_context()
1849 for (i = 0; i < soc->fpci.num_offsets; i++) in tegra_xusb_save_context()
1850 ctx->fpci[i] = fpci_readl(tegra, soc->fpci.offsets[i]); in tegra_xusb_save_context()
1856 const struct tegra_xusb_context_soc *soc = tegra->soc->context; in tegra_xusb_restore_context()
1857 struct tegra_xusb_context *ctx = &tegra->context; in tegra_xusb_restore_context()
1860 if (soc->fpci.num_offsets > 0) { in tegra_xusb_restore_context()
1861 for (i = 0; i < soc->fpci.num_offsets; i++) in tegra_xusb_restore_context()
1862 fpci_writel(tegra, ctx->fpci[i], soc->fpci.offsets[i]); in tegra_xusb_restore_context()
1865 if (soc->ipfs.num_offsets > 0) { in tegra_xusb_restore_context()
1866 for (i = 0; i < soc->ipfs.num_offsets; i++) in tegra_xusb_restore_context()
1867 ipfs_writel(tegra, ctx->ipfs[i], soc->ipfs.offsets[i]); in tegra_xusb_restore_context()
1890 struct tegra_xusb_padctl *padctl = tegra->padctl; in tegra_xhci_enable_phy_sleepwalk_wake()
1891 struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); in tegra_xhci_enable_phy_sleepwalk_wake()
1899 for (i = 0, k = 0; i < tegra->soc->num_types; i++) { in tegra_xhci_enable_phy_sleepwalk_wake()
1900 if (strcmp(tegra->soc->phy_types[i].name, "usb3") == 0) in tegra_xhci_enable_phy_sleepwalk_wake()
1901 rhub = &xhci->usb3_rhub; in tegra_xhci_enable_phy_sleepwalk_wake()
1903 rhub = &xhci->usb2_rhub; in tegra_xhci_enable_phy_sleepwalk_wake()
1905 if (strcmp(tegra->soc->phy_types[i].name, "hsic") == 0) in tegra_xhci_enable_phy_sleepwalk_wake()
1906 offset = tegra->soc->ports.usb2.count; in tegra_xhci_enable_phy_sleepwalk_wake()
1910 for (j = 0; j < tegra->soc->phy_types[i].num; j++) { in tegra_xhci_enable_phy_sleepwalk_wake()
1911 phy = tegra->phys[k++]; in tegra_xhci_enable_phy_sleepwalk_wake()
1918 if (index >= rhub->num_ports) in tegra_xhci_enable_phy_sleepwalk_wake()
1924 portsc = readl(rhub->ports[index]->addr); in tegra_xhci_enable_phy_sleepwalk_wake()
1934 struct tegra_xusb_padctl *padctl = tegra->padctl; in tegra_xhci_disable_phy_wake()
1937 for (i = 0; i < tegra->num_phys; i++) { in tegra_xhci_disable_phy_wake()
1938 if (!tegra->phys[i]) in tegra_xhci_disable_phy_wake()
1941 tegra_xusb_padctl_disable_phy_wake(padctl, tegra->phys[i]); in tegra_xhci_disable_phy_wake()
1947 struct tegra_xusb_padctl *padctl = tegra->padctl; in tegra_xhci_disable_phy_sleepwalk()
1950 for (i = 0; i < tegra->num_phys; i++) { in tegra_xhci_disable_phy_sleepwalk()
1951 if (!tegra->phys[i]) in tegra_xhci_disable_phy_sleepwalk()
1954 tegra_xusb_padctl_disable_phy_sleepwalk(padctl, tegra->phys[i]); in tegra_xhci_disable_phy_sleepwalk()
1960 struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); in tegra_xusb_enter_elpg()
1961 struct device *dev = tegra->dev; in tegra_xusb_enter_elpg()
1969 usbcmd = readl(&xhci->op_regs->command); in tegra_xusb_enter_elpg()
1971 writel(usbcmd, &xhci->op_regs->command); in tegra_xusb_enter_elpg()
1975 dev_err(tegra->dev, "not all ports suspended: %d\n", err); in tegra_xusb_enter_elpg()
1981 dev_err(tegra->dev, "failed to suspend XHCI: %d\n", err); in tegra_xusb_enter_elpg()
1992 for (i = 0; i < tegra->num_phys; i++) { in tegra_xusb_enter_elpg()
1993 if (!tegra->phys[i]) in tegra_xusb_enter_elpg()
1996 phy_power_off(tegra->phys[i]); in tegra_xusb_enter_elpg()
1998 phy_exit(tegra->phys[i]); in tegra_xusb_enter_elpg()
2005 dev_dbg(tegra->dev, "entering ELPG done\n"); in tegra_xusb_enter_elpg()
2007 usbcmd = readl(&xhci->op_regs->command); in tegra_xusb_enter_elpg()
2009 writel(usbcmd, &xhci->op_regs->command); in tegra_xusb_enter_elpg()
2011 dev_dbg(tegra->dev, "entering ELPG failed\n"); in tegra_xusb_enter_elpg()
2012 pm_runtime_mark_last_busy(tegra->dev); in tegra_xusb_enter_elpg()
2020 struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); in tegra_xusb_exit_elpg()
2021 struct device *dev = tegra->dev; in tegra_xusb_exit_elpg()
2028 pm_runtime_mark_last_busy(tegra->dev); in tegra_xusb_exit_elpg()
2032 dev_err(tegra->dev, "failed to enable clocks: %d\n", err); in tegra_xusb_exit_elpg()
2043 for (i = 0; i < tegra->num_phys; i++) { in tegra_xusb_exit_elpg()
2044 if (!tegra->phys[i]) in tegra_xusb_exit_elpg()
2048 phy_init(tegra->phys[i]); in tegra_xusb_exit_elpg()
2050 phy_power_on(tegra->phys[i]); in tegra_xusb_exit_elpg()
2058 dev_err(tegra->dev, "failed to load firmware: %d\n", err); in tegra_xusb_exit_elpg()
2064 dev_err(tegra->dev, "failed to enable messages: %d\n", err); in tegra_xusb_exit_elpg()
2073 dev_err(tegra->dev, "failed to resume XHCI: %d\n", err); in tegra_xusb_exit_elpg()
2077 usbcmd = readl(&xhci->op_regs->command); in tegra_xusb_exit_elpg()
2079 writel(usbcmd, &xhci->op_regs->command); in tegra_xusb_exit_elpg()
2084 for (i = 0; i < tegra->num_phys; i++) { in tegra_xusb_exit_elpg()
2085 if (!tegra->phys[i]) in tegra_xusb_exit_elpg()
2088 phy_power_off(tegra->phys[i]); in tegra_xusb_exit_elpg()
2090 phy_exit(tegra->phys[i]); in tegra_xusb_exit_elpg()
2109 synchronize_irq(tegra->mbox_irq); in tegra_xusb_suspend()
2111 mutex_lock(&tegra->lock); in tegra_xusb_suspend()
2132 tegra->suspended = true; in tegra_xusb_suspend()
2136 if (enable_irq_wake(tegra->padctl_irq)) in tegra_xusb_suspend()
2141 mutex_unlock(&tegra->lock); in tegra_xusb_suspend()
2151 mutex_lock(&tegra->lock); in tegra_xusb_resume()
2153 if (!tegra->suspended) { in tegra_xusb_resume()
2154 mutex_unlock(&tegra->lock); in tegra_xusb_resume()
2160 mutex_unlock(&tegra->lock); in tegra_xusb_resume()
2165 if (disable_irq_wake(tegra->padctl_irq)) in tegra_xusb_resume()
2168 tegra->suspended = false; in tegra_xusb_resume()
2169 mutex_unlock(&tegra->lock); in tegra_xusb_resume()
2182 synchronize_irq(tegra->mbox_irq); in tegra_xusb_runtime_suspend()
2183 mutex_lock(&tegra->lock); in tegra_xusb_runtime_suspend()
2185 mutex_unlock(&tegra->lock); in tegra_xusb_runtime_suspend()
2195 mutex_lock(&tegra->lock); in tegra_xusb_runtime_resume()
2197 mutex_unlock(&tegra->lock); in tegra_xusb_runtime_resume()
2209 "avddio-pex",
2210 "dvddio-pex",
2211 "avdd-usb",
2212 "hvdd-usb-ss",
2282 "dvddio-pex",
2283 "hvddio-pex",
2284 "avdd-usb",
2294 .firmware = "nvidia/tegra210/xusb.bin",
2315 MODULE_FIRMWARE("nvidia/tegra210/xusb.bin");
2391 { .compatible = "nvidia,tegra124-xusb", .data = &tegra124_soc },
2392 { .compatible = "nvidia,tegra210-xusb", .data = &tegra210_soc },
2393 { .compatible = "nvidia,tegra186-xusb", .data = &tegra186_soc },
2394 { .compatible = "nvidia,tegra194-xusb", .data = &tegra194_soc },
2403 .name = "tegra-xusb",
2413 xhci->quirks |= XHCI_PLAT; in tegra_xhci_quirks()
2414 if (tegra && tegra->soc->lpm_support) in tegra_xhci_quirks()
2415 xhci->quirks |= XHCI_LPM_SUPPORT; in tegra_xhci_quirks()
2442 MODULE_DESCRIPTION("NVIDIA Tegra XUSB xHCI host-controller driver");