usb Host/Device switch command

 

Host/Device switch command

echo "peripheral" > /sys/devices/soc/6a00000.ssusb/mode //Sets to periperhal mode 

echo "host" > /sys/devices/soc/6a00000.ssusb/mode //Sets to host mode 

echo "none" > /sys/devices/soc/6a00000.ssusb/mode //Sets to disconnected state 
 

msm8996:/ # lsusb

Bus 001 Device 001: ID 1d6b:0002

Bus 002 Device 001: ID 1d6b:0003

 

 

msm8996:/sys/devices/soc/6a00000.ssusb # echo "host" > mode

msm8996:/sys/devices/soc/6a00000.ssusb # lsusb

Bus 003 Device 002: ID 05e3:0749

Bus 001 Device 001: ID 1d6b:0002

Bus 002 Device 001: ID 1d6b:0003

Bus 003 Device 001: ID 1d6b:0002

Bus 004 Device 001: ID 1d6b:0003

msm8996:/sys/devices/soc/6a00000.ssusb # 

msm8996:/sys/devices/soc/6a00000.ssusb # 

s /dev/block/ |grep sda                                                       <

sda

sda1

 

127|msm8996:/sys/devices/soc/6a00000.ssusb # mount

/dev/root on / type ext4 (ro,seclabel,relatime,data=ordered)

devtmpfs on /dev type devtmpfs (rw,seclabel,relatime,size=1783304k,nr_inodes=445826,mode=755)

tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)

devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)

proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)

sysfs on /sys type sysfs (rw,seclabel,relatime)

selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)

/dev/block/dm-1 on /vendor type ext4 (ro,seclabel,relatime,discard,data=ordered)

none on /acct type cgroup (rw,relatime,cpuacct)

debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)

tmpfs on /mnt type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)

none on /config type configfs (rw,relatime)

none on /dev/cpuctl type cgroup (rw,relatime,cpu)

pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)

/dev/block/mmcblk0p55 on /ota_chj/otacache type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)

/dev/block/mmcblk0p56 on /ota_chj/otabak_a type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)

/dev/block/mmcblk0p57 on /ota_chj/otabak_b type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)

/dev/block/mmcblk0p58 on /extra/tts type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)

/dev/block/mmcblk0p60 on /extra/can_data type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)

/dev/block/mmcblk0p61 on /extra/diag_data type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)

/dev/block/mmcblk0p62 on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)

/dev/block/mmcblk0p30 on /dsp type ext4 (ro,seclabel,nosuid,nodev,relatime,data=ordered)

/dev/block/mmcblk0p28 on /firmware type vfat (ro,context=u:object_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)

/dev/block/mmcblk0p41 on /bt_firmware type vfat (ro,context=u:object_r:bt_firmware_file:s0,relatime,uid=1002,gid=3002,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)

/dev/block/mmcblk0p47 on /persist type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)

tmpfs on /storage type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)

tracefs on /sys/kernel/debug/tracing type tracefs (rw,seclabel,relatime)

adb on /dev/usb-ffs/adb type functionfs (rw,relatime)

/dev/fuse on /mnt/runtime/default/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

/dev/fuse on /storage/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

/dev/fuse on /mnt/runtime/read/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

/dev/fuse on /mnt/runtime/write/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

/dev/block/vold/public:8,1 on /mnt/media_rw/9016-4EF8 type vfat (rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)

/dev/fuse on /mnt/runtime/default/9016-4EF8 type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

/dev/fuse on /storage/9016-4EF8 type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

/dev/fuse on /mnt/runtime/read/9016-4EF8 type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

/dev/fuse on /mnt/runtime/write/9016-4EF8 <

















msm8996:/ # dmesg |grep usb

[ 14.196280] init: processing action (sys.usb.config=diag,adb && sys.usb.configfs=0) from (/vendor/etc/init/hw/init.qcom.usb.rc:176)[ 14.196443] init: Unable to open '/sys/class/android_usb/android0/enable': Permission denied[ 14.196529] init: Unable to open '/sys/class/android_usb/android0/iSerial': Permission denied[ 14.196660] type=1400 audit(15.709:41): avc: denied { write } for pid=1 comm="init" name="android0" dev="sysfs" ino=47610 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_android_usb:s0 tclass=dir permissive=1[ 14.208753] init: Unable to open '/sys/class/android_usb/android0/idVendor': Permission denied[ 14.260006] init: Unable to open '/sys/class/android_usb/android0/idProduct': Permission denied[ 14.260112] init: Unable to open '/sys/class/android_usb/android0/f_diag/clients': No such file or directory[ 14.267734] init: Unable to open '/sys/class/android_usb/android0/functions': Permission denied[ 14.303815] init: Unable to open '/sys/class/android_usb/android0/enable': Permission denied[ 14.310459] init: processing action (sys.usb.config=diag,adb && sys.usb.configfs=1) from (/vendor/etc/init/hw/init.msm.usb.configfs.rc:66)[ 14.310510] init: processing action (sys.usb.config=diag,adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/vendor/etc/init/hw/init.msm.usb.configfs.rc:69)[ 14.529815] msm-dwc3 6a00000.ssusb: Could not get usb psy[ 14.559733] init: Service 'qcom-usb-sh' (pid 652) exited with status 0[ 14.629451] msm-dwc3 6a00000.ssusb: Could not get usb psy[ 14.786034] msm-dwc3 6a00000.ssusb: Could not get usb psy[ 15.787292] type=1400 audit(15.779:42): avc: denied { write } for pid=1 comm="init" name="android0" dev="sysfs" ino=47610 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_android_usb:s0 tclass=dir permissive=1[ 53.840678] type=1400 audit(1532085917.739:67): avc: denied { module_load } for pid=2213 comm="insmod" path="/system/lib/modules/usbserial.ko" dev="dm-0" ino=2484 scontext=u:r:qti_init_shell:s0 tcontext=u:object_r:system_file:s0 tclass=system permissive=1[ 53.845641] usbcore: registered new interface driver usbserial[ 53.893959] usbcore: registered new interface driver option[ 53.894831] usbserial: USB Serial support registered for GSM modem (1-port)[ 53.901112] type=1400 audit(1532085917.739:67): avc: denied { module_load } for pid=2213 comm="insmod" path="/system/lib/modules/usbserial.ko" dev="dm-0" ino=2484 scontext=u:r:qti_init_shell:s0 tcontext=u:object_r:system_file:s0 tclass=system permissive=1[ 54.984827] msm-dwc3 7600000.hsusb: DWC3 exited from low power mode[ 54.992073] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.[ 55.366741] usx4702_probe: modify usb hub id failed[ 55.492509] usbcore: registered new interface driver cdc_acm[ 55.509415] usbcore: registered new interface driver cdc_wdm[ 55.529427] usbcore: registered new interface driver usb-storage[ 55.575245] usbcore: registered new interface driver ks_bridge[ 55.592106] usbcore: registered new interface driver usb_ehset_test[ 56.090311] msm-dwc3 7600000.hsusb: DWC3 in low power mode[ 75.206411] init: processing action (sys.usb.config=diag,adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/vendor/etc/init/hw/init.msm.usb.configfs.rc:69)[ 75.430935] msm-dwc3 6a00000.ssusb: Could not get usb psy[ 75.530561] msm-dwc3 6a00000.ssusb: Could not get usb psy[ 76.314704] msm-dwc3 6a00000.ssusb: Could not get usb psy[ 104.623776] msm-dwc3 6a00000.ssusb: DWC3 in low power mode[ 104.625969] msm-dwc3 6a00000.ssusb: Could not get usb psy /sys/devices/soc/6a00000.ssusb/mode //Sets to host mode

你可能感兴趣的:(Linux)