Commit 4525beeb authored by Felipe Balbi's avatar Felipe Balbi

usb: phy: rename usb_nop_xceiv to usb_phy_generic

no functional changes, just renaming the function
in order to make it slightly clearer what it should
be used for, also matching the driver name.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 0700faaf
...@@ -349,7 +349,7 @@ static struct fixed_voltage_config hsusb_reg_config = { ...@@ -349,7 +349,7 @@ static struct fixed_voltage_config hsusb_reg_config = {
/* .init_data filled later */ /* .init_data filled later */
}; };
static const char *nop_name = "usb_phy_gen_xceiv"; /* NOP PHY driver */ static const char *nop_name = "usb_phy_generic"; /* NOP PHY driver */
static const char *reg_name = "reg-fixed-voltage"; /* Regulator driver */ static const char *reg_name = "reg-fixed-voltage"; /* Regulator driver */
/** /**
...@@ -435,7 +435,7 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys) ...@@ -435,7 +435,7 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
struct platform_device *pdev; struct platform_device *pdev;
char *phy_id; char *phy_id;
struct platform_device_info pdevinfo; struct platform_device_info pdevinfo;
struct usb_phy_gen_xceiv_platform_data nop_pdata; struct usb_phy_generic_platform_data nop_pdata;
for (i = 0; i < num_phys; i++) { for (i = 0; i < num_phys; i++) {
...@@ -469,8 +469,8 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys) ...@@ -469,8 +469,8 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
pdevinfo.id = phy->port; pdevinfo.id = phy->port;
pdevinfo.data = &nop_pdata; pdevinfo.data = &nop_pdata;
pdevinfo.size_data = pdevinfo.size_data =
sizeof(struct usb_phy_gen_xceiv_platform_data); sizeof(struct usb_phy_generic_platform_data);
scnprintf(phy_id, MAX_STR, "usb_phy_gen_xceiv.%d", scnprintf(phy_id, MAX_STR, "usb_phy_generic.%d",
phy->port); phy->port);
pdev = platform_device_register_full(&pdevinfo); pdev = platform_device_register_full(&pdevinfo);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
......
...@@ -38,13 +38,13 @@ struct dwc3_exynos { ...@@ -38,13 +38,13 @@ struct dwc3_exynos {
static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos) static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos)
{ {
struct usb_phy_gen_xceiv_platform_data pdata; struct usb_phy_generic_platform_data pdata;
struct platform_device *pdev; struct platform_device *pdev;
int ret; int ret;
memset(&pdata, 0x00, sizeof(pdata)); memset(&pdata, 0x00, sizeof(pdata));
pdev = platform_device_alloc("usb_phy_gen_xceiv", PLATFORM_DEVID_AUTO); pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
if (!pdev) if (!pdev)
return -ENOMEM; return -ENOMEM;
...@@ -56,7 +56,7 @@ static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos) ...@@ -56,7 +56,7 @@ static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos)
if (ret) if (ret)
goto err1; goto err1;
pdev = platform_device_alloc("usb_phy_gen_xceiv", PLATFORM_DEVID_AUTO); pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
if (!pdev) { if (!pdev) {
ret = -ENOMEM; ret = -ENOMEM;
goto err1; goto err1;
......
...@@ -40,13 +40,13 @@ struct dwc3_pci { ...@@ -40,13 +40,13 @@ struct dwc3_pci {
static int dwc3_pci_register_phys(struct dwc3_pci *glue) static int dwc3_pci_register_phys(struct dwc3_pci *glue)
{ {
struct usb_phy_gen_xceiv_platform_data pdata; struct usb_phy_generic_platform_data pdata;
struct platform_device *pdev; struct platform_device *pdev;
int ret; int ret;
memset(&pdata, 0x00, sizeof(pdata)); memset(&pdata, 0x00, sizeof(pdata));
pdev = platform_device_alloc("usb_phy_gen_xceiv", 0); pdev = platform_device_alloc("usb_phy_generic", 0);
if (!pdev) if (!pdev)
return -ENOMEM; return -ENOMEM;
...@@ -58,7 +58,7 @@ static int dwc3_pci_register_phys(struct dwc3_pci *glue) ...@@ -58,7 +58,7 @@ static int dwc3_pci_register_phys(struct dwc3_pci *glue)
if (ret) if (ret)
goto err1; goto err1;
pdev = platform_device_alloc("usb_phy_gen_xceiv", 1); pdev = platform_device_alloc("usb_phy_generic", 1);
if (!pdev) { if (!pdev) {
ret = -ENOMEM; ret = -ENOMEM;
goto err1; goto err1;
......
...@@ -360,7 +360,7 @@ static int am35x_musb_init(struct musb *musb) ...@@ -360,7 +360,7 @@ static int am35x_musb_init(struct musb *musb)
if (!rev) if (!rev)
return -ENODEV; return -ENODEV;
usb_nop_xceiv_register(); usb_phy_generic_register();
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb->xceiv)) if (IS_ERR_OR_NULL(musb->xceiv))
return -EPROBE_DEFER; return -EPROBE_DEFER;
...@@ -402,7 +402,7 @@ static int am35x_musb_exit(struct musb *musb) ...@@ -402,7 +402,7 @@ static int am35x_musb_exit(struct musb *musb)
data->set_phy_power(0); data->set_phy_power(0);
usb_put_phy(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_phy_generic_unregister();
return 0; return 0;
} }
......
...@@ -401,7 +401,7 @@ static int bfin_musb_init(struct musb *musb) ...@@ -401,7 +401,7 @@ static int bfin_musb_init(struct musb *musb)
} }
gpio_direction_output(musb->config->gpio_vrsel, 0); gpio_direction_output(musb->config->gpio_vrsel, 0);
usb_nop_xceiv_register(); usb_phy_generic_register();
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb->xceiv)) { if (IS_ERR_OR_NULL(musb->xceiv)) {
gpio_free(musb->config->gpio_vrsel); gpio_free(musb->config->gpio_vrsel);
...@@ -426,7 +426,7 @@ static int bfin_musb_exit(struct musb *musb) ...@@ -426,7 +426,7 @@ static int bfin_musb_exit(struct musb *musb)
gpio_free(musb->config->gpio_vrsel); gpio_free(musb->config->gpio_vrsel);
usb_put_phy(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_phy_generic_unregister();
return 0; return 0;
} }
......
...@@ -418,7 +418,7 @@ static int da8xx_musb_init(struct musb *musb) ...@@ -418,7 +418,7 @@ static int da8xx_musb_init(struct musb *musb)
if (!rev) if (!rev)
goto fail; goto fail;
usb_nop_xceiv_register(); usb_phy_generic_register();
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb->xceiv)) { if (IS_ERR_OR_NULL(musb->xceiv)) {
ret = -EPROBE_DEFER; ret = -EPROBE_DEFER;
...@@ -453,7 +453,7 @@ static int da8xx_musb_exit(struct musb *musb) ...@@ -453,7 +453,7 @@ static int da8xx_musb_exit(struct musb *musb)
phy_off(); phy_off();
usb_put_phy(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_phy_generic_unregister();
return 0; return 0;
} }
......
...@@ -381,7 +381,7 @@ static int davinci_musb_init(struct musb *musb) ...@@ -381,7 +381,7 @@ static int davinci_musb_init(struct musb *musb)
u32 revision; u32 revision;
int ret = -ENODEV; int ret = -ENODEV;
usb_nop_xceiv_register(); usb_phy_generic_register();
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb->xceiv)) { if (IS_ERR_OR_NULL(musb->xceiv)) {
ret = -EPROBE_DEFER; ret = -EPROBE_DEFER;
...@@ -439,7 +439,7 @@ static int davinci_musb_init(struct musb *musb) ...@@ -439,7 +439,7 @@ static int davinci_musb_init(struct musb *musb)
fail: fail:
usb_put_phy(musb->xceiv); usb_put_phy(musb->xceiv);
unregister: unregister:
usb_nop_xceiv_unregister(); usb_phy_generic_unregister();
return ret; return ret;
} }
...@@ -487,7 +487,7 @@ static int davinci_musb_exit(struct musb *musb) ...@@ -487,7 +487,7 @@ static int davinci_musb_exit(struct musb *musb)
phy_off(); phy_off();
usb_put_phy(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_phy_generic_unregister();
return 0; return 0;
} }
......
...@@ -1065,7 +1065,7 @@ static int tusb_musb_init(struct musb *musb) ...@@ -1065,7 +1065,7 @@ static int tusb_musb_init(struct musb *musb)
void __iomem *sync = NULL; void __iomem *sync = NULL;
int ret; int ret;
usb_nop_xceiv_register(); usb_phy_generic_register();
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb->xceiv)) if (IS_ERR_OR_NULL(musb->xceiv))
return -EPROBE_DEFER; return -EPROBE_DEFER;
...@@ -1117,7 +1117,7 @@ static int tusb_musb_init(struct musb *musb) ...@@ -1117,7 +1117,7 @@ static int tusb_musb_init(struct musb *musb)
iounmap(sync); iounmap(sync);
usb_put_phy(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_phy_generic_unregister();
} }
return ret; return ret;
} }
...@@ -1133,7 +1133,7 @@ static int tusb_musb_exit(struct musb *musb) ...@@ -1133,7 +1133,7 @@ static int tusb_musb_exit(struct musb *musb)
iounmap(musb->sync_va); iounmap(musb->sync_va);
usb_put_phy(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_phy_generic_unregister();
return 0; return 0;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "phy-generic.h" #include "phy-generic.h"
struct am335x_phy { struct am335x_phy {
struct usb_phy_gen_xceiv usb_phy_gen; struct usb_phy_generic usb_phy_gen;
struct phy_control *phy_ctrl; struct phy_control *phy_ctrl;
int id; int id;
}; };
......
...@@ -43,32 +43,32 @@ ...@@ -43,32 +43,32 @@
static struct platform_device *pd; static struct platform_device *pd;
void usb_nop_xceiv_register(void) void usb_phy_generic_register(void)
{ {
if (pd) if (pd)
return; return;
pd = platform_device_register_simple("usb_phy_gen_xceiv", -1, NULL, 0); pd = platform_device_register_simple("usb_phy_generic", -1, NULL, 0);
if (IS_ERR(pd)) { if (IS_ERR(pd)) {
pr_err("Unable to register generic usb transceiver\n"); pr_err("Unable to register generic usb transceiver\n");
pd = NULL; pd = NULL;
return; return;
} }
} }
EXPORT_SYMBOL_GPL(usb_nop_xceiv_register); EXPORT_SYMBOL_GPL(usb_phy_generic_register);
void usb_nop_xceiv_unregister(void) void usb_phy_generic_unregister(void)
{ {
platform_device_unregister(pd); platform_device_unregister(pd);
pd = NULL; pd = NULL;
} }
EXPORT_SYMBOL_GPL(usb_nop_xceiv_unregister); EXPORT_SYMBOL_GPL(usb_phy_generic_unregister);
static int nop_set_suspend(struct usb_phy *x, int suspend) static int nop_set_suspend(struct usb_phy *x, int suspend)
{ {
return 0; return 0;
} }
static void nop_reset_set(struct usb_phy_gen_xceiv *nop, int asserted) static void nop_reset_set(struct usb_phy_generic *nop, int asserted)
{ {
int value; int value;
...@@ -87,7 +87,7 @@ static void nop_reset_set(struct usb_phy_gen_xceiv *nop, int asserted) ...@@ -87,7 +87,7 @@ static void nop_reset_set(struct usb_phy_gen_xceiv *nop, int asserted)
int usb_gen_phy_init(struct usb_phy *phy) int usb_gen_phy_init(struct usb_phy *phy)
{ {
struct usb_phy_gen_xceiv *nop = dev_get_drvdata(phy->dev); struct usb_phy_generic *nop = dev_get_drvdata(phy->dev);
if (!IS_ERR(nop->vcc)) { if (!IS_ERR(nop->vcc)) {
if (regulator_enable(nop->vcc)) if (regulator_enable(nop->vcc))
...@@ -106,7 +106,7 @@ EXPORT_SYMBOL_GPL(usb_gen_phy_init); ...@@ -106,7 +106,7 @@ EXPORT_SYMBOL_GPL(usb_gen_phy_init);
void usb_gen_phy_shutdown(struct usb_phy *phy) void usb_gen_phy_shutdown(struct usb_phy *phy)
{ {
struct usb_phy_gen_xceiv *nop = dev_get_drvdata(phy->dev); struct usb_phy_generic *nop = dev_get_drvdata(phy->dev);
/* Assert RESET */ /* Assert RESET */
nop_reset_set(nop, 1); nop_reset_set(nop, 1);
...@@ -150,8 +150,8 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host) ...@@ -150,8 +150,8 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host)
return 0; return 0;
} }
int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop, int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
struct usb_phy_gen_xceiv_platform_data *pdata) struct usb_phy_generic_platform_data *pdata)
{ {
enum usb_phy_type type = USB_PHY_TYPE_USB2; enum usb_phy_type type = USB_PHY_TYPE_USB2;
int err; int err;
...@@ -245,10 +245,10 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop, ...@@ -245,10 +245,10 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop,
} }
EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy); EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy);
static int usb_phy_gen_xceiv_probe(struct platform_device *pdev) static int usb_phy_generic_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct usb_phy_gen_xceiv *nop; struct usb_phy_generic *nop;
int err; int err;
nop = devm_kzalloc(dev, sizeof(*nop), GFP_KERNEL); nop = devm_kzalloc(dev, sizeof(*nop), GFP_KERNEL);
...@@ -274,9 +274,9 @@ static int usb_phy_gen_xceiv_probe(struct platform_device *pdev) ...@@ -274,9 +274,9 @@ static int usb_phy_gen_xceiv_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int usb_phy_gen_xceiv_remove(struct platform_device *pdev) static int usb_phy_generic_remove(struct platform_device *pdev)
{ {
struct usb_phy_gen_xceiv *nop = platform_get_drvdata(pdev); struct usb_phy_generic *nop = platform_get_drvdata(pdev);
usb_remove_phy(&nop->phy); usb_remove_phy(&nop->phy);
...@@ -290,29 +290,29 @@ static const struct of_device_id nop_xceiv_dt_ids[] = { ...@@ -290,29 +290,29 @@ static const struct of_device_id nop_xceiv_dt_ids[] = {
MODULE_DEVICE_TABLE(of, nop_xceiv_dt_ids); MODULE_DEVICE_TABLE(of, nop_xceiv_dt_ids);
static struct platform_driver usb_phy_gen_xceiv_driver = { static struct platform_driver usb_phy_generic_driver = {
.probe = usb_phy_gen_xceiv_probe, .probe = usb_phy_generic_probe,
.remove = usb_phy_gen_xceiv_remove, .remove = usb_phy_generic_remove,
.driver = { .driver = {
.name = "usb_phy_gen_xceiv", .name = "usb_phy_generic",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = nop_xceiv_dt_ids, .of_match_table = nop_xceiv_dt_ids,
}, },
}; };
static int __init usb_phy_gen_xceiv_init(void) static int __init usb_phy_generic_init(void)
{ {
return platform_driver_register(&usb_phy_gen_xceiv_driver); return platform_driver_register(&usb_phy_generic_driver);
} }
subsys_initcall(usb_phy_gen_xceiv_init); subsys_initcall(usb_phy_generic_init);
static void __exit usb_phy_gen_xceiv_exit(void) static void __exit usb_phy_generic_exit(void)
{ {
platform_driver_unregister(&usb_phy_gen_xceiv_driver); platform_driver_unregister(&usb_phy_generic_driver);
} }
module_exit(usb_phy_gen_xceiv_exit); module_exit(usb_phy_generic_exit);
MODULE_ALIAS("platform:usb_phy_gen_xceiv"); MODULE_ALIAS("platform:usb_phy_generic");
MODULE_AUTHOR("Texas Instruments Inc"); MODULE_AUTHOR("Texas Instruments Inc");
MODULE_DESCRIPTION("NOP USB Transceiver driver"); MODULE_DESCRIPTION("NOP USB Transceiver driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <linux/usb/usb_phy_gen_xceiv.h> #include <linux/usb/usb_phy_gen_xceiv.h>
struct usb_phy_gen_xceiv { struct usb_phy_generic {
struct usb_phy phy; struct usb_phy phy;
struct device *dev; struct device *dev;
struct clk *clk; struct clk *clk;
...@@ -15,7 +15,7 @@ struct usb_phy_gen_xceiv { ...@@ -15,7 +15,7 @@ struct usb_phy_gen_xceiv {
int usb_gen_phy_init(struct usb_phy *phy); int usb_gen_phy_init(struct usb_phy *phy);
void usb_gen_phy_shutdown(struct usb_phy *phy); void usb_gen_phy_shutdown(struct usb_phy *phy);
int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop, int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
struct usb_phy_gen_xceiv_platform_data *pdata); struct usb_phy_generic_platform_data *pdata);
#endif #endif
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define PHY_REF_SSP_EN BIT(29) #define PHY_REF_SSP_EN BIT(29)
struct keystone_usbphy { struct keystone_usbphy {
struct usb_phy_gen_xceiv usb_phy_gen; struct usb_phy_generic usb_phy_gen;
void __iomem *phy_ctrl; void __iomem *phy_ctrl;
}; };
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <linux/usb/otg.h> #include <linux/usb/otg.h>
struct usb_phy_gen_xceiv_platform_data { struct usb_phy_generic_platform_data {
enum usb_phy_type type; enum usb_phy_type type;
unsigned long clk_rate; unsigned long clk_rate;
...@@ -15,14 +15,14 @@ struct usb_phy_gen_xceiv_platform_data { ...@@ -15,14 +15,14 @@ struct usb_phy_gen_xceiv_platform_data {
#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
/* sometimes transceivers are accessed only through e.g. ULPI */ /* sometimes transceivers are accessed only through e.g. ULPI */
extern void usb_nop_xceiv_register(void); extern void usb_phy_generic_register(void);
extern void usb_nop_xceiv_unregister(void); extern void usb_phy_generic_unregister(void);
#else #else
static inline void usb_nop_xceiv_register(void) static inline void usb_phy_generic_register(void)
{ {
} }
static inline void usb_nop_xceiv_unregister(void) static inline void usb_phy_generic_unregister(void)
{ {
} }
#endif #endif
......
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