# Copyright 2024 The Phosh Developers
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of gmobile.
#
# Do not edit this file, it will be overwritten on update

ACTION=="remove", GOTO="gmobile_end"
KERNEL!="event*|*:torch|*:flash", GOTO="gmobile_end"

# AT keyboard matching by the machine's DMI data
DRIVERS=="atkbd", \
  IMPORT{builtin}="hwdb 'gmobile:atkbd:$attr{[dmi/id]modalias}'", \
  ENV{.HAVE_HWDB_PROPERTIES}="1"

# Device matching the input device name and the machine's DMI data
KERNELS=="input*", \
  IMPORT{builtin}="hwdb 'gmobile:name:$attr{name}:$attr{[dmi/id]modalias}'", \
  ENV{.HAVE_HWDB_PROPERTIES}="1"

# Device matching the input device name and the machine's device tree compatible
KERNELS=="input*", \
  IMPORT{builtin}="hwdb 'gmobile:name:$attr{name}:dt:$attr{[devicetree/base]compatible}'", \
  ENV{.HAVE_HWDB_PROPERTIES}="1"

# LEDs matching by OF name and the machine's device tree compatible
SUBSYSTEM=="leds", \
  IMPORT{builtin}="hwdb 'gmobile:name:$kernel:dt:$attr{[devicetree/base]compatible}'", \
  ENV{.HAVE_HWDB_PROPERTIES}="1"

LABEL="gmobile_end"
