Hello Ranjith,
If USB OTG1 works in device mode, USB_OTG1_ID should be pulled up to High(here is 3.3V) via a 4.7K/10K resistor. USB_OTG1_VBUS power comes from USB_VBUS on mircro USB Connector, which means USB OTG1 VBUS is supplied by external 5V(coming from PC USB when it is connected to PC USB HOST).
If USB OTG1 works in Host mode, USB_OTG1_ID pin should be pulled down to LOW via a resistor(for example, 2.2k). At this time, USB OTG1 PWR should output HIGH to enable USB OTG1 power to supply 5V to USB OTG1 VUBS and USB VBUS on USB HOST Connector(USB TYPE-A-F).
OK, try the following code:
......
regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;
......
reg_gpio_dvfs: regulator-gpio {
compatible = "regulator-gpio";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dvfs>;
regulator-min-microvolt = <1300000>;
regulator-max-microvolt = <1400000>;
regulator-name = "gpio_dvfs";
regulator-type = "voltage";
gpios = <&gpio5 3 GPIO_ACTIVE_HIGH>;
states = <1300000 0x1 1400000 0x0>;
};
/* add the node to regulator. */
reg_usb_otg1_vbus: regulator@2 {
compatible = "regulator-fixed";
reg = <2>;
regulator-name = "usb_otg_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio1 4 0>;
enable-active-high;
};
... ...
}
pinctrl_hog_1: hoggrp-1 {
fsl,pins = <
MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x17059
>;
};
pinctrl_usb_otg1_id: usbotg1idgrp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO00__ANATOP_OTG1_ID 0x17059 /* check if it has been in dts, if not , add it.*/
>;
};
&usbotg1 {
vbus-supply = <®_usb_otg1_vbus>; /* add power control */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_otg1_id>;
dr_mode = "otg";
srp-disable;
hnp-disable;
adp-disable;
status = "okay";
};
try it, please!
Have a nice day!
Weidong