# Enables brightness slider in Steam
# - /sys/class/backlight/amdgpu_bl0/brightness
# - /sys/devices/platform/AMDI0010:02/i2c-2/i2c-ANX7580A:00/{brightness,bmode}
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", RUN+="/usr/bin/chmod a+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="i2c", KERNEL=="i2c-ANX7580A:00", RUN+="/usr/bin/chmod a+w /sys/%p/brightness /sys/%p/bmode"

# Enables manual GPU clock control in Steam
# - /sys/class/drm/card0/device/power_dpm_force_performance_level
# - /sys/class/drm/card0/device/pp_od_clk_voltage
ACTION=="add", SUBSYSTEM=="pci", DRIVER=="amdgpu", RUN+="/usr/bin/chmod a+w /sys/%p/power_dpm_force_performance_level /sys/%p/pp_od_clk_voltage"

# Enables manual TDP limiter in Steam
# - /sys/class/hwmon/hwmon0/power{1,2}_cap
ACTION=="add", SUBSYSTEM=="hwmon", DEVPATH=="*/hwmon0", RUN+="/usr/bin/chmod a+w /sys/%p/power1_cap /sys/%p/power2_cap"

# Enables power button handling
# - isa0060/serio0/input0
SUBSYSTEM=="input", ATTRS{phys}=="isa0060/serio0/input0", MODE="0660", TAG+="uaccess"
