phy: amlogic: phy-meson-gxl-usb2: default to host mode
The USB2 PHY can switch between PHY_MODE_USB_HOST and PHY_MODE_USB_DEVICE. However, it cannot do it on it's own since it requires re-routing of the corresponding USB pins from dwc3 (which is used for host-mode) to dwc2 (which is used for device-mode). Thus we don't need to auto-detect the mode based on the USB controller, which simplifies the driver code. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
parent
bc4a0241d4
commit
05818862bc
|
@ -18,7 +18,6 @@ config PHY_MESON_GXL_USB2
|
||||||
default ARCH_MESON
|
default ARCH_MESON
|
||||||
depends on OF && (ARCH_MESON || COMPILE_TEST)
|
depends on OF && (ARCH_MESON || COMPILE_TEST)
|
||||||
depends on USB_SUPPORT
|
depends on USB_SUPPORT
|
||||||
select USB_COMMON
|
|
||||||
select GENERIC_PHY
|
select GENERIC_PHY
|
||||||
select REGMAP_MMIO
|
select REGMAP_MMIO
|
||||||
help
|
help
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include <linux/reset.h>
|
#include <linux/reset.h>
|
||||||
#include <linux/phy/phy.h>
|
#include <linux/phy/phy.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/usb/of.h>
|
|
||||||
|
|
||||||
/* bits [31:27] are read-only */
|
/* bits [31:27] are read-only */
|
||||||
#define U2P_R0 0x0
|
#define U2P_R0 0x0
|
||||||
|
@ -254,18 +253,8 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base))
|
||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
|
||||||
switch (of_usb_get_dr_mode_by_phy(dev->of_node, -1)) {
|
/* start in host mode */
|
||||||
case USB_DR_MODE_PERIPHERAL:
|
|
||||||
priv->mode = PHY_MODE_USB_DEVICE;
|
|
||||||
break;
|
|
||||||
case USB_DR_MODE_OTG:
|
|
||||||
priv->mode = PHY_MODE_USB_OTG;
|
|
||||||
break;
|
|
||||||
case USB_DR_MODE_HOST:
|
|
||||||
default:
|
|
||||||
priv->mode = PHY_MODE_USB_HOST;
|
priv->mode = PHY_MODE_USB_HOST;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->regmap = devm_regmap_init_mmio(dev, base,
|
priv->regmap = devm_regmap_init_mmio(dev, base,
|
||||||
&phy_meson_gxl_usb2_regmap_conf);
|
&phy_meson_gxl_usb2_regmap_conf);
|
||||||
|
|
Loading…
Reference in New Issue