]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: chipidea: i.MX: simplify usbmisc
authorSascha Hauer <s.hauer@pengutronix.de>
Mon, 12 Aug 2013 10:29:42 +0000 (12:29 +0200)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:51 +0000 (09:54 +0800)
commitcacfd35474c5c0984dd2eecd1eda265944f8d233
tree114c3bcd594625306a8e70cd8df4156da5442e25
parent12480f999a7876f4fc4e3b651f538084480675c6
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>
drivers/usb/chipidea/ci_hdrc_imx.c
drivers/usb/chipidea/ci_hdrc_imx.h
drivers/usb/chipidea/usbmisc_imx.c