diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2013-06-24 14:46:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-24 16:16:55 -0700 |
commit | 8e22978c57087aac4d88693278db1cc3e94f1253 (patch) | |
tree | 37394ec786b6e51cdc2c71d4c37aabbf969fe011 /drivers/usb | |
parent | 38dcdb3a7db757203b71faf0a49710685d897852 (diff) |
usb: chipidea: drop "13xxx" infix
"ci13xxx" is bad for at least the following reasons:
* people often mistype it
* it doesn't add any informational value to the names it's used in
* it needlessly attracts mail filters
This patch replaces it with "ci_hdrc", "ci_udc" or "ci_hw", depending
on the situation. Modules with ci13xxx prefix are also renamed accordingly
and aliases are added for compatibility. Otherwise, no functional changes.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/Makefile | 6 | ||||
-rw-r--r-- | drivers/usb/chipidea/ci.h | 50 | ||||
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c (renamed from drivers/usb/chipidea/ci13xxx_imx.c) | 46 | ||||
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.h (renamed from drivers/usb/chipidea/ci13xxx_imx.h) | 0 | ||||
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_msm.c (renamed from drivers/usb/chipidea/ci13xxx_msm.c) | 49 | ||||
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_pci.c (renamed from drivers/usb/chipidea/ci13xxx_pci.c) | 43 | ||||
-rw-r--r-- | drivers/usb/chipidea/core.c | 36 | ||||
-rw-r--r-- | drivers/usb/chipidea/debug.c | 34 | ||||
-rw-r--r-- | drivers/usb/chipidea/debug.h | 8 | ||||
-rw-r--r-- | drivers/usb/chipidea/host.c | 10 | ||||
-rw-r--r-- | drivers/usb/chipidea/host.h | 4 | ||||
-rw-r--r-- | drivers/usb/chipidea/udc.c | 217 | ||||
-rw-r--r-- | drivers/usb/chipidea/udc.h | 16 | ||||
-rw-r--r-- | drivers/usb/chipidea/usbmisc_imx.c | 2 |
14 files changed, 261 insertions, 260 deletions
diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile index 4ab83e98219b..3bbbcba03815 100644 --- a/drivers/usb/chipidea/Makefile +++ b/drivers/usb/chipidea/Makefile @@ -9,13 +9,13 @@ ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG) += debug.o # Glue/Bridge layers go here -obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_msm.o +obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_msm.o # PCI doesn't provide stubs, need to check ifneq ($(CONFIG_PCI),) - obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_pci.o + obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_pci.o endif ifneq ($(CONFIG_OF_DEVICE),) - obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_imx.o usbmisc_imx.o + obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_imx.o usbmisc_imx.o endif diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 9ef686086c24..33cb29f36e06 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -22,14 +22,14 @@ * DEFINE *****************************************************************************/ #define TD_PAGE_COUNT 5 -#define CI13XXX_PAGE_SIZE 4096ul /* page size for TD's */ +#define CI_HDRC_PAGE_SIZE 4096ul /* page size for TD's */ #define ENDPT_MAX 32 /****************************************************************************** * STRUCTURES *****************************************************************************/ /** - * struct ci13xxx_ep - endpoint representation + * struct ci_hw_ep - endpoint representation * @ep: endpoint structure for gadget drivers * @dir: endpoint direction (TX/RX) * @num: endpoint number @@ -41,7 +41,7 @@ * @lock: pointer to controller's spinlock * @td_pool: pointer to controller's TD pool */ -struct ci13xxx_ep { +struct ci_hw_ep { struct usb_ep ep; u8 dir; u8 num; @@ -49,13 +49,13 @@ struct ci13xxx_ep { char name[16]; struct { struct list_head queue; - struct ci13xxx_qh *ptr; + struct ci_hw_qh *ptr; dma_addr_t dma; } qh; int wedge; /* global resources */ - struct ci13xxx *ci; + struct ci_hdrc *ci; spinlock_t *lock; struct dma_pool *td_pool; struct td_node *pending_td; @@ -75,9 +75,9 @@ enum ci_role { * name: role name string (host/gadget) */ struct ci_role_driver { - int (*start)(struct ci13xxx *); - void (*stop)(struct ci13xxx *); - irqreturn_t (*irq)(struct ci13xxx *); + int (*start)(struct ci_hdrc *); + void (*stop)(struct ci_hdrc *); + irqreturn_t (*irq)(struct ci_hdrc *); const char *name; }; @@ -102,7 +102,7 @@ struct hw_bank { }; /** - * struct ci13xxx - chipidea device representation + * struct ci_hdrc - chipidea device representation * @dev: pointer to parent device * @lock: access synchronization * @hw_bank: hardware register mapping @@ -117,7 +117,7 @@ struct hw_bank { * @gadget: device side representation for peripheral controller * @driver: gadget driver * @hw_ep_max: total number of endpoints supported by hardware - * @ci13xxx_ep: array of endpoints + * @ci_hw_ep: array of endpoints * @ep0_dir: ep0 direction * @ep0out: pointer to ep0 OUT endpoint * @ep0in: pointer to ep0 IN endpoint @@ -133,7 +133,7 @@ struct hw_bank { * @hcd: pointer to usb_hcd for ehci host driver * @debugfs: root dentry for this controller in debugfs */ -struct ci13xxx { +struct ci_hdrc { struct device *dev; spinlock_t lock; struct hw_bank hw_bank; @@ -150,9 +150,9 @@ struct ci13xxx { struct usb_gadget gadget; struct usb_gadget_driver *driver; unsigned hw_ep_max; - struct ci13xxx_ep ci13xxx_ep[ENDPT_MAX]; + struct ci_hw_ep ci_hw_ep[ENDPT_MAX]; u32 ep0_dir; - struct ci13xxx_ep *ep0out, *ep0in; + struct ci_hw_ep *ep0out, *ep0in; struct usb_request *status; bool setaddr; @@ -161,7 +161,7 @@ struct ci13xxx { u8 suspended; u8 test_mode; - struct ci13xxx_platform_data *platdata; + struct ci_hdrc_platform_data *platdata; int vbus_active; /* FIXME: some day, we'll not use global phy */ bool global_phy; @@ -170,13 +170,13 @@ struct ci13xxx { struct dentry *debugfs; }; -static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) +static inline struct ci_role_driver *ci_role(struct ci_hdrc *ci) { BUG_ON(ci->role >= CI_ROLE_END || !ci->roles[ci->role]); return ci->roles[ci->role]; } -static inline int ci_role_start(struct ci13xxx *ci, enum ci_role role) +static inline int ci_role_start(struct ci_hdrc *ci, enum ci_role role) { int ret; @@ -192,7 +192,7 @@ static inline int ci_role_start(struct ci13xxx *ci, enum ci_role role) return ret; } -static inline void ci_role_stop(struct ci13xxx *ci) +static inline void ci_role_stop(struct ci_hdrc *ci) { enum ci_role role = ci->role; @@ -211,7 +211,7 @@ static inline void ci_role_stop(struct ci13xxx *ci) #define REG_BITS (32) /* register indices */ -enum ci13xxx_regs { +enum ci_hw_regs { CAP_CAPLENGTH, CAP_HCCPARAMS, CAP_DCCPARAMS, @@ -243,7 +243,7 @@ enum ci13xxx_regs { * * This function returns register contents */ -static inline u32 hw_read(struct ci13xxx *ci, enum ci13xxx_regs reg, u32 mask) +static inline u32 hw_read(struct ci_hdrc *ci, enum ci_hw_regs reg, u32 mask) { return ioread32(ci->hw_bank.regmap[reg]) & mask; } @@ -254,7 +254,7 @@ static inline u32 hw_read(struct ci13xxx *ci, enum ci13xxx_regs reg, u32 mask) * @mask: bitfield mask * @data: new value */ -static inline void hw_write(struct ci13xxx *ci, enum ci13xxx_regs reg, +static inline void hw_write(struct ci_hdrc *ci, enum ci_hw_regs reg, u32 mask, u32 data) { if (~mask) @@ -271,7 +271,7 @@ static inline void hw_write(struct ci13xxx *ci, enum ci13xxx_regs reg, * * This function returns register contents */ -static inline u32 hw_test_and_clear(struct ci13xxx *ci, enum ci13xxx_regs reg, +static inline u32 hw_test_and_clear(struct ci_hdrc *ci, enum ci_hw_regs reg, u32 mask) { u32 val = ioread32(ci->hw_bank.regmap[reg]) & mask; @@ -288,7 +288,7 @@ static inline u32 hw_test_and_clear(struct ci13xxx *ci, enum ci13xxx_regs reg, * * This function returns register contents */ -static inline u32 hw_test_and_write(struct ci13xxx *ci, enum ci13xxx_regs reg, +static inline u32 hw_test_and_write(struct ci_hdrc *ci, enum ci_hw_regs reg, u32 mask, u32 data) { u32 val = hw_read(ci, reg, ~0); @@ -297,10 +297,10 @@ static inline u32 hw_test_and_write(struct ci13xxx *ci, enum ci13xxx_regs reg, return (val & mask) >> __ffs(mask); } -int hw_device_reset(struct ci13xxx *ci, u32 mode); +int hw_device_reset(struct ci_hdrc *ci, u32 mode); -int hw_port_test_set(struct ci13xxx *ci, u8 mode); +int hw_port_test_set(struct ci_hdrc *ci, u8 mode); -u8 hw_port_test_get(struct ci13xxx *ci); +u8 hw_port_test_get(struct ci_hdrc *ci); #endif /* __DRIVERS_USB_CHIPIDEA_CI_H */ diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 7e6f0674bee3..37fdae5106ae 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -22,12 +22,12 @@ #include <linux/regulator/consumer.h> #include "ci.h" -#include "ci13xxx_imx.h" +#include "ci_hdrc_imx.h" #define pdev_to_phy(pdev) \ ((struct usb_phy *)platform_get_drvdata(pdev)) -struct ci13xxx_imx_data { +struct ci_hdrc_imx_data { struct usb_phy *phy; struct platform_device *ci_pdev; struct clk *clk; @@ -86,15 +86,15 @@ EXPORT_SYMBOL_GPL(usbmisc_get_init_data); /* End of common functions shared by usbmisc drivers*/ -static int ci13xxx_imx_probe(struct platform_device *pdev) +static int ci_hdrc_imx_probe(struct platform_device *pdev) { - struct ci13xxx_imx_data *data; - struct ci13xxx_platform_data pdata = { - .name = "ci13xxx_imx", + struct ci_hdrc_imx_data *data; + struct ci_hdrc_platform_data pdata = { + .name = "ci_hdrc_imx", .capoffset = DEF_CAPOFFSET, - .flags = CI13XXX_REQUIRE_TRANSCEIVER | - CI13XXX_PULLUP_ON_VBUS | - CI13XXX_DISABLE_STREAMING, + .flags = CI_HDRC_REQUIRE_TRANSCEIVER | + CI_HDRC_PULLUP_ON_VBUS | + CI_HDRC_DISABLE_STREAMING, }; struct resource *res; int ret; @@ -106,7 +106,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) { - dev_err(&pdev->dev, "Failed to allocate CI13xxx-IMX data!\n"); + dev_err(&pdev->dev, "Failed to allocate ci_hdrc-imx data!\n"); return -ENOMEM; } @@ -172,7 +172,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) } } - data->ci_pdev = ci13xxx_add_device(&pdev->dev, + data->ci_pdev = ci_hdrc_add_device(&pdev->dev, pdev->resource, pdev->num_resources, &pdata); if (IS_ERR(data->ci_pdev)) { @@ -200,7 +200,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) return 0; disable_device: - ci13xxx_remove_device(data->ci_pdev); + ci_hdrc_remove_device(data->ci_pdev); err: if (data->reg_vbus) regulator_disable(data->reg_vbus); @@ -209,12 +209,12 @@ err_clk: return ret; } -static int ci13xxx_imx_remove(struct platform_device *pdev) +static int ci_hdrc_imx_remove(struct platform_device *pdev) { - struct ci13xxx_imx_data *data = platform_get_drvdata(pdev); + struct ci_hdrc_imx_data *data = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); - ci13xxx_remove_device(data->ci_pdev); + ci_hdrc_remove_device(data->ci_pdev); if (data->reg_vbus) regulator_disable(data->reg_vbus); @@ -229,26 +229,26 @@ static int ci13xxx_imx_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id ci13xxx_imx_dt_ids[] = { +static const struct of_device_id ci_hdrc_imx_dt_ids[] = { { .compatible = "fsl,imx27-usb", }, { /* sentinel */ } }; -MODULE_DEVICE_TABLE(of, ci13xxx_imx_dt_ids); +MODULE_DEVICE_TABLE(of, ci_hdrc_imx_dt_ids); -static struct platform_driver ci13xxx_imx_driver = { - .probe = ci13xxx_imx_probe, - .remove = ci13xxx_imx_remove, +static struct platform_driver ci_hdrc_imx_driver = { + .probe = ci_hdrc_imx_probe, + .remove = ci_hdrc_imx_remove, .driver = { .name = "imx_usb", .owner = THIS_MODULE, - .of_match_table = ci13xxx_imx_dt_ids, + .of_match_table = ci_hdrc_imx_dt_ids, }, }; -module_platform_driver(ci13xxx_imx_driver); +module_platform_driver(ci_hdrc_imx_driver); MODULE_ALIAS("platform:imx-usb"); MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("CI13xxx i.MX USB binding"); +MODULE_DESCRIPTION("CI HDRC i.MX USB binding"); MODULE_AUTHOR("Marek Vasut <marex@denx.de>"); MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>"); diff --git a/drivers/usb/chipidea/ci13xxx_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h index 550bfa457620..550bfa457620 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.h +++ b/drivers/usb/chipidea/ci_hdrc_imx.h diff --git a/drivers/usb/chipidea/ci13xxx_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index 7d16681fd3d2..fb657ef50a9c 100644 --- a/drivers/usb/chipidea/ci13xxx_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -17,19 +17,19 @@ #define MSM_USB_BASE (ci->hw_bank.abs) -static void ci13xxx_msm_notify_event(struct ci13xxx *ci, unsigned event) +static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event) { struct device *dev = ci->gadget.dev.parent; int val; switch (event) { - case CI13XXX_CONTROLLER_RESET_EVENT: - dev_dbg(dev, "CI13XXX_CONTROLLER_RESET_EVENT received\n"); + case CI_HDRC_CONTROLLER_RESET_EVENT: + dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n"); writel(0, USB_AHBBURST); writel(0, USB_AHBMODE); break; - case CI13XXX_CONTROLLER_STOPPED_EVENT: - dev_dbg(dev, "CI13XXX_CONTROLLER_STOPPED_EVENT received\n"); + case CI_HDRC_CONTROLLER_STOPPED_EVENT: + dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n"); /* * Put the transceiver in non-driving mode. Otherwise host * may not detect soft-disconnection. @@ -40,32 +40,32 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *ci, unsigned event) usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL); break; default: - dev_dbg(dev, "unknown ci13xxx event\n"); + dev_dbg(dev, "unknown ci_hdrc event\n"); break; } } -static struct ci13xxx_platform_data ci13xxx_msm_platdata = { - .name = "ci13xxx_msm", - .flags = CI13XXX_REGS_SHARED | - CI13XXX_REQUIRE_TRANSCEIVER | - CI13XXX_PULLUP_ON_VBUS | - CI13XXX_DISABLE_STREAMING, +static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = { + .name = "ci_hdrc_msm", + .flags = CI_HDRC_REGS_SHARED | + CI_HDRC_REQUIRE_TRANSCEIVER | + CI_HDRC_PULLUP_ON_VBUS | + CI_HDRC_DISABLE_STREAMING, - .notify_event = ci13xxx_msm_notify_event, + .notify_event = ci_hdrc_msm_notify_event, }; -static int ci13xxx_msm_probe(struct platform_device *pdev) +static int ci_hdrc_msm_probe(struct platform_device *pdev) { struct platform_device *plat_ci; - dev_dbg(&pdev->dev, "ci13xxx_msm_probe\n"); + dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n"); - plat_ci = ci13xxx_add_device(&pdev->dev, + plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource, pdev->num_resources, - &ci13xxx_msm_platdata); + &ci_hdrc_msm_platdata); if (IS_ERR(plat_ci)) { - dev_err(&pdev->dev, "ci13xxx_add_device failed!\n"); + dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); return PTR_ERR(plat_ci); } @@ -77,23 +77,24 @@ static int ci13xxx_msm_probe(struct platform_device *pdev) return 0; } -static int ci13xxx_msm_remove(struct platform_device *pdev) +static int ci_hdrc_msm_remove(struct platform_device *pdev) { struct platform_device *plat_ci = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); - ci13xxx_remove_device(plat_ci); + ci_hdrc_remove_device(plat_ci); return 0; } -static struct platform_driver ci13xxx_msm_driver = { - .probe = ci13xxx_msm_probe, - .remove = ci13xxx_msm_remove, +static struct platform_driver ci_hdrc_msm_driver = { + .probe = ci_hdrc_msm_probe, + .remove = ci_hdrc_msm_remove, .driver = { .name = "msm_hsusb", }, }; -module_platform_driver(ci13xxx_msm_driver); +module_platform_driver(ci_hdrc_msm_driver); MODULE_ALIAS("platform:msm_hsusb"); +MODULE_ALIAS("platform:ci13xxx_msm"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/usb/chipidea/ci13xxx_pci.c b/drivers/usb/chipidea/ci_hdrc_pci.c index 7cf549561b07..042320a6c6c7 100644 --- a/drivers/usb/chipidea/ci13xxx_pci.c +++ b/drivers/usb/chipidea/ci_hdrc_pci.c @@ -1,5 +1,5 @@ /* - * ci13xxx_pci.c - MIPS USB IP core family device controller + * ci_hdrc_pci.c - MIPS USB IP core family device controller * * Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved. * @@ -18,29 +18,29 @@ #include <linux/usb/chipidea.h> /* driver name */ -#define UDC_DRIVER_NAME "ci13xxx_pci" +#define UDC_DRIVER_NAME "ci_hdrc_pci" /****************************************************************************** * PCI block *****************************************************************************/ -static struct ci13xxx_platform_data pci_platdata = { +static struct ci_hdrc_platform_data pci_platdata = { .name = UDC_DRIVER_NAME, .capoffset = DEF_CAPOFFSET, }; -static struct ci13xxx_platform_data langwell_pci_platdata = { +static struct ci_hdrc_platform_data langwell_pci_platdata = { .name = UDC_DRIVER_NAME, .capoffset = 0, }; -static struct ci13xxx_platform_data penwell_pci_platdata = { +static struct ci_hdrc_platform_data penwell_pci_platdata = { .name = UDC_DRIVER_NAME, .capoffset = 0, .power_budget = 200, }; /** - * ci13xxx_pci_probe: PCI probe + * ci_hdrc_pci_probe: PCI probe * @pdev: USB device controller being probed * @id: PCI hotplug ID connecting controller to UDC framework * @@ -48,10 +48,10 @@ static struct ci13xxx_platform_data penwell_pci_platdata = { * Allocates basic PCI resources for this USB device controller, and then * invokes the udc_probe() method to start the UDC associated with it */ -static int ci13xxx_pci_probe(struct pci_dev *pdev, +static int ci_hdrc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { - struct ci13xxx_platform_data *platdata = (void *)id->driver_data; + struct ci_hdrc_platform_data *platdata = (void *)id->driver_data; struct platform_device *plat_ci; struct resource res[3]; int retval = 0, nres = 2; @@ -80,9 +80,9 @@ static int ci13xxx_pci_probe(struct pci_dev *pdev, res[1].start = pdev->irq; res[1].flags = IORESOURCE_IRQ; - plat_ci = ci13xxx_add_device(&pdev->dev, res, nres, platdata); + plat_ci = ci_hdrc_add_device(&pdev->dev, res, nres, platdata); if (IS_ERR(plat_ci)) { - dev_err(&pdev->dev, "ci13xxx_add_device failed!\n"); + dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); return PTR_ERR(plat_ci); } @@ -92,18 +92,18 @@ static int ci13xxx_pci_probe(struct pci_dev *pdev, } /** - * ci13xxx_pci_remove: PCI remove + * ci_hdrc_pci_remove: PCI remove * @pdev: USB Device Controller being removed * - * Reverses the effect of ci13xxx_pci_probe(), + * Reverses the effect of ci_hdrc_pci_probe(), * first invoking the udc_remove() and then releases * all PCI resources allocated for this USB device controller */ -static void ci13xxx_pci_remove(struct pci_dev *pdev) +static void ci_hdrc_pci_remove(struct pci_dev *pdev) { struct platform_device *plat_ci = pci_get_drvdata(pdev); - ci13xxx_remove_device(plat_ci); + ci_hdrc_remove_device(plat_ci); } /** @@ -112,7 +112,7 @@ static void ci13xxx_pci_remove(struct pci_dev *pdev) * * Check "pci.h" for details */ -static DEFINE_PCI_DEVICE_TABLE(ci13xxx_pci_id_table) = { +static DEFINE_PCI_DEVICE_TABLE(ci_hdrc_pci_id_table) = { { PCI_DEVICE(0x153F, 0x1004), .driver_data = (kernel_ulong_t)&pci_platdata, @@ -131,18 +131,19 @@ static DEFINE_PCI_DEVICE_TABLE(ci13xxx_pci_id_table) = { }, { 0, 0, 0, 0, 0, 0, 0 /* end: all zeroes */ } }; -MODULE_DEVICE_TABLE(pci, ci13xxx_pci_id_table); +MODULE_DEVICE_TABLE(pci, ci_hdrc_pci_id_table); -static struct pci_driver ci13xxx_pci_driver = { +static struct pci_driver ci_hdrc_pci_driver = { .name = UDC_DRIVER_NAME, - .id_table = ci13xxx_pci_id_table, - .probe = ci13xxx_pci_probe, - .remove = ci13xxx_pci_remove, + .id_table = ci_hdrc_pci_id_table, + .probe = ci_hdrc_pci_probe, + .remove = ci_hdrc_pci_remove, }; -module_pci_driver(ci13xxx_pci_driver); +module_pci_driver(ci_hdrc_pci_driver); MODULE_AUTHOR("MIPS - David Lopo <dlopo@chipidea.mips.com>"); MODULE_DESCRIPTION("MIPS CI13XXX USB Peripheral Controller"); MODULE_LICENSE("GPL"); MODULE_VERSION("June 2008"); +MODULE_ALIAS("platform:ci13xxx_pci"); diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 66c6c7157bb9..a5df24c578fc 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -117,7 +117,7 @@ static uintptr_t ci_regs_lpm[] = { [OP_ENDPTCTRL] = 0x0ECUL, }; -static int hw_alloc_regmap(struct ci13xxx *ci, bool is_lpm) +static int hw_alloc_regmap(struct ci_hdrc *ci, bool is_lpm) { int i; @@ -149,7 +149,7 @@ static int hw_alloc_regmap(struct ci13xxx *ci, bool is_lpm) * * This function returns an error code */ -int hw_port_test_set(struct ci13xxx *ci, u8 mode) +int hw_port_test_set(struct ci_hdrc *ci, u8 mode) { const u8 TEST_MODE_MAX = 7; @@ -165,12 +165,12 @@ int hw_port_test_set(struct ci13xxx *ci, u8 mode) * * This function returns port test mode value */ -u8 hw_port_test_get(struct ci13xxx *ci) +u8 hw_port_test_get(struct ci_hdrc *ci) { return hw_read(ci, OP_PORTSC, PORTSC_PTC) >> __ffs(PORTSC_PTC); } -static int hw_device_init(struct ci13xxx *ci, void __iomem *base) +static int hw_device_init(struct ci_hdrc *ci, void __iomem *base) { u32 reg; @@ -209,7 +209,7 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base) return 0; } -static void hw_phymode_configure(struct ci13xxx *ci) +static void hw_phymode_configure(struct ci_hdrc *ci) { u32 portsc, lpm, sts; @@ -254,7 +254,7 @@ static void hw_phymode_configure(struct ci13xxx *ci) * * This function returns an error code */ -int hw_device_reset(struct ci13xxx *ci, u32 mode) +int hw_device_reset(struct ci_hdrc *ci, u32 mode) { /* should flush & stop before reset */ hw_write(ci, OP_ENDPTFLUSH, ~0, ~0); @@ -268,9 +268,9 @@ int hw_device_reset(struct ci13xxx *ci, u32 mode) if (ci->platdata->notify_event) ci->platdata->notify_event(ci, - CI13XXX_CONTROLLER_RESET_EVENT); + CI_HDRC_CONTROLLER_RESET_EVENT); - if (ci->platdata->flags & CI13XXX_DISABLE_STREAMING) + if (ci->platdata->flags & CI_HDRC_DISABLE_STREAMING) hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); /* USBMODE should be configured step by step */ @@ -292,7 +292,7 @@ int hw_device_reset(struct ci13xxx *ci, u32 mode) * ci_otg_role - pick role based on ID pin state * @ci: the controller */ -static enum ci_role ci_otg_role(struct ci13xxx *ci) +static enum ci_role ci_otg_role(struct ci_hdrc *ci) { u32 sts = hw_read(ci, OP_OTGSC, ~0); enum ci_role role = sts & OTGSC_ID @@ -308,7 +308,7 @@ static enum ci_role ci_otg_role(struct ci13xxx *ci) */ static void ci_role_work(struct work_struct *work) { - struct ci13xxx *ci = container_of(work, struct ci13xxx, work); + struct ci_hdrc *ci = container_of(work, struct ci_hdrc, work); enum ci_role role = ci_otg_role(ci); if (role != ci->role) { @@ -324,7 +324,7 @@ static void ci_role_work(struct work_struct *work) static irqreturn_t ci_irq(int irq, void *data) { - struct ci13xxx *ci = data; + struct ci_hdrc *ci = data; irqreturn_t ret = IRQ_NONE; u32 otgsc = 0; @@ -346,9 +346,9 @@ static irqreturn_t ci_irq(int irq, void *data) static DEFINE_IDA(ci_ida); -struct platform_device *ci13xxx_add_device(struct device *dev, +struct platform_device *ci_hdrc_add_device(struct device *dev, struct resource *res, int nres, - struct ci13xxx_platform_data *platdata) + struct ci_hdrc_platform_data *platdata) { struct platform_device *pdev; int id, ret; @@ -388,20 +388,20 @@ put_id: ida_simple_remove(&ci_ida, id); return ERR_PTR(ret); } -EXPORT_SYMBOL_GPL(ci13xxx_add_device); +EXPORT_SYMBOL_GPL(ci_hdrc_add_device); -void ci13xxx_remove_device(struct platform_device *pdev) +void ci_hdrc_remove_device(struct platform_device *pdev) { int id = pdev->id; platform_device_unregister(pdev); ida_simple_remove(&ci_ida, id); } -EXPORT_SYMBOL_GPL(ci13xxx_remove_device); +EXPORT_SYMBOL_GPL(ci_hdrc_remove_device); static int ci_hdrc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct ci13xxx *ci; + struct ci_hdrc *ci; struct resource *res; void __iomem *base; int ret; @@ -526,7 +526,7 @@ rm_wq: static int ci_hdrc_remove(struct platform_device *pdev) { - struct ci13xxx *ci = platform_get_drvdata(pdev); + struct ci_hdrc *ci = platform_get_drvdata(pdev); dbg_remove_files(ci); flush_workqueue(ci->wq); diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index 33566219f3bd..96d899aee473 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c @@ -18,7 +18,7 @@ */ static int ci_device_show(struct seq_file *s, void *data) { - struct ci13xxx *ci = s->private; + struct ci_hdrc *ci = s->private; struct usb_gadget *gadget = &ci->gadget; seq_printf(s, "speed = %d\n", gadget->speed); @@ -58,7 +58,7 @@ static const struct file_operations ci_device_fops = { */ static int ci_port_test_show(struct seq_file *s, void *data) { - struct ci13xxx *ci = s->private; + struct ci_hdrc *ci = s->private; unsigned long flags; unsigned mode; @@ -78,7 +78,7 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf, size_t count, loff_t *ppos) { struct seq_file *s = file->private_data; - struct ci13xxx *ci = s->private; + struct ci_hdrc *ci = s->private; unsigned long flags; unsigned mode; char buf[32]; @@ -115,7 +115,7 @@ static const struct file_operations ci_port_test_fops = { */ static int ci_qheads_show(struct seq_file *s, void *data) { - struct ci13xxx *ci = s->private; + struct ci_hdrc *ci = s->private; unsigned long flags; unsigned i, j; @@ -126,12 +126,12 @@ static int ci_qheads_show(struct seq_file *s, void *data) spin_lock_irqsave(&ci->lock, flags); for (i = 0; i < ci->hw_ep_max/2; i++) { - struct ci13xxx_ep *hweprx = &ci->ci13xxx_ep[i]; - struct ci13xxx_ep *hweptx = - &ci->ci13xxx_ep[i + ci->hw_ep_max/2]; + struct ci_hw_ep *hweprx = &ci->ci_hw_ep[i]; + struct ci_hw_ep *hweptx = + &ci->ci_hw_ep[i + ci->hw_ep_max/2]; seq_printf(s, "EP=%02i: RX=%08X TX=%08X\n", i, (u32)hweprx->qh.dma, (u32)hweptx->qh.dma); - for (j = 0; j < (sizeof(struct ci13xxx_qh)/sizeof(u32)); j++) + for (j = 0; j < (sizeof(struct ci_hw_qh)/sizeof(u32)); j++) seq_printf(s, " %04X: %08X %08X\n", j, *((u32 *)hweprx->qh.ptr + j), *((u32 *)hweptx->qh.ptr + j)); @@ -158,12 +158,12 @@ static const struct file_operations ci_qheads_fops = { */ static int ci_requests_show(struct seq_file *s, void *data) { - struct ci13xxx *ci = s->private; + struct ci_hdrc *ci = s->private; unsigned long flags; struct list_head *ptr = NULL; - struct ci13xxx_req *req = NULL; + struct ci_hw_req *req = NULL; struct td_node *node, *tmpnode; - unsigned i, j, qsize = sizeof(struct ci13xxx_td)/sizeof(u32); + unsigned i, j, qsize = sizeof(struct ci_hw_td)/sizeof(u32); if (ci->role != CI_ROLE_GADGET) { seq_printf(s, "not in gadget mode\n"); @@ -172,8 +172,8 @@ static int ci_requests_show(struct seq_file *s, void *data) spin_lock_irqsave(&ci->lock, flags); for (i = 0; i < ci->hw_ep_max; i++) - list_for_each(ptr, &ci->ci13xxx_ep[i].qh.queue) { - req = list_entry(ptr, struct ci13xxx_req, queue); + list_for_each(ptr, &ci->ci_hw_ep[i].qh.queue) { + req = list_entry(ptr, struct ci_hw_req, queue); list_for_each_entry_safe(node, tmpnode, &req->tds, td) { seq_printf(s, "EP=%02i: TD=%08X %s\n", @@ -206,7 +206,7 @@ static const struct file_operations ci_requests_fops = { static int ci_role_show(struct seq_file *s, void *data) { - struct ci13xxx *ci = s->private; + struct ci_hdrc *ci = s->private; seq_printf(s, "%s\n", ci_role(ci)->name); @@ -217,7 +217,7 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf, size_t count, loff_t *ppos) { struct seq_file *s = file->private_data; - struct ci13xxx *ci = s->private; + struct ci_hdrc *ci = s->private; enum ci_role role; char buf[8]; int ret; @@ -259,7 +259,7 @@ static const struct file_operations ci_role_fops = { * * This function returns an error code */ -int dbg_create_files(struct ci13xxx *ci) +int dbg_create_files(struct ci_hdrc *ci) { struct dentry *dent; @@ -300,7 +300,7 @@ err: * dbg_remove_files: destroys the attribute interface * @ci: device */ -void dbg_remove_files(struct ci13xxx *ci) +void dbg_remove_files(struct ci_hdrc *ci) { debugfs_remove_recursive(ci->debugfs); } diff --git a/drivers/usb/chipidea/debug.h b/drivers/usb/chipidea/debug.h index 7ca6ca0a24a5..e16478c4a943 100644 --- a/drivers/usb/chipidea/debug.h +++ b/drivers/usb/chipidea/debug.h @@ -14,15 +14,15 @@ #define __DRIVERS_USB_CHIPIDEA_DEBUG_H #ifdef CONFIG_USB_CHIPIDEA_DEBUG -int dbg_create_files(struct ci13xxx *ci); -void dbg_remove_files(struct ci13xxx *ci); +int dbg_create_files(struct ci_hdrc *ci); +void dbg_remove_files(struct ci_hdrc *ci); #else -static inline int dbg_create_files(struct ci13xxx *ci) +static inline int dbg_create_files(struct ci_hdrc *ci) { return 0; } -static inline void dbg_remove_files(struct ci13xxx *ci) +static inline void dbg_remove_files(struct ci_hdrc *ci) { } #endif diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 8e9d31277c43..40d0fda4f66c 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -33,12 +33,12 @@ static struct hc_driver __read_mostly ci_ehci_hc_driver; -static irqreturn_t host_irq(struct ci13xxx *ci) +static irqreturn_t host_irq(struct ci_hdrc *ci) { return usb_hcd_irq(ci->irq, ci->hcd); } -static int host_start(struct ci13xxx *ci) +static int host_start(struct ci_hdrc *ci) { struct usb_hcd *hcd; struct ehci_hcd *ehci; @@ -70,13 +70,13 @@ static int host_start(struct ci13xxx *ci) else ci->hcd = hcd; - if (ci->platdata->flags & CI13XXX_DISABLE_STREAMING) + if (ci->platdata->flags & CI_HDRC_DISABLE_STREAMING) hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); return ret; } -static void host_stop(struct ci13xxx *ci) +static void host_stop(struct ci_hdrc *ci) { struct usb_hcd *hcd = ci->hcd; @@ -84,7 +84,7 @@ static void host_stop(struct ci13xxx *ci) usb_put_hcd(hcd); } -int ci_hdrc_host_init(struct ci13xxx *ci) +int ci_hdrc_host_init(struct ci_hdrc *ci) { struct ci_role_driver *rdrv; diff --git a/drivers/usb/chipidea/host.h b/drivers/usb/chipidea/host.h index 761fb1fd6d99..058875c15333 100644 --- a/drivers/usb/chipidea/host.h +++ b/drivers/usb/chipidea/host.h @@ -3,11 +3,11 @@ #ifdef CONFIG_USB_CHIPIDEA_HOST -int ci_hdrc_host_init(struct ci13xxx *ci); +int ci_hdrc_host_init(struct ci_hdrc *ci); #else -static inline int ci_hdrc_host_init(struct ci13xxx *ci) +static inline int ci_hdrc_host_init(struct ci_hdrc *ci) { return -ENXIO; } diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 0a9dcc9a82aa..e475fcda1d68 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -61,7 +61,7 @@ static inline int hw_ep_bit(int num, int dir) return num + (dir ? 16 : 0); } -static inline int ep_to_bit(struct ci13xxx *ci, int n) +static inline int ep_to_bit(struct ci_hdrc *ci, int n) { int fill = 16 - ci->hw_ep_max / 2; @@ -77,7 +77,7 @@ static inline int ep_to_bit(struct ci13xxx *ci, int n) * * This function returns an error code */ -static int hw_device_state(struct ci13xxx *ci, u32 dma) +static int hw_device_state(struct ci_hdrc *ci, u32 dma) { if (dma) { hw_w |