| # Copyright 2022 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # wakeup attributes may appear statically (at 'add' time) for some devices, |
| # while others will be added dynamically by various runtime triggers, for |
| # 'bind' or 'change'. |
| ACTION=="add|bind|change", TEST=="power/wakeup", \ |
| RUN+="/bin/chown power:power \"$sys$devpath/power/wakeup\"" |
| |
| # For all the following permission changes, the corresponding attribute is |
| # available when the device is added. |
| ACTION!="add", GOTO="powerd_permissions_end" |
| |
| TEST=="power/control", \ |
| RUN+="/bin/chown power:power \"$sys$devpath/power/control\"" |
| TEST=="power/autosuspend_delay_ms", \ |
| RUN+="/bin/chown power:power \"$sys$devpath/power/autosuspend_delay_ms\"" |
| TEST=="inhibited", \ |
| RUN+="/bin/chown power:power \"$sys$devpath/inhibited\"" |
| |
| # Allow powerd to read bluetooth host controller identity |
| SUBSYSTEM=="bluetooth", ENV{DEVTYPE}=="host", \ |
| TEST=="identity", \ |
| RUN+="/bin/chown power:power \"$sys$devpath/identity\"" |
| |
| # Allow powerd to program the RTC wakealarm |
| TEST=="wakealarm", SUBSYSTEM=="rtc", \ |
| RUN+="/bin/chown power:power \"$sys$devpath/wakealarm\"" |
| |
| # Make pluggable keyboard backlights writable by powerd. |
| SUBSYSTEM=="leds", DEVPATH=="*:kbd_backlight", \ |
| RUN+="/lib/udev/chown-sysfs-backlight-dir.sh \"$sys$devpath\"" |
| |
| # Older kernels (<v4.19) put cros_fp under the chromeos class |
| # The cros_ec-access group is also required by cros_healthd (the associated user |
| # that is part of the cros_ec-access group is "healthd_ec"). |
| SUBSYSTEM=="chromeos|misc", KERNEL=="cros_ec" OWNER="root", \ |
| GROUP="cros_ec-access" MODE="0660" |
| |
| LABEL="powerd_permissions_end" |