arm: imx: Start using struct usb_otg

Use struct usb_otg members with OTG specific functions instead
of usb_phy members.

Includes fixes from Sascha Hauer.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Heikki Krogerus 2012-02-13 13:24:14 +02:00 committed by Felipe Balbi
parent 298b083cf9
commit 76eb57ec1b
2 changed files with 28 additions and 16 deletions

View file

@ -177,7 +177,7 @@ static int devboard_isp1105_init(struct usb_phy *otg)
} }
static int devboard_isp1105_set_vbus(struct usb_phy *otg, bool on) static int devboard_isp1105_set_vbus(struct usb_otg *otg, bool on)
{ {
if (on) if (on)
gpio_set_value(USBH1_VBUSEN_B, 0); gpio_set_value(USBH1_VBUSEN_B, 0);
@ -194,18 +194,24 @@ static struct mxc_usbh_platform_data usbh1_pdata __initdata = {
static int __init devboard_usbh1_init(void) static int __init devboard_usbh1_init(void)
{ {
struct usb_phy *otg; struct usb_phy *phy;
struct platform_device *pdev; struct platform_device *pdev;
otg = kzalloc(sizeof(*otg), GFP_KERNEL); phy = kzalloc(sizeof(*phy), GFP_KERNEL);
if (!otg) if (!phy)
return -ENOMEM; return -ENOMEM;
otg->label = "ISP1105"; phy->otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
otg->init = devboard_isp1105_init; if (!phy->otg) {
otg->set_vbus = devboard_isp1105_set_vbus; kfree(phy);
return -ENOMEM;
}
usbh1_pdata.otg = otg; phy->label = "ISP1105";
phy->init = devboard_isp1105_init;
phy->otg->set_vbus = devboard_isp1105_set_vbus;
usbh1_pdata.otg = phy;
pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata); pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata);
if (IS_ERR(pdev)) if (IS_ERR(pdev))

View file

@ -291,7 +291,7 @@ static int marxbot_isp1105_init(struct usb_phy *otg)
} }
static int marxbot_isp1105_set_vbus(struct usb_phy *otg, bool on) static int marxbot_isp1105_set_vbus(struct usb_otg *otg, bool on)
{ {
if (on) if (on)
gpio_set_value(USBH1_VBUSEN_B, 0); gpio_set_value(USBH1_VBUSEN_B, 0);
@ -308,18 +308,24 @@ static struct mxc_usbh_platform_data usbh1_pdata __initdata = {
static int __init marxbot_usbh1_init(void) static int __init marxbot_usbh1_init(void)
{ {
struct usb_phy *otg; struct usb_phy *phy;
struct platform_device *pdev; struct platform_device *pdev;
otg = kzalloc(sizeof(*otg), GFP_KERNEL); phy = kzalloc(sizeof(*phy), GFP_KERNEL);
if (!otg) if (!phy)
return -ENOMEM; return -ENOMEM;
otg->label = "ISP1105"; phy->otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
otg->init = marxbot_isp1105_init; if (!phy->otg) {
otg->set_vbus = marxbot_isp1105_set_vbus; kfree(phy);
return -ENOMEM;
}
usbh1_pdata.otg = otg; phy->label = "ISP1105";
phy->init = marxbot_isp1105_init;
phy->otg->set_vbus = marxbot_isp1105_set_vbus;
usbh1_pdata.otg = phy;
pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata); pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata);
if (IS_ERR(pdev)) if (IS_ERR(pdev))