All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Felipe Balbi <balbi@ti.com>, Greg KH <gregkh@suse.de>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Chen <peter.chen@freescale.com>,
	Lin Tony-B19295 <B19295@freescale.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Sascha Hauer <s.hauer@pengutronix.de>
Subject: [PATCHv5 14/19] arm: imx: Start using struct usb_otg
Date: Mon, 26 Sep 2011 14:21:27 +0300	[thread overview]
Message-ID: <1317036092-3000-15-git-send-email-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <1317036092-3000-1-git-send-email-heikki.krogerus@linux.intel.com>

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>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/mx31moboard-devboard.c |   22 ++++++++++++++--------
 arch/arm/mach-imx/mx31moboard-marxbot.c  |   22 ++++++++++++++--------
 2 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index 9cd4a97..cc285e5 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -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)
 		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)
 {
-	struct usb_phy *otg;
+	struct usb_phy *phy;
 	struct platform_device *pdev;
 
-	otg = kzalloc(sizeof(*otg), GFP_KERNEL);
-	if (!otg)
+	phy = kzalloc(sizeof(*phy), GFP_KERNEL);
+	if (!phy)
 		return -ENOMEM;
 
-	otg->label	= "ISP1105";
-	otg->init	= devboard_isp1105_init;
-	otg->set_vbus	= devboard_isp1105_set_vbus;
+	phy->otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
+	if (!phy->otg) {
+		kfree(phy);
+		return -ENOMEM;
+	}
+
+	phy->label	= "ISP1105";
+	phy->init	= devboard_isp1105_init;
+	phy->otg->set_vbus	= devboard_isp1105_set_vbus;
 
-	usbh1_pdata.otg = otg;
+	usbh1_pdata.otg = phy;
 
 	pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata);
 	if (IS_ERR(pdev))
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index 2be769b..135c90e 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -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)
 		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)
 {
-	struct usb_phy *otg;
+	struct usb_phy *phy;
 	struct platform_device *pdev;
 
-	otg = kzalloc(sizeof(*otg), GFP_KERNEL);
-	if (!otg)
+	phy = kzalloc(sizeof(*phy), GFP_KERNEL);
+	if (!phy)
 		return -ENOMEM;
 
-	otg->label	= "ISP1105";
-	otg->init	= marxbot_isp1105_init;
-	otg->set_vbus	= marxbot_isp1105_set_vbus;
+	phy->otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
+	if (!phy->otg) {
+		kfree(phy);
+		return -ENOMEM;
+	}
+
+	phy->label	= "ISP1105";
+	phy->init	= marxbot_isp1105_init;
+	phy->otg->set_vbus	= marxbot_isp1105_set_vbus;
 
-	usbh1_pdata.otg = otg;
+	usbh1_pdata.otg = phy;
 
 	pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata);
 	if (IS_ERR(pdev))
-- 
1.7.4.1


  parent reply	other threads:[~2011-09-26 11:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 11:21 [PATCHv5 00/19] First round in OTG rework Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 01/19] usb: otg: Rename otg_transceiver to usb_phy Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 02/19] usb: otg: Rename usb_otg and usb_xceiv " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 03/19] usb: otg: Separate otg members from usb_phy Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 04/19] usb: otg: ab8500: Start using struct usb_otg Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 05/19] usb: otg: fsl: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 06/19] usb: otg: gpio_vbus: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 07/19] usb: otg: isp1301_omap: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 08/19] usb: otg: msm: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 09/19] usb: otg: langwell: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 10/19] usb: otg: nop: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 11/19] usb: otg: twl4030: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 12/19] usb: otg: twl6030: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 13/19] usb: otg: ulpi: " Heikki Krogerus
2011-10-24 12:28   ` Igor Grinberg
2011-09-26 11:21 ` Heikki Krogerus [this message]
2011-10-03 13:04   ` [PATCHv5 14/19] arm: imx: " Heikki Krogerus
2011-10-03 13:29     ` Fabio Estevam
2011-10-04 13:51       ` Philippe Rétornaz
2011-10-04 14:38         ` Heikki Krogerus
2011-10-04 17:05       ` Philippe Rétornaz
2011-10-05  9:51         ` Heikki Krogerus
2011-10-07 12:52           ` Sascha Hauer
2011-09-26 11:21 ` [PATCHv5 15/19] usb: musb: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 16/19] power_supply: Convert all users to new usb_phy Heikki Krogerus
     [not found]   ` <20111003131055.GC2487@xps8300>
2011-10-10 19:08     ` Anton Vorontsov
2011-10-24 10:14       ` Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 17/19] usb: " Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 18/19] usb: otg: Remove OTG specific members from usb_phy Heikki Krogerus
2011-09-26 11:21 ` [PATCHv5 19/19] usb: otg: Convert all users to pass struct usb_otg for OTG functions Heikki Krogerus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317036092-3000-15-git-send-email-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=B19295@freescale.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=balbi@ti.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@freescale.com \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.