1c72fcc34Sopenharmony_ci# This is the toplevel configuration for 'alsactl init'.
2c72fcc34Sopenharmony_ci# See 'man alsactl_init' for syntax.
3c72fcc34Sopenharmony_ci
4c72fcc34Sopenharmony_ci# set root device directory in sysfs for soundcard for ATTR{} command
5c72fcc34Sopenharmony_ciCONFIG{sysfs_device}="/class/sound/card$cardinfo{card}/device"
6c72fcc34Sopenharmony_ciACCESS!="$sysfsroot$config{sysfs_device}", \
7c72fcc34Sopenharmony_ci	CONFIG{sysfs_device}="/class/sound/controlC$cardinfo{card}/device"
8c72fcc34Sopenharmony_ci
9c72fcc34Sopenharmony_ci# test for extra commands
10c72fcc34Sopenharmony_ciENV{CMD}=="help", INCLUDE="help", GOTO="00main_end"
11c72fcc34Sopenharmony_ciENV{CMD}=="info", INCLUDE="info", GOTO="00main_end"
12c72fcc34Sopenharmony_ciENV{CMD}=="default", INCLUDE="default", GOTO="00main_end"
13c72fcc34Sopenharmony_ciENV{CMD}=="test", INCLUDE="test", GOTO="00main_end"
14c72fcc34Sopenharmony_ciENV{CMD}=="*", ERROR="Unknown command '$env{CMD}'\n", GOTO="00main_end"
15c72fcc34Sopenharmony_ci
16c72fcc34Sopenharmony_ci# include files with real configuration
17c72fcc34Sopenharmony_ci#
18c72fcc34Sopenharmony_ci# steps are:
19c72fcc34Sopenharmony_ci#   1) look for preinit subdirectory and parse all files in it
20c72fcc34Sopenharmony_ci#   2) if RESULT=="skip", skip ALSA standard configuration files
21c72fcc34Sopenharmony_ci#   3) do ALSA standard configuration
22c72fcc34Sopenharmony_ci#   4) look for postinit subdirectory and parse all files in it
23c72fcc34Sopenharmony_ci#   5) if RESULT!="true", initialize hardware using a guess method,
24c72fcc34Sopenharmony_ci#      print an error message and return with exit code 99
25c72fcc34Sopenharmony_ci#   6) return with exit code 0 (success)
26c72fcc34Sopenharmony_ci#
27c72fcc34Sopenharmony_ci
28c72fcc34Sopenharmony_ciRESULT="unknown"
29c72fcc34Sopenharmony_ciACCESS=="preinit", INCLUDE="preinit"
30c72fcc34Sopenharmony_ciRESULT=="skip", GOTO="init_end"
31c72fcc34Sopenharmony_ci
32c72fcc34Sopenharmony_ci# real ALSA configuration database
33c72fcc34Sopenharmony_ciCARDINFO{driver}=="HDA-Intel", INCLUDE="hda", GOTO="init_end"
34c72fcc34Sopenharmony_ciCARDINFO{driver}=="CA0106", INCLUDE="ca0106", GOTO="init_end"
35c72fcc34Sopenharmony_ciCARDINFO{driver}=="Test", INCLUDE="test", GOTO="init_end"
36c72fcc34Sopenharmony_ci
37c72fcc34Sopenharmony_ciLABEL="init_end"
38c72fcc34Sopenharmony_ciACCESS=="postinit", INCLUDE="postinit"
39c72fcc34Sopenharmony_ciRESULT=="true", GOTO="00main_end"
40c72fcc34Sopenharmony_ciERROR="Found hardware: \"$cardinfo{driver}\" \"$cardinfo{mixername}\" \"$cardinfo{components}\" \"$attr{subsystem_vendor}\" \"$attr{subsystem_device}\"\n"
41c72fcc34Sopenharmony_ciERROR="Hardware is initialized using a generic method\n"
42c72fcc34Sopenharmony_ciINCLUDE="default"
43c72fcc34Sopenharmony_ciEXIT="99"
44c72fcc34Sopenharmony_ci
45c72fcc34Sopenharmony_ci#
46c72fcc34Sopenharmony_ci# label identifying end of main file
47c72fcc34Sopenharmony_ci#
48c72fcc34Sopenharmony_ci
49c72fcc34Sopenharmony_ciLABEL="00main_end"
50