blob: 7b55dc22b61817b40cf6a19d218ad52804190533 [file] [log] [blame]
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Replay input devices (accel) udev events needed by Chrome"
author "chromium-os-dev@chromium.org"
# This job is used to replay events of devices needed by Chrome,
# in particular accelerometers.
# Given accelerometer needs VPD data, and on some kernel, VPD data is cached
# in the stateful partition, this job has to start after boot-service.
#
# Subsystems listed here must be excluded from udev-trigger.conf to avoid
# replaying twice.
# script must run otherwise device will never go in tablet mode/rotate.
oom score never
start on started boot-services
stop on stopping boot-services
script
# Use sysname-match to trigger the platform and chromeos devices.
udevadm trigger --action=add --subsystem-match=chromeos \
--subsystem-match=platform --sysname-match="*cros-ec*" \
--sysname-match="*cros_ec*"
# Use attr-match to trigger the iio accelerometer devices.
udevadm trigger --action=add --subsystem-match=iio \
--attr-match="name=cros-ec-accel*"
exec udevadm settle
end script