Lines Matching defs:powerRole
32 int32_t UsbdPort::IfCanSwitch(int32_t portId, int32_t powerRole, int32_t dataRole)
39 if (powerRole <= POWER_ROLE_NONE || powerRole >= POWER_ROLE_MAX) {
40 HDF_LOGE("%{public}s: powerRole error", __func__);
71 int32_t UsbdPort::WritePortFile(int32_t powerRole, int32_t dataRole, int32_t mode)
109 int32_t UsbdPort::ReadPortFile(int32_t &powerRole, int32_t &dataRole, int32_t &mode)
127 powerRole = POWER_ROLE_SOURCE;
134 powerRole = POWER_ROLE_SINK;
149 int32_t UsbdPort::SetPortInit(int32_t portId, int32_t powerRole, int32_t dataRole)
151 auto ret = IfCanSwitch(portId, powerRole, dataRole);
158 if (powerRole == POWER_ROLE_SOURCE && dataRole == DATA_ROLE_HOST) {
162 if (powerRole == POWER_ROLE_SINK && dataRole == DATA_ROLE_DEVICE) {
166 if (WritePortFile(powerRole, dataRole, mode)) {
170 currentPortInfo_.powerRole = powerRole;
180 int32_t portId, int32_t powerRole, int32_t dataRole, UsbdSubscriber *usbdSubscribers, uint32_t len)
182 int32_t ret = SetPortInit(portId, powerRole, dataRole);
196 int32_t UsbdPort::QueryPort(int32_t &portId, int32_t &powerRole, int32_t &dataRole, int32_t &mode)
198 (void)ReadPortFile(currentPortInfo_.powerRole, currentPortInfo_.dataRole, currentPortInfo_.mode);
200 powerRole = currentPortInfo_.powerRole;
210 currentPortInfo_.powerRole = POWER_ROLE_SOURCE;
215 currentPortInfo_.powerRole = POWER_ROLE_SINK;