SamarV-121 | eb08a77 | 2022-04-12 22:01:01 +0530 | [diff] [blame] | 1 | on early-init |
| 2 | write /sys/module/musb_hdrc/parameters/kernel_init_done 1 |
| 3 | #ifdef VENDOR_EDIT |
| 4 | #Wanghao@BSP.bootloader.bootflow, 2020/03/28, Add for usb port in meta mode |
| 5 | #write /sys/class/udc/musb-hdrc/device/cmode 3 |
| 6 | #endif |
| 7 | |
| 8 | on post-fs |
| 9 | #ifndef VENDOR_EDIT |
| 10 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 11 | #setprop vendor.usb.vid "0x0E8D" |
| 12 | #else /* VENDOR_EDIT */ |
| 13 | setprop vendor.usb.vid "0x22d9" |
| 14 | #endif /* VENDOR_EDIT */ |
| 15 | mkdir /dev/usb-ffs 0770 shell shell |
| 16 | mkdir /dev/usb-ffs/adb 0770 shell shell |
| 17 | mkdir /config/usb_gadget/g1 0770 shell shell |
| 18 | write /config/usb_gadget/g1/idVendor ${vendor.usb.vid} |
| 19 | write /config/usb_gadget/g1/bcdDevice 0x0404 |
| 20 | write /config/usb_gadget/g1/bcdUSB 0x0200 |
| 21 | write /config/usb_gadget/g1/os_desc/use 1 |
| 22 | mkdir /config/usb_gadget/g1/strings/0x409 0770 |
| 23 | write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} |
| 24 | write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} |
| 25 | write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} |
| 26 | mkdir /config/usb_gadget/g1/functions/accessory.gs2 |
| 27 | mkdir /config/usb_gadget/g1/functions/audio_source.gs3 |
| 28 | mkdir /config/usb_gadget/g1/functions/ffs.adb |
| 29 | mkdir /config/usb_gadget/g1/functions/mtp.gs0 |
| 30 | write /config/usb_gadget/g1/functions/mtp.gs0/os_desc/interface.MTP/compatible_id "MTP" |
| 31 | mkdir /config/usb_gadget/g1/functions/ptp.gs1 |
| 32 | mkdir /config/usb_gadget/g1/functions/rndis.gs4 |
| 33 | mkdir /config/usb_gadget/g1/functions/midi.gs5 |
| 34 | mkdir /config/usb_gadget/g1/functions/acm.gs0 |
| 35 | mkdir /config/usb_gadget/g1/functions/acm.gs1 |
| 36 | mkdir /config/usb_gadget/g1/functions/acm.gs2 |
| 37 | mkdir /config/usb_gadget/g1/functions/acm.gs3 |
| 38 | mkdir /config/usb_gadget/g1/functions/mass_storage.usb0 |
| 39 | mkdir /config/usb_gadget/g1/functions/hid.gs0 |
| 40 | mkdir /config/usb_gadget/g1/functions/via_modem.gs0 |
| 41 | mkdir /config/usb_gadget/g1/functions/via_ets.gs0 |
| 42 | mkdir /config/usb_gadget/g1/functions/via_atc.gs0 |
| 43 | mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell |
| 44 | mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell |
| 45 | write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 |
| 46 | write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" |
| 47 | write /config/usb_gadget/g1/configs/b.1/MaxPower 500 |
| 48 | symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 |
| 49 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 50 | |
| 51 | on boot |
| 52 | setprop sys.usb.configfs 1 |
| 53 | setprop sys.usb.ffs.aio_compat 1 |
| 54 | setprop vendor.usb.controller "musb-hdrc" |
| 55 | setprop vendor.usb.acm_cnt 0 |
| 56 | setprop vendor.usb.acm_port0 "" |
| 57 | setprop vendor.usb.acm_port1 "" |
| 58 | setprop vendor.usb.acm_enable 0 |
| 59 | write /sys/class/android_usb/android0/f_mtp/cpu_mask 0xF0 |
| 60 | write /sys/module/usb_f_mtp/parameters/mtp_rx_cont 1 |
| 61 | chmod 0664 /sys/class/android_usb/android0/iSerial |
| 62 | chown root system /sys/class/android_usb/android0/iSerial |
| 63 | |
| 64 | chown radio system /sys/class/usb_rawbulk/data/enable |
| 65 | chmod 0660 /sys/class/usb_rawbulk/data/enable |
| 66 | chown radio system /sys/class/usb_rawbulk/ets/enable |
| 67 | chmod 0660 /sys/class/usb_rawbulk/ets/enable |
| 68 | chown radio system /sys/class/usb_rawbulk/atc/enable |
| 69 | chmod 0660 /sys/class/usb_rawbulk/atc/enable |
| 70 | chown radio system /sys/class/usb_rawbulk/pcv/enable |
| 71 | chmod 0660 /sys/class/usb_rawbulk/pcv/enable |
| 72 | chown radio system /sys/class/usb_rawbulk/gps/enable |
| 73 | chmod 0660 /sys/class/usb_rawbulk/gps/enable |
| 74 | chown system radio /dev/ttyGS0 |
| 75 | chmod 0660 /dev/ttyGS0 |
| 76 | chown system radio /dev/ttyGS1 |
| 77 | chmod 0660 /dev/ttyGS1 |
| 78 | chown system radio /dev/ttyGS2 |
| 79 | chmod 0660 /dev/ttyGS2 |
| 80 | chown system radio /dev/ttyGS3 |
| 81 | chmod 0660 /dev/ttyGS3 |
| 82 | |
| 83 | # for UAC MAX dpidle time |
| 84 | write /sys/module/xhci_hcd/parameters/dpidle_fs_max 0 |
| 85 | write /sys/module/xhci_hcd/parameters/dpidle_hs_max 0 |
| 86 | |
| 87 | # for usb otg sdcard hot plug detection |
| 88 | write /sys/module/block/parameters/events_dfl_poll_msecs 1000 |
| 89 | |
| 90 | on charger |
| 91 | mkdir /config/usb_gadget/g1 0770 shell shell |
| 92 | write /config/usb_gadget/g1/idVendor 0x0E8D |
| 93 | write /config/usb_gadget/g1/bcdDevice 0x0223 |
| 94 | write /config/usb_gadget/g1/bcdUSB 0x0200 |
| 95 | write /config/usb_gadget/g1/os_desc/use 1 |
| 96 | mkdir /config/usb_gadget/g1/strings/0x409 0770 |
| 97 | write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} |
| 98 | write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} |
| 99 | write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} |
| 100 | mkdir /config/usb_gadget/g1/functions/hid.gs0 |
| 101 | mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell |
| 102 | mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell |
| 103 | write /config/usb_gadget/g1/configs/b.1/MaxPower 500 |
| 104 | mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 |
| 105 | setprop sys.usb.configfs 1 |
| 106 | setprop vendor.usb.controller "musb-hdrc" |
| 107 | setprop vendor.usb.acm_cnt 0 |
| 108 | setprop vendor.usb.acm_port0 "" |
| 109 | setprop vendor.usb.acm_port1 "" |
| 110 | setprop vendor.usb.acm_enable 0 |
| 111 | setprop sys.usb.config hid |
| 112 | |
| 113 | ### more command at init.usb.configfs.rc ### |
| 114 | on property:sys.usb.config=none && property:sys.usb.configfs=1 |
| 115 | write /config/usb_gadget/g1/idVendor ${vendor.usb.vid} |
| 116 | rm /config/usb_gadget/g1/configs/b.1/f4 |
| 117 | rm /config/usb_gadget/g1/configs/b.1/f5 |
| 118 | write /sys/class/udc/musb-hdrc/device/saving 0 |
| 119 | |
| 120 | ### HID for KPOC ### |
| 121 | on property:sys.usb.config=hid && property:sys.usb.configfs=1 |
| 122 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "HID" |
| 123 | write /config/usb_gadget/g1/idProduct 0x20FF |
| 124 | write /config/usb_gadget/g1/functions/hid.gs0/protocol 0 |
| 125 | write /config/usb_gadget/g1/functions/hid.gs0/subclass 0 |
| 126 | #write /config/usb_gadget/g1/functions/hid.gs0/report_length 4 |
| 127 | #write /config/usb_gadget/g1/functions/hid.gs0/report_desc \\x05\\x01\\x09\\x00\\xa1\\x01\\xc0 |
| 128 | symlink /config/usb_gadget/g1/functions/hid.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 129 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 130 | setprop sys.usb.state ${sys.usb.config} |
| 131 | |
| 132 | ### main function : adb ### |
| 133 | ### start adbd at init.usb.configfs.rc ### |
| 134 | on property:sys.usb.config=adb && property:vendor.usb.acm_cnt=0 && \ |
| 135 | property:sys.usb.configfs=1 |
| 136 | #ifndef VENDOR_EDIT |
| 137 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 138 | #setprop vendor.usb.pid 0x201C |
| 139 | #else /* VENDOR_EDIT */ |
| 140 | setprop vendor.usb.pid 0x2769 |
| 141 | #endif /* VENDOR_EDIT */ |
| 142 | on property:sys.usb.config=adb && property:vendor.usb.acm_cnt=1 && \ |
| 143 | property:sys.usb.configfs=1 |
| 144 | setprop vendor.usb.pid 0x2006 |
| 145 | setprop vendor.usb.acm_port1 "" |
| 146 | on property:sys.usb.config=adb && property:vendor.usb.acm_cnt=2 && \ |
| 147 | property:sys.usb.configfs=1 |
| 148 | #ifndef VENDOR_EDIT |
| 149 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2018/03/14, Modify for OPPO VID&PID */ |
| 150 | #setprop vendor.usb.pid 0x2029 |
| 151 | #else |
| 152 | setprop vendor.usb.pid 0x200E |
| 153 | #endif |
| 154 | |
| 155 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && \ |
| 156 | property:vendor.usb.acm_enable=1 && property:sys.usb.configfs=1 |
| 157 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb_acm" |
| 158 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 159 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 160 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 161 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 162 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f3 |
| 163 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f4 |
| 164 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 165 | setprop sys.usb.state ${sys.usb.config} |
| 166 | |
| 167 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && \ |
| 168 | property:vendor.usb.acm_enable=0 && property:sys.usb.configfs=1 |
| 169 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" |
| 170 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 171 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 |
| 172 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 173 | setprop sys.usb.state ${sys.usb.config} |
| 174 | |
| 175 | ### main function : mtp ### |
| 176 | on property:sys.usb.config=mtp && property:vendor.usb.acm_cnt=0 && \ |
| 177 | property:sys.usb.configfs=1 |
| 178 | #ifndef VENDOR_EDIT |
| 179 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 180 | #setprop vendor.usb.pid 0x2008 |
| 181 | #else /* VENDOR_EDIT */ |
| 182 | setprop vendor.usb.pid 0x2764 |
| 183 | #endif /* VENDOR_EDIT */ |
| 184 | on property:sys.usb.config=mtp && property:vendor.usb.acm_cnt=1 && \ |
| 185 | property:sys.usb.configfs=1 |
| 186 | setprop vendor.usb.pid 0x2012 |
| 187 | setprop vendor.usb.acm_port1 "" |
| 188 | on property:sys.usb.config=mtp && property:vendor.usb.acm_cnt=2 && \ |
| 189 | property:sys.usb.configfs=1 |
| 190 | setprop vendor.usb.pid 0x202A |
| 191 | |
| 192 | on property:sys.usb.config=mtp && property:vendor.usb.acm_enable=1 && \ |
| 193 | property:sys.usb.configfs=1 |
| 194 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_acm" |
| 195 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 196 | write /config/usb_gadget/g1/os_desc/use 1 |
| 197 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 198 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 199 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f2 |
| 200 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f3 |
| 201 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 202 | setprop sys.usb.state ${sys.usb.config} |
| 203 | |
| 204 | on property:sys.usb.config=mtp && property:vendor.usb.acm_enable=0 && \ |
| 205 | property:sys.usb.configfs=1 |
| 206 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp" |
| 207 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 208 | write /config/usb_gadget/g1/os_desc/use 1 |
| 209 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 210 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 211 | setprop sys.usb.state ${sys.usb.config} |
| 212 | |
| 213 | ### start adbd at init.usb.configfs.rc ### |
| 214 | on property:sys.usb.config=mtp,adb && property:vendor.usb.acm_cnt=0 && \ |
| 215 | property:sys.usb.configfs=1 |
| 216 | #ifndef VENDOR_EDIT |
| 217 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 218 | #setprop vendor.usb.pid 0x201D |
| 219 | #else |
| 220 | setprop vendor.usb.pid 0x2765 |
| 221 | #endif |
| 222 | on property:sys.usb.config=mtp,adb && property:vendor.usb.acm_cnt=1 && \ |
| 223 | property:sys.usb.configfs=1 |
| 224 | setprop vendor.usb.pid 0x200A |
| 225 | setprop vendor.usb.acm_port1 "" |
| 226 | on property:sys.usb.config=mtp,adb && property:vendor.usb.acm_cnt=2 && \ |
| 227 | property:sys.usb.configfs=1 |
| 228 | setprop vendor.usb.pid 0x2026 |
| 229 | |
| 230 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && \ |
| 231 | property:vendor.usb.acm_enable=1 && property:sys.usb.configfs=1 |
| 232 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb_acm" |
| 233 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 234 | write /config/usb_gadget/g1/os_desc/use 1 |
| 235 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 236 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 237 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 238 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f3 |
| 239 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f4 |
| 240 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 241 | setprop sys.usb.state ${sys.usb.config} |
| 242 | |
| 243 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && \ |
| 244 | property:vendor.usb.acm_enable=0 && property:sys.usb.configfs=1 |
| 245 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb" |
| 246 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 247 | write /config/usb_gadget/g1/os_desc/use 1 |
| 248 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 249 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 250 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 251 | setprop sys.usb.state ${sys.usb.config} |
| 252 | |
| 253 | ### main function : ptp ### |
| 254 | on property:sys.usb.config=ptp && property:vendor.usb.acm_cnt=0 && \ |
| 255 | property:sys.usb.configfs=1 |
| 256 | setprop vendor.usb.pid 0x200B |
| 257 | on property:sys.usb.config=ptp && property:vendor.usb.acm_cnt=1 && \ |
| 258 | property:sys.usb.configfs=1 |
| 259 | setprop vendor.usb.pid 0x2013 |
| 260 | setprop vendor.usb.acm_port1 "" |
| 261 | on property:sys.usb.config=ptp && property:vendor.usb.acm_cnt=2 && \ |
| 262 | property:sys.usb.configfs=1 |
| 263 | setprop vendor.usb.pid 0x202B |
| 264 | |
| 265 | on property:sys.usb.config=ptp && property:vendor.usb.acm_enable=1 && \ |
| 266 | property:sys.usb.configfs=1 |
| 267 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_acm" |
| 268 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 269 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 270 | symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 |
| 271 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f2 |
| 272 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f3 |
| 273 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 274 | setprop sys.usb.state ${sys.usb.config} |
| 275 | |
| 276 | on property:sys.usb.config=ptp && property:vendor.usb.acm_enable=0 && \ |
| 277 | property:sys.usb.configfs=1 |
| 278 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp" |
| 279 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 280 | symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 |
| 281 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 282 | setprop sys.usb.state ${sys.usb.config} |
| 283 | |
| 284 | ### start adbd at init.usb.configfs.rc ### |
| 285 | on property:sys.usb.config=ptp,adb && property:vendor.usb.acm_cnt=0 && \ |
| 286 | property:sys.usb.configfs=1 |
| 287 | #ifndef VENDOR_EDIT |
| 288 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 289 | #setprop vendor.usb.pid 0x200C |
| 290 | #else |
| 291 | setprop vendor.usb.pid 0x2772 |
| 292 | #endif |
| 293 | on property:sys.usb.config=ptp,adb && property:vendor.usb.acm_cnt=1 && \ |
| 294 | property:sys.usb.configfs=1 |
| 295 | setprop vendor.usb.pid 0x200D |
| 296 | setprop vendor.usb.acm_port1 "" |
| 297 | on property:sys.usb.config=ptp,adb && property:vendor.usb.acm_cnt=2 && \ |
| 298 | property:sys.usb.configfs=1 |
| 299 | setprop vendor.usb.pid 0x2027 |
| 300 | |
| 301 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && \ |
| 302 | property:vendor.usb.acm_enable=1 && property:sys.usb.configfs=1 |
| 303 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb_acm" |
| 304 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 305 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 306 | symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 |
| 307 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 308 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f3 |
| 309 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f4 |
| 310 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 311 | setprop sys.usb.state ${sys.usb.config} |
| 312 | |
| 313 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && \ |
| 314 | property:vendor.usb.acm_enable=0 && property:sys.usb.configfs=1 |
| 315 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb" |
| 316 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 317 | symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1 |
| 318 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 319 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 320 | setprop sys.usb.state ${sys.usb.config} |
| 321 | |
| 322 | ### main function : rndis ### |
| 323 | on property:sys.usb.config=rndis && property:vendor.usb.acm_cnt=0 && \ |
| 324 | property:sys.usb.configfs=1 |
| 325 | #ifndef VENDOR_EDIT |
| 326 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 327 | #setprop vendor.usb.pid 0x2004 |
| 328 | #else |
| 329 | setprop vendor.usb.pid 0x276A |
| 330 | #endif |
| 331 | on property:sys.usb.config=rndis && property:vendor.usb.acm_cnt=1 && \ |
| 332 | property:sys.usb.configfs=1 |
| 333 | setprop vendor.usb.pid 0x2011 |
| 334 | setprop vendor.usb.acm_port1 "" |
| 335 | on property:sys.usb.config=rndis && property:vendor.usb.acm_cnt=2 && \ |
| 336 | property:sys.usb.configfs=1 |
| 337 | setprop vendor.usb.pid 0x202C |
| 338 | |
| 339 | on property:sys.usb.config=rndis && property:vendor.usb.acm_enable=1 && \ |
| 340 | property:sys.usb.configfs=1 |
| 341 | mkdir /config/usb_gadget/g1/functions/rndis.gs4 |
| 342 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums_acm" |
| 343 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 344 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 345 | symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 |
| 346 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f2 |
| 347 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f3 |
| 348 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 349 | setprop sys.usb.state ${sys.usb.config} |
| 350 | |
| 351 | on property:sys.usb.config=rndis && property:vendor.usb.acm_enable=0 && \ |
| 352 | property:sys.usb.configfs=1 |
| 353 | mkdir /config/usb_gadget/g1/functions/rndis.gs4 |
| 354 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis" |
| 355 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 356 | symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 |
| 357 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 358 | setprop sys.usb.state ${sys.usb.config} |
| 359 | |
| 360 | on property:sys.usb.config=rndis,adb && property:vendor.usb.acm_cnt=0 && \ |
| 361 | property:sys.usb.configfs=1 |
| 362 | #ifndef VENDOR_EDIT |
| 363 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 364 | #setprop vendor.usb.pid 0x2005 |
| 365 | #else |
| 366 | setprop vendor.usb.pid 0x2766 |
| 367 | #endif |
| 368 | on property:sys.usb.config=rndis,adb && property:vendor.usb.acm_cnt=1 && \ |
| 369 | property:sys.usb.configfs=1 |
| 370 | setprop vendor.usb.pid 0x2010 |
| 371 | setprop vendor.usb.acm_port1 "" |
| 372 | on property:sys.usb.config=rndis,adb && property:vendor.usb.acm_cnt=2 && \ |
| 373 | property:sys.usb.configfs=1 |
| 374 | setprop vendor.usb.pid 0x2028 |
| 375 | |
| 376 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && \ |
| 377 | property:vendor.usb.acm_enable=1 && property:sys.usb.configfs=1 |
| 378 | mkdir /config/usb_gadget/g1/functions/rndis.gs4 |
| 379 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb_acm" |
| 380 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 381 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 382 | symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 |
| 383 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 384 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f3 |
| 385 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f4 |
| 386 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 387 | setprop sys.usb.state ${sys.usb.config} |
| 388 | |
| 389 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && \ |
| 390 | property:vendor.usb.acm_enable=0 && property:sys.usb.configfs=1 |
| 391 | mkdir /config/usb_gadget/g1/functions/rndis.gs4 |
| 392 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb" |
| 393 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 394 | symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1 |
| 395 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 396 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 397 | setprop sys.usb.state ${sys.usb.config} |
| 398 | |
| 399 | ### main function : midi ### |
| 400 | on property:sys.usb.config=midi && property:sys.usb.configfs=1 |
| 401 | write /config/usb_gadget/g1/idProduct 0x2046 |
| 402 | |
| 403 | on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 |
| 404 | write /config/usb_gadget/g1/idProduct 0x2048 |
| 405 | |
| 406 | ### main function : accessory ### |
| 407 | on property:sys.usb.config=accessory && property:sys.usb.configfs=1 |
| 408 | write /config/usb_gadget/g1/idVendor 0x18d1 |
| 409 | write /config/usb_gadget/g1/idProduct 0x2d00 |
| 410 | |
| 411 | on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 |
| 412 | write /config/usb_gadget/g1/idVendor 0x18d1 |
| 413 | write /config/usb_gadget/g1/idProduct 0x2d01 |
| 414 | |
| 415 | ### main function : audio_source ### |
| 416 | on property:sys.usb.config=audio_source && property:sys.usb.configfs=1 |
| 417 | write /config/usb_gadget/g1/idVendor 0x18d1 |
| 418 | write /config/usb_gadget/g1/idProduct 0x2d02 |
| 419 | |
| 420 | on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 |
| 421 | write /config/usb_gadget/g1/idVendor 0x18d1 |
| 422 | write /config/usb_gadget/g1/idProduct 0x2d03 |
| 423 | |
| 424 | ### main function : accessory,audio_source ### |
| 425 | on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1 |
| 426 | write /config/usb_gadget/g1/idVendor 0x18d1 |
| 427 | write /config/usb_gadget/g1/idProduct 0x2d04 |
| 428 | |
| 429 | on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 |
| 430 | write /config/usb_gadget/g1/idVendor 0x18d1 |
| 431 | write /config/usb_gadget/g1/idProduct 0x2d05 |
| 432 | |
| 433 | on property:sys.usb.config=via_bypass && property:vendor.usb.acm_cnt=0 && \ |
| 434 | property:sys.usb.configfs=1 |
| 435 | setprop vendor.usb.pid 0x2031 |
| 436 | on property:sys.usb.config=via_bypass && property:vendor.usb.acm_cnt=1 && \ |
| 437 | property:sys.usb.configfs=1 |
| 438 | setprop vendor.usb.pid 0x2033 |
| 439 | setprop vendor.usb.acm_port1 "" |
| 440 | |
| 441 | ##via_modem,via_ets,via_atc,acm |
| 442 | on property:sys.usb.config=via_bypass && property:vendor.usb.acm_enable=1 && \ |
| 443 | property:sys.usb.configfs=1 |
| 444 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "via_bypass" |
| 445 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 446 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 447 | symlink /config/usb_gadget/g1/functions/via_modem.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 448 | symlink /config/usb_gadget/g1/functions/via_ets.gs0 /config/usb_gadget/g1/configs/b.1/f2 |
| 449 | symlink /config/usb_gadget/g1/functions/via_atc.gs0 /config/usb_gadget/g1/configs/b.1/f3 |
| 450 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f4 |
| 451 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 452 | setprop sys.usb.state ${sys.usb.config} |
| 453 | |
| 454 | ##via_modem,via_ets,via_atc,adb |
| 455 | on property:sys.usb.config=via_bypass && property:vendor.usb.acm_enable=0 && \ |
| 456 | property:sys.usb.configfs=1 |
| 457 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "via_bypass" |
| 458 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 459 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 460 | symlink /config/usb_gadget/g1/functions/via_modem.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 461 | symlink /config/usb_gadget/g1/functions/via_ets.gs0 /config/usb_gadget/g1/configs/b.1/f2 |
| 462 | symlink /config/usb_gadget/g1/functions/via_atc.gs0 /config/usb_gadget/g1/configs/b.1/f3 |
| 463 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 464 | setprop sys.usb.state ${sys.usb.config} |
| 465 | |
| 466 | on property:sys.usb.config=via_bypass,adb && property:vendor.usb.acm_cnt=0 && \ |
| 467 | property:sys.usb.configfs=1 |
| 468 | setprop vendor.usb.pid 0x2032 |
| 469 | on property:sys.usb.config=via_bypass,adb && property:vendor.usb.acm_cnt=1 && \ |
| 470 | property:sys.usb.configfs=1 |
| 471 | setprop vendor.usb.pid 0x2034 |
| 472 | setprop vendor.usb.acm_port1 "" |
| 473 | on property:sys.usb.config=via_bypass,adb && property:vendor.usb.acm_cnt=2 && \ |
| 474 | property:sys.usb.configfs=1 |
| 475 | setprop vendor.usb.pid 0x2050 |
| 476 | |
| 477 | on property:sys.usb.config=via_bypass,adb && property:sys.usb.configfs=1 |
| 478 | start adbd |
| 479 | |
| 480 | ##via_modem,via_ets,via_atc,adb,acm |
| 481 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=via_bypass,adb && \ |
| 482 | property:vendor.usb.acm_enable=1 && property:vendor.usb.acm_cnt=1 && \ |
| 483 | property:sys.usb.configfs=1 |
| 484 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb_acm" |
| 485 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 486 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 487 | symlink /config/usb_gadget/g1/functions/via_modem.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 488 | symlink /config/usb_gadget/g1/functions/via_ets.gs0 /config/usb_gadget/g1/configs/b.1/f2 |
| 489 | symlink /config/usb_gadget/g1/functions/via_atc.gs0 /config/usb_gadget/g1/configs/b.1/f3 |
| 490 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 |
| 491 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f5 |
| 492 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 493 | setprop sys.usb.state ${sys.usb.config} |
| 494 | |
| 495 | ##via_modem,acm,adb |
| 496 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=via_bypass,adb && \ |
| 497 | property:vendor.usb.acm_enable=1 && property:vendor.usb.acm_cnt=2 && \ |
| 498 | property:sys.usb.configfs=1 |
| 499 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb_acm2" |
| 500 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 501 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 502 | symlink /config/usb_gadget/g1/functions/via_modem.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 503 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 504 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f3 |
| 505 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f4 |
| 506 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 507 | setprop sys.usb.state ${sys.usb.config} |
| 508 | |
| 509 | ##via_modem,via_ets,via_atc,adb |
| 510 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=via_bypass,adb && \ |
| 511 | property:vendor.usb.acm_enable=0 && property:sys.usb.configfs=1 |
| 512 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb" |
| 513 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 514 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 515 | symlink /config/usb_gadget/g1/functions/via_modem.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 516 | symlink /config/usb_gadget/g1/functions/via_ets.gs0 /config/usb_gadget/g1/configs/b.1/f2 |
| 517 | symlink /config/usb_gadget/g1/functions/via_atc.gs0 /config/usb_gadget/g1/configs/b.1/f3 |
| 518 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 |
| 519 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 520 | setprop sys.usb.state ${sys.usb.config} |
| 521 | |
| 522 | ### main function : mass_storage ### |
| 523 | on property:sys.usb.config=mass_storage && property:vendor.usb.acm_cnt=0 && \ |
| 524 | property:sys.usb.configfs=1 |
| 525 | #ifndef VENDOR_EDIT |
| 526 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 527 | #setprop vendor.usb.pid 0x2002 |
| 528 | #else /* VENDOR_EDIT */ |
| 529 | setprop vendor.usb.pid 0x2768 |
| 530 | #endif /* VENDOR_EDIT */ |
| 531 | on property:sys.usb.config=mass_storage && property:vendor.usb.acm_cnt=1 && \ |
| 532 | property:sys.usb.configfs=1 |
| 533 | setprop vendor.usb.pid 0x200F |
| 534 | setprop vendor.usb.acm_port1 "" |
| 535 | on property:sys.usb.config=mass_storage && property:vendor.usb.acm_cnt=2 && \ |
| 536 | property:sys.usb.configfs=1 |
| 537 | setprop vendor.usb.pid 0x202D |
| 538 | |
| 539 | on property:sys.usb.config=mass_storage && property:vendor.usb.acm_enable=1 && \ |
| 540 | property:sys.usb.configfs=1 |
| 541 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums_acm" |
| 542 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 543 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 544 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 545 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f2 |
| 546 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f3 |
| 547 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 548 | setprop sys.usb.state ${sys.usb.config} |
| 549 | |
| 550 | on property:sys.usb.config=mass_storage && property:vendor.usb.acm_enable=0 && \ |
| 551 | property:sys.usb.configfs=1 |
| 552 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums" |
| 553 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 554 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 555 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 556 | setprop sys.usb.state ${sys.usb.config} |
| 557 | |
| 558 | on property:sys.usb.config=mass_storage,adb && property:vendor.usb.acm_cnt=0 && \ |
| 559 | property:sys.usb.configfs=1 |
| 560 | #ifndef VENDOR_EDIT |
| 561 | #/* Qiao.Hu@BSP.BaseDrv.CHG.Basic, 2017/12/08, Modify for OPPO VID&PID */ |
| 562 | #setprop vendor.usb.pid 0x2003 |
| 563 | #else |
| 564 | setprop vendor.usb.pid 0x2767 |
| 565 | #endif |
| 566 | on property:sys.usb.config=mass_storage,adb && property:vendor.usb.acm_cnt=1 && \ |
| 567 | property:sys.usb.configfs=1 |
| 568 | setprop vendor.usb.pid 0x2006 |
| 569 | setprop vendor.usb.acm_port1 "" |
| 570 | on property:sys.usb.config=mass_storage,adb && property:vendor.usb.acm_cnt=2 && \ |
| 571 | property:sys.usb.configfs=1 |
| 572 | setprop vendor.usb.pid 0x2029 |
| 573 | |
| 574 | on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1 |
| 575 | start adbd |
| 576 | |
| 577 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && \ |
| 578 | property:vendor.usb.acm_enable=1 && property:sys.usb.configfs=1 |
| 579 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums_adb_acm" |
| 580 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 581 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 582 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 583 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 584 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f3 |
| 585 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f4 |
| 586 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 587 | setprop sys.usb.state ${sys.usb.config} |
| 588 | |
| 589 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && \ |
| 590 | property:vendor.usb.acm_enable=0 && property:sys.usb.configfs=1 |
| 591 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums_adb" |
| 592 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 593 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 594 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 595 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 596 | setprop sys.usb.state ${sys.usb.config} |
| 597 | |
| 598 | ### main function : bicr ### |
| 599 | on property:sys.usb.config=bicr && property:vendor.usb.acm_cnt=0 && \ |
| 600 | property:sys.usb.configfs=1 |
| 601 | setprop vendor.usb.pid 0x2002 |
| 602 | on property:sys.usb.config=bicr && property:vendor.usb.acm_cnt=1 && \ |
| 603 | property:sys.usb.configfs=1 |
| 604 | setprop vendor.usb.pid 0x200F |
| 605 | setprop vendor.usb.acm_port1 "" |
| 606 | on property:sys.usb.config=bicr && property:vendor.usb.acm_cnt=2 && \ |
| 607 | property:sys.usb.configfs=1 |
| 608 | setprop vendor.usb.pid 0x202D |
| 609 | |
| 610 | on property:sys.usb.config=bicr && property:vendor.usb.acm_enable=1 && \ |
| 611 | property:sys.usb.configfs=1 |
| 612 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums_acm" |
| 613 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 614 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 615 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/cdrom 1 |
| 616 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/file "/dev/block/loop0" |
| 617 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 618 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f2 |
| 619 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f3 |
| 620 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 621 | setprop sys.usb.state ${sys.usb.config} |
| 622 | |
| 623 | on property:sys.usb.config=bicr && property:vendor.usb.acm_enable=0 && \ |
| 624 | property:sys.usb.configfs=1 |
| 625 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums" |
| 626 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 627 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/cdrom 1 |
| 628 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/file "/dev/block/loop0" |
| 629 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 630 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 631 | setprop sys.usb.state ${sys.usb.config} |
| 632 | |
| 633 | on property:sys.usb.config=bicr,adb && property:vendor.usb.acm_cnt=0 && \ |
| 634 | property:sys.usb.configfs=1 |
| 635 | setprop vendor.usb.pid 0x2003 |
| 636 | on property:sys.usb.config=bicr,adb && property:vendor.usb.acm_cnt=1 && \ |
| 637 | property:sys.usb.configfs=1 |
| 638 | setprop vendor.usb.pid 0x2006 |
| 639 | setprop vendor.usb.acm_port1 "" |
| 640 | on property:sys.usb.config=bicr,adb && property:vendor.usb.acm_cnt=2 && \ |
| 641 | property:sys.usb.configfs=1 |
| 642 | setprop vendor.usb.pid 0x2029 |
| 643 | |
| 644 | on property:sys.usb.config=bicr,adb && property:sys.usb.configfs=1 |
| 645 | start adbd |
| 646 | |
| 647 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=bicr,adb && \ |
| 648 | property:vendor.usb.acm_enable=1 && property:sys.usb.configfs=1 |
| 649 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums_adb_acm" |
| 650 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 651 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 652 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/cdrom 1 |
| 653 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/file "/dev/block/loop0" |
| 654 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 655 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 656 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port0} /config/usb_gadget/g1/configs/b.1/f3 |
| 657 | symlink /config/usb_gadget/g1/functions/acm.gs${vendor.usb.acm_port1} /config/usb_gadget/g1/configs/b.1/f4 |
| 658 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 659 | setprop sys.usb.state ${sys.usb.config} |
| 660 | |
| 661 | on property:sys.usb.ffs.ready=1 && property:sys.usb.config=bicr,adb && \ |
| 662 | property:vendor.usb.acm_enable=0 && property:sys.usb.configfs=1 |
| 663 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ums_adb" |
| 664 | write /config/usb_gadget/g1/idProduct ${vendor.usb.pid} |
| 665 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/cdrom 1 |
| 666 | write /config/usb_gadget/g1/functions/mass_storage.usb0/lun.0/file "/dev/block/loop0" |
| 667 | symlink /config/usb_gadget/g1/functions/mass_storage.usb0 /config/usb_gadget/g1/configs/b.1/f1 |
| 668 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 669 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 670 | setprop sys.usb.state ${sys.usb.config} |
| 671 | |
| 672 | ### ACM APPEND SERIES ### |
| 673 | on property:persist.vendor.radio.port_index=0 && property:sys.boot_completed=1 |
| 674 | setprop vendor.usb.acm_idx "" |
| 675 | setprop vendor.usb.acm_cnt 0 |
| 676 | setprop vendor.usb.acm_enable 0 |
| 677 | setprop sys.usb.config none |
| 678 | setprop sys.usb.config ${sys.usb.state} |
| 679 | |
| 680 | on property:persist.vendor.radio.port_index=1 && property:sys.boot_completed=1 |
| 681 | setprop sys.usb.config acm_gs0 |
| 682 | on property:sys.usb.config=mass_storage,adb,acm |
| 683 | setprop sys.usb.config acm_gs0 |
| 684 | on property:sys.usb.config=acm_gs0 |
| 685 | setprop vendor.usb.acm_port0 0 |
| 686 | setprop vendor.usb.acm_port1 "" |
| 687 | setprop vendor.usb.acm_cnt 1 |
| 688 | setprop vendor.usb.acm_enable 1 |
| 689 | setprop sys.usb.config none |
| 690 | setprop sys.usb.config ${sys.usb.state} |
| 691 | setprop vendor.usb.acm_idx "1" |
| 692 | |
| 693 | on property:persist.vendor.radio.port_index=2 && property:sys.boot_completed=1 |
| 694 | setprop sys.usb.config acm_gs1 |
| 695 | on property:sys.usb.config=acm_gs1 |
| 696 | setprop vendor.usb.acm_port0 1 |
| 697 | setprop vendor.usb.acm_port1 "" |
| 698 | setprop vendor.usb.acm_cnt 1 |
| 699 | setprop vendor.usb.acm_enable 1 |
| 700 | setprop sys.usb.config none |
| 701 | setprop sys.usb.config ${sys.usb.state} |
| 702 | setprop vendor.usb.acm_idx "2" |
| 703 | |
| 704 | on property:persist.vendor.radio.port_index=3 && property:sys.boot_completed=1 |
| 705 | setprop sys.usb.config acm_gs2 |
| 706 | on property:sys.usb.config=acm_third |
| 707 | setprop sys.usb.config acm_gs2 |
| 708 | on property:sys.usb.config=acm_gs2 |
| 709 | setprop vendor.usb.acm_port0 2 |
| 710 | setprop vendor.usb.acm_port1 "" |
| 711 | setprop vendor.usb.acm_cnt 1 |
| 712 | setprop vendor.usb.acm_enable 1 |
| 713 | setprop sys.usb.config none |
| 714 | setprop sys.usb.config ${sys.usb.state} |
| 715 | setprop vendor.usb.acm_idx "3" |
| 716 | |
| 717 | on property:persist.vendor.radio.port_index=4 && property:sys.boot_completed=1 |
| 718 | setprop sys.usb.config acm_gs3 |
| 719 | on property:sys.usb.config=gs3 |
| 720 | setprop sys.usb.config acm_gs3 |
| 721 | on property:sys.usb.config=mtp,gs3 |
| 722 | setprop sys.usb.config acm_gs3 |
| 723 | on property:sys.usb.config=acm_gs3 |
| 724 | setprop vendor.usb.acm_port0 3 |
| 725 | setprop vendor.usb.acm_port1 "" |
| 726 | setprop vendor.usb.acm_cnt 1 |
| 727 | setprop vendor.usb.acm_enable 1 |
| 728 | setprop sys.usb.config none |
| 729 | setprop sys.usb.config ${sys.usb.state} |
| 730 | setprop vendor.usb.acm_idx "4" |
| 731 | |
| 732 | on property:sys.usb.config=mtp,gs0gs1 |
| 733 | setprop sys.usb.config acm_gs0gs1 |
| 734 | on property:sys.usb.config=gs0gs1 |
| 735 | setprop sys.usb.config acm_gs0gs1 |
| 736 | on property:sys.usb.config=rndis,gs0gs1 |
| 737 | setprop sys.usb.config acm_gs0gs1 |
| 738 | on property:sys.usb.config=rndis,adb,gs0gs1 |
| 739 | setprop sys.usb.config acm_gs0gs1 |
| 740 | on property:sys.usb.config=acm_gs0gs1 |
| 741 | setprop vendor.usb.acm_port0 0 |
| 742 | setprop vendor.usb.acm_port1 1 |
| 743 | setprop vendor.usb.acm_cnt 2 |
| 744 | setprop vendor.usb.acm_enable 1 |
| 745 | setprop sys.usb.config none |
| 746 | setprop sys.usb.config ${sys.usb.state} |
| 747 | setprop vendor.usb.acm_idx "1,2" |
| 748 | |
| 749 | on property:sys.usb.config=gs3,dual_acm |
| 750 | setprop sys.usb.config acm_gs0gs3 |
| 751 | on property:sys.usb.config=mtp,gs3,dual_acm |
| 752 | setprop sys.usb.config acm_gs0gs3 |
| 753 | on property:sys.usb.config=mtp,gs0gs3 |
| 754 | setprop sys.usb.config acm_gs0gs3 |
| 755 | on property:sys.usb.config=gs0gs3 |
| 756 | setprop sys.usb.config acm_gs0gs3 |
| 757 | on property:sys.usb.config=rndis,gs0gs3 |
| 758 | setprop sys.usb.config acm_gs0gs3 |
| 759 | on property:sys.usb.config=rndis,adb,gs0gs3 |
| 760 | setprop sys.usb.config acm_gs0gs3 |
| 761 | on property:sys.usb.config=acm_gs0gs3 |
| 762 | setprop vendor.usb.acm_port0 0 |
| 763 | setprop vendor.usb.acm_port1 3 |
| 764 | setprop vendor.usb.acm_cnt 2 |
| 765 | setprop vendor.usb.acm_enable 1 |
| 766 | setprop sys.usb.config none |
| 767 | setprop sys.usb.config ${sys.usb.state} |
| 768 | setprop vendor.usb.acm_idx "1,4" |
| 769 | |
| 770 | on property:sys.usb.config=gs1gs3 |
| 771 | setprop sys.usb.config acm_gs1gs3 |
| 772 | on property:sys.usb.config=mtp,gs1gs3 |
| 773 | setprop sys.usb.config acm_gs1gs3 |
| 774 | on property:sys.usb.config=via_bypass,gs1gs3 |
| 775 | setprop sys.usb.config acm_gs1gs3 |
| 776 | on property:sys.usb.config=rndis,gs1gs3 |
| 777 | setprop sys.usb.config acm_gs1gs3 |
| 778 | on property:sys.usb.config=acm_gs1gs3 |
| 779 | setprop vendor.usb.acm_port0 1 |
| 780 | setprop vendor.usb.acm_port1 3 |
| 781 | setprop vendor.usb.acm_cnt 2 |
| 782 | setprop vendor.usb.acm_enable 1 |
| 783 | setprop sys.usb.config none |
| 784 | setprop sys.usb.config ${sys.usb.state} |
| 785 | setprop vendor.usb.acm_idx "2,4" |
| 786 | |
| 787 | # For ATM (Android Test Mode) |
| 788 | on property:vendor.usb.clear=1 && property:sys.usb.configfs=1 |
| 789 | write /config/usb_gadget/g1/UDC "none" |
| 790 | write /config/usb_gadget/g1/bDeviceClass 0 |
| 791 | write /config/usb_gadget/g1/bDeviceSubClass 0 |
| 792 | write /config/usb_gadget/g1/bDeviceProtocol 0 |
| 793 | rm /config/usb_gadget/g1/configs/b.1/f1 |
| 794 | rm /config/usb_gadget/g1/configs/b.1/f2 |
| 795 | rm /config/usb_gadget/g1/configs/b.1/f3 |
| 796 | rm /config/usb_gadget/g1/configs/b.1/f4 |
| 797 | rm /config/usb_gadget/g1/configs/b.1/f5 |
| 798 | rmdir /config/usb_gadget/g1/functions/rndis.gs4 |
| 799 | write /sys/class/udc/musb-hdrc/device/saving 0 |
| 800 | setprop vendor.usb.clear 2 |
| 801 | |
| 802 | # has permission issue when read from ${sys.usb.ffs.ready} |
| 803 | on property:sys.usb.ffs.ready=0 |
| 804 | setprop vendor.usb.ffs.ready 0 |
| 805 | on property:sys.usb.ffs.ready=1 |
| 806 | setprop vendor.usb.ffs.ready 1 |
| 807 | |
| 808 | on property:sys.usb.config=atm_gs0 && property:sys.usb.configfs=1 |
| 809 | stop adbd |
| 810 | setprop vendor.usb.ffs.ready 0 |
| 811 | setprop vendor.usb.clear 1 |
| 812 | |
| 813 | on property:vendor.usb.ffs.ready=0 && property:sys.usb.config=atm_gs0 && \ |
| 814 | property:vendor.usb.clear=2 && property:sys.usb.configfs=1 |
| 815 | start adbd |
| 816 | |
| 817 | on property:vendor.usb.ffs.ready=1 && property:sys.usb.config=atm_gs0 && \ |
| 818 | property:vendor.usb.clear=2 && property:sys.usb.configfs=1 |
| 819 | setprop vendor.usb.acm_port0 0 |
| 820 | setprop vendor.usb.acm_port1 "" |
| 821 | setprop vendor.usb.acm_cnt 1 |
| 822 | setprop vendor.usb.acm_enable 1 |
| 823 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 824 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "atm_gs0" |
| 825 | write /config/usb_gadget/g1/idProduct 0x200A |
| 826 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 827 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 828 | symlink /config/usb_gadget/g1/functions/acm.gs0 /config/usb_gadget/g1/configs/b.1/f3 |
| 829 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 830 | #setprop sys.usb.state ${sys.usb.config} |
| 831 | #setprop vendor.usb.pid 0x200A |
| 832 | setprop vendor.usb.clear 0 |
| 833 | setprop vendor.usb.acm_idx "1" |
| 834 | |
| 835 | on property:sys.usb.config=atm_gs0gs3 && property:sys.usb.configfs=1 |
| 836 | stop adbd |
| 837 | setprop vendor.usb.ffs.ready 0 |
| 838 | setprop vendor.usb.clear 1 |
| 839 | |
| 840 | on property:vendor.usb.ffs.ready=0 && property:sys.usb.config=atm_gs0gs3 && \ |
| 841 | property:vendor.usb.clear=2 && property:sys.usb.configfs=1 |
| 842 | start adbd |
| 843 | |
| 844 | on property:vendor.usb.ffs.ready=1 && property:sys.usb.config=atm_gs0gs3 && \ |
| 845 | property:vendor.usb.clear=2 && property:sys.usb.configfs=1 |
| 846 | setprop vendor.usb.acm_port0 0 |
| 847 | setprop vendor.usb.acm_port1 3 |
| 848 | setprop vendor.usb.acm_cnt 2 |
| 849 | setprop vendor.usb.acm_enable 1 |
| 850 | write /sys/class/udc/musb-hdrc/device/saving 1 |
| 851 | #ifndef VENDOR_EDIT |
| 852 | #Jianchao.Shi@PSW.BSP.CHG.Basic, 2018/11/02, sjc Modify for factory mode |
| 853 | # write /config/usb_gadget/g1/idProduct 0x2026 |
| 854 | # symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 855 | # symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 |
| 856 | # symlink /config/usb_gadget/g1/functions/acm.gs0 /config/usb_gadget/g1/configs/b.1/f3 |
| 857 | # symlink /config/usb_gadget/g1/functions/acm.gs3 /config/usb_gadget/g1/configs/b.1/f4 |
| 858 | #else |
| 859 | write /config/usb_gadget/g1/idProduct 0x200E |
| 860 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 |
| 861 | symlink /config/usb_gadget/g1/functions/acm.gs0 /config/usb_gadget/g1/configs/b.1/f2 |
| 862 | symlink /config/usb_gadget/g1/functions/acm.gs3 /config/usb_gadget/g1/configs/b.1/f3 |
| 863 | #endif |
| 864 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 865 | #setprop sys.usb.state ${sys.usb.config} |
| 866 | #setprop vendor.usb.pid 0x2026 |
| 867 | setprop vendor.usb.clear 0 |
| 868 | setprop vendor.usb.acm_idx "1,4" |
| 869 | |
| 870 | ### CHARGING ### |
| 871 | on property:sys.usb.config=cdp && property:sys.usb.configfs=1 |
| 872 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp" |
| 873 | write /config/usb_gadget/g1/idProduct 0x2008 |
| 874 | write /config/usb_gadget/g1/os_desc/use 1 |
| 875 | symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 |
| 876 | write /config/usb_gadget/g1/UDC ${vendor.usb.controller} |
| 877 | setprop sys.usb.state ${sys.usb.config} |
| 878 | setprop vendor.usb.pid 0x2008 |
| 879 | |
| 880 | on property:sys.usb.config=charging_yes |
| 881 | setprop vendor.usb.state ${sys.usb.state} |
| 882 | setprop vendor.usb.charging yes |
| 883 | setprop sys.usb.config none |
| 884 | setprop sys.usb.config ${vendor.usb.state} |
| 885 | |
| 886 | on property:sys.usb.config=charging_no |
| 887 | setprop vendor.usb.state ${sys.usb.state} |
| 888 | setprop sys.usb.config none |
| 889 | setprop sys.usb.config ${vendor.usb.state} |
| 890 | setprop vendor.usb.charging no |
| 891 | |
| 892 | on property:vendor.usb.charging=yes |
| 893 | write /sys/class/udc/musb-hdrc/device/cmode 2 |
| 894 | on property:vendor.usb.charging=no |
| 895 | write /sys/class/udc/musb-hdrc/device/cmode 1 |
| 896 | |
| 897 | on property:vendor.usb.bicr=yes |
| 898 | write /sys/class/android_usb/android0/f_mass_storage/bicr 1 |
| 899 | write /sys/class/android_usb/android0/f_mass_storage/lun/file "/dev/block/loop0" |
| 900 | on property:vendor.usb.bicr=no |
| 901 | write /sys/class/android_usb/android0/f_mass_storage/bicr 0 |
| 902 | write /sys/class/android_usb/android0/f_mass_storage/lun/file "off" |
| 903 | |
| 904 | on property:vendor.usb.port.mode=usb |
| 905 | write /sys/class/udc/musb-hdrc/device/portmode 0 |
| 906 | on property:vendor.usb.port.mode=uart |
| 907 | write /sys/class/udc/musb-hdrc/device/portmode 1 |
| 908 | |
SamarV-121 | eb08a77 | 2022-04-12 22:01:01 +0530 | [diff] [blame] | 909 | on property:vendor.em.usb.bypass.enable=0 |
| 910 | write /sys/class/usb_rawbulk/gps/enable 1 |
| 911 | on property:vendor.em.usb.bypass.enable=1 |
| 912 | write /sys/class/usb_rawbulk/pcv/enable 1 |
| 913 | on property:vendor.em.usb.bypass.enable=2 |
| 914 | write /sys/class/usb_rawbulk/atc/enable 1 |
| 915 | on property:vendor.em.usb.bypass.enable=3 |
| 916 | write /sys/class/usb_rawbulk/ets/enable 1 |
| 917 | on property:vendor.em.usb.bypass.enable=4 |
| 918 | write /sys/class/usb_rawbulk/data/enable 1 |
| 919 | on property:vendor.em.usb.bypass.disable=0 |
| 920 | write /sys/class/usb_rawbulk/gps/enable 0 |
| 921 | on property:vendor.em.usb.bypass.disable=1 |
| 922 | write /sys/class/usb_rawbulk/pcv/enable 0 |
| 923 | on property:vendor.em.usb.bypass.disable=2 |
| 924 | write /sys/class/usb_rawbulk/atc/enable 0 |
| 925 | on property:vendor.em.usb.bypass.disable=3 |
| 926 | write /sys/class/usb_rawbulk/ets/enable 0 |
| 927 | on property:vendor.em.usb.bypass.disable=4 |
| 928 | write /sys/class/usb_rawbulk/data/enable 0 |
| 929 | |
| 930 | ### vendor process start ### |
| 931 | on property:vendor.usb.config=* |
| 932 | setprop sys.usb.config ${vendor.usb.config} |
| 933 | ### vendor process end ### |
| 934 | |
| 935 | ### test command start ### |
| 936 | on property:vendor.usb.test=* |
| 937 | setprop sys.usb.config none |
| 938 | setprop sys.usb.config ${vendor.usb.test} |
| 939 | ### test command end ### |
| 940 | |
| 941 | on property:vendor.usb.printk=* |
| 942 | write /proc/sys/kernel/printk ${vendor.usb.printk} |
| 943 | |
| 944 | on property:persist.vendor.usb.printk=* |
| 945 | setprop vendor.usb.printk ${persist.vendor.usb.printk} |
| 946 | |
| 947 | on property:vendor.usb.speed.mode=u3 |
| 948 | write /sys/module/musb_hdrc/parameters/speed 1 |
| 949 | write /sys/class/udc/musb-hdrc/device/cmode 0 |
| 950 | write /sys/class/udc/musb-hdrc/device/cmode 1 |
| 951 | |
| 952 | on property:vendor.usb.speed.mode=u2 |
| 953 | write /sys/module/musb_hdrc/parameters/speed 0 |
| 954 | write /sys/class/udc/musb-hdrc/device/cmode 0 |
| 955 | write /sys/class/udc/musb-hdrc/device/cmode 1 |
| 956 | |
| 957 | on property:persist.vendor.usb.speed.mode=u3 |
| 958 | write /sys/module/musb_hdrc/parameters/speed 1 |
| 959 | write /sys/class/udc/musb-hdrc/device/cmode 0 |
| 960 | write /sys/class/udc/musb-hdrc/device/cmode 1 |
| 961 | |
| 962 | on property:persist.vendor.usb.speed.mode=u2 |
| 963 | write /sys/module/musb_hdrc/parameters/speed 0 |
| 964 | write /sys/class/udc/musb-hdrc/device/cmode 0 |
| 965 | write /sys/class/udc/musb-hdrc/device/cmode 1 |
| 966 | |
| 967 | on property:vendor.usb.sib_enable=1 |
| 968 | write /sys/class/udc/musb-hdrc/device/sib_enable 1 |
| 969 | |
| 970 | on property:vendor.usb.sib_enable=0 |
| 971 | write /sys/class/udc/musb-hdrc/device/sib_enable 0 |
| 972 | |
| 973 | on property:persist.vendor.usb.dbg.lv=* |
| 974 | setprop vendor.usb.dbg.lv ${persist.vendor.usb.dbg.lv} |
| 975 | |
| 976 | on property:vendor.usb.dbg.lv=* |
| 977 | write /sys/module/musb_hdrc/parameters/debug_level ${vendor.usb.dbg.lv} |
| 978 | |
| 979 | ### PLATFORM VARIANT, cat $rc_file | grep write | sort | grep -vE "android0|usb20_phy" | awk '{print $2}' | uniq ### |