blob: 6929e3d95266034e2fb32ec5d023183fe9d8a01e [file] [log] [blame]
micky3876e308742020-09-20 02:54:09 +02001# Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are met:
5# * Redistributions of source code must retain the above copyright
6# notice, this list of conditions and the following disclaimer.
7# * Redistributions in binary form must reproduce the above copyright
8# notice, this list of conditions and the following disclaimer in the
9# documentation and/or other materials provided with the distribution.
10# * Neither the name of The Linux Foundation nor
11# the names of its contributors may be used to endorse or promote
12# products derived from this software without specific prior written
13# permission.
14#
15# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26#
27
28on init
29 write /sys/class/backlight/panel0-backlight/brightness 200
30
31 mkdir /config
32 mount configfs none /config
33 mkdir /config/usb_gadget/g1 0770 shell shell
34 write /config/usb_gadget/g1/bcdUSB 0x0200
35 write /config/usb_gadget/g1/idVendor 0x0b05
36 write /config/usb_gadget/g1/idProduct 0x4dae
37 mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
38 write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
39 write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
40 write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
41 mkdir /config/usb_gadget/g1/functions/ffs.adb
42 write /config/usb_gadget/g1/os_desc/use 1
43 write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
44 write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
45 setprop sys.usb.configfs 1
46
47on property:ro.boot.usbconfigfs=false
48 setprop sys.usb.configfs 0
49
50on property:ro.boot.recover_usb=*
51 write /sys/bus/platform/devices/a600000.ssusb/mode "peripheral"
52
53on property:ro.boot.usbcontroller=*
54 setprop sys.usb.controller ${ro.boot.usbcontroller}
55
56on property:sys.usb.ffs.ready=1
57 mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
58 symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
59 mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
60 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
61 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
62 write /config/usb_gadget/g1/UDC ${sys.usb.controller}
63
64on fs
65 wait /dev/block/platform/soc/${ro.boot.bootdevice}
66 symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice