Updated Equivalent Commands (markdown)

NGnius (Graham) 2023-02-11 16:48:19 +00:00
parent 4076fe9317
commit 572c12ae89

@ -9,6 +9,12 @@ Disable: `echo 0 > /sys/devices/system/cpu/cpu{cpu_number}/online` where `{cpu_n
NOTE: You cannot enable or disable cpu0, hence why there are only 7 in the range for 8 cpu threads. NOTE: You cannot enable or disable cpu0, hence why there are only 7 in the range for 8 cpu threads.
# Enable & Disable CPU SMT
Enable: `echo on > /sys/devices/system/cpu/smt/control`.
Disable: `echo off > /sys/devices/system/cpu/smt/control`.
# Enable & Disable CPU boost # Enable & Disable CPU boost
Enable: `echo 1 > /sys/devices/system/cpu/cpufreq/boost` enables boost across all threads. Enable: `echo 1 > /sys/devices/system/cpu/cpufreq/boost` enables boost across all threads.
@ -51,7 +57,7 @@ Read the actual fan RPM: `cat /sys/class/hwmon/hwmon5/fan1_input` gives the fan
NOTE: There's a bug in the fan controller; if you enable automatic fan control it will forget any previously-set target despite it appearing to be set correctly (i.e. `cat /sys/class/hwmon/hwmon5/fan1_target` will display the correct value). NOTE: There's a bug in the fan controller; if you enable automatic fan control it will forget any previously-set target despite it appearing to be set correctly (i.e. `cat /sys/class/hwmon/hwmon5/fan1_target` will display the correct value).
When you disable automatic fan control, you will need to set the fan RPM again. When you disable automatic fan control, you will need to set the fan RPM again.
# Battery stats # Get battery stats
Get the battery charge right now: `cat /sys/class/hwmon/hwmon2/device/charge_now` gives charge in uAh (uAh * 7.7/1000000 = charge in Wh). Get the battery charge right now: `cat /sys/class/hwmon/hwmon2/device/charge_now` gives charge in uAh (uAh * 7.7/1000000 = charge in Wh).
@ -59,10 +65,22 @@ Get the maximum battery capacity: `cat /sys/class/hwmon/hwmon2/device/charge_ful
Get the design battery capacity: `cat /sys/class/hwmon/hwmon2/device/charge_full_design` gives charge in uAh. Get the design battery capacity: `cat /sys/class/hwmon/hwmon2/device/charge_full_design` gives charge in uAh.
Get whether the deck is plugged in: `cat /sys/class/hwmon/hwmon5/curr1_input` gives the charger current in mA. Get battery current: `cat /sys/class/hwmon/hwmon5/curr1_input` gives the charger current in mA.
NOTE: 7.7 is the voltage of the battery -- it's not just a magic number. NOTE: 7.7 is the voltage of the battery -- it's not just a magic number.
# Set battery charge rate
Set the charge rate: `echo {rate} > /sys/class/hwmon/hwmon5/maximum_battery_charge_rate` where `{rate}` is the charge rate in mA, between 250 and 2500 mA.
That file is write only, so changes cannot be directly observed.
# Set battery charge mode
There exists a binary which may or may not be executable (depending on which SteamOS version) which can be used to set this and other things. [More details in the issue](https://github.com/NGnius/PowerTools/issues/50).
Refer to [util.rs](https://github.com/NGnius/PowerTools/blob/main/backend/src/settings/steam_deck/util.rs) for how the firmware interface works.
# Steam Deck kernel patches # Steam Deck kernel patches
This is how I figured out how the fan stuff works. This is how I figured out how the fan stuff works.