AnsweredAssumed Answered

imx6ul usb charger type detection

Question asked by Asma Alekar on Dec 3, 2019
Latest reply on Dec 4, 2019 by igorpadykov

Hello everyone,

I have added USB as otg and charger in our custom imx6ul board. I can see usb added and I also verified usb serial functionality which is working perfectly fine.

 

I also want to verify usb charger type(cdp,dcp,sdp) functionality which I am not able to do.

 

My device tree is as follows:

reg_usb_otg_vbus: regulator-usb-otg-vbus {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_regulator_usbotg_pwr>;
regulator-name = "usb_otg_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
enable-active-high;
status = "okay";
};

 

&usbotg1 {
pinctrl-names = "default";
vbus-supply = <&reg_usb_otg_vbus>;
dr_mode = "otg";
imx6-usb-charger-detection;
srp-disable;
hnp-disable;
adp-disable;
status = "okay";
};

 

I can see usb device in sysfs:

root@imx6ulevk:~# cat /sys/class/udc/ci_hdrc.0/device/role
gadget

 

I followed i.MX Linux® Reference Manual, when I do following command 

cat /sys/class/power_supply/imx6_usb_charger/type

it says, No such directory. 

 

My kernel version is:

Linux imx6ulevk 4.19.35-04767-g8890ce5c8d98-dirty

 

Can anybody please let me know what I am missing?

 

Thanks,

Asma

Outcomes