Commit 8e22978c authored by Alexander Shishkin's avatar Alexander Shishkin Committed by Greg Kroah-Hartman
Browse files

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: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 38dcdb3a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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
+25 −25
Original line number Diff line number Diff line
@@ -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 */
+23 −23
Original line number Diff line number Diff line
@@ -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>");
+25 −24
Original line number Diff line number Diff line
@@ -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");
Loading