usb: add disable_contanimant_detection

This patch adds the disable_contaminant_detection script, providing a
command-based method to bypass moisture detection.

Bug: 295127978
Test: disable moisture detection by 'setprop vendor.usb.contaminantdisable true'
Change-Id: I035d656401aedf11a9a5390504bec46b3c4e2634
Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
This commit is contained in:
Kuen-Han Tsai 2024-02-02 13:46:41 +08:00
parent 4461b53174
commit 453a29320a
4 changed files with 21 additions and 0 deletions

View file

@ -34,3 +34,10 @@ license {
"NOTICE", "NOTICE",
], ],
} }
sh_binary {
name: "disable_contaminant_detection.sh",
src: "disable_contaminant_detection.sh",
vendor: true,
sub_dir: "hw",
}

View file

@ -296,6 +296,9 @@ on property:sys.usb.config=charger && property:sys.usb.configfs=1
on property:ro.bootmode=usbuwb on property:ro.bootmode=usbuwb
setprop persist.vendor.usb.usbradio.config uwb_acm setprop persist.vendor.usb.usbradio.config uwb_acm
on property:vendor.usb.contaminantdisable=true
exec /vendor/bin/hw/disable_contaminant_detection.sh
on property:persist.vendor.usb.displayport.enabled=1 on property:persist.vendor.usb.displayport.enabled=1
write /sys/module/exynos_drm/parameters/dp_enabled 1 write /sys/module/exynos_drm/parameters/dp_enabled 1
write /sys/class/typec/port0/port0.0/mode1/active "yes" write /sys/class/typec/port0/port0.0/mode1/active "yes"

View file

@ -380,6 +380,10 @@ PRODUCT_COPY_FILES += \
device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.persist:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.persist \ device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.persist:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.persist \
device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.modem:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.modem device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.modem:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.modem
# Shell scripts
PRODUCT_PACKAGES += \
disable_contaminant_detection.sh
include device/google/gs-common/insmod/insmod.mk include device/google/gs-common/insmod/insmod.mk
# Insmod config files # Insmod config files

View file

@ -0,0 +1,7 @@
#!/vendor/bin/sh
for f in /sys/devices/platform/108d0000.hsi2c/i2c-*/*-0025; do
if [ -d $f ]; then
echo 0 > $f/contaminant_detection;
fi
done