Date:2014-04-16 22:20:44 (6 years 3 months ago)
Author:Felipe Balbi
Commit:4525beeb9aadbb9e1cb3e9e135f4371553f26a70
Message: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: Felipe Balbi <balbi@ti.com>
Files: arch/arm/mach-omap2/usb-host.c (3 diffs)
drivers/usb/dwc3/dwc3-exynos.c (2 diffs)
drivers/usb/dwc3/dwc3-pci.c (2 diffs)
drivers/usb/musb/am35x.c (2 diffs)
drivers/usb/musb/blackfin.c (2 diffs)
drivers/usb/musb/da8xx.c (2 diffs)
drivers/usb/musb/davinci.c (3 diffs)
drivers/usb/musb/tusb6010.c (3 diffs)
drivers/usb/phy/phy-am335x.c (1 diff)
drivers/usb/phy/phy-generic.c (7 diffs)
drivers/usb/phy/phy-generic.h (2 diffs)
drivers/usb/phy/phy-keystone.c (1 diff)
include/linux/usb/usb_phy_gen_xceiv.h (2 diffs)

Change Details

arch/arm/mach-omap2/usb-host.c
349349    /* .init_data filled later */
350350};
351351
352static const char *nop_name = "usb_phy_gen_xceiv"; /* NOP PHY driver */
352static const char *nop_name = "usb_phy_generic"; /* NOP PHY driver */
353353static const char *reg_name = "reg-fixed-voltage"; /* Regulator driver */
354354
355355/**
...... 
435435    struct platform_device *pdev;
436436    char *phy_id;
437437    struct platform_device_info pdevinfo;
438    struct usb_phy_gen_xceiv_platform_data nop_pdata;
438    struct usb_phy_generic_platform_data nop_pdata;
439439
440440    for (i = 0; i < num_phys; i++) {
441441
...... 
469469        pdevinfo.id = phy->port;
470470        pdevinfo.data = &nop_pdata;
471471        pdevinfo.size_data =
472            sizeof(struct usb_phy_gen_xceiv_platform_data);
473        scnprintf(phy_id, MAX_STR, "usb_phy_gen_xceiv.%d",
472            sizeof(struct usb_phy_generic_platform_data);
473        scnprintf(phy_id, MAX_STR, "usb_phy_generic.%d",
474474                    phy->port);
475475        pdev = platform_device_register_full(&pdevinfo);
476476        if (IS_ERR(pdev)) {
drivers/usb/dwc3/dwc3-exynos.c
3838
3939static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos)
4040{
41    struct usb_phy_gen_xceiv_platform_data pdata;
41    struct usb_phy_generic_platform_data pdata;
4242    struct platform_device *pdev;
4343    int ret;
4444
4545    memset(&pdata, 0x00, sizeof(pdata));
4646
47    pdev = platform_device_alloc("usb_phy_gen_xceiv", PLATFORM_DEVID_AUTO);
47    pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
4848    if (!pdev)
4949        return -ENOMEM;
5050
...... 
5656    if (ret)
5757        goto err1;
5858
59    pdev = platform_device_alloc("usb_phy_gen_xceiv", PLATFORM_DEVID_AUTO);
59    pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
6060    if (!pdev) {
6161        ret = -ENOMEM;
6262        goto err1;
drivers/usb/dwc3/dwc3-pci.c
4040
4141static int dwc3_pci_register_phys(struct dwc3_pci *glue)
4242{
43    struct usb_phy_gen_xceiv_platform_data pdata;
43    struct usb_phy_generic_platform_data pdata;
4444    struct platform_device *pdev;
4545    int ret;
4646
4747    memset(&pdata, 0x00, sizeof(pdata));
4848
49    pdev = platform_device_alloc("usb_phy_gen_xceiv", 0);
49    pdev = platform_device_alloc("usb_phy_generic", 0);
5050    if (!pdev)
5151        return -ENOMEM;
5252
...... 
5858    if (ret)
5959        goto err1;
6060
61    pdev = platform_device_alloc("usb_phy_gen_xceiv", 1);
61    pdev = platform_device_alloc("usb_phy_generic", 1);
6262    if (!pdev) {
6363        ret = -ENOMEM;
6464        goto err1;
drivers/usb/musb/am35x.c
360360    if (!rev)
361361        return -ENODEV;
362362
363    usb_nop_xceiv_register();
363    usb_phy_generic_register();
364364    musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
365365    if (IS_ERR_OR_NULL(musb->xceiv))
366366        return -EPROBE_DEFER;
...... 
402402        data->set_phy_power(0);
403403
404404    usb_put_phy(musb->xceiv);
405    usb_nop_xceiv_unregister();
405    usb_phy_generic_unregister();
406406
407407    return 0;
408408}
drivers/usb/musb/blackfin.c
401401    }
402402    gpio_direction_output(musb->config->gpio_vrsel, 0);
403403
404    usb_nop_xceiv_register();
404    usb_phy_generic_register();
405405    musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
406406    if (IS_ERR_OR_NULL(musb->xceiv)) {
407407        gpio_free(musb->config->gpio_vrsel);
...... 
426426    gpio_free(musb->config->gpio_vrsel);
427427
428428    usb_put_phy(musb->xceiv);
429    usb_nop_xceiv_unregister();
429    usb_phy_generic_unregister();
430430    return 0;
431431}
432432
drivers/usb/musb/da8xx.c
418418    if (!rev)
419419        goto fail;
420420
421    usb_nop_xceiv_register();
421    usb_phy_generic_register();
422422    musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
423423    if (IS_ERR_OR_NULL(musb->xceiv)) {
424424        ret = -EPROBE_DEFER;
...... 
453453    phy_off();
454454
455455    usb_put_phy(musb->xceiv);
456    usb_nop_xceiv_unregister();
456    usb_phy_generic_unregister();
457457
458458    return 0;
459459}
drivers/usb/musb/davinci.c
381381    u32 revision;
382382    int ret = -ENODEV;
383383
384    usb_nop_xceiv_register();
384    usb_phy_generic_register();
385385    musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
386386    if (IS_ERR_OR_NULL(musb->xceiv)) {
387387        ret = -EPROBE_DEFER;
...... 
439439fail:
440440    usb_put_phy(musb->xceiv);
441441unregister:
442    usb_nop_xceiv_unregister();
442    usb_phy_generic_unregister();
443443    return ret;
444444}
445445
...... 
487487    phy_off();
488488
489489    usb_put_phy(musb->xceiv);
490    usb_nop_xceiv_unregister();
490    usb_phy_generic_unregister();
491491
492492    return 0;
493493}
drivers/usb/musb/tusb6010.c
10651065    void __iomem *sync = NULL;
10661066    int ret;
10671067
1068    usb_nop_xceiv_register();
1068    usb_phy_generic_register();
10691069    musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
10701070    if (IS_ERR_OR_NULL(musb->xceiv))
10711071        return -EPROBE_DEFER;
...... 
11171117            iounmap(sync);
11181118
11191119        usb_put_phy(musb->xceiv);
1120        usb_nop_xceiv_unregister();
1120        usb_phy_generic_unregister();
11211121    }
11221122    return ret;
11231123}
...... 
11331133    iounmap(musb->sync_va);
11341134
11351135    usb_put_phy(musb->xceiv);
1136    usb_nop_xceiv_unregister();
1136    usb_phy_generic_unregister();
11371137    return 0;
11381138}
11391139
drivers/usb/phy/phy-am335x.c
1313#include "phy-generic.h"
1414
1515struct am335x_phy {
16    struct usb_phy_gen_xceiv usb_phy_gen;
16    struct usb_phy_generic usb_phy_gen;
1717    struct phy_control *phy_ctrl;
1818    int id;
1919};
drivers/usb/phy/phy-generic.c
4343
4444static struct platform_device *pd;
4545
46void usb_nop_xceiv_register(void)
46void usb_phy_generic_register(void)
4747{
4848    if (pd)
4949        return;
50    pd = platform_device_register_simple("usb_phy_gen_xceiv", -1, NULL, 0);
50    pd = platform_device_register_simple("usb_phy_generic", -1, NULL, 0);
5151    if (IS_ERR(pd)) {
5252        pr_err("Unable to register generic usb transceiver\n");
5353        pd = NULL;
5454        return;
5555    }
5656}
57EXPORT_SYMBOL_GPL(usb_nop_xceiv_register);
57EXPORT_SYMBOL_GPL(usb_phy_generic_register);
5858
59void usb_nop_xceiv_unregister(void)
59void usb_phy_generic_unregister(void)
6060{
6161    platform_device_unregister(pd);
6262    pd = NULL;
6363}
64EXPORT_SYMBOL_GPL(usb_nop_xceiv_unregister);
64EXPORT_SYMBOL_GPL(usb_phy_generic_unregister);
6565
6666static int nop_set_suspend(struct usb_phy *x, int suspend)
6767{
6868    return 0;
6969}
7070
71static void nop_reset_set(struct usb_phy_gen_xceiv *nop, int asserted)
71static void nop_reset_set(struct usb_phy_generic *nop, int asserted)
7272{
7373    int value;
7474
...... 
8787
8888int usb_gen_phy_init(struct usb_phy *phy)
8989{
90    struct usb_phy_gen_xceiv *nop = dev_get_drvdata(phy->dev);
90    struct usb_phy_generic *nop = dev_get_drvdata(phy->dev);
9191
9292    if (!IS_ERR(nop->vcc)) {
9393        if (regulator_enable(nop->vcc))
...... 
106106
107107void usb_gen_phy_shutdown(struct usb_phy *phy)
108108{
109    struct usb_phy_gen_xceiv *nop = dev_get_drvdata(phy->dev);
109    struct usb_phy_generic *nop = dev_get_drvdata(phy->dev);
110110
111111    /* Assert RESET */
112112    nop_reset_set(nop, 1);
...... 
150150    return 0;
151151}
152152
153int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop,
154        struct usb_phy_gen_xceiv_platform_data *pdata)
153int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
154        struct usb_phy_generic_platform_data *pdata)
155155{
156156    enum usb_phy_type type = USB_PHY_TYPE_USB2;
157157    int err;
...... 
245245}
246246EXPORT_SYMBOL_GPL(usb_phy_gen_create_phy);
247247
248static int usb_phy_gen_xceiv_probe(struct platform_device *pdev)
248static int usb_phy_generic_probe(struct platform_device *pdev)
249249{
250250    struct device *dev = &pdev->dev;
251    struct usb_phy_gen_xceiv *nop;
251    struct usb_phy_generic *nop;
252252    int err;
253253
254254    nop = devm_kzalloc(dev, sizeof(*nop), GFP_KERNEL);
...... 
274274    return 0;
275275}
276276
277static int usb_phy_gen_xceiv_remove(struct platform_device *pdev)
277static int usb_phy_generic_remove(struct platform_device *pdev)
278278{
279    struct usb_phy_gen_xceiv *nop = platform_get_drvdata(pdev);
279    struct usb_phy_generic *nop = platform_get_drvdata(pdev);
280280
281281    usb_remove_phy(&nop->phy);
282282
...... 
290290
291291MODULE_DEVICE_TABLE(of, nop_xceiv_dt_ids);
292292
293static struct platform_driver usb_phy_gen_xceiv_driver = {
294    .probe = usb_phy_gen_xceiv_probe,
295    .remove = usb_phy_gen_xceiv_remove,
293static struct platform_driver usb_phy_generic_driver = {
294    .probe = usb_phy_generic_probe,
295    .remove = usb_phy_generic_remove,
296296    .driver = {
297        .name = "usb_phy_gen_xceiv",
297        .name = "usb_phy_generic",
298298        .owner = THIS_MODULE,
299299        .of_match_table = nop_xceiv_dt_ids,
300300    },
301301};
302302
303static int __init usb_phy_gen_xceiv_init(void)
303static int __init usb_phy_generic_init(void)
304304{
305    return platform_driver_register(&usb_phy_gen_xceiv_driver);
305    return platform_driver_register(&usb_phy_generic_driver);
306306}
307subsys_initcall(usb_phy_gen_xceiv_init);
307subsys_initcall(usb_phy_generic_init);
308308
309static void __exit usb_phy_gen_xceiv_exit(void)
309static void __exit usb_phy_generic_exit(void)
310310{
311    platform_driver_unregister(&usb_phy_gen_xceiv_driver);
311    platform_driver_unregister(&usb_phy_generic_driver);
312312}
313module_exit(usb_phy_gen_xceiv_exit);
313module_exit(usb_phy_generic_exit);
314314
315MODULE_ALIAS("platform:usb_phy_gen_xceiv");
315MODULE_ALIAS("platform:usb_phy_generic");
316316MODULE_AUTHOR("Texas Instruments Inc");
317317MODULE_DESCRIPTION("NOP USB Transceiver driver");
318318MODULE_LICENSE("GPL");
drivers/usb/phy/phy-generic.h
33
44#include <linux/usb/usb_phy_gen_xceiv.h>
55
6struct usb_phy_gen_xceiv {
6struct usb_phy_generic {
77    struct usb_phy phy;
88    struct device *dev;
99    struct clk *clk;
...... 
1515int usb_gen_phy_init(struct usb_phy *phy);
1616void usb_gen_phy_shutdown(struct usb_phy *phy);
1717
18int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop,
19        struct usb_phy_gen_xceiv_platform_data *pdata);
18int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
19        struct usb_phy_generic_platform_data *pdata);
2020
2121#endif
drivers/usb/phy/phy-keystone.c
3535#define PHY_REF_SSP_EN BIT(29)
3636
3737struct keystone_usbphy {
38    struct usb_phy_gen_xceiv usb_phy_gen;
38    struct usb_phy_generic usb_phy_gen;
3939    void __iomem *phy_ctrl;
4040};
4141
include/linux/usb/usb_phy_gen_xceiv.h
33
44#include <linux/usb/otg.h>
55
6struct usb_phy_gen_xceiv_platform_data {
6struct usb_phy_generic_platform_data {
77    enum usb_phy_type type;
88    unsigned long clk_rate;
99
...... 
1515
1616#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
1717/* sometimes transceivers are accessed only through e.g. ULPI */
18extern void usb_nop_xceiv_register(void);
19extern void usb_nop_xceiv_unregister(void);
18extern void usb_phy_generic_register(void);
19extern void usb_phy_generic_unregister(void);
2020#else
21static inline void usb_nop_xceiv_register(void)
21static inline void usb_phy_generic_register(void)
2222{
2323}
2424
25static inline void usb_nop_xceiv_unregister(void)
25static inline void usb_phy_generic_unregister(void)
2626{
2727}
2828#endif

Archive Download the corresponding diff file



interactive