#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
#define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE)
-static int devboard_isp1105_init(struct otg_transceiver *otg)
+static int devboard_isp1105_init(struct usb_phy *otg)
{
int ret = gpio_request(USBH1_MODE, "usbh1-mode");
if (ret)
}
-static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
+static int devboard_isp1105_set_vbus(struct usb_phy *otg, bool on)
{
if (on)
gpio_set_value(USBH1_VBUSEN_B, 0);
static int __init devboard_usbh1_init(void)
{
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
struct platform_device *pdev;
otg = kzalloc(sizeof(*otg), GFP_KERNEL);
#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
#define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE)
-static int marxbot_isp1105_init(struct otg_transceiver *otg)
+static int marxbot_isp1105_init(struct usb_phy *otg)
{
int ret = gpio_request(USBH1_MODE, "usbh1-mode");
if (ret)
}
-static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
+static int marxbot_isp1105_set_vbus(struct usb_phy *otg, bool on)
{
if (on)
gpio_set_value(USBH1_VBUSEN_B, 0);
static int __init marxbot_usbh1_init(void)
{
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
struct platform_device *pdev;
otg = kzalloc(sizeof(*otg), GFP_KERNEL);
struct clk *clk;
void __iomem *mmio_base;
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
unsigned int ulpi_mode;
};
return -ETIMEDOUT;
}
-static int pxa310_ulpi_read(struct otg_transceiver *otg, u32 reg)
+static int pxa310_ulpi_read(struct usb_phy *otg, u32 reg)
{
int err;
return u2d_readl(U2DOTGUCR) & U2DOTGUCR_RDATA;
}
-static int pxa310_ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg)
+static int pxa310_ulpi_write(struct usb_phy *otg, u32 val, u32 reg)
{
if (pxa310_ulpi_get_phymode() != SYNCH) {
pr_warning("%s: PHY is not in SYNCH mode!\n", __func__);
struct clk *pad_clk;
enum tegra_usb_phy_mode mode;
void *config;
- struct otg_transceiver *ulpi;
+ struct usb_phy *ulpi;
};
struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
int (*exit)(struct platform_device *pdev);
unsigned int portsc;
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
};
int mx51_initialize_usb_hw(int port, unsigned int flags);
#define __MACH_ULPI_H
#ifdef CONFIG_USB_ULPI
-struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags);
+struct usb_phy *imx_otg_ulpi_create(unsigned int flags);
#else
-static inline struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags)
+static inline struct usb_phy *imx_otg_ulpi_create(unsigned int flags)
{
return NULL;
}
return -ETIMEDOUT;
}
-static int ulpi_read(struct otg_transceiver *otg, u32 reg)
+static int ulpi_read(struct usb_phy *otg, u32 reg)
{
int ret;
void __iomem *view = otg->io_priv;
return (__raw_readl(view) >> ULPIVW_RDATA_SHIFT) & ULPIVW_RDATA_MASK;
}
-static int ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg)
+static int ulpi_write(struct usb_phy *otg, u32 val, u32 reg)
{
int ret;
void __iomem *view = otg->io_priv;
};
EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops);
-struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags)
+struct usb_phy *imx_otg_ulpi_create(unsigned int flags)
{
return otg_ulpi_create(&mxc_ulpi_access_ops, flags);
}
struct isp1704_charger {
struct device *dev;
struct power_supply psy;
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
struct notifier_block nb;
struct work_struct work;
static int polling;
#ifdef CONFIG_USB_OTG_UTILS
-static struct otg_transceiver *transceiver;
+static struct usb_phy *transceiver;
static struct notifier_block otg_nb;
#endif
struct device *dev;
struct power_supply ac;
struct power_supply usb;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
struct notifier_block otg_nb;
struct work_struct work;
int irq_chg;
struct usb_gadget_driver *driver; /* 3rd party gadget driver */
struct ci13xxx_udc_driver *udc_driver; /* device controller driver */
int vbus_active; /* is VBUS active */
- struct otg_transceiver *transceiver; /* Transceiver struct */
+ struct usb_phy *transceiver; /* Transceiver struct */
};
/******************************************************************************
struct usb_ctrlrequest local_setup_buff;
spinlock_t lock;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
unsigned softconnect:1;
unsigned vbus_active:1;
unsigned stopped:1;
spinlock_t lock; /* device lock */
struct langwell_ep *ep;
struct usb_gadget_driver *driver;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
u8 dev_addr;
u32 usb_state;
u32 resume_state;
struct work_struct vbus_work;
struct workqueue_struct *qwork;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
struct mv_usb_platform_data *pdata;
}
static int __init
-omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv)
+omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv)
{
unsigned tmp, buf;
{
int status = -ENODEV;
int hmc;
- struct otg_transceiver *xceiv = NULL;
+ struct usb_phy *xceiv = NULL;
const char *type = NULL;
struct omap_usb_config *config = pdev->dev.platform_data;
struct clk *dc_clk;
struct omap_ep ep[32];
u16 devstat;
u16 clr_halt;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
struct list_head iso;
unsigned softconnect:1;
unsigned vbus_active:1;
struct device *dev;
struct clk *clk;
struct pxa2xx_udc_mach_info *mach;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
u64 dma_mask;
struct pxa25x_ep ep [PXA_UDC_NUM_ENDPOINTS];
struct usb_gadget_driver *driver;
struct device *dev;
struct pxa2xx_udc_mach_info *mach;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
enum ep0_state ep0state;
struct udc_stats stats;
struct usb_gadget_driver *driver;
struct device *dev;
struct s3c24xx_hsudc_platdata *pd;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
struct regulator_bulk_data supplies[ARRAY_SIZE(s3c_hsudc_supply_names)];
spinlock_t lock;
void __iomem *regs;
#define MSM_USB_BASE (hcd->regs)
-static struct otg_transceiver *otg;
+static struct usb_phy *otg;
static int ehci_msm_reset(struct usb_hcd *hcd)
{
void __iomem *cap_regs;
void __iomem *op_regs;
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
struct mv_usb_platform_data *pdata;
struct tegra_usb_phy *phy;
struct clk *clk;
struct clk *emc_clk;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
int host_resumed;
int bus_suspended;
int port_resuming;
/*
* OTG controllers and transceivers need software interaction
*/
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
};
/* convert between an HCD pointer and the corresponding EHCI_HCD */
* OTG controllers and transceivers need software interaction;
* other external transceivers should be software-transparent
*/
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
void (*start_hnp)(struct ohci_hcd *ohci);
/*
musb_readb(musb->mregs, MUSB_DEVCTL));
}
-static int bfin_musb_set_power(struct otg_transceiver *x, unsigned mA)
+static int bfin_musb_set_power(struct usb_phy *x, unsigned mA)
{
return 0;
}
/*-------------------------------------------------------------------------*/
#ifndef CONFIG_BLACKFIN
-static int musb_ulpi_read(struct otg_transceiver *otg, u32 offset)
+static int musb_ulpi_read(struct usb_phy *otg, u32 offset)
{
void __iomem *addr = otg->io_priv;
int i = 0;
return musb_readb(addr, MUSB_ULPI_REG_DATA);
}
-static int musb_ulpi_write(struct otg_transceiver *otg,
+static int musb_ulpi_write(struct usb_phy *otg,
u32 offset, u32 data)
{
void __iomem *addr = otg->io_priv;
u16 int_rx;
u16 int_tx;
- struct otg_transceiver *xceiv;
+ struct usb_phy *xceiv;
u8 xceiv_event;
int nIrq;
* mode), or low power Default-B sessions, something else supplies power.
* Caller must take care of locking.
*/
-static int tusb_draw_power(struct otg_transceiver *x, unsigned mA)
+static int tusb_draw_power(struct usb_phy *x, unsigned mA)
{
struct musb *musb = the_musb;
void __iomem *tbase = musb->ctrl_base;
select USB_OTG_UTILS
help
Provides simple GPIO VBUS sensing for controllers with an
- internal transceiver via the otg_transceiver interface, and
+ internal transceiver via the usb_phy interface, and
optionally control of a D+ pullup GPIO as well as a VBUS
current limit regulator.
};
struct ab8500_usb {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct device *dev;
int irq_num_id_rise;
int irq_num_id_fall;
int rev;
};
-static inline struct ab8500_usb *xceiv_to_ab(struct otg_transceiver *x)
+static inline struct ab8500_usb *xceiv_to_ab(struct usb_phy *x)
{
return container_of(x, struct ab8500_usb, otg);
}
ab8500_usb_peri_phy_dis(ab);
}
-static int ab8500_usb_set_power(struct otg_transceiver *otg, unsigned mA)
+static int ab8500_usb_set_power(struct usb_phy *otg, unsigned mA)
{
struct ab8500_usb *ab;
* ab->vbus_draw.
*/
-static int ab8500_usb_set_suspend(struct otg_transceiver *x, int suspend)
+static int ab8500_usb_set_suspend(struct usb_phy *x, int suspend)
{
/* TODO */
return 0;
}
-static int ab8500_usb_set_peripheral(struct otg_transceiver *otg,
+static int ab8500_usb_set_peripheral(struct usb_phy *otg,
struct usb_gadget *gadget)
{
struct ab8500_usb *ab;
return 0;
}
-static int ab8500_usb_set_host(struct otg_transceiver *otg,
+static int ab8500_usb_set_host(struct usb_phy *otg,
struct usb_bus *host)
{
struct ab8500_usb *ab;
/* Call suspend/resume routines in host driver */
int fsl_otg_start_host(struct otg_fsm *fsm, int on)
{
- struct otg_transceiver *xceiv = fsm->transceiver;
+ struct usb_phy *xceiv = fsm->transceiver;
struct device *dev;
struct fsl_otg *otg_dev = container_of(xceiv, struct fsl_otg, otg);
u32 retval = 0;
*/
int fsl_otg_start_gadget(struct otg_fsm *fsm, int on)
{
- struct otg_transceiver *xceiv = fsm->transceiver;
+ struct usb_phy *xceiv = fsm->transceiver;
struct device *dev;
if (!xceiv->gadget || !xceiv->gadget->dev.parent)
* Called by initialization code of host driver. Register host controller
* to the OTG. Suspend host for OTG role detection.
*/
-static int fsl_otg_set_host(struct otg_transceiver *otg_p, struct usb_bus *host)
+static int fsl_otg_set_host(struct usb_phy *otg_p, struct usb_bus *host)
{
struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
}
/* Called by initialization code of udc. Register udc to OTG. */
-static int fsl_otg_set_peripheral(struct otg_transceiver *otg_p,
+static int fsl_otg_set_peripheral(struct usb_phy *otg_p,
struct usb_gadget *gadget)
{
struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
}
/* Set OTG port power, only for B-device */
-static int fsl_otg_set_power(struct otg_transceiver *otg_p, unsigned mA)
+static int fsl_otg_set_power(struct usb_phy *otg_p, unsigned mA)
{
if (!fsl_otg_dev)
return -ENODEV;
}
/* B-device start SRP */
-static int fsl_otg_start_srp(struct otg_transceiver *otg_p)
+static int fsl_otg_start_srp(struct usb_phy *otg_p)
{
struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
}
/* A_host suspend will call this function to start hnp */
-static int fsl_otg_start_hnp(struct otg_transceiver *otg_p)
+static int fsl_otg_start_hnp(struct usb_phy *otg_p)
{
struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
irqreturn_t fsl_otg_isr(int irq, void *dev_id)
{
struct otg_fsm *fsm = &((struct fsl_otg *)dev_id)->fsm;
- struct otg_transceiver *otg = &((struct fsl_otg *)dev_id)->otg;
+ struct usb_phy *otg = &((struct fsl_otg *)dev_id)->otg;
u32 otg_int_src, otg_sc;
otg_sc = fsl_readl(&usb_dr_regs->otgsc);
int usb_otg_start(struct platform_device *pdev)
{
struct fsl_otg *p_otg;
- struct otg_transceiver *otg_trans = otg_get_transceiver();
+ struct usb_phy *otg_trans = otg_get_transceiver();
struct otg_fsm *fsm;
int status;
struct resource *res;
}
struct fsl_otg {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct otg_fsm fsm;
struct usb_dr_mmap *dr_mem_map;
struct delayed_work otg_event;
* Needs to be loaded before the UDC driver that will use it.
*/
struct gpio_vbus_data {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct device *dev;
struct regulator *vbus_draw;
int vbus_draw_enabled;
/* OTG transceiver interface */
/* bind/unbind the peripheral controller */
-static int gpio_vbus_set_peripheral(struct otg_transceiver *otg,
+static int gpio_vbus_set_peripheral(struct usb_phy *otg,
struct usb_gadget *gadget)
{
struct gpio_vbus_data *gpio_vbus;
}
/* effective for B devices, ignored for A-peripheral */
-static int gpio_vbus_set_power(struct otg_transceiver *otg, unsigned mA)
+static int gpio_vbus_set_power(struct usb_phy *otg, unsigned mA)
{
struct gpio_vbus_data *gpio_vbus;
}
/* for non-OTG B devices: set/clear transceiver suspend mode */
-static int gpio_vbus_set_suspend(struct otg_transceiver *otg, int suspend)
+static int gpio_vbus_set_suspend(struct usb_phy *otg, int suspend)
{
struct gpio_vbus_data *gpio_vbus;
MODULE_LICENSE("GPL");
struct isp1301 {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct i2c_client *client;
void (*i2c_release)(struct device *dev);
/* add or disable the host device+driver */
static int
-isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host)
+isp1301_set_host(struct usb_phy *otg, struct usb_bus *host)
{
struct isp1301 *isp = container_of(otg, struct isp1301, otg);
}
static int
-isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget)
+isp1301_set_peripheral(struct usb_phy *otg, struct usb_gadget *gadget)
{
struct isp1301 *isp = container_of(otg, struct isp1301, otg);
#ifndef CONFIG_USB_OTG
/*-------------------------------------------------------------------------*/
static int
-isp1301_set_power(struct otg_transceiver *dev, unsigned mA)
+isp1301_set_power(struct usb_phy *dev, unsigned mA)
{
if (!the_transceiver)
return -ENODEV;
}
static int
-isp1301_start_srp(struct otg_transceiver *dev)
+isp1301_start_srp(struct usb_phy *dev)
{
struct isp1301 *isp = container_of(dev, struct isp1301, otg);
u32 otg_ctrl;
}
static int
-isp1301_start_hnp(struct otg_transceiver *dev)
+isp1301_start_hnp(struct usb_phy *dev)
{
#ifdef CONFIG_USB_OTG
struct isp1301 *isp = container_of(dev, struct isp1301, otg);
return ret < 0 ? ret : 0;
}
-static int ulpi_read(struct otg_transceiver *otg, u32 reg)
+static int ulpi_read(struct usb_phy *otg, u32 reg)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
int cnt = 0;
return ULPI_DATA_READ(readl(USB_ULPI_VIEWPORT));
}
-static int ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg)
+static int ulpi_write(struct usb_phy *otg, u32 val, u32 reg)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
int cnt = 0;
}
#define LINK_RESET_TIMEOUT_USEC (250 * 1000)
-static int msm_otg_reset(struct otg_transceiver *otg)
+static int msm_otg_reset(struct usb_phy *otg)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
struct msm_otg_platform_data *pdata = motg->pdata;
#ifdef CONFIG_PM_SLEEP
static int msm_otg_suspend(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
struct usb_bus *bus = otg->host;
struct msm_otg_platform_data *pdata = motg->pdata;
int cnt = 0;
static int msm_otg_resume(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
struct usb_bus *bus = otg->host;
int cnt = 0;
unsigned temp;
motg->cur_power = mA;
}
-static int msm_otg_set_power(struct otg_transceiver *otg, unsigned mA)
+static int msm_otg_set_power(struct usb_phy *otg, unsigned mA)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
return 0;
}
-static void msm_otg_start_host(struct otg_transceiver *otg, int on)
+static void msm_otg_start_host(struct usb_phy *otg, int on)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
struct msm_otg_platform_data *pdata = motg->pdata;
}
}
-static int msm_otg_set_host(struct otg_transceiver *otg, struct usb_bus *host)
+static int msm_otg_set_host(struct usb_phy *otg, struct usb_bus *host)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
struct usb_hcd *hcd;
return 0;
}
-static void msm_otg_start_peripheral(struct otg_transceiver *otg, int on)
+static void msm_otg_start_peripheral(struct usb_phy *otg, int on)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
struct msm_otg_platform_data *pdata = motg->pdata;
}
-static int msm_otg_set_peripheral(struct otg_transceiver *otg,
+static int msm_otg_set_peripheral(struct usb_phy *otg,
struct usb_gadget *gadget)
{
struct msm_otg *motg = container_of(otg, struct msm_otg, otg);
static bool msm_chg_check_secondary_det(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 chg_det;
bool ret = false;
static void msm_chg_enable_secondary_det(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 chg_det;
switch (motg->pdata->phy_type) {
static bool msm_chg_check_primary_det(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 chg_det;
bool ret = false;
static void msm_chg_enable_primary_det(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 chg_det;
switch (motg->pdata->phy_type) {
static bool msm_chg_check_dcd(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 line_state;
bool ret = false;
static void msm_chg_disable_dcd(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 chg_det;
switch (motg->pdata->phy_type) {
static void msm_chg_enable_dcd(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 chg_det;
switch (motg->pdata->phy_type) {
static void msm_chg_block_on(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 func_ctrl, chg_det;
/* put the controller in non-driving mode */
static void msm_chg_block_off(struct msm_otg *motg)
{
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 func_ctrl, chg_det;
switch (motg->pdata->phy_type) {
static void msm_chg_detect_work(struct work_struct *w)
{
struct msm_otg *motg = container_of(w, struct msm_otg, chg_work.work);
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
bool is_dcd, tmout, vout;
unsigned long delay;
static void msm_otg_sm_work(struct work_struct *w)
{
struct msm_otg *motg = container_of(w, struct msm_otg, sm_work);
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
switch (otg->state) {
case OTG_STATE_UNDEFINED:
static irqreturn_t msm_otg_irq(int irq, void *data)
{
struct msm_otg *motg = data;
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
u32 otgsc = 0;
if (atomic_read(&motg->in_lpm)) {
static int msm_otg_mode_show(struct seq_file *s, void *unused)
{
struct msm_otg *motg = s->private;
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
switch (otg->state) {
case OTG_STATE_A_HOST:
struct seq_file *s = file->private_data;
struct msm_otg *motg = s->private;
char buf[16];
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
int status = count;
enum usb_mode_type req_mode;
int ret = 0;
struct resource *res;
struct msm_otg *motg;
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
dev_info(&pdev->dev, "msm_otg probe\n");
if (!pdev->dev.platform_data) {
static int __devexit msm_otg_remove(struct platform_device *pdev)
{
struct msm_otg *motg = platform_get_drvdata(pdev);
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
int cnt = 0;
if (otg->host || otg->gadget)
static int msm_otg_runtime_idle(struct device *dev)
{
struct msm_otg *motg = dev_get_drvdata(dev);
- struct otg_transceiver *otg = &motg->otg;
+ struct usb_phy *otg = &motg->otg;
dev_dbg(dev, "OTG runtime idle\n");
"a_vbus_err"
};
-static int mv_otg_set_vbus(struct otg_transceiver *otg, bool on)
+static int mv_otg_set_vbus(struct usb_phy *otg, bool on)
{
struct mv_otg *mvotg = container_of(otg, struct mv_otg, otg);
if (mvotg->pdata->set_vbus == NULL)
return mvotg->pdata->set_vbus(on);
}
-static int mv_otg_set_host(struct otg_transceiver *otg,
+static int mv_otg_set_host(struct usb_phy *otg,
struct usb_bus *host)
{
otg->host = host;
return 0;
}
-static int mv_otg_set_peripheral(struct otg_transceiver *otg,
+static int mv_otg_set_peripheral(struct usb_phy *otg,
struct usb_gadget *gadget)
{
otg->gadget = gadget;
static void mv_otg_start_host(struct mv_otg *mvotg, int on)
{
#ifdef CONFIG_USB
- struct otg_transceiver *otg = &mvotg->otg;
+ struct usb_phy *otg = &mvotg->otg;
struct usb_hcd *hcd;
if (!otg->host)
static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on)
{
- struct otg_transceiver *otg = &mvotg->otg;
+ struct usb_phy *otg = &mvotg->otg;
if (!otg->gadget)
return;
static void mv_otg_update_state(struct mv_otg *mvotg)
{
struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl;
- struct otg_transceiver *otg = &mvotg->otg;
+ struct usb_phy *otg = &mvotg->otg;
int old_state = otg->state;
switch (old_state) {
static void mv_otg_work(struct work_struct *work)
{
struct mv_otg *mvotg;
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
int old_state;
mvotg = container_of((struct delayed_work *)work, struct mv_otg, work);
};
struct mv_otg {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct mv_otg_ctrl otg_ctrl;
/* base address */
#include <linux/slab.h>
struct nop_usb_xceiv {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct device *dev;
};
}
EXPORT_SYMBOL(usb_nop_xceiv_unregister);
-static inline struct nop_usb_xceiv *xceiv_to_nop(struct otg_transceiver *x)
+static inline struct nop_usb_xceiv *xceiv_to_nop(struct usb_phy *x)
{
return container_of(x, struct nop_usb_xceiv, otg);
}
-static int nop_set_suspend(struct otg_transceiver *x, int suspend)
+static int nop_set_suspend(struct usb_phy *x, int suspend)
{
return 0;
}
-static int nop_set_peripheral(struct otg_transceiver *x,
+static int nop_set_peripheral(struct usb_phy *x,
struct usb_gadget *gadget)
{
struct nop_usb_xceiv *nop;
return 0;
}
-static int nop_set_host(struct otg_transceiver *x, struct usb_bus *host)
+static int nop_set_host(struct usb_phy *x, struct usb_bus *host)
{
struct nop_usb_xceiv *nop;
#include <linux/usb/otg.h>
-static struct otg_transceiver *xceiv;
+static struct usb_phy *xceiv;
/**
* otg_get_transceiver - find the (single) OTG transceiver
*
* For use by USB host and peripheral drivers.
*/
-struct otg_transceiver *otg_get_transceiver(void)
+struct usb_phy *otg_get_transceiver(void)
{
if (xceiv)
get_device(xceiv->dev);
*
* For use by USB host and peripheral drivers.
*/
-void otg_put_transceiver(struct otg_transceiver *x)
+void otg_put_transceiver(struct usb_phy *x)
{
if (x)
put_device(x->dev);
* coordinate the activities of drivers for host and peripheral
* controllers, and in some cases for VBUS current regulation.
*/
-int otg_set_transceiver(struct otg_transceiver *x)
+int otg_set_transceiver(struct usb_phy *x)
{
if (xceiv && x)
return -EBUSY;
int loc_sof;
struct otg_fsm_ops *ops;
- struct otg_transceiver *transceiver;
+ struct usb_phy *transceiver;
/* Current usb protocol used: 0:undefine; 1:host; 2:client */
int protocol;
#define GPIO_USB_4PIN_ULPI_2430C (3 << 0)
struct twl4030_usb {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct device *dev;
/* TWL4030 internal USB regulator supplies */
sysfs_notify(&twl->dev->kobj, NULL, "vbus");
}
-static int twl4030_set_suspend(struct otg_transceiver *x, int suspend)
+static int twl4030_set_suspend(struct usb_phy *x, int suspend)
{
struct twl4030_usb *twl = xceiv_to_twl(x);
return 0;
}
-static int twl4030_set_peripheral(struct otg_transceiver *x,
+static int twl4030_set_peripheral(struct usb_phy *x,
struct usb_gadget *gadget)
{
struct twl4030_usb *twl;
return 0;
}
-static int twl4030_set_host(struct otg_transceiver *x, struct usb_bus *host)
+static int twl4030_set_host(struct usb_phy *x, struct usb_bus *host)
{
struct twl4030_usb *twl;
#define VBUS_DET BIT(2)
struct twl6030_usb {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct device *dev;
/* for vbus reporting with irqs disabled */
return ret;
}
-static int twl6030_phy_init(struct otg_transceiver *x)
+static int twl6030_phy_init(struct usb_phy *x)
{
struct twl6030_usb *twl;
struct device *dev;
return 0;
}
-static void twl6030_phy_shutdown(struct otg_transceiver *x)
+static void twl6030_phy_shutdown(struct usb_phy *x)
{
struct twl6030_usb *twl;
struct device *dev;
pdata->phy_power(twl->dev, 0, 0);
}
-static int twl6030_phy_suspend(struct otg_transceiver *x, int suspend)
+static int twl6030_phy_suspend(struct usb_phy *x, int suspend)
{
struct twl6030_usb *twl = xceiv_to_twl(x);
struct device *dev = twl->dev;
return 0;
}
-static int twl6030_start_srp(struct otg_transceiver *x)
+static int twl6030_start_srp(struct usb_phy *x)
{
struct twl6030_usb *twl = xceiv_to_twl(x);
return IRQ_HANDLED;
}
-static int twl6030_set_peripheral(struct otg_transceiver *x,
+static int twl6030_set_peripheral(struct usb_phy *x,
struct usb_gadget *gadget)
{
struct twl6030_usb *twl;
return 0;
}
-static int twl6030_enable_irq(struct otg_transceiver *x)
+static int twl6030_enable_irq(struct usb_phy *x)
{
struct twl6030_usb *twl = xceiv_to_twl(x);
CHARGERUSB_CTRL1);
}
-static int twl6030_set_vbus(struct otg_transceiver *x, bool enabled)
+static int twl6030_set_vbus(struct usb_phy *x, bool enabled)
{
struct twl6030_usb *twl = xceiv_to_twl(x);
return 0;
}
-static int twl6030_set_host(struct otg_transceiver *x, struct usb_bus *host)
+static int twl6030_set_host(struct usb_phy *x, struct usb_bus *host)
{
struct twl6030_usb *twl;
ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB331x"),
};
-static int ulpi_set_otg_flags(struct otg_transceiver *otg)
+static int ulpi_set_otg_flags(struct usb_phy *otg)
{
unsigned int flags = ULPI_OTG_CTRL_DP_PULLDOWN |
ULPI_OTG_CTRL_DM_PULLDOWN;
return otg_io_write(otg, flags, ULPI_OTG_CTRL);
}
-static int ulpi_set_fc_flags(struct otg_transceiver *otg)
+static int ulpi_set_fc_flags(struct usb_phy *otg)
{
unsigned int flags = 0;
return otg_io_write(otg, flags, ULPI_FUNC_CTRL);
}
-static int ulpi_set_ic_flags(struct otg_transceiver *otg)
+static int ulpi_set_ic_flags(struct usb_phy *otg)
{
unsigned int flags = 0;
return otg_io_write(otg, flags, ULPI_IFC_CTRL);
}
-static int ulpi_set_flags(struct otg_transceiver *otg)
+static int ulpi_set_flags(struct usb_phy *otg)
{
int ret;
return ulpi_set_fc_flags(otg);
}
-static int ulpi_check_integrity(struct otg_transceiver *otg)
+static int ulpi_check_integrity(struct usb_phy *otg)
{
int ret, i;
unsigned int val = 0x55;
return 0;
}
-static int ulpi_init(struct otg_transceiver *otg)
+static int ulpi_init(struct usb_phy *otg)
{
int i, vid, pid, ret;
u32 ulpi_id = 0;
return ulpi_set_flags(otg);
}
-static int ulpi_set_host(struct otg_transceiver *otg, struct usb_bus *host)
+static int ulpi_set_host(struct usb_phy *otg, struct usb_bus *host)
{
unsigned int flags = otg_io_read(otg, ULPI_IFC_CTRL);
return otg_io_write(otg, flags, ULPI_IFC_CTRL);
}
-static int ulpi_set_vbus(struct otg_transceiver *otg, bool on)
+static int ulpi_set_vbus(struct usb_phy *otg, bool on)
{
unsigned int flags = otg_io_read(otg, ULPI_OTG_CTRL);
return otg_io_write(otg, flags, ULPI_OTG_CTRL);
}
-struct otg_transceiver *
+struct usb_phy *
otg_ulpi_create(struct otg_io_access_ops *ops,
unsigned int flags)
{
- struct otg_transceiver *otg;
+ struct usb_phy *otg;
otg = kzalloc(sizeof(*otg), GFP_KERNEL);
if (!otg)
return -ETIMEDOUT;
}
-static int ulpi_viewport_read(struct otg_transceiver *otg, u32 reg)
+static int ulpi_viewport_read(struct usb_phy *otg, u32 reg)
{
int ret;
void __iomem *view = otg->io_priv;
return ULPI_VIEW_DATA_READ(readl(view));
}
-static int ulpi_viewport_write(struct otg_transceiver *otg, u32 val, u32 reg)
+static int ulpi_viewport_write(struct usb_phy *otg, u32 val, u32 reg)
{
int ret;
void __iomem *view = otg->io_priv;
/*
* the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact
* with device and host drivers to implement the USB OTG related feature. More
- * function members are added based on otg_transceiver data structure for this
+ * function members are added based on usb_phy data structure for this
* purpose.
*/
struct intel_mid_otg_xceiv {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct otg_hsm hsm;
/* base address */
};
static inline
-struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct otg_transceiver *otg)
+struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct usb_phy *otg)
{
return container_of(otg, struct intel_mid_otg_xceiv, otg);
}
* detection process.
*/
struct msm_otg {
- struct otg_transceiver otg;
+ struct usb_phy otg;
struct msm_otg_platform_data *pdata;
int irq;
struct clk *clk;
USB_EVENT_ENUMERATED, /* gadget driver enumerated */
};
-struct otg_transceiver;
+struct usb_phy;
/* for transceivers connected thru an ULPI interface, the user must
* provide access ops
*/
struct otg_io_access_ops {
- int (*read)(struct otg_transceiver *otg, u32 reg);
- int (*write)(struct otg_transceiver *otg, u32 val, u32 reg);
+ int (*read)(struct usb_phy *x, u32 reg);
+ int (*write)(struct usb_phy *x, u32 val, u32 reg);
};
/*
* moment, using the transceiver, ID signal, HNP and sometimes static
* configuration information (including "board isn't wired for otg").
*/
-struct otg_transceiver {
+struct usb_phy {
struct device *dev;
const char *label;
unsigned int flags;
u16 port_change;
/* initialize/shutdown the OTG controller */
- int (*init)(struct otg_transceiver *otg);
- void (*shutdown)(struct otg_transceiver *otg);
+ int (*init)(struct usb_phy *x);
+ void (*shutdown)(struct usb_phy *x);
/* bind/unbind the host controller */
- int (*set_host)(struct otg_transceiver *otg,
+ int (*set_host)(struct usb_phy *x,
struct usb_bus *host);
/* bind/unbind the peripheral controller */
- int (*set_peripheral)(struct otg_transceiver *otg,
+ int (*set_peripheral)(struct usb_phy *x,
struct usb_gadget *gadget);
/* effective for B devices, ignored for A-peripheral */
- int (*set_power)(struct otg_transceiver *otg,
+ int (*set_power)(struct usb_phy *x,
unsigned mA);
/* effective for A-peripheral, ignored for B devices */
- int (*set_vbus)(struct otg_transceiver *otg,
+ int (*set_vbus)(struct usb_phy *x,
bool enabled);
/* for non-OTG B devices: set transceiver into suspend mode */
- int (*set_suspend)(struct otg_transceiver *otg,
+ int (*set_suspend)(struct usb_phy *x,
int suspend);
/* for B devices only: start session with A-Host */
- int (*start_srp)(struct otg_transceiver *otg);
+ int (*start_srp)(struct usb_phy *x);
/* start or continue HNP role switch */
- int (*start_hnp)(struct otg_transceiver *otg);
+ int (*start_hnp)(struct usb_phy *x);
};
/* for board-specific init logic */
-extern int otg_set_transceiver(struct otg_transceiver *);
+extern int otg_set_transceiver(struct usb_phy *);
#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
/* sometimes transceivers are accessed only through e.g. ULPI */
#endif
/* helpers for direct access thru low-level io interface */
-static inline int otg_io_read(struct otg_transceiver *otg, u32 reg)
+static inline int otg_io_read(struct usb_phy *x, u32 reg)
{
- if (otg->io_ops && otg->io_ops->read)
- return otg->io_ops->read(otg, reg);
+ if (x->io_ops && x->io_ops->read)
+ return x->io_ops->read(x, reg);
return -EINVAL;
}
-static inline int otg_io_write(struct otg_transceiver *otg, u32 val, u32 reg)
+static inline int otg_io_write(struct usb_phy *x, u32 val, u32 reg)
{
- if (otg->io_ops && otg->io_ops->write)
- return otg->io_ops->write(otg, val, reg);
+ if (x->io_ops && x->io_ops->write)
+ return x->io_ops->write(x, val, reg);
return -EINVAL;
}
static inline int
-otg_init(struct otg_transceiver *otg)
+otg_init(struct usb_phy *x)
{
- if (otg->init)
- return otg->init(otg);
+ if (x->init)
+ return x->init(x);
return 0;
}
static inline void
-otg_shutdown(struct otg_transceiver *otg)
+otg_shutdown(struct usb_phy *x)
{
- if (otg->shutdown)
- otg->shutdown(otg);
+ if (x->shutdown)
+ x->shutdown(x);
}
/* for usb host and peripheral controller drivers */
#ifdef CONFIG_USB_OTG_UTILS
-extern struct otg_transceiver *otg_get_transceiver(void);
-extern void otg_put_transceiver(struct otg_transceiver *);
+extern struct usb_phy *otg_get_transceiver(void);
+extern void otg_put_transceiver(struct usb_phy *);
extern const char *otg_state_string(enum usb_otg_state state);
#else
-static inline struct otg_transceiver *otg_get_transceiver(void)
+static inline struct usb_phy *otg_get_transceiver(void)
{
return NULL;
}
-static inline void otg_put_transceiver(struct otg_transceiver *x)
+static inline void otg_put_transceiver(struct usb_phy *x)
{
}
/* Context: can sleep */
static inline int
-otg_start_hnp(struct otg_transceiver *otg)
+otg_start_hnp(struct usb_phy *x)
{
- return otg->start_hnp(otg);
+ return x->start_hnp(x);
}
/* Context: can sleep */
static inline int
-otg_set_vbus(struct otg_transceiver *otg, bool enabled)
+otg_set_vbus(struct usb_phy *x, bool enabled)
{
- return otg->set_vbus(otg, enabled);
+ return x->set_vbus(x, enabled);
}
/* for HCDs */
static inline int
-otg_set_host(struct otg_transceiver *otg, struct usb_bus *host)
+otg_set_host(struct usb_phy *x, struct usb_bus *host)
{
- return otg->set_host(otg, host);
+ return x->set_host(x, host);
}
/* for usb peripheral controller drivers */
/* Context: can sleep */
static inline int
-otg_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *periph)
+otg_set_peripheral(struct usb_phy *x, struct usb_gadget *periph)
{
- return otg->set_peripheral(otg, periph);
+ return x->set_peripheral(x, periph);
}
static inline int
-otg_set_power(struct otg_transceiver *otg, unsigned mA)
+otg_set_power(struct usb_phy *x, unsigned mA)
{
- return otg->set_power(otg, mA);
+ return x->set_power(x, mA);
}
/* Context: can sleep */
static inline int
-otg_set_suspend(struct otg_transceiver *otg, int suspend)
+otg_set_suspend(struct usb_phy *x, int suspend)
{
- if (otg->set_suspend != NULL)
- return otg->set_suspend(otg, suspend);
+ if (x->set_suspend != NULL)
+ return x->set_suspend(x, suspend);
else
return 0;
}
static inline int
-otg_start_srp(struct otg_transceiver *otg)
+otg_start_srp(struct usb_phy *x)
{
- return otg->start_srp(otg);
+ return x->start_srp(x);
}
/* notifiers */
static inline int
-otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
+otg_register_notifier(struct usb_phy *x, struct notifier_block *nb)
{
- return atomic_notifier_chain_register(&otg->notifier, nb);
+ return atomic_notifier_chain_register(&x->notifier, nb);
}
static inline void
-otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
+otg_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
{
- atomic_notifier_chain_unregister(&otg->notifier, nb);
+ atomic_notifier_chain_unregister(&x->notifier, nb);
}
/* for OTG controller drivers (and maybe other stuff) */
/*-------------------------------------------------------------------------*/
-struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops,
+struct usb_phy *otg_ulpi_create(struct otg_io_access_ops *ops,
unsigned int flags);
#ifdef CONFIG_USB_ULPI_VIEWPORT