mirror of
https://github.com/systemd/systemd.git
synced 2026-08-05 07:30:30 +00:00
hwdb: add parser grammar for IEEE 1394 unit function list
In added IEEE 1394 unit function list, I use custom key to detect unit entries in node context. Although the list is not widely used in the most of systemd users, I would like to add parser grammar for testing, by borrowing a bit time in builders. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
@@ -72,6 +72,7 @@ TYPES = {'mouse': ('usb', 'bluetooth', 'ps2', '*'),
|
|||||||
'joystick': ('i8042', 'rmi', 'bluetooth', 'usb'),
|
'joystick': ('i8042', 'rmi', 'bluetooth', 'usb'),
|
||||||
'keyboard': ('name', ),
|
'keyboard': ('name', ),
|
||||||
'sensor': ('modalias', ),
|
'sensor': ('modalias', ),
|
||||||
|
'ieee1394-unit-function' : ('node', ),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Patterns that are used to set general properties on a device
|
# Patterns that are used to set general properties on a device
|
||||||
@@ -82,6 +83,7 @@ GENERAL_MATCHES = {'acpi',
|
|||||||
'sdio',
|
'sdio',
|
||||||
'vmbus',
|
'vmbus',
|
||||||
'OUI',
|
'OUI',
|
||||||
|
'ieee1394',
|
||||||
}
|
}
|
||||||
|
|
||||||
def upperhex_word(length):
|
def upperhex_word(length):
|
||||||
@@ -122,6 +124,9 @@ def property_grammar():
|
|||||||
mount_matrix = Group(mount_matrix_row + ';' + mount_matrix_row + ';' + mount_matrix_row)('MOUNT_MATRIX')
|
mount_matrix = Group(mount_matrix_row + ';' + mount_matrix_row + ';' + mount_matrix_row)('MOUNT_MATRIX')
|
||||||
xkb_setting = Optional(Word(alphanums + '+-/@._'))
|
xkb_setting = Optional(Word(alphanums + '+-/@._'))
|
||||||
|
|
||||||
|
# Although this set doesn't cover all of characters in database entries, it's enough for test targets.
|
||||||
|
name_literal = Word(printables + ' ')
|
||||||
|
|
||||||
props = (('MOUSE_DPI', Group(OneOrMore(dpi_setting))),
|
props = (('MOUSE_DPI', Group(OneOrMore(dpi_setting))),
|
||||||
('MOUSE_WHEEL_CLICK_ANGLE', INTEGER),
|
('MOUSE_WHEEL_CLICK_ANGLE', INTEGER),
|
||||||
('MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL', INTEGER),
|
('MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL', INTEGER),
|
||||||
@@ -153,6 +158,11 @@ def property_grammar():
|
|||||||
('ACCEL_MOUNT_MATRIX', mount_matrix),
|
('ACCEL_MOUNT_MATRIX', mount_matrix),
|
||||||
('ACCEL_LOCATION', Or(('display', 'base'))),
|
('ACCEL_LOCATION', Or(('display', 'base'))),
|
||||||
('PROXIMITY_NEAR_LEVEL', INTEGER),
|
('PROXIMITY_NEAR_LEVEL', INTEGER),
|
||||||
|
('IEEE1394_UNIT_FUNCTION_MIDI', Or((Literal('0'), Literal('1')))),
|
||||||
|
('IEEE1394_UNIT_FUNCTION_AUDIO', Or((Literal('0'), Literal('1')))),
|
||||||
|
('IEEE1394_UNIT_FUNCTION_VIDEO', Or((Literal('0'), Literal('1')))),
|
||||||
|
('ID_VENDOR_FROM_DATABASE', name_literal),
|
||||||
|
('ID_MODEL_FROM_DATABASE', name_literal),
|
||||||
)
|
)
|
||||||
fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
|
fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
|
||||||
for name, val in props]
|
for name, val in props]
|
||||||
|
|||||||
Reference in New Issue
Block a user