diff options
author | Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> | 2016-09-26 13:14:19 +0200 |
---|---|---|
committer | Peter Chen <peter.chen@nxp.com> | 2016-11-14 10:03:40 +0800 |
commit | d13631bb15cebe8eba50777cb96e2223e5485c23 (patch) | |
tree | 79ad2f4a9dd82b7dd7affca5ae6a97adc6e6dca2 /drivers/usb/chipidea/ci_hdrc_imx.c | |
parent | 34445fb4333f47674e988b98a587195ffa84beae (diff) | |
download | linux-d13631bb15cebe8eba50777cb96e2223e5485c23.tar.gz |
usb: chipidea: imx: configure imx for ULPI phy
In order to use ULPI phy with usb host 2 and 3, we need to configure
controller register to enable ULPI features.
Each USB controller have different behaviour, so in order to avoid to have
several "swicth(data->index)" and lock/unlock, we prefer to get the index
switch and then test for features if they exist for this index.
This patch also remove useless test of reg and val. Those two values cannot
be NULL.
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/ci_hdrc_imx.c')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 099179457f60..5f4a8157fad8 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -18,6 +18,7 @@ #include <linux/pm_runtime.h> #include <linux/dma-mapping.h> #include <linux/usb/chipidea.h> +#include <linux/usb/of.h> #include <linux/clk.h> #include "ci.h" @@ -146,6 +147,9 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) if (of_find_property(np, "external-vbus-divider", NULL)) data->evdo = 1; + if (of_usb_get_phy_mode(np) == USBPHY_INTERFACE_MODE_ULPI) + data->ulpi = 1; + return data; } |