| # Copyright 2017 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 "Load cros-ec devices and sensors 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. |
| |
| # cros-ec - sensors needed when chrome start. Needed for disabling keyboard in |
| # smart keyboard mode. |
| start on starting ui |
| |
| 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 |