Lines Matching defs:dataRole
32 int32_t UsbdPort::IfCanSwitch(int32_t portId, int32_t powerRole, int32_t dataRole)
44 if (dataRole <= DATA_ROLE_NONE || dataRole >= DATA_ROLE_MAX) {
45 HDF_LOGE("%{public}s: dataRole 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)
128 dataRole = DATA_ROLE_HOST;
135 dataRole = DATA_ROLE_DEVICE;
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)) {
171 currentPortInfo_.dataRole = dataRole;
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);
201 dataRole = currentPortInfo_.dataRole;
211 currentPortInfo_.dataRole = DATA_ROLE_HOST;
216 currentPortInfo_.dataRole = DATA_ROLE_DEVICE;