Modify file path for i2c devices

Bug: 188078957
Test: Verified using temporary log messages to confirm
file paths are formed correctly as otherwise to test queryMoistureDetectionStatus()
requires some mock circuits.

Signed-off-by: Manish Varma <varmam@google.com>
Change-Id: If5402d5999c77bf5a3431c70d800e50570b87c88
This commit is contained in:
Manish Varma 2021-05-13 18:49:04 -07:00 committed by TreeHugger Robot
parent af45f3e261
commit 3fd056fb40
3 changed files with 10 additions and 10 deletions

View file

@ -776,8 +776,8 @@ on post-fs-data
# ODPM
on fs
chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-6/6-001f/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails
chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-7/7-002f/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails
chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-6/i2c-s2mpg10mfd/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails
chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-7/i2c-s2mpg11mfd/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails
chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-7/7-001f/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails
chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-8/8-002f/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails
chown system system /sys/devices/platform/acpm_mfd_bus@17500000/i2c-7/i2c-s2mpg10mfd/s2mpg10-meter/s2mpg10-odpm/iio:device0/enabled_rails
chown system system /sys/devices/platform/acpm_mfd_bus@17510000/i2c-8/i2c-s2mpg11mfd/s2mpg11-meter/s2mpg11-odpm/iio:device1/enabled_rails

View file

@ -92,8 +92,8 @@ volatile bool destroyThread;
std::string enabledPath;
constexpr char kHsi2cPath[] = "/sys/devices/platform/10d50000.hsi2c";
constexpr char kI2CPath[] = "/sys/devices/platform/10d50000.hsi2c/i2c-";
constexpr char kContaminantDetectionPath[] = "-0025/contaminant_detection";
constexpr char kStatusPath[] = "-0025/contaminant_detection_status";
constexpr char kContaminantDetectionPath[] = "i2c-max77759tcpc/contaminant_detection";
constexpr char kStatusPath[] = "i2c-max77759tcpc/contaminant_detection_status";
constexpr char kTypecPath[] = "/sys/class/typec";
constexpr char kDisableContatminantDetection[] = "vendor.usb.contaminantdisable";
@ -176,14 +176,14 @@ Status queryMoistureDetectionStatus(hidl_vec<PortStatus> *currentPortStatus_1_2)
(*currentPortStatus_1_2)[0].supportsEnableContaminantPresenceProtection = false;
getContaminantDetectionNamesHelper(&path);
enabledPath = kI2CPath + path + "/" + path + kContaminantDetectionPath;
enabledPath = kI2CPath + path + "/" + kContaminantDetectionPath;
if (readFile(enabledPath, &enabled)) {
ALOGE("Failed to open moisture_detection_enabled");
return Status::ERROR;
}
if (enabled == "1") {
DetectedPath = kI2CPath + path + "/" + path + kStatusPath;
DetectedPath = kI2CPath + path + "/" + kStatusPath;
if (readFile(DetectedPath, &status)) {
ALOGE("Failed to open moisture_detected");
return Status::ERROR;

View file

@ -7,8 +7,8 @@ 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/10d50000.hsi2c/i2c-5/5-0025/contaminant_detection
chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/6-0025/contaminant_detection
chown root system /sys/devices/platform/10d50000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/10d50000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection
chown root system /sys/class/udc/11110000.usb/device/b_sess
chown root system /sys/class/udc/11110000.usb/device/id
chown root system /sys/class/udc/11110000.usb/device/usb_data_enabled