Skip to content

Commit 85814c0

Browse files
authored
async/embassy/ucsi: Remove SET_UOR workaround (#79)
This was originally put in as a workaround for a bug in the PD controller. SET_UOR is verified to work correctly now.
1 parent 8bd6fa2 commit 85814c0

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/asynchronous/embassy/ucsi.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,31 +64,6 @@ impl<'a, M: RawMutex, B: I2c> Tps6699x<'a, M, B> {
6464
Ok(ReturnValue::Success)
6565
}
6666

67-
async fn execute_set_uor(
68-
&mut self,
69-
port: LocalPortId,
70-
args: &lpm::set_uor::Args,
71-
) -> Result<ReturnValue, Error<B::Error>> {
72-
// Controller implementation is broken, manual implementation
73-
if args.dfp() && args.ufp() {
74-
// Cannot attempt to enter both DFP and UFP modes at the same time
75-
error!("SET_UOR rejected: both UFP and DFP requested");
76-
return Ok(ReturnValue::Rejected);
77-
}
78-
79-
let mut port_control = self.get_port_control(port).await?;
80-
81-
port_control.set_initiate_swap_to_dfp(args.dfp());
82-
port_control.set_initiate_swap_to_ufp(args.ufp());
83-
port_control.set_process_swap_to_dfp(args.accept_swap());
84-
port_control.set_process_swap_to_ufp(args.accept_swap());
85-
86-
self.set_port_control(port, port_control).await?;
87-
88-
// No output data for this command
89-
Ok(ReturnValue::Success)
90-
}
91-
9267
pub async fn execute_ucsi_command(
9368
&mut self,
9469
command: &lpm::LocalCommand,
@@ -113,7 +88,6 @@ impl<'a, M: RawMutex, B: I2c> Tps6699x<'a, M, B> {
11388
lpm::CommandData::GetAlternateModes(_) => {
11489
self.execute_get_alternate_modes(port, &indata, &mut outdata).await?
11590
}
116-
lpm::CommandData::SetUor(args) => self.execute_set_uor(port, &args).await?,
11791
lpm::CommandData::GetPdos(args) => self.execute_get_pdos(port, &args, &indata, &mut outdata).await?,
11892
_rest => {
11993
self.execute_command(port, Command::Ucsi, Some(&indata), Some(&mut outdata))

0 commit comments

Comments
 (0)