aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-01-07 09:28:51 -0500
committerTakashi Iwai <tiwai@suse.de>2014-01-08 03:59:23 -0500
commit8e3ae6f7ad825129ce3691934bc7238f9b70029b (patch)
treed81598ffc14e9dff91d44ad1339c83f56160641b /sound/pci/hda
parentd81e397c65279847e473a2284927ee5b4f712693 (diff)
ALSA: hda - Add consistent tag names for firmware patch
Some tags used in the firmware patch file are inconsistent with hwdep sysfs file names, such as, the firmware patch takes [hint] tag while sysfs file is */hints. This makes even me referring back to the document often. Let's provide the same tag names as sysfs for reducing confusions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_hwdep.c51
1 files changed, 42 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 79b3dd0d4dd8..72d8389fb399 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -762,19 +762,50 @@ DEFINE_PARSE_ID_MODE(revision_id);
762 762
763struct hda_patch_item { 763struct hda_patch_item {
764 const char *tag; 764 const char *tag;
765 const char *alias;
765 void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc); 766 void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc);
766}; 767};
767 768
768static struct hda_patch_item patch_items[NUM_LINE_MODES] = { 769static struct hda_patch_item patch_items[NUM_LINE_MODES] = {
769 [LINE_MODE_CODEC] = { "[codec]", parse_codec_mode }, 770 [LINE_MODE_CODEC] = {
770 [LINE_MODE_MODEL] = { "[model]", parse_model_mode }, 771 .tag = "[codec]",
771 [LINE_MODE_VERB] = { "[verb]", parse_verb_mode }, 772 .parser = parse_codec_mode,
772 [LINE_MODE_PINCFG] = { "[pincfg]", parse_pincfg_mode }, 773 },
773 [LINE_MODE_HINT] = { "[hint]", parse_hint_mode }, 774 [LINE_MODE_MODEL] = {
774 [LINE_MODE_VENDOR_ID] = { "[vendor_id]", parse_vendor_id_mode }, 775 .tag = "[model]",
775 [LINE_MODE_SUBSYSTEM_ID] = { "[subsystem_id]", parse_subsystem_id_mode }, 776 .parser = parse_model_mode,
776 [LINE_MODE_REVISION_ID] = { "[revision_id]", parse_revision_id_mode }, 777 },
777 [LINE_MODE_CHIP_NAME] = { "[chip_name]", parse_chip_name_mode }, 778 [LINE_MODE_VERB] = {
779 .tag = "[verb]",
780 .alias = "[init_verbs]",
781 .parser = parse_verb_mode,
782 },
783 [LINE_MODE_PINCFG] = {
784 .tag = "[pincfg]",
785 .alias = "[user_pin_configs]",
786 .parser = parse_pincfg_mode,
787 },
788 [LINE_MODE_HINT] = {
789 .tag = "[hint]",
790 .alias = "[hints]",
791 .parser = parse_hint_mode
792 },
793 [LINE_MODE_VENDOR_ID] = {
794 .tag = "[vendor_id]",
795 .parser = parse_vendor_id_mode,
796 },
797 [LINE_MODE_SUBSYSTEM_ID] = {
798 .tag = "[subsystem_id]",
799 .parser = parse_subsystem_id_mode,
800 },
801 [LINE_MODE_REVISION_ID] = {
802 .tag = "[revision_id]",
803 .parser = parse_revision_id_mode,
804 },
805 [LINE_MODE_CHIP_NAME] = {
806 .tag = "[chip_name]",
807 .parser = parse_chip_name_mode,
808 },
778}; 809};
779 810
780/* check the line starting with '[' -- change the parser mode accodingly */ 811/* check the line starting with '[' -- change the parser mode accodingly */
@@ -786,6 +817,8 @@ static int parse_line_mode(char *buf, struct hda_bus *bus)
786 continue; 817 continue;
787 if (strmatch(buf, patch_items[i].tag)) 818 if (strmatch(buf, patch_items[i].tag))
788 return i; 819 return i;
820 if (patch_items[i].alias && strmatch(buf, patch_items[i].alias))
821 return i;
789 } 822 }
790 return LINE_MODE_NONE; 823 return LINE_MODE_NONE;
791} 824}