Lines Matching refs:mode
71 int32_t UsbdPort::WritePortFile(int32_t powerRole, int32_t dataRole, int32_t mode) in WritePortFile() argument
75 if (mode == PORT_MODE_HOST || mode == PORT_MODE_DEVICE) { in WritePortFile()
76 switch (mode) { in WritePortFile()
109 int32_t UsbdPort::ReadPortFile(int32_t &powerRole, int32_t &dataRole, int32_t &mode) in ReadPortFile() argument
129 mode = PORT_MODE_HOST; in ReadPortFile()
136 mode = PORT_MODE_DEVICE; in ReadPortFile()
157 int32_t mode = PORT_MODE_DEVICE; in SetPortInit() local
159 mode = PORT_MODE_HOST; in SetPortInit()
163 mode = PORT_MODE_DEVICE; in SetPortInit()
166 if (WritePortFile(powerRole, dataRole, mode)) { in SetPortInit()
172 currentPortInfo_.mode = mode; in SetPortInit()
173 if (currentPortInfo_.mode == PORT_MODE_DEVICE) { in SetPortInit()
196 int32_t UsbdPort::QueryPort(int32_t &portId, int32_t &powerRole, int32_t &dataRole, int32_t &mode) in QueryPort() argument
198 … (void)ReadPortFile(currentPortInfo_.powerRole, currentPortInfo_.dataRole, currentPortInfo_.mode); in QueryPort()
202 mode = currentPortInfo_.mode; in QueryPort()
206 int32_t UsbdPort::UpdatePort(int32_t mode, const sptr<IUsbdSubscriber> &subscriber) in UpdatePort() argument
208 switch (mode) { in UpdatePort()
212 currentPortInfo_.mode = PORT_MODE_HOST; in UpdatePort()
217 currentPortInfo_.mode = PORT_MODE_DEVICE; in UpdatePort()
220 HDF_LOGE("%{public}s invalid mode:%{public}d", __func__, mode); in UpdatePort()