diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-08-14 12:44:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-14 12:37:20 -0700 |
commit | 05986ba9b025ae7742744e1108bd59b1f6e8f443 (patch) | |
tree | 4849fd683a155e70f98fea64dfe7d6ae9b361601 /drivers/usb/chipidea/ci_hdrc_imx.h | |
parent | 4a64783b66bbeed06a1f10ab56a1dd401dd5bfba (diff) | |
download | talos-op-linux-05986ba9b025ae7742744e1108bd59b1f6e8f443.tar.gz talos-op-linux-05986ba9b025ae7742744e1108bd59b1f6e8f443.zip |
USB: chipidea: i.MX: simplify usbmisc
The chipidea i.MX driver is split into two drivers. The ci_hdrc_imx driver
handles the chipidea cores and the usbmisc_imx driver handles the noncore
registers common to all chipidea cores (but SoC specific). Current flow is:
- usbmisc sets an ops pointer in the ci_hdrc_imx driver during probe
- ci_hdrc_imx checks if the pointer is valid during probe, if yes calls
the functions in the ops pointer.
- usbmisc_imx calls back into the ci_hdrc_imx driver to get additional
data
This is overly complicated and has problems if the drivers are compiled
as modules. In this case the usbmisc_imx driver can be unloaded even if
the ci_hdrc_imx driver still needs usbmisc functionality.
This patch changes this by letting the ci_hdrc_imx driver calling functions
from the usbmisc_imx driver. This way the symbol resolving during module
load makes sure the ci_hdrc_imx driver depends on the usbmisc_imx driver.
Also instead of letting the usbmisc_imx driver call back into the ci_hdrc_imx
driver, pass the needed data in the first place.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/ci_hdrc_imx.h')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h index 550bfa457620..c7271590dd0a 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.h +++ b/drivers/usb/chipidea/ci_hdrc_imx.h @@ -9,23 +9,12 @@ * http://www.gnu.org/copyleft/gpl.html */ -/* Used to set SoC specific callbacks */ -struct usbmisc_ops { - /* It's called once when probe a usb device */ - int (*init)(struct device *dev); - /* It's called once after adding a usb device */ - int (*post)(struct device *dev); -}; - -struct usbmisc_usb_device { - struct device *dev; /* usb controller device */ +struct imx_usbmisc_data { int index; unsigned int disable_oc:1; /* over current detect disabled */ unsigned int evdo:1; /* set external vbus divider option */ }; -int usbmisc_set_ops(const struct usbmisc_ops *ops); -void usbmisc_unset_ops(const struct usbmisc_ops *ops); -int -usbmisc_get_init_data(struct device *dev, struct usbmisc_usb_device *usbdev); +int imx_usbmisc_init(struct imx_usbmisc_data *); +int imx_usbmisc_init_post(struct imx_usbmisc_data *); |