blob: f51824ac3f2ed11b90ad2394081b53218e9ae2c8 [file] [log] [blame]
# 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.
ENV{POWERD_ROLE}=="internal_keyboard", ENV{POWERD_TAGS_USABLE}="usable_when_laptop usable_when_display_off"
ENV{POWERD_ROLE}=="internal_touchpad", ENV{POWERD_TAGS_USABLE}="usable_when_laptop usable_when_display_off"
ENV{POWERD_ROLE}=="internal_touchscreen", ENV{POWERD_TAGS_USABLE}="usable_when_laptop usable_when_tablet"
ENV{POWERD_ROLE}=="internal_stylus", ENV{POWERD_TAGS_USABLE}="usable_when_laptop usable_when_tablet"
ENV{POWERD_ROLE}=="external_input", ENV{POWERD_TAGS_USABLE}="usable_when_docked usable_when_laptop usable_when_tablet usable_when_display_off"
ENV{POWERD_ROLE}=="cros_fingerprint", ENV{POWERD_TAGS_USABLE}="usable_when_docked usable_when_laptop usable_when_tablet usable_when_display_off"
ENV{POWERD_ROLE}=="cros_bluetooth", ENV{POWERD_TAGS_USABLE}="usable_when_docked usable_when_laptop usable_when_tablet usable_when_display_off"
ENV{POWERD_ROLE}=="internal_keyboard", KERNEL=="input*", ENV{POWERD_TAGS_WAKEUP}="wakeup"
ENV{POWERD_ROLE}=="internal_touchpad", KERNEL=="input*", ENV{POWERD_TAGS_WAKEUP}="wakeup wakeup_only_when_usable"
ENV{POWERD_ROLE}=="internal_touchscreen", KERNEL=="input*", ENV{POWERD_TAGS_WAKEUP}="wakeup wakeup_disabled"
ENV{POWERD_ROLE}=="internal_stylus", KERNEL=="input*", ENV{POWERD_TAGS_WAKEUP}="wakeup wakeup_only_when_usable"
ENV{POWERD_ROLE}=="external_input", KERNEL=="input*", ENV{POWERD_TAGS_WAKEUP}="wakeup wakeup_only_when_usable"
ENV{POWERD_ROLE}=="cros_fingerprint", KERNEL=="input*", ENV{POWERD_TAGS_WAKEUP}="wakeup wakeup_only_when_usable"
# Bluetooth hids are usable when in tablet mode but cannot wake the system from
# sleep. This is to prevent tablets (and convertibles in tablet mode) from being
# woken up unnecessarily. For example, we do not want to wake tablets stored in
# a backpack on Bluetooth HID connection.
ENV{POWERD_ROLE}=="cros_bluetooth", KERNEL=="input*", ENV{POWERD_TAGS_WAKEUP}="wakeup wakeup_when_docked wakeup_when_laptop wakeup_when_display_off"
# Power button, lid switch, and tablet-mode switch are never inhibited because
# they should always work regardless which mode the device is currently in.
# For all other "real" input devices, powerd will inhibit them according to
# their usable_* tags declared above.
ENV{POWERD_ROLE}!="", \
ENV{POWERD_ROLE}!="power_button", \
ENV{POWERD_ROLE}!="lid_switch", \
ENV{POWERD_ROLE}!="tablet_mode_switch", \
KERNEL=="input*", \
ATTR{inhibited}!="", \
ENV{POWERD_TAGS_INHIBIT}="inhibit"