Merge changes from topic "318820040" into main

* changes:
  usb: select usb-service rc files based on device type
  usb: Runtime search the i2c path
This commit is contained in:
RD Babiera 2024-02-03 01:14:47 +00:00 committed by Android (Google) Code Review
commit 86d9057bab
9 changed files with 221 additions and 240 deletions

View file

@ -492,6 +492,12 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.usb.gadget-service
ifneq (,$(filter ripcurrentpro, $(TARGET_PRODUCT)))
PRODUCT_PACKAGES += usb_service_init_rc_i2c11
else
PRODUCT_PACKAGES += usb_service_init_rc_i2c6
endif
# MIDI feature
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml

View file

@ -17,7 +17,6 @@
#define LOG_TAG "android.hardware.usb.gadget.aidl-service"
#include "UsbGadget.h"
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/inotify.h>
@ -29,23 +28,30 @@
#include<android-base/properties.h>
#include <aidl/android/frameworks/stats/IStats.h>
#include <pixelusb/I2cHelper.h>
namespace aidl {
namespace android {
namespace hardware {
namespace usb {
namespace gadget {
#define NUM_HSI2C_PATHS 2
using ::android::hardware::google::pixel::usb::getI2cClientPath;
using ::android::base::GetBoolProperty;
using ::android::hardware::google::pixel::usb::kUvcEnabled;
string enabledPath;
constexpr char kHsi2cPath[] = "/sys/devices/platform/108d0000.hsi2c";
constexpr char kI2CPath[] = "/sys/devices/platform/108d0000.hsi2c/i2c-";
constexpr char kAccessoryLimitCurrent[] = "-0025/usb_limit_accessory_current";
constexpr char kAccessoryLimitCurrentEnable[] = "-0025/usb_limit_accessory_enable";
constexpr char* kHsi2cPaths[] = { (char *) "/sys/devices/platform/108d0000.hsi2c",
(char *) "/sys/devices/platform/10cb0000.hsi2c" };
constexpr char kTcpcDevName[] = "i2c-max77759tcpc";
constexpr char kI2cClientId[] = "0025";
constexpr char kAccessoryLimitCurrent[] = "usb_limit_accessory_current";
constexpr char kAccessoryLimitCurrentEnable[] = "usb_limit_accessory_enable";
UsbGadget::UsbGadget() : mGadgetIrqPath("") {
UsbGadget::UsbGadget() : mGadgetIrqPath(""),
mI2cClientPath("") {
if (access(OS_DESC_PATH, R_OK) != 0) {
ALOGE("configfs setup not done yet");
abort();
@ -445,29 +451,6 @@ Status UsbGadget::setupFunctions(long functions,
return Status::SUCCESS;
}
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;
}
ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions,
const shared_ptr<IUsbGadgetCallback> &callback,
int64_t timeout,
@ -475,15 +458,23 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions,
std::unique_lock<std::mutex> 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 + "/" + path + kAccessoryLimitCurrent;
accessoryCurrentLimitEnablePath = kI2CPath + path + "/" + path + kAccessoryLimitCurrentEnable;
if (mI2cClientPath.empty()) {
for (int i = 0; i < NUM_HSI2C_PATHS; i++) {
mI2cClientPath = getI2cClientPath(kHsi2cPaths[i], kTcpcDevName, kI2cClientId);
if (mI2cClientPath.empty()) {
ALOGE("%s: Unable to locate i2c bus node", __func__);
} else {
break;
}
}
}
accessoryCurrentLimitPath = mI2cClientPath + kAccessoryLimitCurrent;
accessoryCurrentLimitEnablePath = mI2cClientPath + kAccessoryLimitCurrentEnable;
// Get the gadget IRQ number before tearDownGadget()
if (mGadgetIrqPath.empty())

View file

@ -115,6 +115,8 @@ struct UsbGadget : public BnUsbGadget {
ScopedAStatus setVidPid(const char *vid,const char *pid);
std::string mI2cClientPath;
private:
Status tearDownGadget();
Status getUsbGadgetIrqPath();

View file

@ -28,7 +28,6 @@ package {
cc_binary {
name: "android.hardware.usb-service",
relative_install_path: "hw",
init_rc: ["android.hardware.usb-service.rc"],
vintf_fragments: ["android.hardware.usb-service.xml"],
vendor: true,
srcs: [
@ -68,6 +67,22 @@ cc_binary {
],
}
prebuilt_etc {
name: "usb_service_init_rc_i2c6",
vendor: true,
filename: "android.hardware.usb-service-i2c6.rc",
src: "android.hardware.usb-service-i2c6.rc",
sub_dir: "init",
}
prebuilt_etc {
name: "usb_service_init_rc_i2c11",
vendor: true,
filename: "android.hardware.usb-service-i2c11.rc",
src: "android.hardware.usb-service-i2c11.rc",
sub_dir: "init",
}
cc_aconfig_library {
name: "android.hardware.usb.flags-aconfig-c-lib",
vendor: true,

View file

@ -42,8 +42,9 @@
#include <aidl/android/frameworks/stats/IStats.h>
#include <android_hardware_usb_flags.h>
#include <pixelusb/UsbGadgetAidlCommon.h>
#include <pixelstats/StatsHelper.h>
#include <pixelusb/I2cHelper.h>
#include <pixelusb/UsbGadgetAidlCommon.h>
namespace usb_flags = android::hardware::usb::flags;
@ -56,19 +57,23 @@ 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;
namespace aidl {
namespace android {
namespace hardware {
namespace usb {
#define NUM_HSI2C_PATHS 2
// Set by the signal handler to destroy the thread
volatile bool destroyThread;
volatile bool destroyDisplayPortThread;
string enabledPath;
constexpr char kHsi2cPath[] = "/sys/devices/platform/108d0000.hsi2c";
constexpr char kI2CPath[] = "/sys/devices/platform/108d0000.hsi2c/i2c-";
constexpr char kContaminantDetectionPath[] = "-0025/contaminant_detection";
constexpr char *kHsi2cPaths[] = { (char *) "/sys/devices/platform/108d0000.hsi2c",
(char *) "/sys/devices/platform/10cb0000.hsi2c" };
constexpr char kTcpcDevName[] = "i2c-max77759tcpc";
constexpr char kI2cClientId[] = "0025";
constexpr char kDisplayPortDrmPath[] = "/sys/devices/platform/110f0000.drmdp/drm-displayport/";
constexpr char kDisplayPortUsbPath[] = "/sys/class/typec/port0-partner/";
constexpr char kComplianceWarningsPath[] = "device/non_compliant_reasons";
@ -77,10 +82,11 @@ constexpr char kComplianceWarningDebugAccessory[] = "debug-accessory";
constexpr char kComplianceWarningMissingRp[] = "missing_rp";
constexpr char kComplianceWarningOther[] = "other";
constexpr char kComplianceWarningInputPowerLimited[] = "input_power_limited";
constexpr char kStatusPath[] = "-0025/contaminant_detection_status";
constexpr char kSinkLimitEnable[] = "-0025/usb_limit_sink_enable";
constexpr char kSourceLimitEnable[] = "-0025/usb_limit_source_enable";
constexpr char kSinkLimitCurrent[] = "-0025/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/";
@ -92,7 +98,7 @@ constexpr char kThermalZoneForTempReadSecondary2[] = "qi_therm";
constexpr char kPogoUsbActive[] = "/sys/devices/platform/google,pogo/pogo_usb_active";
constexpr char kPogoEnableUsb[] = "/sys/devices/platform/google,pogo/enable_usb";
constexpr char kPowerSupplyUsbType[] = "/sys/class/power_supply/usb/usb_type";
constexpr char kIrqHpdCounPath[] = "-0025/irq_hpd_count";
constexpr char kIrqHpdCount[] = "irq_hpd_count";
constexpr char kUdcUeventRegex[] =
"/devices/platform/11210000.usb/11210000.dwc3/udc/11210000.dwc3";
constexpr char kUdcStatePath[] =
@ -272,31 +278,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<PortStatus> *currentPortStatus) {
string enabled, status, path, DetectedPath;
Status queryMoistureDetectionStatus(android::hardware::usb::Usb *usb,
std::vector<PortStatus> *currentPortStatus) {
string enabled, status, DetectedPath;
(*currentPortStatus)[0].supportedContaminantProtectionModes
.push_back(ContaminantProtectionMode::FORCE_DISABLE);
@ -305,8 +289,18 @@ Status queryMoistureDetectionStatus(std::vector<PortStatus> *currentPortStatus)
(*currentPortStatus)[0].supportsEnableContaminantPresenceDetection = true;
(*currentPortStatus)[0].supportsEnableContaminantPresenceProtection = false;
getI2cBusHelper(&path);
enabledPath = kI2CPath + path + "/" + path + kContaminantDetectionPath;
if (usb->mI2cClientPath.empty()) {
for (int i = 0; i < NUM_HSI2C_PATHS; i++) {
usb->mI2cClientPath = getI2cClientPath(kHsi2cPaths[i], kTcpcDevName, kI2cClientId);
if (usb->mI2cClientPath.empty()) {
ALOGE("%s: Unable to locate i2c bus node", __func__);
} else {
break;
}
}
}
enabledPath = usb->mI2cClientPath + kContaminantDetectionPath;
if (!ReadFileToString(enabledPath, &enabled)) {
ALOGE("Failed to open moisture_detection_enabled");
return Status::ERROR;
@ -314,7 +308,7 @@ Status queryMoistureDetectionStatus(std::vector<PortStatus> *currentPortStatus)
enabled = Trim(enabled);
if (enabled == "1") {
DetectedPath = kI2CPath + path + "/" + path + kStatusPath;
DetectedPath = usb->mI2cClientPath + kStatusPath;
if (!ReadFileToString(DetectedPath, &status)) {
ALOGE("Failed to open moisture_detected");
return Status::ERROR;
@ -533,6 +527,7 @@ Usb::Usb()
ZoneInfo(TemperatureType::UNKNOWN, kThermalZoneForTempReadSecondary2,
ThrottlingSeverity::NONE)}, kSamplingIntervalSec),
mUsbDataEnabled(true),
mI2cClientPath(""),
mDisplayPortPollRunning(false),
mDisplayPortPollStarting(false),
mDisplayPortCVLock(PTHREAD_MUTEX_INITIALIZER),
@ -639,12 +634,22 @@ ScopedAStatus Usb::limitPowerTransfer(const string& in_portName, bool in_limit,
int64_t in_transactionId) {
bool sessionFail = false, success;
std::vector<PortStatus> currentPortStatus;
string path, sinkLimitEnablePath, currentLimitPath, sourceLimitEnablePath;
string sinkLimitEnablePath, currentLimitPath, sourceLimitEnablePath;
getI2cBusHelper(&path);
sinkLimitEnablePath = kI2CPath + path + "/" + path + kSinkLimitEnable;
currentLimitPath = kI2CPath + path + "/" + path + kSinkLimitCurrent;
sourceLimitEnablePath = kI2CPath + path + "/" + path + kSourceLimitEnable;
if (mI2cClientPath.empty()) {
for (int i = 0; i < NUM_HSI2C_PATHS; i++) {
mI2cClientPath = getI2cClientPath(kHsi2cPaths[i], kTcpcDevName, kI2cClientId);
if (mI2cClientPath.empty()) {
ALOGE("%s: Unable to locate i2c bus node", __func__);
} else {
break;
}
}
}
sinkLimitEnablePath = mI2cClientPath + kSinkLimitEnable;
currentLimitPath = mI2cClientPath + kSinkLimitCurrent;
sourceLimitEnablePath = mI2cClientPath + kSourceLimitEnable;
pthread_mutex_lock(&mLock);
if (in_limit) {
@ -684,11 +689,22 @@ ScopedAStatus Usb::limitPowerTransfer(const string& in_portName, bool in_limit,
return ScopedAStatus::ok();
}
Status queryPowerTransferStatus(std::vector<PortStatus> *currentPortStatus) {
string limitedPath, enabled, path;
Status queryPowerTransferStatus(android::hardware::usb::Usb *usb,
std::vector<PortStatus> *currentPortStatus) {
string limitedPath, enabled;
getI2cBusHelper(&path);
limitedPath = kI2CPath + path + "/" + path + kSinkLimitEnable;
if (usb->mI2cClientPath.empty()) {
for (int i = 0; i < NUM_HSI2C_PATHS; i++) {
usb->mI2cClientPath = getI2cClientPath(kHsi2cPaths[i], kTcpcDevName, kI2cClientId);
if (usb->mI2cClientPath.empty()) {
ALOGE("%s: Unable to locate i2c bus node", __func__);
} else {
break;
}
}
}
limitedPath = usb->mI2cClientPath + kSinkLimitEnable;
if (!ReadFileToString(limitedPath, &enabled)) {
ALOGE("Failed to open limit_sink_enable");
return Status::ERROR;
@ -1085,8 +1101,8 @@ void queryVersionHelper(android::hardware::usb::Usb *usb,
pthread_mutex_lock(&usb->mLock);
status = getPortStatusHelper(usb, currentPortStatus);
queryMoistureDetectionStatus(currentPortStatus);
queryPowerTransferStatus(currentPortStatus);
queryMoistureDetectionStatus(usb, currentPortStatus);
queryPowerTransferStatus(usb, currentPortStatus);
queryNonCompliantChargerStatus(currentPortStatus);
pthread_mutex_lock(&usb->mDisplayPortLock);
if (!usb->mDisplayPortFirstSetupDone &&
@ -1603,8 +1619,18 @@ void *displayPortPollWork(void *param) {
partnerActivePath = displayPortUsbPath + "../mode1/active";
portActivePath = "/sys/class/typec/port0/port0.0/mode1/active";
getI2cBusHelper(&tcpcI2cBus);
irqHpdCountPath = kI2CPath + tcpcI2cBus + "/" + tcpcI2cBus + kIrqHpdCounPath;
if (usb->mI2cClientPath.empty()) {
for (int i = 0; i < NUM_HSI2C_PATHS; i++) {
usb->mI2cClientPath = getI2cClientPath(kHsi2cPaths[i], kTcpcDevName, kI2cClientId);
if (usb->mI2cClientPath.empty()) {
ALOGE("%s: Unable to locate i2c bus node", __func__);
} else {
break;
}
}
}
irqHpdCountPath = usb->mI2cClientPath + kIrqHpdCount;
ALOGI("usbdp: worker: irqHpdCountPath:%s", irqHpdCountPath.c_str());
epoll_fd = epoll_create(64);

View file

@ -129,6 +129,8 @@ struct Usb : public BnUsb {
float mPluggedTemperatureCelsius;
// Usb Data status
bool mUsbDataEnabled;
std::string mI2cClientPath;
// True when mDisplayPortPoll pthread is running
volatile bool mDisplayPortPollRunning;
volatile bool mDisplayPortPollStarting;

View file

@ -0,0 +1,47 @@
service vendor.usb /vendor/bin/hw/android.hardware.usb-service
class hal
user system
group system shell wakelock
capabilities WAKE_ALARM BLOCK_SUSPEND
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/class/typec/port0/port0.0/mode1/active
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/contaminant_detection
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_current
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_source_enable
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
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
chmod 664 /sys/class/typec/port0/port0.0/mode1/active
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/10cb0000.hsi2c/i2c-11/11-0025/contaminant_detection
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/10cb0000.hsi2c/i2c-11/11-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
chmod 664 /sys/devices/platform/google,pogo/enable_usb

View file

@ -0,0 +1,47 @@
service vendor.usb /vendor/bin/hw/android.hardware.usb-service
class hal
user system
group system shell wakelock
capabilities WAKE_ALARM BLOCK_SUSPEND
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/class/typec/port0/port0.0/mode1/active
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_source_enable
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
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
chmod 664 /sys/class/typec/port0/port0.0/mode1/active
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/108d0000.hsi2c/i2c-6/6-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
chmod 664 /sys/devices/platform/google,pogo/enable_usb

View file

@ -1,155 +0,0 @@
service vendor.usb /vendor/bin/hw/android.hardware.usb-service
class hal
user system
group system shell wakelock
capabilities WAKE_ALARM BLOCK_SUSPEND
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/class/typec/port0/port0.0/mode1/active
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/contaminant_detection
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_accessory_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_accessory_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_sink_current
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_sink_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_source_enable
chown root system /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_source_enable
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
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
chmod 664 /sys/class/typec/port0/port0.0/mode1/active
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/108d0000.hsi2c/i2c-0/0-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/contaminant_detection
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_accessory_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_accessory_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_sink_current
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_sink_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-0/0-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-1/1-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-2/2-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-3/3-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-4/4-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-5/5-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-6/6-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-7/7-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-8/8-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/108d0000.hsi2c/i2c-9/9-0025/usb_limit_source_enable
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/hpd
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/irq_hpd
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
chmod 664 /sys/devices/platform/google,pogo/enable_usb