From a83716ff8d6c9a60a55312f792a9de4f32431ed5 Mon Sep 17 00:00:00 2001 From: Kyle Tso Date: Tue, 27 Sep 2022 15:05:22 +0800 Subject: [PATCH 1/3] usb: Remove the permission change of unused nodes Bug: 248982089 Signed-off-by: Kyle Tso Change-Id: I4707e3bbd7fa1d42e08577edba8d9bb52cc7c061 --- usb/usb/android.hardware.usb-service.rc | 2 -- 1 file changed, 2 deletions(-) diff --git a/usb/usb/android.hardware.usb-service.rc b/usb/usb/android.hardware.usb-service.rc index dcdabf7e..f196ef06 100644 --- a/usb/usb/android.hardware.usb-service.rc +++ b/usb/usb/android.hardware.usb-service.rc @@ -23,7 +23,6 @@ on post-fs chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id chown root system /sys/devices/platform/11110000.usb/usb_data_enabled - chown root system /sys/devices/platform/google,pogo/enable_usb chmod 664 /sys/class/typec/port0/power_role chmod 664 /sys/class/typec/port0/data_role chmod 664 /sys/class/typec/port0/port_type @@ -42,4 +41,3 @@ on post-fs chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/google,pogo/enable_usb From bfb57fd23f075ca2086a2cda6105f17b05dd8eca Mon Sep 17 00:00:00 2001 From: Ray Chi Date: Tue, 27 Sep 2022 16:41:04 +0800 Subject: [PATCH 2/3] usb: remove redundant changes for USB nodes Bug: 248982089 Test: build pass Change-Id: Ic93017c26aada15cb04fc2d5cbeb9c9b07c999fa --- usb/usb/android.hardware.usb-service.rc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/usb/usb/android.hardware.usb-service.rc b/usb/usb/android.hardware.usb-service.rc index f196ef06..f06b46b7 100644 --- a/usb/usb/android.hardware.usb-service.rc +++ b/usb/usb/android.hardware.usb-service.rc @@ -20,15 +20,9 @@ on post-fs chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess - chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id - chown root system /sys/devices/platform/11110000.usb/usb_data_enabled chmod 664 /sys/class/typec/port0/power_role chmod 664 /sys/class/typec/port0/data_role chmod 664 /sys/class/typec/port0/port_type - chmod 664 /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess - chmod 664 /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id - chmod 664 /sys/devices/platform/11110000.usb/usb_data_enabled chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current From 2307196bb89d53377c393186a3ffd3fe896cdfed Mon Sep 17 00:00:00 2001 From: Kyle Tso Date: Wed, 28 Sep 2022 11:00:20 +0800 Subject: [PATCH 3/3] Disable USB contaminant detection when the disable flag is true (ported from 6b1106498e1164f46b9a895ed2258a20a0c7a7b5) Bug: 244658328 Signed-off-by: Kyle Tso Change-Id: I9d17748d24f3c402deaddb8a9bca89f8ef606056 Merged-In: I9d17748d24f3c402deaddb8a9bca89f8ef606056 --- conf/init.gs201.usb.rc | 3 +++ device.mk | 1 + disable_contaminant_detection.sh | 7 +++++++ 3 files changed, 11 insertions(+) create mode 100644 disable_contaminant_detection.sh diff --git a/conf/init.gs201.usb.rc b/conf/init.gs201.usb.rc index 36203f40..4ac57f92 100644 --- a/conf/init.gs201.usb.rc +++ b/conf/init.gs201.usb.rc @@ -194,3 +194,6 @@ on property:sys.usb.config=charger && property:sys.usb.configfs=1 on property:ro.bootmode=usbuwb setprop persist.vendor.usb.usbradio.config uwb_acm + +on property:vendor.usb.contaminantdisable=true + exec /vendor/bin/hw/disable_contaminant_detection.sh diff --git a/device.mk b/device.mk index e6941bec..2a3a6287 100644 --- a/device.mk +++ b/device.mk @@ -313,6 +313,7 @@ PRODUCT_COPY_FILES += \ # Shell scripts PRODUCT_COPY_FILES += \ device/google/gs201/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \ + device/google/gs201/disable_contaminant_detection.sh:$(TARGET_COPY_OUT_VENDOR)/bin/hw/disable_contaminant_detection.sh # insmod files PRODUCT_COPY_FILES += \ diff --git a/disable_contaminant_detection.sh b/disable_contaminant_detection.sh new file mode 100644 index 00000000..b5c22a78 --- /dev/null +++ b/disable_contaminant_detection.sh @@ -0,0 +1,7 @@ +#!/vendor/bin/sh + +for f in /sys/devices/platform/10d60000.hsi2c/i2c-*/i2c-max77759tcpc; do + if [ -d $f ]; then + echo 0 > $f/contaminant_detection; + fi +done