Skip to content

Commit

Permalink
i2c powersave fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed May 27, 2024
1 parent 7c929bf commit 1a4429e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/service/backends/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ def _powersave():
writefile("{}/{}/power/control".format(pci_path,dir),"auto")
writefile("/sys/module/pcie_aspm/parameters/policy", "powersave")


if get("i2c",True,"power"):
# i2c auto suspend
i2c_path="/sys/bus/i2c/devices/"
for dir in listdir(i2c_path):
writefile("{}/{}/power/control".format(i2c_path,dir),"auto")
writefile("{}/{}/device/power/control".format(i2c_path,dir),"auto")

if get("audio",True,"power"):
# audio card
Expand Down Expand Up @@ -254,6 +256,7 @@ def _performance():
i2c_path="/sys/bus/i2c/devices/"
for dir in listdir(i2c_path):
writefile("{}/{}/power/control".format(i2c_path,dir),"on")
writefile("{}/{}/device/power/control".format(i2c_path,dir),"on")

if get("audio",True,"power"):
# audio card
Expand Down

0 comments on commit 1a4429e

Please sign in to comment.