@@ -167,7 +167,7 @@ pub struct Cli {
167167 pub sensors : bool ,
168168 pub fansetduty : Option < ( Option < u32 > , u32 ) > ,
169169 pub fansetrpm : Option < ( Option < u32 > , u32 ) > ,
170- pub autofanctrl : bool ,
170+ pub autofanctrl : Option < Option < u8 > > ,
171171 pub pdports : bool ,
172172 pub privacy : bool ,
173173 pub pd_info : bool ,
@@ -1184,7 +1184,9 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
11841184 print_err ( ec. fan_set_duty ( fan, percent) ) ;
11851185 } else if let Some ( ( fan, rpm) ) = args. fansetrpm {
11861186 print_err ( ec. fan_set_rpm ( fan, rpm) ) ;
1187- } else if args. autofanctrl {
1187+ } else if let Some ( Some ( fan_id) ) = args. autofanctrl {
1188+ print_err ( ec. autofanctrl ( Some ( fan_id) ) ) ;
1189+ } else if let Some ( None ) = args. autofanctrl {
11881190 print_err ( ec. autofanctrl ( None ) ) ;
11891191 } else if args. pdports {
11901192 power:: get_and_print_pd_info ( & ec) ;
@@ -1457,7 +1459,7 @@ Options:
14571459 --sensors Print sensor information (ALS, G-Sensor)
14581460 --fansetduty Set fan duty cycle (0-100%)
14591461 --fansetrpm Set fan RPM (limited by EC fan table max RPM)
1460- --autofanctrl Turn on automatic fan speed control
1462+ --autofanctrl [<FANID>] Turn on automatic fan speed control (optionally provide fan index)
14611463 --pdports Show information about USB-C PD ports
14621464 --info Show info from SMBIOS (Only on UEFI)
14631465 --pd-info Show details about the PD controllers
0 commit comments