Skip to content

Commit bc44172

Browse files
committed
tgl: Don't get PD version from EC
That EC command is not supported on TGL. Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 6fd13f2 commit bc44172

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

framework_lib/src/commandline/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,14 @@ fn selftest(ec: &CrosEc) -> Option<()> {
10651065
return None;
10661066
}
10671067

1068-
// Try to get PD versions through EC
1069-
power::read_pd_version(ec).ok()?;
1068+
println!("Reading PD Version from EC");
1069+
if let Err(err) = power::read_pd_version(ec) {
1070+
// TGL does not have this command, so we have to ignore it
1071+
if err != EcError::Response(EcResponseStatus::InvalidCommand) {
1072+
println!("Err: {:?}", err);
1073+
return None;
1074+
}
1075+
}
10701076

10711077
let pd_01 = PdController::new(PdPort::Left01, ec.clone());
10721078
let pd_23 = PdController::new(PdPort::Right23, ec.clone());

framework_lib/src/power.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ pub fn print_memmap_version_info(ec: &CrosEc) {
191191
let _events_ver = ec.read_memory(EC_MEMMAP_EVENTS_VERSION, 2).unwrap();
192192
}
193193

194+
/// Not supported on TGL EC
194195
pub fn get_als_reading(ec: &CrosEc) -> Option<u32> {
195196
let als = ec.read_memory(EC_MEMMAP_ALS, 0x04)?;
196197
Some(u32::from_le_bytes([als[0], als[1], als[2], als[3]]))

0 commit comments

Comments
 (0)