• Home
  • Raw
  • Download

Lines Matching refs:padctl

220 to_tegra124_xusb_padctl(struct tegra_xusb_padctl *padctl)  in to_tegra124_xusb_padctl()  argument
222 return container_of(padctl, struct tegra124_xusb_padctl, base); in to_tegra124_xusb_padctl()
225 static int tegra124_xusb_padctl_enable(struct tegra_xusb_padctl *padctl) in tegra124_xusb_padctl_enable() argument
229 mutex_lock(&padctl->lock); in tegra124_xusb_padctl_enable()
231 if (padctl->enable++ > 0) in tegra124_xusb_padctl_enable()
234 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_enable()
236 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_enable()
240 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_enable()
242 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_enable()
246 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_enable()
248 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_enable()
251 mutex_unlock(&padctl->lock); in tegra124_xusb_padctl_enable()
255 static int tegra124_xusb_padctl_disable(struct tegra_xusb_padctl *padctl) in tegra124_xusb_padctl_disable() argument
259 mutex_lock(&padctl->lock); in tegra124_xusb_padctl_disable()
261 if (WARN_ON(padctl->enable == 0)) in tegra124_xusb_padctl_disable()
264 if (--padctl->enable > 0) in tegra124_xusb_padctl_disable()
267 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_disable()
269 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_disable()
273 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_disable()
275 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_disable()
279 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_disable()
281 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_xusb_padctl_disable()
284 mutex_unlock(&padctl->lock); in tegra124_xusb_padctl_disable()
288 static int tegra124_usb3_save_context(struct tegra_xusb_padctl *padctl, in tegra124_usb3_save_context() argument
295 port = tegra_xusb_find_usb3_port(padctl, index); in tegra124_usb3_save_context()
302 if (lane->pad == padctl->pcie) in tegra124_usb3_save_context()
307 value = padctl_readl(padctl, offset); in tegra124_usb3_save_context()
312 padctl_writel(padctl, value, offset); in tegra124_usb3_save_context()
314 value = padctl_readl(padctl, offset) >> in tegra124_usb3_save_context()
318 value = padctl_readl(padctl, offset); in tegra124_usb3_save_context()
323 padctl_writel(padctl, value, offset); in tegra124_usb3_save_context()
325 value = padctl_readl(padctl, offset) >> in tegra124_usb3_save_context()
329 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_USB3_PADX_CTL4(index)); in tegra124_usb3_save_context()
338 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_USB3_PADX_CTL4(index)); in tegra124_usb3_save_context()
340 value = padctl_readl(padctl, offset); in tegra124_usb3_save_context()
345 padctl_writel(padctl, value, offset); in tegra124_usb3_save_context()
347 value = padctl_readl(padctl, offset); in tegra124_usb3_save_context()
352 padctl_writel(padctl, value, offset); in tegra124_usb3_save_context()
354 value = padctl_readl(padctl, offset) >> in tegra124_usb3_save_context()
359 value = padctl_readl(padctl, offset); in tegra124_usb3_save_context()
364 padctl_writel(padctl, value, offset); in tegra124_usb3_save_context()
366 value = padctl_readl(padctl, offset) >> in tegra124_usb3_save_context()
371 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_USB3_PADX_CTL2(index)); in tegra124_usb3_save_context()
380 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_USB3_PADX_CTL2(index)); in tegra124_usb3_save_context()
385 static int tegra124_hsic_set_idle(struct tegra_xusb_padctl *padctl, in tegra124_hsic_set_idle() argument
390 value = padctl_readl(padctl, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_set_idle()
399 padctl_writel(padctl, value, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_set_idle()
468 return tegra124_xusb_padctl_enable(lane->pad->padctl); in tegra124_usb2_phy_init()
475 return tegra124_xusb_padctl_disable(lane->pad->padctl); in tegra124_usb2_phy_exit()
483 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_usb2_phy_power_on() local
490 port = tegra_xusb_find_usb2_port(padctl, index); in tegra124_usb2_phy_power_on()
496 priv = to_tegra124_xusb_padctl(padctl); in tegra124_usb2_phy_power_on()
498 value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); in tegra124_usb2_phy_power_on()
507 padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); in tegra124_usb2_phy_power_on()
509 value = padctl_readl(padctl, XUSB_PADCTL_USB2_PORT_CAP); in tegra124_usb2_phy_power_on()
514 padctl_writel(padctl, value, XUSB_PADCTL_USB2_PORT_CAP); in tegra124_usb2_phy_power_on()
516 value = padctl_readl(padctl, XUSB_PADCTL_USB2_OTG_PADX_CTL0(index)); in tegra124_usb2_phy_power_on()
533 padctl_writel(padctl, value, XUSB_PADCTL_USB2_OTG_PADX_CTL0(index)); in tegra124_usb2_phy_power_on()
535 value = padctl_readl(padctl, XUSB_PADCTL_USB2_OTG_PADX_CTL1(index)); in tegra124_usb2_phy_power_on()
547 padctl_writel(padctl, value, XUSB_PADCTL_USB2_OTG_PADX_CTL1(index)); in tegra124_usb2_phy_power_on()
558 value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); in tegra124_usb2_phy_power_on()
560 padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); in tegra124_usb2_phy_power_on()
571 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_usb2_phy_power_off() local
575 port = tegra_xusb_find_usb2_port(padctl, lane->index); in tegra124_usb2_phy_power_off()
590 value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); in tegra124_usb2_phy_power_off()
592 padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); in tegra124_usb2_phy_power_off()
609 tegra124_usb2_pad_probe(struct tegra_xusb_padctl *padctl, in tegra124_usb2_pad_probe() argument
627 err = tegra_xusb_pad_init(pad, padctl, np); in tegra124_usb2_pad_probe()
717 return tegra124_xusb_padctl_enable(lane->pad->padctl); in tegra124_ulpi_phy_init()
724 return tegra124_xusb_padctl_disable(lane->pad->padctl); in tegra124_ulpi_phy_exit()
746 tegra124_ulpi_pad_probe(struct tegra_xusb_padctl *padctl, in tegra124_ulpi_pad_probe() argument
762 err = tegra_xusb_pad_init(pad, padctl, np); in tegra124_ulpi_pad_probe()
853 return tegra124_xusb_padctl_enable(lane->pad->padctl); in tegra124_hsic_phy_init()
860 return tegra124_xusb_padctl_disable(lane->pad->padctl); in tegra124_hsic_phy_exit()
868 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_hsic_phy_power_on() local
877 padctl_writel(padctl, hsic->strobe_trim, in tegra124_hsic_phy_power_on()
880 value = padctl_readl(padctl, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_phy_power_on()
887 padctl_writel(padctl, value, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_phy_power_on()
889 value = padctl_readl(padctl, XUSB_PADCTL_HSIC_PADX_CTL0(index)); in tegra124_hsic_phy_power_on()
906 padctl_writel(padctl, value, XUSB_PADCTL_HSIC_PADX_CTL0(index)); in tegra124_hsic_phy_power_on()
908 value = padctl_readl(padctl, XUSB_PADCTL_HSIC_PADX_CTL2(index)); in tegra124_hsic_phy_power_on()
917 padctl_writel(padctl, value, XUSB_PADCTL_HSIC_PADX_CTL2(index)); in tegra124_hsic_phy_power_on()
919 value = padctl_readl(padctl, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_phy_power_on()
928 padctl_writel(padctl, value, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_phy_power_on()
937 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_hsic_phy_power_off() local
941 value = padctl_readl(padctl, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_phy_power_off()
946 padctl_writel(padctl, value, XUSB_PADCTL_HSIC_PADX_CTL1(index)); in tegra124_hsic_phy_power_off()
962 tegra124_hsic_pad_probe(struct tegra_xusb_padctl *padctl, in tegra124_hsic_pad_probe() argument
978 err = tegra_xusb_pad_init(pad, padctl, np); in tegra124_hsic_pad_probe()
1073 return tegra124_xusb_padctl_enable(lane->pad->padctl); in tegra124_pcie_phy_init()
1080 return tegra124_xusb_padctl_disable(lane->pad->padctl); in tegra124_pcie_phy_exit()
1086 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_pcie_phy_power_on() local
1091 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); in tegra124_pcie_phy_power_on()
1093 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); in tegra124_pcie_phy_power_on()
1095 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_P0_CTL2); in tegra124_pcie_phy_power_on()
1099 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_P0_CTL2); in tegra124_pcie_phy_power_on()
1101 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); in tegra124_pcie_phy_power_on()
1103 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); in tegra124_pcie_phy_power_on()
1108 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); in tegra124_pcie_phy_power_on()
1117 value = padctl_readl(padctl, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_pcie_phy_power_on()
1119 padctl_writel(padctl, value, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_pcie_phy_power_on()
1127 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_pcie_phy_power_off() local
1130 value = padctl_readl(padctl, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_pcie_phy_power_off()
1132 padctl_writel(padctl, value, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_pcie_phy_power_off()
1134 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); in tegra124_pcie_phy_power_off()
1136 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); in tegra124_pcie_phy_power_off()
1150 tegra124_pcie_pad_probe(struct tegra_xusb_padctl *padctl, in tegra124_pcie_pad_probe() argument
1166 err = tegra_xusb_pad_init(pad, padctl, np); in tegra124_pcie_pad_probe()
1251 return tegra124_xusb_padctl_enable(lane->pad->padctl); in tegra124_sata_phy_init()
1258 return tegra124_xusb_padctl_disable(lane->pad->padctl); in tegra124_sata_phy_exit()
1264 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_sata_phy_power_on() local
1269 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); in tegra124_sata_phy_power_on()
1272 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); in tegra124_sata_phy_power_on()
1274 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_on()
1277 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_on()
1279 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_on()
1281 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_on()
1283 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_on()
1285 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_on()
1290 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_on()
1299 value = padctl_readl(padctl, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_sata_phy_power_on()
1301 padctl_writel(padctl, value, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_sata_phy_power_on()
1309 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra124_sata_phy_power_off() local
1312 value = padctl_readl(padctl, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_sata_phy_power_off()
1314 padctl_writel(padctl, value, XUSB_PADCTL_USB3_PAD_MUX); in tegra124_sata_phy_power_off()
1316 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_off()
1318 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_off()
1320 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_off()
1322 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_off()
1324 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_off()
1327 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_sata_phy_power_off()
1329 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); in tegra124_sata_phy_power_off()
1332 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); in tegra124_sata_phy_power_off()
1346 tegra124_sata_pad_probe(struct tegra_xusb_padctl *padctl, in tegra124_sata_pad_probe() argument
1362 err = tegra_xusb_pad_init(pad, padctl, np); in tegra124_sata_pad_probe()
1421 return tegra_xusb_find_lane(port->padctl, "usb2", port->index); in tegra124_usb2_port_map()
1444 return tegra_xusb_find_lane(port->padctl, "ulpi", port->index); in tegra124_ulpi_port_map()
1466 return tegra_xusb_find_lane(port->padctl, "hsic", port->index); in tegra124_hsic_port_map()
1479 struct tegra_xusb_padctl *padctl = port->padctl; in tegra124_usb3_port_enable() local
1484 value = padctl_readl(padctl, XUSB_PADCTL_SS_PORT_MAP); in tegra124_usb3_port_enable()
1493 padctl_writel(padctl, value, XUSB_PADCTL_SS_PORT_MAP); in tegra124_usb3_port_enable()
1500 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_USB3_PADX_CTL2(index)); in tegra124_usb3_port_enable()
1525 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_USB3_PADX_CTL2(index)); in tegra124_usb3_port_enable()
1540 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_USB3_PADX_CTL4(index)); in tegra124_usb3_port_enable()
1542 if (lane->pad == padctl->pcie) in tegra124_usb3_port_enable()
1547 value = padctl_readl(padctl, offset); in tegra124_usb3_port_enable()
1552 padctl_writel(padctl, value, offset); in tegra124_usb3_port_enable()
1554 if (lane->pad == padctl->pcie) in tegra124_usb3_port_enable()
1559 value = padctl_readl(padctl, offset); in tegra124_usb3_port_enable()
1561 padctl_writel(padctl, value, offset); in tegra124_usb3_port_enable()
1564 if (lane->pad == padctl->sata) { in tegra124_usb3_port_enable()
1565 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_usb3_port_enable()
1570 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); in tegra124_usb3_port_enable()
1572 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL2); in tegra124_usb3_port_enable()
1587 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL2); in tegra124_usb3_port_enable()
1589 value = padctl_readl(padctl, XUSB_PADCTL_IOPHY_PLL_S0_CTL3); in tegra124_usb3_port_enable()
1591 padctl_writel(padctl, value, XUSB_PADCTL_IOPHY_PLL_S0_CTL3); in tegra124_usb3_port_enable()
1594 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_enable()
1596 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_enable()
1600 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_enable()
1602 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_enable()
1606 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_enable()
1608 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_enable()
1615 struct tegra_xusb_padctl *padctl = port->padctl; in tegra124_usb3_port_disable() local
1618 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_disable()
1620 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_disable()
1624 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_disable()
1626 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_disable()
1630 value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_disable()
1632 padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM); in tegra124_usb3_port_disable()
1634 value = padctl_readl(padctl, XUSB_PADCTL_SS_PORT_MAP); in tegra124_usb3_port_disable()
1637 padctl_writel(padctl, value, XUSB_PADCTL_SS_PORT_MAP); in tegra124_usb3_port_disable()
1694 struct tegra124_xusb_padctl *padctl; in tegra124_xusb_padctl_probe() local
1697 padctl = devm_kzalloc(dev, sizeof(*padctl), GFP_KERNEL); in tegra124_xusb_padctl_probe()
1698 if (!padctl) in tegra124_xusb_padctl_probe()
1701 padctl->base.dev = dev; in tegra124_xusb_padctl_probe()
1702 padctl->base.soc = soc; in tegra124_xusb_padctl_probe()
1704 err = tegra124_xusb_read_fuse_calibration(&padctl->fuse); in tegra124_xusb_padctl_probe()
1708 return &padctl->base; in tegra124_xusb_padctl_probe()
1711 static void tegra124_xusb_padctl_remove(struct tegra_xusb_padctl *padctl) in tegra124_xusb_padctl_remove() argument