Skip to content

Commit

Permalink
USB: Chipidea: rename struct ci13xxx variables from udc to ci
Browse files Browse the repository at this point in the history
struct ci13xxx represent the controller, which may be device or host,
so name its variables as ci.

Signed-off-by: Richard Zhao <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
Signed-off-by: Alexander Shishkin <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Richard Zhao authored and gregkh committed Jul 9, 2012
1 parent 2f0de9d commit 26c696c
Show file tree
Hide file tree
Showing 5 changed files with 407 additions and 407 deletions.
26 changes: 13 additions & 13 deletions drivers/usb/chipidea/ci.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @name: string description of the endpoint
* @qh: queue head for this endpoint
* @wedge: is the endpoint wedged
* @udc: pointer to the controller
* @ci: pointer to the controller
* @lock: pointer to controller's spinlock
* @td_pool: pointer to controller's TD pool
*/
Expand All @@ -54,7 +54,7 @@ struct ci13xxx_ep {
int wedge;

/* global resources */
struct ci13xxx *udc;
struct ci13xxx *ci;
spinlock_t *lock;
struct dma_pool *td_pool;
};
Expand Down Expand Up @@ -250,9 +250,9 @@ static inline int ffs_nr(u32 x)
*
* This function returns register contents
*/
static inline u32 hw_read(struct ci13xxx *udc, enum ci13xxx_regs reg, u32 mask)
static inline u32 hw_read(struct ci13xxx *ci, enum ci13xxx_regs reg, u32 mask)
{
return ioread32(udc->hw_bank.regmap[reg]) & mask;
return ioread32(ci->hw_bank.regmap[reg]) & mask;
}

/**
Expand All @@ -261,14 +261,14 @@ static inline u32 hw_read(struct ci13xxx *udc, enum ci13xxx_regs reg, u32 mask)
* @mask: bitfield mask
* @data: new value
*/
static inline void hw_write(struct ci13xxx *udc, enum ci13xxx_regs reg,
static inline void hw_write(struct ci13xxx *ci, enum ci13xxx_regs reg,
u32 mask, u32 data)
{
if (~mask)
data = (ioread32(udc->hw_bank.regmap[reg]) & ~mask)
data = (ioread32(ci->hw_bank.regmap[reg]) & ~mask)
| (data & mask);

iowrite32(data, udc->hw_bank.regmap[reg]);
iowrite32(data, ci->hw_bank.regmap[reg]);
}

/**
Expand All @@ -278,12 +278,12 @@ static inline void hw_write(struct ci13xxx *udc, enum ci13xxx_regs reg,
*
* This function returns register contents
*/
static inline u32 hw_test_and_clear(struct ci13xxx *udc, enum ci13xxx_regs reg,
static inline u32 hw_test_and_clear(struct ci13xxx *ci, enum ci13xxx_regs reg,
u32 mask)
{
u32 val = ioread32(udc->hw_bank.regmap[reg]) & mask;
u32 val = ioread32(ci->hw_bank.regmap[reg]) & mask;

iowrite32(val, udc->hw_bank.regmap[reg]);
iowrite32(val, ci->hw_bank.regmap[reg]);
return val;
}

Expand All @@ -295,12 +295,12 @@ static inline u32 hw_test_and_clear(struct ci13xxx *udc, enum ci13xxx_regs reg,
*
* This function returns register contents
*/
static inline u32 hw_test_and_write(struct ci13xxx *udc, enum ci13xxx_regs reg,
static inline u32 hw_test_and_write(struct ci13xxx *ci, enum ci13xxx_regs reg,
u32 mask, u32 data)
{
u32 val = hw_read(udc, reg, ~0);
u32 val = hw_read(ci, reg, ~0);

hw_write(udc, reg, mask, data);
hw_write(ci, reg, mask, data);
return (val & mask) >> ffs_nr(mask);
}

Expand Down
12 changes: 6 additions & 6 deletions drivers/usb/chipidea/ci13xxx_msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

#include "ci.h"

#define MSM_USB_BASE (udc->hw_bank.abs)
#define MSM_USB_BASE (ci->hw_bank.abs)

static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event)
static void ci13xxx_msm_notify_event(struct ci13xxx *ci, unsigned event)
{
struct device *dev = udc->gadget.dev.parent;
struct device *dev = ci->gadget.dev.parent;
int val;

switch (event) {
Expand All @@ -34,13 +34,13 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event)
* Put the transceiver in non-driving mode. Otherwise host
* may not detect soft-disconnection.
*/
val = usb_phy_io_read(udc->transceiver, ULPI_FUNC_CTRL);
val = usb_phy_io_read(ci->transceiver, ULPI_FUNC_CTRL);
val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING;
usb_phy_io_write(udc->transceiver, val, ULPI_FUNC_CTRL);
usb_phy_io_write(ci->transceiver, val, ULPI_FUNC_CTRL);
break;
default:
dev_dbg(dev, "unknown ci13xxx_udc event\n");
dev_dbg(dev, "unknown ci13xxx event\n");
break;
}
}
Expand Down
Loading

0 comments on commit 26c696c

Please sign in to comment.