@@ -420,50 +420,46 @@ fn print_versions(ec: &CrosEc) {
420420 println ! ( " Unknown" )
421421 }
422422
423- println ! ( "Retimers" ) ;
424- let mut found_retimer = false ;
423+ let has_retimer = matches ! (
424+ smbios:: get_platform( ) ,
425+ Some ( Platform :: IntelGen11 )
426+ | Some ( Platform :: IntelGen12 )
427+ | Some ( Platform :: IntelGen13 )
428+ | Some ( Platform :: IntelCoreUltra1 )
429+ ) ;
430+ let mut left_retimer: Option < u32 > = None ;
431+ let mut right_retimer: Option < u32 > = None ;
425432 if let Some ( esrt) = esrt:: get_esrt ( ) {
426433 for entry in & esrt. entries {
427- match entry. fw_class {
428- esrt:: TGL_RETIMER01_GUID
429- | esrt:: TGL_RETIMER23_GUID
430- | esrt:: ADL_RETIMER01_GUID
431- | esrt:: ADL_RETIMER23_GUID
432- | esrt:: RPL_RETIMER01_GUID
433- | esrt:: RPL_RETIMER23_GUID
434- | esrt:: MTL_RETIMER01_GUID
435- | esrt:: MTL_RETIMER23_GUID => {
436- if !found_retimer {
437- found_retimer = true ;
438- }
439- }
440- _ => { }
441- }
442434 match entry. fw_class {
443435 esrt:: TGL_RETIMER01_GUID
444436 | esrt:: ADL_RETIMER01_GUID
445437 | esrt:: RPL_RETIMER01_GUID
446438 | esrt:: MTL_RETIMER01_GUID => {
447- println ! (
448- " Left: 0x{:X} ({})" ,
449- entry. fw_version, entry. fw_version
450- ) ;
439+ left_retimer = Some ( entry. fw_version ) ;
451440 }
452441 esrt:: TGL_RETIMER23_GUID
453442 | esrt:: ADL_RETIMER23_GUID
454443 | esrt:: RPL_RETIMER23_GUID
455444 | esrt:: MTL_RETIMER23_GUID => {
456- println ! (
457- " Right: 0x{:X} ({})" ,
458- entry. fw_version, entry. fw_version
459- ) ;
445+ right_retimer = Some ( entry. fw_version ) ;
460446 }
461447 _ => { }
462448 }
463449 }
464450 }
465- if !found_retimer {
466- println ! ( " Unknown" ) ;
451+ if has_retimer {
452+ println ! ( "Retimers" ) ;
453+ if let Some ( fw_version) = left_retimer {
454+ println ! ( " Left: 0x{:X} ({})" , fw_version, fw_version) ;
455+ }
456+ if let Some ( fw_version) = right_retimer {
457+ println ! ( " Right: 0x{:X} ({})" , fw_version, fw_version) ;
458+ }
459+ if left_retimer. is_none ( ) && right_retimer. is_none ( ) {
460+ // This means there's a bug, we should've found one but didn't
461+ println ! ( " Unknown" ) ;
462+ }
467463 }
468464
469465 #[ cfg( feature = "linux" ) ]
@@ -485,7 +481,9 @@ fn print_versions(ec: &CrosEc) {
485481 let _ignore_err = print_touchpad_fw_ver ( ) ;
486482
487483 #[ cfg( feature = "hidapi" ) ]
488- let _ignore_err = touchscreen:: print_fw_ver ( ) ;
484+ if let Some ( Platform :: Framework12IntelGen13 ) = smbios:: get_platform ( ) {
485+ let _ignore_err = touchscreen:: print_fw_ver ( ) ;
486+ }
489487}
490488
491489fn print_esrt ( ) {
0 commit comments