mirror of https://lore.kernel.org/lkml/
 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
Subject: [PATCHv6 18/19] usb: otg: Remove OTG specific members from usb_phy
Date: Fri, 28 Oct 2011 15:35:24 +0300	[thread overview]
Message-ID: <1319805325-24689-19-git-send-email-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <1319805325-24689-1-git-send-email-heikki.krogerus@linux.intel.com>

All the drivers are now converted to use struct usb_otg, so
removing the OTG specific members from struct usb_phy.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 include/linux/usb/otg.h |   50 ++++------------------------------------------
 1 files changed, 5 insertions(+), 45 deletions(-)

diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 34dea9b..ff47067 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -89,15 +89,11 @@ struct usb_phy {
 	const char		*label;
 	unsigned int		 flags;
 
-	u8			default_a;
 	enum usb_phy_state	state;
 	enum usb_phy_events	last_event;
 
 	struct usb_otg		*otg;
 
-	struct usb_bus		*host;
-	struct usb_gadget	*gadget;
-
 	struct usb_phy_io_ops	*io_ops;
 	void __iomem		*io_priv;
 
@@ -112,32 +108,14 @@ struct usb_phy {
 	int	(*init)(struct usb_phy *x);
 	void	(*shutdown)(struct usb_phy *x);
 
-	/* bind/unbind the host controller */
-	int	(*set_host)(struct usb_phy *x,
-				struct usb_bus *host);
-
-	/* bind/unbind the peripheral controller */
-	int	(*set_peripheral)(struct usb_phy *x,
-				struct usb_gadget *gadget);
-
 	/* effective for B devices, ignored for A-peripheral */
 	int	(*set_power)(struct usb_phy *x,
 				unsigned mA);
 
-	/* effective for A-peripheral, ignored for B devices */
-	int	(*set_vbus)(struct usb_phy *x,
-				bool enabled);
-
 	/* for non-OTG B devices: set transceiver into suspend mode */
 	int	(*set_suspend)(struct usb_phy *x,
 				int suspend);
 
-	/* for B devices only:  start session with A-Host */
-	int	(*start_srp)(struct usb_phy *x);
-
-	/* start or continue HNP role switch */
-	int	(*start_hnp)(struct usb_phy *x);
-
 };
 
 
@@ -219,7 +197,7 @@ otg_start_hnp(struct usb_phy *x)
 	if (x->otg && x->otg->start_hnp)
 		return x->otg->start_hnp(x->otg);
 
-	return x->start_hnp(x);
+	return -ENOTSUPP;
 }
 
 /* Context: can sleep */
@@ -229,7 +207,7 @@ otg_set_vbus(struct usb_phy *x, bool enabled)
 	if (x->otg && x->otg->set_vbus)
 		return x->otg->set_vbus(x->otg, enabled);
 
-	return x->set_vbus(x, enabled);
+	return -ENOTSUPP;
 }
 
 /* for HCDs */
@@ -239,7 +217,7 @@ otg_set_host(struct usb_phy *x, struct usb_bus *host)
 	if (x->otg && x->otg->set_host)
 		return x->otg->set_host(x->otg, host);
 
-	return x->set_host(x, host);
+	return -ENOTSUPP;
 }
 
 /* for usb peripheral controller drivers */
@@ -251,7 +229,7 @@ otg_set_peripheral(struct usb_phy *x, struct usb_gadget *periph)
 	if (x->otg && x->otg->set_peripheral)
 		return x->otg->set_peripheral(x->otg, periph);
 
-	return x->set_peripheral(x, periph);
+	return -ENOTSUPP;
 }
 
 static inline int
@@ -278,7 +256,7 @@ otg_start_srp(struct usb_phy *x)
 	if (x->otg && x->otg->start_srp)
 		return x->otg->start_srp(x->otg);
 
-	return x->start_srp(x);
+	return -ENOTSUPP;
 }
 
 /* notifiers */
@@ -297,22 +275,4 @@ usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
 /* for OTG controller drivers (and maybe other stuff) */
 extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
 
-/* Temporary aliases for transceiver functions */
-#define otg_set_transceiver(x) usb_set_transceiver(x)
-#define otg_get_transceiver() usb_get_transceiver()
-#define otg_put_transceiver(x) usb_put_transceiver(x)
-
-#define otg_io_read(x, a) usb_phy_io_read(x, a)
-#define otg_io_write(x, a, b) usb_phy_io_write(x, a, b)
-
-#define otg_init(x) usb_phy_init(x)
-#define otg_shutdown(x) usb_phy_shutdown(x)
-#define otg_set_power(x, a) usb_phy_set_power(x, a)
-#define otg_set_suspend(x, a) usb_phy_set_suspend(x, a)
-
-#define otg_register_notifier(x, a) usb_register_notifier(x, a)
-#define otg_unregister_notifier(x, a) usb_unregiser_notifier(x, a)
-
-#define otg_io_access_ops usb_phy_io_ops
-
 #endif /* __LINUX_USB_OTG_H */
-- 
1.7.4.1


  parent reply	other threads:[~2011-10-28 12:36 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 12:35 [PATCHv6 00/19] First round in OTG rework Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 01/19] usb: otg: Rename otg_transceiver to usb_phy Heikki Krogerus
2011-11-08  5:57   ` ABRAHAM, KISHON VIJAY
2011-11-08 12:06     ` Heikki Krogerus
2011-11-08 14:58       ` ABRAHAM, KISHON VIJAY
2011-11-08 15:04         ` Felipe Balbi
2011-11-09  8:52           ` Heikki Krogerus
2011-11-09 10:44             ` Felipe Balbi
2011-11-09  1:22     ` Peter Chen
2011-11-09  6:06       ` Felipe Balbi
2011-11-09  6:15         ` Peter Chen
2011-11-09  6:36           ` Felipe Balbi
2011-10-28 12:35 ` [PATCHv6 02/19] usb: otg: Rename usb_otg and usb_xceiv " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 03/19] usb: otg: Separate otg members from usb_phy Heikki Krogerus
2011-11-07 11:27   ` ABRAHAM, KISHON VIJAY
2011-11-08 12:58     ` Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 04/19] usb: otg: ab8500: Start using struct usb_otg Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 05/19] usb: otg: fsl: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 06/19] usb: otg: gpio_vbus: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 07/19] usb: otg: isp1301_omap: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 08/19] usb: otg: msm: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 09/19] usb: otg: langwell: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 10/19] usb: otg: nop: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 11/19] usb: otg: twl4030: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 12/19] usb: otg: twl6030: " Heikki Krogerus
2011-11-08 14:58   ` ABRAHAM, KISHON VIJAY
2011-10-28 12:35 ` [PATCHv6 13/19] usb: otg: ulpi: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 14/19] arm: imx: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 15/19] usb: musb: " Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 16/19] power_supply: Convert all users to new usb_phy Heikki Krogerus
2011-10-28 12:35 ` [PATCHv6 17/19] usb: " Heikki Krogerus
2011-10-28 12:35 ` Heikki Krogerus [this message]
2011-10-28 12:35 ` [PATCHv6 19/19] usb: otg: Convert all users to pass struct usb_otg for OTG functions Heikki Krogerus
2011-11-04 13:26 ` [PATCHv6 00/19] First round in OTG rework Heikki Krogerus
2011-11-04 13:51   ` Greg KH
2011-11-04 14:40     ` Heikki Krogerus
2011-11-04 15:35       ` Felipe Balbi
2011-11-04 15:45         ` Greg KH

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=1319805325-24689-19-git-send-email-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=balbi@ti.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome