Lines Matching +full:usb2 +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0-only
3 * phy-bcm-kona-usb2.c - Broadcom Kona USB2 Phy Driver
15 #include <linux/phy/phy.h>
34 static void bcm_kona_usb_phy_power(struct bcm_kona_usb *phy, int on) in bcm_kona_usb_phy_power() argument
38 val = readl(phy->regs + OTGCTL); in bcm_kona_usb_phy_power()
40 /* Configure and power PHY */ in bcm_kona_usb_phy_power()
47 writel(val, phy->regs + OTGCTL); in bcm_kona_usb_phy_power()
50 static int bcm_kona_usb_phy_init(struct phy *gphy) in bcm_kona_usb_phy_init()
52 struct bcm_kona_usb *phy = phy_get_drvdata(gphy); in bcm_kona_usb_phy_init() local
55 /* Soft reset PHY */ in bcm_kona_usb_phy_init()
56 val = readl(phy->regs + P1CTL); in bcm_kona_usb_phy_init()
59 writel(val, phy->regs + P1CTL); in bcm_kona_usb_phy_init()
60 writel(val & ~P1CTL_SOFT_RESET, phy->regs + P1CTL); in bcm_kona_usb_phy_init()
63 writel(val | P1CTL_SOFT_RESET, phy->regs + P1CTL); in bcm_kona_usb_phy_init()
68 static int bcm_kona_usb_phy_power_on(struct phy *gphy) in bcm_kona_usb_phy_power_on()
70 struct bcm_kona_usb *phy = phy_get_drvdata(gphy); in bcm_kona_usb_phy_power_on() local
72 bcm_kona_usb_phy_power(phy, 1); in bcm_kona_usb_phy_power_on()
77 static int bcm_kona_usb_phy_power_off(struct phy *gphy) in bcm_kona_usb_phy_power_off()
79 struct bcm_kona_usb *phy = phy_get_drvdata(gphy); in bcm_kona_usb_phy_power_off() local
81 bcm_kona_usb_phy_power(phy, 0); in bcm_kona_usb_phy_power_off()
95 struct device *dev = &pdev->dev; in bcm_kona_usb2_probe()
96 struct bcm_kona_usb *phy; in bcm_kona_usb2_probe() local
98 struct phy *gphy; in bcm_kona_usb2_probe()
101 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); in bcm_kona_usb2_probe()
102 if (!phy) in bcm_kona_usb2_probe()
103 return -ENOMEM; in bcm_kona_usb2_probe()
106 phy->regs = devm_ioremap_resource(&pdev->dev, res); in bcm_kona_usb2_probe()
107 if (IS_ERR(phy->regs)) in bcm_kona_usb2_probe()
108 return PTR_ERR(phy->regs); in bcm_kona_usb2_probe()
110 platform_set_drvdata(pdev, phy); in bcm_kona_usb2_probe()
116 /* The Kona PHY supports an 8-bit wide UTMI interface */ in bcm_kona_usb2_probe()
119 phy_set_drvdata(gphy, phy); in bcm_kona_usb2_probe()
128 { .compatible = "brcm,kona-usb2-phy" },
137 .name = "bcm-kona-usb2",
144 MODULE_ALIAS("platform:bcm-kona-usb2");
146 MODULE_DESCRIPTION("BCM Kona USB 2.0 PHY driver");