Commit a8a24429 authored by Nagarjuna Kristam's avatar Nagarjuna Kristam Committed by Kishon Vijay Abraham I

phy: tegra: xusb: Add vbus override support on Tegra186

Tegra XUSB device control driver needs to control vbus override
during its operations, add API for the support.
Signed-off-by: default avatarNagarjuna Kristam <nkristam@nvidia.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 90767cdf
...@@ -857,9 +857,32 @@ static void tegra186_xusb_padctl_remove(struct tegra_xusb_padctl *padctl) ...@@ -857,9 +857,32 @@ static void tegra186_xusb_padctl_remove(struct tegra_xusb_padctl *padctl)
{ {
} }
static int tegra186_xusb_padctl_vbus_override(struct tegra_xusb_padctl *padctl,
bool status)
{
u32 value;
dev_dbg(padctl->dev, "%s vbus override\n", status ? "set" : "clear");
value = padctl_readl(padctl, USB2_VBUS_ID);
if (status) {
value |= VBUS_OVERRIDE;
value &= ~ID_OVERRIDE(~0);
value |= ID_OVERRIDE_FLOATING;
} else {
value &= ~VBUS_OVERRIDE;
}
padctl_writel(padctl, value, USB2_VBUS_ID);
return 0;
}
static const struct tegra_xusb_padctl_ops tegra186_xusb_padctl_ops = { static const struct tegra_xusb_padctl_ops tegra186_xusb_padctl_ops = {
.probe = tegra186_xusb_padctl_probe, .probe = tegra186_xusb_padctl_probe,
.remove = tegra186_xusb_padctl_remove, .remove = tegra186_xusb_padctl_remove,
.vbus_override = tegra186_xusb_padctl_vbus_override,
}; };
static const char * const tegra186_xusb_padctl_supply_names[] = { static const char * const tegra186_xusb_padctl_supply_names[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment