Merge "Use init to write usb typec props" into mnc-dr-dev
This commit is contained in:
commit
946533648c
1 changed files with 31 additions and 0 deletions
|
@ -89,3 +89,34 @@ on property:sys.usb.config=accessory,audio_source,adb
|
|||
# when changing the default configuration
|
||||
on property:persist.sys.usb.config=*
|
||||
setprop sys.usb.config ${persist.sys.usb.config}
|
||||
|
||||
#
|
||||
# USB type C
|
||||
#
|
||||
|
||||
# USB mode changes
|
||||
on property:sys.usb.typec.mode=dfp
|
||||
write /sys/class/dual_role_usb/otg_default/mode ${sys.usb.typec.mode}
|
||||
setprop sys.usb.typec.state ${sys.usb.typec.mode}
|
||||
|
||||
on property:sys.usb.typec.mode=ufp
|
||||
write /sys/class/dual_role_usb/otg_default/mode ${sys.usb.typec.mode}
|
||||
setprop sys.usb.typec.state ${sys.usb.typec.mode}
|
||||
|
||||
# USB data role changes
|
||||
on property:sys.usb.typec.data_role=device
|
||||
write /sys/class/dual_role_usb/otg_default/data_role ${sys.usb.typec.data}
|
||||
setprop sys.usb.typec.state ${sys.usb.typec.data_role}
|
||||
|
||||
on property:sys.usb.typec.data_role=host
|
||||
write /sys/class/dual_role_usb/otg_default/data_role ${sys.usb.typec.data}
|
||||
setprop sys.usb.typec.state ${sys.usb.typec.data_role}
|
||||
|
||||
# USB power role changes
|
||||
on property:sys.usb.typec.power_role=source
|
||||
write /sys/class/dual_role_usb/otg_default/power_role ${sys.usb.typec.power}
|
||||
setprop sys.usb.typec.state ${sys.usb.typec.power_role}
|
||||
|
||||
on property:sys.usb.typec.power_role=sink
|
||||
write /sys/class/dual_role_usb/otg_default/power_role ${sys.usb.typec.power}
|
||||
setprop sys.usb.typec.state ${sys.usb.typec.power_role}
|
||||
|
|
Loading…
Reference in a new issue