File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff 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 ( ) ) ;
Original file line number Diff line number Diff 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
194195pub 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 ] ] ) )
You can’t perform that action at this time.
0 commit comments