diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk index e1d6cd4f..2eab1573 100644 --- a/BoardConfig-common.mk +++ b/BoardConfig-common.mk @@ -190,6 +190,7 @@ BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4 # Video Codec ######################## # 1. Exynos C2 +BOARD_USE_CODEC2_HIDL_1_2 := true BOARD_USE_CSC_FILTER := false BOARD_USE_DEC_SW_CSC := true BOARD_USE_ENC_SW_CSC := true @@ -380,6 +381,9 @@ BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true KERNEL_MODULE_DIR := $(TARGET_KERNEL_DIR) KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko) +ifneq ($(wildcard $(KERNEL_MODULE_DIR)/system_dlkm.modules.blocklist),) +BOARD_SYSTEM_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/system_dlkm.modules.blocklist +endif BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist # Prebuilt kernel modules that are *not* listed in vendor_kernel_boot.modules.load @@ -411,6 +415,9 @@ else BOARD_VENDOR_KERNEL_MODULES := $(KERNEL_MODULES) endif +BOARD_SYSTEM_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/system_dlkm.modules.load)) +BOARD_SYSTEM_KERNEL_MODULES := $(addprefix $(KERNEL_MODULE_DIR)/, $(notdir $(BOARD_SYSTEM_KERNEL_MODULES_LOAD))) + # Using BUILD_COPY_HEADERS BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true diff --git a/conf/init.gs201.rc b/conf/init.gs201.rc index 4c6da6df..abc18c58 100644 --- a/conf/init.gs201.rc +++ b/conf/init.gs201.rc @@ -20,12 +20,8 @@ on init write /proc/vendor_sched/teo_util_threshold "1024 1024 1024" # Boot time fs tuning - write /sys/block/sda/queue/iostats 0 write /sys/block/sda/queue/scheduler bfq write /sys/block/sda/queue/iosched/slice_idle 0 - write /sys/block/sda/queue/nr_requests 256 - write /dev/sys/fs/by-name/userdata/data_io_flag 56 - write /dev/sys/fs/by-name/userdata/node_io_flag 56 chown system system /proc/vendor_sched/groups/bg/set_task_group chown system system /proc/vendor_sched/groups/cam/set_task_group @@ -105,15 +101,6 @@ on init chmod 0220 /proc/vendor_sched/pmu_poll_enable chmod 0220 /proc/vendor_sched/pmu_poll_time - wait /dev/block/platform/${ro.boot.boot_devices} - symlink /dev/block/platform/${ro.boot.boot_devices} /dev/block/bootdevice - - # to access UFS/eMMC sysfs directly - symlink /sys/devices/platform/${ro.boot.boot_devices} /dev/sys/block/bootdevice - - # Disable UFS powersaving - write /dev/sys/block/bootdevice/clkgate_enable 0 - start vendor.keymaster-4-0 # ZRAM setup @@ -238,12 +225,7 @@ on init chown system system /dev/maxfg_history # Dump eeprom - chown system system /sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom - chown system system /sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom - chown system system /sys/devices/platform/10da0000.hsi2c/i2c-5/5-0050/eeprom - chown system system /sys/devices/platform/10da0000.hsi2c/i2c-6/6-0050/eeprom - chown system system /sys/devices/platform/10da0000.hsi2c/i2c-7/7-0050/eeprom - chown system system /sys/devices/platform/10da0000.hsi2c/i2c-9/9-0050/eeprom + chown system system /sys/devices/platform/10da0000.hsi2c/i2c-15/15-0050/eeprom # Loading common kernel modules in background start init_display @@ -288,6 +270,7 @@ on init # BatteryHealthData chown system system /sys/class/power_supply/battery/first_usage_date + chown system system /sys/devices/platform/google,battery/power_supply/battery/swelling_data # Battery Defender chown system system /sys/devices/platform/google,battery/power_supply/battery/bd_trickle_cnt @@ -310,6 +293,7 @@ on init chown system system /sys/devices/platform/google,charger/bd_trigger_time chown system system /sys/devices/platform/google,charger/bd_trigger_voltage chown system system /sys/devices/platform/google,charger/bd_clear + chown system system /sys/devices/platform/google,charger/bd_state chown system system /sys/devices/platform/google,charger/charge_start_level chown system system /sys/devices/platform/google,charger/charge_stop_level chown system system /sys/devices/platform/google,cpm/dc_ctl @@ -461,15 +445,6 @@ on early-boot # Wait for insmod_sh to finish all common modules wait_for_prop vendor.common.modules.ready 1 - # Permission for Health Storage HAL - chown system system /dev/sys/block/bootdevice/manual_gc - - # Permission for Pixelstats - chown system system /dev/sys/block/bootdevice/slowio_read_cnt - chown system system /dev/sys/block/bootdevice/slowio_write_cnt - chown system system /dev/sys/block/bootdevice/slowio_unmap_cnt - chown system system /dev/sys/block/bootdevice/slowio_sync_cnt - # PCIe link stats for pixelstats chown system system /sys/devices/platform/11920000.pcie/link_stats/complete_timeout_irqs chown system system /sys/devices/platform/11920000.pcie/link_stats/link_down_irqs @@ -507,6 +482,7 @@ on early-boot chown system system /dev/logbuffer_cpm chown system system /dev/logbuffer_bd chown system system /dev/logbuffer_dual_batt + chown system system /dev/logbuffer_cpif on boot @@ -590,6 +566,7 @@ on fs chown system system /sys/class/backlight/panel0-backlight/dimming_on chown system system /sys/class/backlight/panel0-backlight/hbm_mode chown system system /sys/class/backlight/panel0-backlight/local_hbm_mode + chown system system /sys/class/backlight/panel0-backlight/allow_wakeup_by_state_change chown system system /sys/devices/platform/exynos-drm/primary-panel/gamma chown system system /sys/devices/platform/exynos-drm/primary-panel/min_vrefresh chown system system /sys/devices/platform/exynos-drm/primary-panel/idle_delay_ms @@ -687,21 +664,6 @@ on property:init.svc.vendor.charger=running write /sys/devices/system/cpu/cpu7/online 0 on property:sys.boot_completed=1 - - # Runtime fs tuning - write /sys/block/sda/queue/nr_requests 128 - write /sys/block/sda/queue/iostats 1 - write /sys/block/sda/queue/iosched/slice_idle 0 - write /dev/sys/fs/by-name/userdata/data_io_flag 8 - write /dev/sys/fs/by-name/userdata/node_io_flag 8 - - # Permission for Pixelstats - chown system system /dev/sys/fs/by-name/userdata/compr_written_block - chown system system /dev/sys/fs/by-name/userdata/compr_saved_block - chown system system /dev/sys/fs/by-name/userdata/compr_new_inode - chown system system /dev/sys/fs/by-name/userdata/gc_segment_mode - chown system system /dev/sys/fs/by-name/userdata/gc_reclaimed_segments - # Enable ZRAM on boot_complete swapon_all /vendor/etc/fstab.${ro.board.platform} write /proc/sys/vm/swappiness 60 @@ -713,9 +675,6 @@ on property:sys.boot_completed=1 write /proc/sys/vm/dirty_expire_centisecs 3000 write /proc/sys/vm/dirty_background_ratio 10 - # Enable UFS powersaving - write /dev/sys/block/bootdevice/clkgate_enable 1 - # Reset DDR frequency write /sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/exynos_data/cancel_boot_freq 1 write /sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/exynos_data/cancel_boot_freq 1 @@ -769,11 +728,11 @@ on property:sys.boot_completed=1 write /proc/vendor_sched/pmu_poll_enable 0 # Make devices on the critical path for suspend/resume asynchronous - write /sys/devices/platform/acpm_mfd_bus@18110000/i2c-8/i2c-s2mpg13mfd/power/async "enabled" - write /sys/devices/platform/acpm_mfd_bus@18110000/i2c-8/power/async "enabled" + write /sys/devices/platform/acpm_mfd_bus@18110000/i2c-21/21-002f/power/async "enabled" + write /sys/devices/platform/acpm_mfd_bus@18110000/i2c-21/power/async "enabled" write /sys/devices/platform/acpm_mfd_bus@18110000/power/async "enabled" - write /sys/devices/platform/acpm_mfd_bus@18100000/i2c-7/i2c-s2mpg12mfd/power/async "enabled" - write /sys/devices/platform/acpm_mfd_bus@18100000/i2c-7/power/async "enabled" + write /sys/devices/platform/acpm_mfd_bus@18100000/i2c-20/20-001f/power/async "enabled" + write /sys/devices/platform/acpm_mfd_bus@18100000/i2c-20/power/async "enabled" write /sys/devices/platform/acpm_mfd_bus@18100000/power/async "enabled" write /sys/devices/platform/dbgdev-pd-hsi0/power/async "enabled" write /sys/devices/platform/fixedregulator@0/regulator/regulator.2/power/async "enabled" @@ -924,6 +883,7 @@ on post-fs-data chown bluetooth system /proc/bluetooth/sleep/btwake chown bluetooth system /proc/bluetooth/sleep/lpm chown bluetooth system /proc/bluetooth/sleep/btwrite + mkdir /data/vendor/bluetooth 0770 bluetooth system on post-fs-data mkdir /data/vendor/powerstats 0771 system system @@ -937,9 +897,9 @@ on property:vendor.brownout.mitigation.ready=1 write /sys/devices/virtual/pmic/mitigation/clock_ratio/tpu_light_clk_ratio 0x80041c3 #DFS write /sys/devices/virtual/pmic/mitigation/clock_ratio/cpu1_heavy_clk_ratio 0xfff041c0 #DFS write /sys/devices/virtual/pmic/mitigation/clock_ratio/cpu2_heavy_clk_ratio 0xfff041c0 #DFS - write /sys/devices/virtual/pmic/mitigation/clock_ratio/gpu_light_clk_ratio 0x80041c3 #DFS + write /sys/devices/virtual/pmic/mitigation/clock_ratio/gpu_light_clk_ratio 0xfff041c1 #DFS write /sys/devices/virtual/pmic/mitigation/clock_ratio/cpu2_light_clk_ratio 0xfff041c3 #OCP - write /sys/devices/virtual/pmic/mitigation/clock_ratio/gpu_heavy_clk_ratio 0xfff04381 #OCP + write /sys/devices/virtual/pmic/mitigation/clock_ratio/gpu_heavy_clk_ratio 0xfff04385 #OCP write /sys/devices/virtual/pmic/mitigation/clock_ratio/tpu_heavy_clk_ratio 0xfff041c1 #OCP write /sys/devices/virtual/pmic/mitigation/triggered_lvl/uvlo1_lvl 3200 write /sys/devices/virtual/pmic/mitigation/triggered_lvl/smpl_lvl 3100 @@ -1025,16 +985,6 @@ on charger mkdir /dev/thermal/cdev-by-name 0750 system system start vendor.thermal.symlinks - # Runtime fs tuning - write /sys/block/sda/queue/nr_requests 128 - write /sys/block/sda/queue/iostats 1 - write /sys/block/sda/queue/iosched/slice_idle 0 - write /dev/sys/fs/by-name/userdata/data_io_flag 8 - write /dev/sys/fs/by-name/userdata/node_io_flag 8 - - # Enable UFS powersaving - write /dev/sys/block/bootdevice/clkgate_enable 1 - # Cancel boot devfreq and uclamp write /sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/exynos_data/cancel_boot_freq 1 write /sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/exynos_data/cancel_boot_freq 1 @@ -1075,10 +1025,7 @@ on property:persist.vendor.softmaxfreq.cl1=* on property:persist.vendor.softmaxfreq.cl2=* write /sys/devices/platform/exynos-acme/freq_qos_max "6 ${persist.vendor.softmaxfreq.cl2}" -# UFS on property:ro.boot.mode=charger && property:init.svc.vendor.charger=running - # Enable UFS powersaving in Off Mode Charger - write /dev/sys/block/bootdevice/clkgate_enable 1 # Disable dock-defend in Off Mode Charger write /sys/devices/platform/google,charger/dd_state -1 diff --git a/conf/ueventd.gs201.rc b/conf/ueventd.gs201.rc index 44ec74cb..faad3bd1 100644 --- a/conf/ueventd.gs201.rc +++ b/conf/ueventd.gs201.rc @@ -55,7 +55,6 @@ /dev/video55 0666 system graphics /dev/g2d 0660 system graphics /dev/fimg2d 0666 system graphics -/dev/i2c-2 0660 system system /dev/HPD 0660 system system # wfd diff --git a/default-permissions.xml b/default-permissions.xml index a00707ef..e9a65436 100644 --- a/default-permissions.xml +++ b/default-permissions.xml @@ -45,6 +45,8 @@ package="com.google.android.apps.camera.services"> + + diff --git a/device.mk b/device.mk index c11e291f..6d754ea8 100644 --- a/device.mk +++ b/device.mk @@ -37,6 +37,10 @@ include device/google/gs-common/sota_app/factoryota.mk include device/google/gs-common/misc_writer/misc_writer.mk include device/google/gs-common/gyotaku_app/gyotaku.mk include device/google/gs-common/bootctrl/bootctrl_aidl.mk +include device/google/gs-common/betterbug/betterbug.mk +ifneq ($(filter cheetah felix panther, $(TARGET_PRODUCT)),) + include device/google/gs-common/bcmbt/dump/dumplog.mk +endif TARGET_BOARD_PLATFORM := gs201 @@ -68,7 +72,7 @@ PRODUCT_SOONG_NAMESPACES += \ hardware/google/pixel \ device/google/gs201 \ device/google/gs201/powerstats \ - system/chre/host/hal_generic \ + vendor/google_devices/common/chre/host/hal \ vendor/google/whitechapel/tools \ vendor/google/interfaces \ vendor/google_devices/common/proprietary/confirmatioui_hal \ @@ -281,8 +285,7 @@ PRODUCT_VENDOR_PROPERTIES += \ PRODUCT_VENDOR_PROPERTIES += \ ro.opengles.version=196610 \ - graphics.gpu.profiler.support=true \ - debug.renderengine.backend=skiaglthreaded + graphics.gpu.profiler.support=true # b/295257834 Add HDR shaders to SurfaceFlinger's pre-warming cache PRODUCT_VENDOR_PROPERTIES += ro.surface_flinger.prime_shader_cache.ultrahdr=1 @@ -367,25 +370,21 @@ PRODUCT_HOST_PACKAGES += \ PRODUCT_PACKAGES += \ messaging -# Contexthub HAL -PRODUCT_PACKAGES += \ - android.hardware.contexthub-service.generic - -# CHRE tools +# CHRE +## tools ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_PACKAGES += \ chre_power_test_client \ - chre_test_client + chre_test_client \ + chre_aidl_hal_client endif +## HAL +include device/google/gs-common/chre/hal.mk PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.context_hub.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.context_hub.xml - -## Enable the CHRE Daemon -CHRE_USF_DAEMON_ENABLED := true CHRE_DEDICATED_TRANSPORT_CHANNEL_ENABLED := true PRODUCT_PACKAGES += \ - chre \ preloaded_nanoapps.json # Filesystem management tools @@ -518,7 +517,7 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ android.hardware.graphics.mapper@4.0-impl \ - android.hardware.graphics.allocator-V2-service + android.hardware.graphics.allocator-V1-service PRODUCT_PACKAGES += \ android.hardware.memtrack-service.pixel \ @@ -704,10 +703,8 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_color_management=tr PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.protected_contents=true PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.display_update_imminent_timeout_ms=50 -# force to blend in P3 mode PRODUCT_PROPERTY_OVERRIDES += \ - persist.sys.sf.native_mode=2 \ - persist.sys.sf.color_mode=9 + persist.sys.sf.native_mode=2 PRODUCT_COPY_FILES += \ device/google/gs201/display/display_colordata_cal0.pb:$(TARGET_COPY_OUT_VENDOR)/etc/display_colordata_cal0.pb @@ -750,30 +747,14 @@ endif $(call soong_config_set,bigo,soc,gs201) # 1. Codec 2.0 -# exynos service -PRODUCT_SOONG_NAMESPACES += vendor/samsung_slsi/codec2 +# for settings used by different C2 hal +include device/google/gs-common/mediacodec/common/mediacodec_common.mk +# for Exynos C2 Hal +include device/google/gs-common/mediacodec/samsung/mediacodec_samsung.mk PRODUCT_COPY_FILES += \ device/google/gs201/media_codecs_performance_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_c2.xml \ -PRODUCT_PACKAGES += \ - samsung.hardware.media.c2@1.0-service \ - codec2.vendor.base.policy \ - codec2.vendor.ext.policy \ - libExynosC2ComponentStore \ - libExynosC2H264Dec \ - libExynosC2H264Enc \ - libExynosC2HevcDec \ - libExynosC2HevcEnc \ - libExynosC2Mpeg4Dec \ - libExynosC2Mpeg4Enc \ - libExynosC2H263Dec \ - libExynosC2H263Enc \ - libExynosC2Vp8Dec \ - libExynosC2Vp8Enc \ - libExynosC2Vp9Dec \ - libExynosC2Vp9Enc - PRODUCT_PROPERTY_OVERRIDES += \ debug.stagefright.c2-poolmask=458752 \ debug.c2.use_dmabufheaps=1 \ @@ -1082,6 +1063,14 @@ PRODUCT_PROPERTY_OVERRIDES += persist.vendor.enable.thermal.genl=true include device/google/gs-common/edgetpu/edgetpu.mk # Config variables for TPU chip on device. $(call soong_config_set,edgetpu_config,chip,janeiro) +# Include the edgetpu targets defined the namespaces below into the final image. +PRODUCT_SOONG_NAMESPACES += \ + vendor/google_devices/gs201/proprietary/gchips/tpu/metrics \ + vendor/google_devices/gs201/proprietary/gchips/tpu/tflite_delegate \ + vendor/google_devices/gs201/proprietary/gchips/tpu/darwinn_logging_service \ + vendor/google_devices/gs201/proprietary/gchips/tpu/nnapi_stable_aidl \ + vendor/google_devices/gs201/proprietary/gchips/tpu/aidl \ + vendor/google_devices/gs201/proprietary/gchips/tpu/hal # TPU firmware PRODUCT_PACKAGES += edgetpu-janeiro.fw @@ -1168,3 +1157,6 @@ include hardware/google/pixel/HardwareInfo/HardwareInfo.mk # UFS: the script is used to select the corresponding firmware to run FFU. PRODUCT_PACKAGES += ufs_firmware_update.sh + +# Touch service +include device/google/gs-common/touch/twoshay/aidl_gs101.mk diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml index 1e34caf2..b3d37877 100644 --- a/device_framework_matrix_product.xml +++ b/device_framework_matrix_product.xml @@ -84,14 +84,6 @@ default - - com.google.input - 2 - - ITouchContextService - default - - hardware.qorvo.uwb 2 @@ -142,13 +134,6 @@ sced0 - - com.google.pixel.modem.logmasklibrary - - ILiboemserviceProxy - default - - vendor.samsung_slsi.telephony.hardware.radioExternal 1.1 diff --git a/disable_contaminant_detection.sh b/disable_contaminant_detection.sh index b5c22a78..d4677e48 100644 --- a/disable_contaminant_detection.sh +++ b/disable_contaminant_detection.sh @@ -1,7 +1,6 @@ #!/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 +max77759tcpc_path=/sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025 +if [ -d $max77759tcpc_path ]; then + echo 0 > $max77759tcpc_path/contaminant_detection; +fi diff --git a/dumpstate/dump_power_gs201.sh b/dumpstate/dump_power_gs201.sh index 19c52e76..64d75566 100644 --- a/dumpstate/dump_power_gs201.sh +++ b/dumpstate/dump_power_gs201.sh @@ -37,7 +37,7 @@ else fi echo "\n------ Power supply property tcpm ------" -cat "/sys/class/power_supply/tcpm-source-psy-8-0025/uevent" +cat /sys/class/power_supply/tcpm-source-psy-*/uevent echo "\n------ Power supply property usb ------" cat "/sys/class/power_supply/usb/uevent" echo "\n------ Power supply property wireless ------" @@ -100,23 +100,21 @@ then fi echo "\n------ TCPC ------" -for f in /sys/devices/platform/10d60000.hsi2c/i2c-*/i2c-max77759tcpc -do - echo "registers:" - cat $f/registers - echo "frs:" - cat $f/frs - echo "auto_discharge:" - cat $f/auto_discharge - echo "bc12_enabled:" - cat $f/bc12_enabled - echo "cc_toggle_enable:" - cat $f/cc_toggle_enable - echo "contaminant_detection:" - cat $f/contaminant_detection - echo "contaminant_detection_status:" - cat $f/contaminant_detection_status -done +max77759tcpc_path="/sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025" +echo "registers:" +cat $max77759tcpc_path/registers +echo "frs:" +cat $max77759tcpc_path/frs +echo "auto_discharge:" +cat $max77759tcpc_path/auto_discharge +echo "bc12_enabled:" +cat $max77759tcpc_path/bc12_enabled +echo "cc_toggle_enable:" +cat $max77759tcpc_path/cc_toggle_enable +echo "contaminant_detection:" +cat $max77759tcpc_path/contaminant_detection +echo "contaminant_detection_status:" +cat $max77759tcpc_path/contaminant_detection_status echo "\n------ PD Engine ------" cat "/dev/logbuffer_usbpd" @@ -129,6 +127,8 @@ cat "/dev/logbuffer_pca9468" echo "\n------ Battery Health ------" cat "/sys/class/power_supply/battery/health_index_stats" +echo "\n------ Battery Health SoC Residency ------" +cat "/sys/class/power_supply/battery/swelling_data" echo "\n------ BMS ------" cat "/dev/logbuffer_ssoc" echo "\n------ TTF ------" @@ -165,14 +165,15 @@ do echo "$f: `cat $f`" done +echo "\n------ DC_registers dump ------" +cat "/sys/class/power_supply/pca94xx-mains/device/registers_dump" +echo "\n------ max77759_chg registers dump ------" +cat "/sys/class/power_supply/main-charger/device/registers_dump" +echo "\n------ max77729_pmic registers dump ------" +cat /sys/devices/platform/*.hsi2c/i2c-*/*-0066/registers_dump + if [ $build_type = "userdebug" ] then - echo "\n------ DC_registers dump ------" - cat "/sys/class/power_supply/pca94xx-mains/device/registers_dump" - echo "\n------ max77759_chg registers dump ------" - cat "/d/max77759_chg/registers" - echo "\n------ max77729_pmic registers dump ------" - cat "/d/max77729_pmic/registers" echo "\n------ Charging table dump ------" cat "/d/google_battery/chg_raw_profile" @@ -218,34 +219,9 @@ then fi echo "\n------ Battery EEPROM ------" -if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom" ] +if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-15/15-0050/eeprom" ] then - xxd /sys/devices/platform/10970000.hsi2c/i2c-4/4-0050/eeprom -fi - -if [ -e "/sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom" ] -then - xxd /sys/devices/platform/10970000.hsi2c/i2c-5/5-0050/eeprom -fi - -if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-5/5-0050/eeprom" ] -then - xxd /sys/devices/platform/10da0000.hsi2c/i2c-5/5-0050/eeprom -fi - -if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-6/6-0050/eeprom" ] -then - xxd /sys/devices/platform/10da0000.hsi2c/i2c-6/6-0050/eeprom -fi - -if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-7/7-0050/eeprom" ] -then - xxd /sys/devices/platform/10da0000.hsi2c/i2c-7/7-0050/eeprom -fi - -if [ -e "/sys/devices/platform/10da0000.hsi2c/i2c-9/9-0050/eeprom" ] -then - xxd /sys/devices/platform/10da0000.hsi2c/i2c-9/9-0050/eeprom + xxd /sys/devices/platform/10da0000.hsi2c/i2c-15/15-0050/eeprom fi echo "\n------ Charger Stats ------" diff --git a/location/gps.cer b/location/gps.cer index 934e0c5c..eab842b3 100644 --- a/location/gps.cer +++ b/location/gps.cer @@ -159,3 +159,17 @@ Op9P1ZW2kjqv5D2+q/qtaePAyHn3B05UZrQYUmx7LaHNO7op6dZgCdoR0sVsR+Fc Zyr0AhgiuTWrjtUEOGx2qJVwAsHkpqtlN+DaGT08dT64LvIf0bfGvmtm++/WEDWJ HInwg85pGm+sEkYbYFRBD0woPBsL3g== -----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICGTCCAZ+gAwIBAgIQCeCTZaz32ci5PhwLBCou8zAKBggqhkjOPQQDAzBOMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJjAkBgNVBAMTHURp +Z2lDZXJ0IFRMUyBFQ0MgUDM4NCBSb290IEc1MB4XDTIxMDExNTAwMDAwMFoXDTQ2 +MDExNDIzNTk1OVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJ +bmMuMSYwJAYDVQQDEx1EaWdpQ2VydCBUTFMgRUNDIFAzODQgUm9vdCBHNTB2MBAG +ByqGSM49AgEGBSuBBAAiA2IABMFEoc8Rl1Ca3iOCNQfN0MsYndLxf3c1TzvdlHJS +7cI7+Oz6e2tYIOyZrsn8aLN1udsJ7MgT9U7GCh1mMEy7H0cKPGEQQil8pQgO4CLp +0zVozptjn4S1mU1YoI71VOeVyaNCMEAwHQYDVR0OBBYEFMFRRVBZqz7nLFr6ICIS +B4CIfBFqMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49 +BAMDA2gAMGUCMQCJao1H5+z8blUD2WdsJk6Dxv3J+ysTvLd6jLRl0mlpYxNjOyZQ +LgGheQaRnUi/wr4CMEfDFXuxoJGZSZOoPHzoRgaLLPIxAJSdYsiJvRmEFOml+wG4 +DXZDjC5Ty3zfDBeWUA== +-----END CERTIFICATE----- diff --git a/manifest-gralloc3.xml b/manifest-gralloc3.xml index cd405200..5cce8cf3 100644 --- a/manifest-gralloc3.xml +++ b/manifest-gralloc3.xml @@ -86,14 +86,6 @@ hwbinder @1.3::IDevice/google-edgetpu - - com.google.input - 2 - - ITouchContextService - default - - vendor.google.google_battery 2-3 diff --git a/manifest.xml b/manifest.xml index a5cf98dc..34b0326d 100644 --- a/manifest.xml +++ b/manifest.xml @@ -12,12 +12,4 @@ android.hardware.boot IBootControl/default - - com.google.input - 2 - - ITouchContextService - default - - diff --git a/manifest_media.xml b/manifest_media.xml index 3ed9e247..38e56ba2 100644 --- a/manifest_media.xml +++ b/manifest_media.xml @@ -5,8 +5,16 @@ 1.0 IComponentStore - default default1 + + android.hardware.media.c2 + hwbinder + 1.2 + + IComponentStore + default + + diff --git a/manifest_media_aosp.xml b/manifest_media_aosp.xml index 3bc347c9..9a1a3dba 100644 --- a/manifest_media_aosp.xml +++ b/manifest_media_aosp.xml @@ -2,7 +2,7 @@ android.hardware.media.c2 hwbinder - 1.0 + 1.2 IComponentStore default diff --git a/media_codecs_performance_c2.xml b/media_codecs_performance_c2.xml index 12dde41e..0f7c377a 100644 --- a/media_codecs_performance_c2.xml +++ b/media_codecs_performance_c2.xml @@ -174,10 +174,10 @@ - - - - + + + + diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index e9e4f01b..f594fc6d 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -309,6 +309,7 @@ com.zhiliaoapp.musically:0.07 com.bilibili.app.in:0.07 com.twitter.android:0.07 + com.google.android.youtube:0.07 diff --git a/pixelstats/pixelstats-vendor.gs201.rc b/pixelstats/pixelstats-vendor.gs201.rc index 70d875ea..6f6da84d 100644 --- a/pixelstats/pixelstats-vendor.gs201.rc +++ b/pixelstats/pixelstats-vendor.gs201.rc @@ -1,4 +1,6 @@ on property:sys.boot_completed=1 + chown system system /sys/class/power_supply/maxfg_base/fg_learning_events + chown system system /sys/class/power_supply/maxfg/fg_learning_events start vendor.pixelstats_vendor on post-fs-data chown system system /sys/kernel/metrics/irq/stats_reset diff --git a/pixelstats/service.cpp b/pixelstats/service.cpp index ab6f85f2..595befbe 100644 --- a/pixelstats/service.cpp +++ b/pixelstats/service.cpp @@ -88,13 +88,26 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = { .IRQStatsResetPath = "/sys/kernel/metrics/irq/stats_reset", .ModemPcieLinkStatsPath = "/sys/devices/platform/11920000.pcie/link_stats", .WifiPcieLinkStatsPath = "/sys/devices/platform/14520000.pcie/link_stats", - .GMSRPath = "/sys/class/power_supply/maxfg/gmsr", + .GMSRPath = { + "/sys/class/power_supply/maxfg/gmsr", + "/sys/class/power_supply/maxfg_base/gmsr", + }, .TotalCallCountPath = "/sys/devices/platform/audiometrics/call_count" }; const struct UeventListener::UeventPaths ueventPaths = { .AudioUevent = "/devices/virtual/amcs/amcs", - .TypeCPartnerUevent = "PRODUCT_TYPE="}; + .TypeCPartnerUevent = "PRODUCT_TYPE=", + .FGLearningPath = { + "/sys/class/power_supply/maxfg/fg_learning_events", + "/sys/class/power_supply/maxfg_base/fg_learning_events" + }, + .FwUpdatePath = "", + .FGModelLoadingPath = { + "/sys/class/power_supply/maxfg/m5_model_state", + "/sys/class/power_supply/maxfg_base/m5_model_state" + } +}; int main() { LOG(INFO) << "starting PixelStats"; diff --git a/powerstats/Gs201CommonDataProviders.cpp b/powerstats/Gs201CommonDataProviders.cpp index d6f1af58..2b1f5618 100644 --- a/powerstats/Gs201CommonDataProviders.cpp +++ b/powerstats/Gs201CommonDataProviders.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ using aidl::android::hardware::power::stats::AdaptiveDvfsStateResidencyDataProvider; using aidl::android::hardware::power::stats::AocTimedStateResidencyDataProvider; using aidl::android::hardware::power::stats::DevfreqStateResidencyDataProvider; +using aidl::android::hardware::power::stats::DisplayMrrStateResidencyDataProvider; using aidl::android::hardware::power::stats::DvfsStateResidencyDataProvider; using aidl::android::hardware::power::stats::UfsStateResidencyDataProvider; using aidl::android::hardware::power::stats::EnergyConsumerType; @@ -608,6 +610,15 @@ void addCamera(std::shared_ptr p) { {"VSYS_PWR_CAM"})); } +void addDisplayMrrByEntity(std::shared_ptr p, std::string name, std::string path) { + p->addStateResidencyDataProvider(std::make_unique( + name, path)); +} + +void addDisplayMrr(std::shared_ptr p) { + addDisplayMrrByEntity(p, "Display", "/sys/class/drm/card0/device/primary-panel/"); +} + void addGs201CommonDataProviders(std::shared_ptr p) { setEnergyMeter(p); diff --git a/powerstats/include/Gs201CommonDataProviders.h b/powerstats/include/Gs201CommonDataProviders.h index 97a70668..6cc81361 100644 --- a/powerstats/include/Gs201CommonDataProviders.h +++ b/powerstats/include/Gs201CommonDataProviders.h @@ -24,6 +24,8 @@ void addAoC(std::shared_ptr p); void addCPUclusters(std::shared_ptr p); void addCamera(std::shared_ptr p); void addDevfreq(std::shared_ptr p); +void addDisplayMrr(std::shared_ptr p); +void addDisplayMrrByEntity(std::shared_ptr p, std::string name, std::string path); void addDvfsStats(std::shared_ptr p); void addGNSS(std::shared_ptr p); void addGs201CommonDataProviders(std::shared_ptr p); diff --git a/usb/gadget/UsbGadget.cpp b/usb/gadget/UsbGadget.cpp index d3bd8f36..da1e8012 100644 --- a/usb/gadget/UsbGadget.cpp +++ b/usb/gadget/UsbGadget.cpp @@ -17,7 +17,6 @@ #define LOG_TAG "android.hardware.usb.gadget.aidl-service" #include "UsbGadget.h" -#include #include #include #include @@ -29,6 +28,7 @@ #include #include +#include namespace aidl { namespace android { @@ -37,39 +37,19 @@ namespace usb { namespace gadget { using ::android::base::GetBoolProperty; +using ::android::hardware::google::pixel::usb::getI2cClientPath; using ::android::hardware::google::pixel::usb::kUvcEnabled; string enabledPath; constexpr char kHsi2cPath[] = "/sys/devices/platform/10d60000.hsi2c"; -constexpr char kI2CPath[] = "/sys/devices/platform/10d60000.hsi2c/i2c-"; -constexpr char kAccessoryLimitCurrent[] = "i2c-max77759tcpc/usb_limit_accessory_current"; -constexpr char kAccessoryLimitCurrentEnable[] = "i2c-max77759tcpc/usb_limit_accessory_enable"; -constexpr char kUpdateSdpEnumTimeout[] = "i2c-max77759tcpc/update_sdp_enum_timeout"; +constexpr char kTcpcDevName[] = "i2c-max77759tcpc"; +constexpr char kI2cClientId[] = "0025"; +constexpr char kAccessoryLimitCurrent[] = "usb_limit_accessory_current"; +constexpr char kAccessoryLimitCurrentEnable[] = "usb_limit_accessory_enable"; +constexpr char kUpdateSdpEnumTimeout[] = "update_sdp_enum_timeout"; -Status getI2cBusHelper(string *name) { - DIR *dp; - - dp = opendir(kHsi2cPath); - if (dp != NULL) { - struct dirent *ep; - - while ((ep = readdir(dp))) { - if (ep->d_type == DT_DIR) { - if (string::npos != string(ep->d_name).find("i2c-")) { - std::strtok(ep->d_name, "-"); - *name = std::strtok(NULL, "-"); - } - } - } - closedir(dp); - return Status::SUCCESS; - } - - ALOGE("Failed to open %s", kHsi2cPath); - return Status::ERROR; -} - -UsbGadget::UsbGadget() : mGadgetIrqPath("") { +UsbGadget::UsbGadget() : mGadgetIrqPath(""), + mI2cClientPath("") { if (access(OS_DESC_PATH, R_OK) != 0) { ALOGE("configfs setup not done yet"); abort(); @@ -389,14 +369,16 @@ ScopedAStatus UsbGadget::reset(const shared_ptr &callback, } void UsbGadget::updateSdpEnumTimeout() { - string i2c_node, update_sdp_enum_timeout_path; + string update_sdp_enum_timeout_path; - Status status = getI2cBusHelper(&i2c_node); - if (status != Status::SUCCESS) { - ALOGE("%s: Unable to locate i2c bus node", __func__); + if (mI2cClientPath.empty()) { + mI2cClientPath = getI2cClientPath(kHsi2cPath, kTcpcDevName, kI2cClientId); + if (mI2cClientPath.empty()) { + ALOGE("%s: Unable to locate i2c bus node", __func__); + } } - update_sdp_enum_timeout_path = kI2CPath + i2c_node + "/" + kUpdateSdpEnumTimeout; + update_sdp_enum_timeout_path = mI2cClientPath + kUpdateSdpEnumTimeout; if (!WriteStringToFile("1", update_sdp_enum_timeout_path)) { ALOGE("%s: Unable to write to %s.", __func__, update_sdp_enum_timeout_path.c_str()); } else { @@ -494,15 +476,20 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions, std::unique_lock lk(mLockSetCurrentFunction); std::string current_usb_power_operation_mode, current_usb_type; std::string usb_limit_sink_enable; - - string accessoryCurrentLimitEnablePath, accessoryCurrentLimitPath, path; + std::string accessoryCurrentLimitEnablePath, accessoryCurrentLimitPath; mCurrentUsbFunctions = functions; mCurrentUsbFunctionsApplied = false; - getI2cBusHelper(&path); - accessoryCurrentLimitPath = kI2CPath + path + "/" + kAccessoryLimitCurrent; - accessoryCurrentLimitEnablePath = kI2CPath + path + "/" + kAccessoryLimitCurrentEnable; + if (mI2cClientPath.empty()) { + mI2cClientPath = getI2cClientPath(kHsi2cPath, kTcpcDevName, kI2cClientId); + if (mI2cClientPath.empty()) { + ALOGE("%s: Unable to locate i2c bus node", __func__); + } + } + + accessoryCurrentLimitPath = mI2cClientPath + kAccessoryLimitCurrent; + accessoryCurrentLimitEnablePath = mI2cClientPath + kAccessoryLimitCurrentEnable; // Get the gadget IRQ number before tearDownGadget() if (mGadgetIrqPath.empty()) diff --git a/usb/gadget/UsbGadget.h b/usb/gadget/UsbGadget.h index 34330815..d117b910 100644 --- a/usb/gadget/UsbGadget.h +++ b/usb/gadget/UsbGadget.h @@ -118,6 +118,7 @@ struct UsbGadget : public BnUsbGadget { // Indicates to the kernel that the gadget service is ready and the kernel can // set SDP timeout to a lower value. void updateSdpEnumTimeout(); + std::string mI2cClientPath; private: Status tearDownGadget(); diff --git a/usb/gadget/android.hardware.usb.gadget-service.rc b/usb/gadget/android.hardware.usb.gadget-service.rc index 68fd3ae7..98fc8530 100644 --- a/usb/gadget/android.hardware.usb.gadget-service.rc +++ b/usb/gadget/android.hardware.usb.gadget-service.rc @@ -7,7 +7,7 @@ on post-fs chown root system /sys/class/typec/port0/power_role chown root system /sys/class/typec/port0/data_role chown root system /sys/class/typec/port0/port_type - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/contaminant_detection chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_otg_b_sess chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_otg_id chown root system /sys/devices/platform/11210000.usb/usb_data_enabled diff --git a/usb/usb/Usb.cpp b/usb/usb/Usb.cpp index 555e6576..cff00bda 100644 --- a/usb/usb/Usb.cpp +++ b/usb/usb/Usb.cpp @@ -43,8 +43,9 @@ #include #include -#include #include +#include +#include namespace usb_flags = android::hardware::usb::flags; @@ -55,6 +56,7 @@ using android::base::Trim; using android::hardware::google::pixel::getStatsService; using android::hardware::google::pixel::PixelAtoms::VendorUsbPortOverheat; using android::hardware::google::pixel::reportUsbPortOverheat; +using android::hardware::google::pixel::usb::getI2cClientPath; using android::String8; using android::Vector; @@ -67,18 +69,19 @@ volatile bool destroyThread; string enabledPath; constexpr char kHsi2cPath[] = "/sys/devices/platform/10d60000.hsi2c"; -constexpr char kI2CPath[] = "/sys/devices/platform/10d60000.hsi2c/i2c-"; +constexpr char kTcpcDevName[] = "i2c-max77759tcpc"; +constexpr char kI2cClientId[] = "0025"; constexpr char kComplianceWarningsPath[] = "device/non_compliant_reasons"; constexpr char kComplianceWarningBC12[] = "bc12"; constexpr char kComplianceWarningDebugAccessory[] = "debug-accessory"; constexpr char kComplianceWarningMissingRp[] = "missing_rp"; constexpr char kComplianceWarningOther[] = "other"; constexpr char kComplianceWarningInputPowerLimited[] = "input_power_limited"; -constexpr char kContaminantDetectionPath[] = "i2c-max77759tcpc/contaminant_detection"; -constexpr char kStatusPath[] = "i2c-max77759tcpc/contaminant_detection_status"; -constexpr char kSinkLimitEnable[] = "i2c-max77759tcpc/usb_limit_sink_enable"; -constexpr char kSourceLimitEnable[] = "i2c-max77759tcpc/usb_limit_source_enable"; -constexpr char kSinkLimitCurrent[] = "i2c-max77759tcpc/usb_limit_sink_current"; +constexpr char kContaminantDetectionPath[] = "contaminant_detection"; +constexpr char kStatusPath[] = "contaminant_detection_status"; +constexpr char kSinkLimitEnable[] = "usb_limit_sink_enable"; +constexpr char kSourceLimitEnable[] = "usb_limit_source_enable"; +constexpr char kSinkLimitCurrent[] = "usb_limit_sink_current"; constexpr char kTypecPath[] = "/sys/class/typec"; constexpr char kDisableContatminantDetection[] = "vendor.usb.contaminantdisable"; constexpr char kOverheatStatsPath[] = "/sys/devices/platform/google,usbc_port_cooling_dev/"; @@ -245,31 +248,9 @@ ScopedAStatus Usb::resetUsbPort(const std::string& in_portName, int64_t in_trans return ::ndk::ScopedAStatus::ok(); } -Status getI2cBusHelper(string *name) { - DIR *dp; - - dp = opendir(kHsi2cPath); - if (dp != NULL) { - struct dirent *ep; - - while ((ep = readdir(dp))) { - if (ep->d_type == DT_DIR) { - if (string::npos != string(ep->d_name).find("i2c-")) { - std::strtok(ep->d_name, "-"); - *name = std::strtok(NULL, "-"); - } - } - } - closedir(dp); - return Status::SUCCESS; - } - - ALOGE("Failed to open %s", kHsi2cPath); - return Status::ERROR; -} - -Status queryMoistureDetectionStatus(std::vector *currentPortStatus) { - string enabled, status, path, DetectedPath; +Status queryMoistureDetectionStatus(android::hardware::usb::Usb *usb, + std::vector *currentPortStatus) { + string enabled, status, DetectedPath; (*currentPortStatus)[0].supportedContaminantProtectionModes .push_back(ContaminantProtectionMode::FORCE_DISABLE); @@ -278,8 +259,15 @@ Status queryMoistureDetectionStatus(std::vector *currentPortStatus) (*currentPortStatus)[0].supportsEnableContaminantPresenceDetection = true; (*currentPortStatus)[0].supportsEnableContaminantPresenceProtection = false; - getI2cBusHelper(&path); - enabledPath = kI2CPath + path + "/" + kContaminantDetectionPath; + if (usb->mI2cClientPath.empty()) { + usb->mI2cClientPath = getI2cClientPath(kHsi2cPath, kTcpcDevName, kI2cClientId); + if (usb->mI2cClientPath.empty()) { + ALOGE("%s: Unable to locate i2c bus node", __func__); + return Status::ERROR; + } + } + + enabledPath = usb->mI2cClientPath + kContaminantDetectionPath; if (!ReadFileToString(enabledPath, &enabled)) { ALOGE("Failed to open moisture_detection_enabled"); return Status::ERROR; @@ -287,7 +275,7 @@ Status queryMoistureDetectionStatus(std::vector *currentPortStatus) enabled = Trim(enabled); if (enabled == "1") { - DetectedPath = kI2CPath + path + "/" + kStatusPath; + DetectedPath = usb->mI2cClientPath + kStatusPath; if (!ReadFileToString(DetectedPath, &status)) { ALOGE("Failed to open moisture_detected"); return Status::ERROR; @@ -562,7 +550,8 @@ Usb::Usb() ThrottlingSeverity::NONE)}, kSamplingIntervalSec), mUsbDataEnabled(true), mUsbHubVendorCmdValue(GL852G_VENDOR_CMD_VALUE_DEFAULT), - mUsbHubVendorCmdIndex(GL852G_VENDOR_CMD_INDEX_DEFAULT) { + mUsbHubVendorCmdIndex(GL852G_VENDOR_CMD_INDEX_DEFAULT), + mI2cClientPath("") { pthread_condattr_t attr; if (pthread_condattr_init(&attr)) { ALOGE("pthread_condattr_init failed: %s", strerror(errno)); @@ -584,6 +573,11 @@ Usb::Usb() ALOGE("pthread creation failed %d\n", errno); abort(); } + + ALOGI("feature flag enable_usb_data_compliance_warning: %d", + usb_flags::enable_usb_data_compliance_warning()); + ALOGI("feature flag enable_input_power_limited_warning: %d", + usb_flags::enable_input_power_limited_warning()); } ScopedAStatus Usb::switchRole(const string& in_portName, const PortRole& in_role, @@ -645,12 +639,19 @@ ScopedAStatus Usb::limitPowerTransfer(const string& in_portName, bool in_limit, int64_t in_transactionId) { bool sessionFail = false, success; std::vector currentPortStatus; - string path, sinkLimitEnablePath, currentLimitPath, sourceLimitEnablePath; + string sinkLimitEnablePath, currentLimitPath, sourceLimitEnablePath; - getI2cBusHelper(&path); - sinkLimitEnablePath = kI2CPath + path + "/" + kSinkLimitEnable; - currentLimitPath = kI2CPath + path + "/" + kSinkLimitCurrent; - sourceLimitEnablePath = kI2CPath + path + "/" + kSourceLimitEnable; + if (mI2cClientPath.empty()) { + mI2cClientPath = getI2cClientPath(kHsi2cPath, kTcpcDevName, kI2cClientId); + if (mI2cClientPath.empty()) { + ALOGE("%s: Unable to locate i2c bus node", __func__); + return ScopedAStatus::ok(); + } + } + + sinkLimitEnablePath = mI2cClientPath + kSinkLimitEnable; + currentLimitPath = mI2cClientPath + kSinkLimitCurrent; + sourceLimitEnablePath = mI2cClientPath + kSourceLimitEnable; pthread_mutex_lock(&mLock); if (in_limit) { @@ -690,11 +691,19 @@ ScopedAStatus Usb::limitPowerTransfer(const string& in_portName, bool in_limit, return ScopedAStatus::ok(); } -Status queryPowerTransferStatus(std::vector *currentPortStatus) { - string limitedPath, enabled, path; +Status queryPowerTransferStatus(android::hardware::usb::Usb *usb, + std::vector *currentPortStatus) { + string limitedPath, enabled; - getI2cBusHelper(&path); - limitedPath = kI2CPath + path + "/" + kSinkLimitEnable; + if (usb->mI2cClientPath.empty()) { + usb->mI2cClientPath = getI2cClientPath(kHsi2cPath, kTcpcDevName, kI2cClientId); + if (usb->mI2cClientPath.empty()) { + ALOGE("%s: Unable to locate i2c bus node", __func__); + return Status::ERROR; + } + } + + limitedPath = usb->mI2cClientPath + kSinkLimitEnable; if (!ReadFileToString(limitedPath, &enabled)) { ALOGE("Failed to open limit_sink_enable"); return Status::ERROR; @@ -948,8 +957,8 @@ void queryVersionHelper(android::hardware::usb::Usb *usb, Status status; pthread_mutex_lock(&usb->mLock); status = getPortStatusHelper(usb, currentPortStatus); - queryMoistureDetectionStatus(currentPortStatus); - queryPowerTransferStatus(currentPortStatus); + queryMoistureDetectionStatus(usb, currentPortStatus); + queryPowerTransferStatus(usb, currentPortStatus); queryNonCompliantChargerStatus(currentPortStatus); queryUsbDataSession(usb, currentPortStatus); if (usb->mCallback != NULL) { diff --git a/usb/usb/Usb.h b/usb/usb/Usb.h index 495a467f..779e7254 100644 --- a/usb/usb/Usb.h +++ b/usb/usb/Usb.h @@ -99,6 +99,7 @@ struct Usb : public BnUsb { // Usb hub vendor command settings for JK level tuning int mUsbHubVendorCmdValue; int mUsbHubVendorCmdIndex; + std::string mI2cClientPath; private: pthread_t mPoll; diff --git a/usb/usb/UsbDataSessionMonitor.cpp b/usb/usb/UsbDataSessionMonitor.cpp index 77defb30..bff52f06 100644 --- a/usb/usb/UsbDataSessionMonitor.cpp +++ b/usb/usb/UsbDataSessionMonitor.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,9 @@ namespace usb { #define UEVENT_MSG_LEN 2048 #define USB_STATE_MAX_LEN 20 #define DATA_ROLE_MAX_LEN 10 +#define WARNING_SURFACE_DELAY_SEC 5 +#define ENUM_FAIL_DEFAULT_COUNT_THRESHOLD 3 +#define DEVICE_FLAKY_CONNECTION_CONFIGURED_COUNT_THRESHOLD 5 constexpr char kUdcConfigfsPath[] = "/config/usb_gadget/g1/UDC"; constexpr char kNotAttachedState[] = "not attached\n"; @@ -115,6 +119,15 @@ UsbDataSessionMonitor::UsbDataSessionMonitor( if (addEpollFd(epollFd, ueventFd)) abort(); + unique_fd timerFd(timerfd_create(CLOCK_BOOTTIME, TFD_NONBLOCK)); + if (timerFd.get() == -1) { + ALOGE("create timerFd failed"); + abort(); + } + + if (addEpollFd(epollFd, timerFd)) + abort(); + if (addEpollFile(epollFd.get(), dataRolePath, mDataRoleFd) != 0) { ALOGE("monitor data role failed"); abort(); @@ -139,6 +152,7 @@ UsbDataSessionMonitor::UsbDataSessionMonitor( mEpollFd = std::move(epollFd); mUeventFd = std::move(ueventFd); + mTimerFd = std::move(timerFd); mUpdatePortStatusCb = updatePortStatusCb; if (ReadFileToString(kUdcConfigfsPath, &udc) && !udc.empty()) @@ -150,6 +164,9 @@ UsbDataSessionMonitor::UsbDataSessionMonitor( ALOGE("pthread creation failed %d", errno); abort(); } + + ALOGI("feature flag enable_report_usb_data_compliance_warning: %d", + usb_flags::enable_report_usb_data_compliance_warning()); } UsbDataSessionMonitor::~UsbDataSessionMonitor() {} @@ -223,13 +240,55 @@ void UsbDataSessionMonitor::notifyComplianceWarning() { void UsbDataSessionMonitor::evaluateComplianceWarning() { std::set newWarningSet; + int elapsedTimeSec; - // TODO: add heuristics and update newWarningSet - if (mDataRole == PortDataRole::DEVICE && mUdcBind) { - } else if (mDataRole == PortDataRole::HOST) { + elapsedTimeSec = + std::chrono::duration_cast(boot_clock::now() - mDataSessionStart) + .count(); + + if (elapsedTimeSec >= WARNING_SURFACE_DELAY_SEC) { + if (mDataRole == PortDataRole::DEVICE && mUdcBind) { + int configuredCount = std::count(mDeviceState.states.begin(), + mDeviceState.states.end(), kConfiguredState); + int defaultCount = + std::count(mDeviceState.states.begin(), mDeviceState.states.end(), kDefaultState); + + if (configuredCount == 0 && defaultCount > ENUM_FAIL_DEFAULT_COUNT_THRESHOLD) + newWarningSet.insert(ComplianceWarning::ENUMERATION_FAIL); + + if (configuredCount > DEVICE_FLAKY_CONNECTION_CONFIGURED_COUNT_THRESHOLD) + newWarningSet.insert(ComplianceWarning::FLAKY_CONNECTION); + } else if (mDataRole == PortDataRole::HOST) { + int host1StateCount = mHost1State.states.size(); + int host1ConfiguredCount = + std::count(mHost1State.states.begin(), mHost1State.states.end(), kConfiguredState); + int host1DefaultCount = + std::count(mHost1State.states.begin(), mHost1State.states.end(), kDefaultState); + int host2StateCount = mHost2State.states.size(); + int host2ConfiguredCount = + std::count(mHost2State.states.begin(), mHost2State.states.end(), kConfiguredState); + int host2DefaultCount = + std::count(mHost2State.states.begin(), mHost2State.states.end(), kDefaultState); + + if (host1ConfiguredCount == 0 && host2ConfiguredCount == 0 && + (host1DefaultCount > ENUM_FAIL_DEFAULT_COUNT_THRESHOLD || + host2DefaultCount > ENUM_FAIL_DEFAULT_COUNT_THRESHOLD)) + newWarningSet.insert(ComplianceWarning::ENUMERATION_FAIL); + + if (host1StateCount == 1 && mHost1State.states.front() == kNotAttachedState && + host2StateCount == 1 && mHost2State.states.front() == kNotAttachedState) + newWarningSet.insert(ComplianceWarning::MISSING_DATA_LINES); + } } if (newWarningSet != mWarningSet) { + std::string newWarningString; + + for (auto e : newWarningSet) { + newWarningString += toString(e) + " "; + } + ALOGI("Usb data compliance warning changed to: %s", newWarningString.c_str()); + mWarningSet = newWarningSet; notifyComplianceWarning(); } @@ -259,6 +318,26 @@ void UsbDataSessionMonitor::handleDeviceStateEvent(struct usbDeviceState *device evaluateComplianceWarning(); } +void UsbDataSessionMonitor::setupNewSession() { + mWarningSet.clear(); + mDataSessionStart = boot_clock::now(); + + if (mDataRole == PortDataRole::DEVICE) { + clearDeviceStateEvents(&mDeviceState); + } else if (mDataRole == PortDataRole::HOST) { + clearDeviceStateEvents(&mHost1State); + clearDeviceStateEvents(&mHost2State); + } + + if (mDataRole != PortDataRole::NONE) { + struct itimerspec delay = itimerspec(); + delay.it_value.tv_sec = WARNING_SURFACE_DELAY_SEC; + int ret = timerfd_settime(mTimerFd.get(), 0, &delay, NULL); + if (ret < 0) + ALOGE("timerfd_settime failed err:%d", errno); + } +} + void UsbDataSessionMonitor::handleDataRoleEvent() { int n; PortDataRole newDataRole; @@ -283,17 +362,8 @@ void UsbDataSessionMonitor::handleDataRoleEvent() { reportUsbDataSessionMetrics(); } - // Set up for the new data session - mWarningSet.clear(); mDataRole = newDataRole; - mDataSessionStart = boot_clock::now(); - - if (newDataRole == PortDataRole::DEVICE) { - clearDeviceStateEvents(&mDeviceState); - } else if (newDataRole == PortDataRole::HOST) { - clearDeviceStateEvents(&mHost1State); - clearDeviceStateEvents(&mHost2State); - } + setupNewSession(); } } @@ -328,8 +398,7 @@ void UsbDataSessionMonitor::updateUdcBindStatus(const std::string &devname) { } else if (!mUdcBind && newUdcBind) { // Gadget soft pullup: reset and start accounting for a new data session. - clearDeviceStateEvents(&mDeviceState); - mDataSessionStart = boot_clock::now(); + setupNewSession(); } } @@ -383,6 +452,23 @@ void UsbDataSessionMonitor::handleUevent() { } } +void UsbDataSessionMonitor::handleTimerEvent() { + int byteRead; + uint64_t numExpiration; + + byteRead = read(mTimerFd.get(), &numExpiration, sizeof(numExpiration)); + + if (byteRead != sizeof(numExpiration)) { + ALOGE("incorrect read size"); + } + + if (numExpiration != 1) { + ALOGE("incorrect expiration count"); + } + + evaluateComplianceWarning(); +} + void *UsbDataSessionMonitor::monitorThread(void *param) { UsbDataSessionMonitor *monitor = (UsbDataSessionMonitor *)param; struct epoll_event events[64]; @@ -400,6 +486,8 @@ void *UsbDataSessionMonitor::monitorThread(void *param) { for (int n = 0; n < nevents; ++n) { if (events[n].data.fd == monitor->mUeventFd.get()) { monitor->handleUevent(); + } else if (events[n].data.fd == monitor->mTimerFd.get()) { + monitor->handleTimerEvent(); } else if (events[n].data.fd == monitor->mDataRoleFd.get()) { monitor->handleDataRoleEvent(); } else if (events[n].data.fd == monitor->mDeviceState.fd.get()) { diff --git a/usb/usb/UsbDataSessionMonitor.h b/usb/usb/UsbDataSessionMonitor.h index 596f378f..aced8a48 100644 --- a/usb/usb/UsbDataSessionMonitor.h +++ b/usb/usb/UsbDataSessionMonitor.h @@ -75,9 +75,11 @@ class UsbDataSessionMonitor { static void *monitorThread(void *param); void handleUevent(); + void handleTimerEvent(); void handleDataRoleEvent(); void handleDeviceStateEvent(struct usbDeviceState *deviceState); void clearDeviceStateEvents(struct usbDeviceState *deviceState); + void setupNewSession(); void reportUsbDataSessionMetrics(); void evaluateComplianceWarning(); void notifyComplianceWarning(); @@ -86,6 +88,7 @@ class UsbDataSessionMonitor { pthread_t mMonitor; unique_fd mEpollFd; unique_fd mUeventFd; + unique_fd mTimerFd; unique_fd mDataRoleFd; struct usbDeviceState mDeviceState; struct usbDeviceState mHost1State; diff --git a/usb/usb/android.hardware.usb-service.rc b/usb/usb/android.hardware.usb-service.rc index d6ef15d5..881317e1 100644 --- a/usb/usb/android.hardware.usb-service.rc +++ b/usb/usb/android.hardware.usb-service.rc @@ -8,146 +8,20 @@ on post-fs chown root system /sys/class/typec/port0/power_role chown root system /sys/class/typec/port0/data_role chown root system /sys/class/typec/port0/port_type - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/contaminant_detection - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_current - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_enable - 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-7/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_source_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/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/update_sdp_enum_timeout - chown root system /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/update_sdp_enum_timeout + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/contaminant_detection + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_accessory_current + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_accessory_enable + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_sink_current + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_sink_enable + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_source_enable + chown root system /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/update_sdp_enum_timeout 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/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/contaminant_detection - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/contaminant_detection - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/contaminant_detection - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/contaminant_detection - 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-7/i2c-max77759tcpc/contaminant_detection - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/contaminant_detection - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/contaminant_detection - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_accessory_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_current - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_sink_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/usb_limit_source_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/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-0/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-1/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-3/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-4/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-7/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-8/i2c-max77759tcpc/update_sdp_enum_timeout - chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-9/i2c-max77759tcpc/update_sdp_enum_timeout + chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/contaminant_detection + chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_accessory_current + chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_accessory_enable + chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_sink_current + chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_sink_enable + chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/usb_limit_source_enable + chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-13/13-0025/update_sdp_enum_timeout