blob: 542b02d6647581fc44f81784ec28d786795cd827 [file] [log] [blame]
Gilad Arnold5b2d00a2012-02-24 14:10:08 -08001# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4#
5# These rules are in charge of exporting the dut_flaga and dut_flagb GPIOs on
6# different platforms. The GPIO IDs are registered as attributes, which can be
7# detected by client processes. This was motivated by update engine
8# auto-testing framework.
9
10# Identify the GPIO chip and set dut_flaga identifier on different platforms.
11# Unfortunately, Mario does not have a debug header, hence no GPIOs exposed.
12#
13# - Alex:
14ATTR{[dmi/id]product_name}=="Alex", SUBSYSTEM=="gpio", KERNEL=="gpiochip192", \
15 ENV{ID_GPIO_DUTFLAGA}="205", ENV{ID_GPIO_DUTFLAGB}="202"
16# - ZGB:
17ATTR{[dmi/id]product_name}=="ZGB", SUBSYSTEM=="gpio", KERNEL=="gpiochip192", \
18 ENV{ID_GPIO_DUTFLAGA}="216", ENV{ID_GPIO_DUTFLAGB}="195"
19# - Lumpy, Stumpy:
20# TODO(garnold) Stumpy is current disabled, as its dutflag GPIOs are
21# non-pull-up wired, which means that they can read arbitrary values when not
22# connected to Servo. Once fixed or properly handled by the application, this
23# should read "Lumpy|Stumpty".
24ATTR{[dmi/id]product_name}=="Lumpy", SUBSYSTEM=="gpio", KERNEL=="gpiochip160", \
25 ENV{ID_GPIO_DUTFLAGA}="173", ENV{ID_GPIO_DUTFLAGB}="170"
26
27# Export dut_flaga/b and register their identifier as an attribute.
28ACTION=="add|change", SUBSYSTEM=="gpio", \
29 ENV{ID_GPIO_DUTFLAGA}=="?*", ENV{ID_GPIO_DUTFLAGB}=="?*", \
30 ATTR{subsystem/export}="%E{ID_GPIO_DUTFLAGA}", \
31 ATTR{subsystem/export}="%E{ID_GPIO_DUTFLAGB}"