Hi Gilles Talis,
Below are the behaviour I am facing during role switching,
1) NXP board is in host mode -By default ( echo host > /sys/kernel/debug/ci.hdrc0/role )
on "lsusb" command I am able to see the devices connected = > Its a expected behaviour.
The connected B-device ( Apple iPhone ) is getting charged.
2) NXP Board is in gadget mode ( echo gadget > /sys/kernel/debug/ci.hdrc0/role )
on "lsusb" command I am not able to see the devices connected = > Its a expected behaviour.
The connected B-device ( Apple iPhone ) is not getting charged. As iPhone expects the power to be supplied from the connected device , when the iPhone is in host mode .
I am suspecting that vbus should be enabled even when the NXP device is in gadget mode .
Did some code modification (short cut way => not the proper fix) to enable to regulator to have the voltage supply in vbus in both the modes . The proper fix should be handling of gpio to enable vbus in both host and device(gadget) modes .
Even after we enable the vbus , we are not able to perform role switch , the nodes responsible for role switch (echo host > /sys/kernel/debug/ci.hdrc0/role) are updating with proper values , but we are not able to see the exact functionality of role switching.
And the documentation part of the kernel say the different nodes for the role switching as below
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwizuoHnuO...
I am able to see the nodes
/sys/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/inputs/a_bus_req
as you mentioned in the document
But the role switching is not happening with my iPhone after the below command
echo 1 > /sys/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/inputs/a_bus_req
I am following the procedure as per below
Linux/Documentation/usb/chipidea.txt - Linux Cross Reference - Free Electrons
The Board details : iMx6q sabre Auto infotainment board
Kernel Version : 4.1.15
Thanks and Regards
Shravan S