From 2698ea98059bb01a9b5d9cfd20e23d55f68c0a17 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 18 Dec 2013 07:45:52 +0100 Subject: ALSA: hda - Kill EXPORT_SYMBOL_HDA() Replace all with the standard EXPORT_SYMBOL_GPL(). Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_hwdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sound/pci/hda/hda_hwdep.c') diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index fe0bda19de1..0ec6fb1e984 100644 --- a/sound/pci/hda/hda_hwdep.c +++ b/sound/pci/hda/hda_hwdep.c @@ -616,7 +616,7 @@ const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) struct hda_hint *hint = get_hint(codec, key); return hint ? hint->val : NULL; } -EXPORT_SYMBOL_HDA(snd_hda_get_hint); +EXPORT_SYMBOL_GPL(snd_hda_get_hint); int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) { @@ -642,7 +642,7 @@ int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) mutex_unlock(&codec->user_mutex); return ret; } -EXPORT_SYMBOL_HDA(snd_hda_get_bool_hint); +EXPORT_SYMBOL_GPL(snd_hda_get_bool_hint); int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) { @@ -663,7 +663,7 @@ int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) mutex_unlock(&codec->user_mutex); return ret; } -EXPORT_SYMBOL_HDA(snd_hda_get_int_hint); +EXPORT_SYMBOL_GPL(snd_hda_get_int_hint); #endif /* CONFIG_SND_HDA_RECONFIG */ #ifdef CONFIG_SND_HDA_PATCH_LOADER @@ -851,5 +851,5 @@ int snd_hda_load_patch(struct hda_bus *bus, size_t fw_size, const void *fw_buf) } return 0; } -EXPORT_SYMBOL_HDA(snd_hda_load_patch); +EXPORT_SYMBOL_GPL(snd_hda_load_patch); #endif /* CONFIG_SND_HDA_PATCH_LOADER */ -- cgit v1.2.3-70-g09d2 From d81e397c65279847e473a2284927ee5b4f712693 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 7 Jan 2014 15:23:44 +0100 Subject: ALSA: hda - firmware patch code cleanup Just a code refactoring: the need_codec flag in hda_patch_item struct can be removed by checking the current mode instead. No functional change. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_hwdep.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'sound/pci/hda/hda_hwdep.c') diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index 0ec6fb1e984..79b3dd0d4dd 100644 --- a/sound/pci/hda/hda_hwdep.c +++ b/sound/pci/hda/hda_hwdep.c @@ -763,19 +763,18 @@ DEFINE_PARSE_ID_MODE(revision_id); struct hda_patch_item { const char *tag; void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc); - int need_codec; }; static struct hda_patch_item patch_items[NUM_LINE_MODES] = { - [LINE_MODE_CODEC] = { "[codec]", parse_codec_mode, 0 }, - [LINE_MODE_MODEL] = { "[model]", parse_model_mode, 1 }, - [LINE_MODE_VERB] = { "[verb]", parse_verb_mode, 1 }, - [LINE_MODE_PINCFG] = { "[pincfg]", parse_pincfg_mode, 1 }, - [LINE_MODE_HINT] = { "[hint]", parse_hint_mode, 1 }, - [LINE_MODE_VENDOR_ID] = { "[vendor_id]", parse_vendor_id_mode, 1 }, - [LINE_MODE_SUBSYSTEM_ID] = { "[subsystem_id]", parse_subsystem_id_mode, 1 }, - [LINE_MODE_REVISION_ID] = { "[revision_id]", parse_revision_id_mode, 1 }, - [LINE_MODE_CHIP_NAME] = { "[chip_name]", parse_chip_name_mode, 1 }, + [LINE_MODE_CODEC] = { "[codec]", parse_codec_mode }, + [LINE_MODE_MODEL] = { "[model]", parse_model_mode }, + [LINE_MODE_VERB] = { "[verb]", parse_verb_mode }, + [LINE_MODE_PINCFG] = { "[pincfg]", parse_pincfg_mode }, + [LINE_MODE_HINT] = { "[hint]", parse_hint_mode }, + [LINE_MODE_VENDOR_ID] = { "[vendor_id]", parse_vendor_id_mode }, + [LINE_MODE_SUBSYSTEM_ID] = { "[subsystem_id]", parse_subsystem_id_mode }, + [LINE_MODE_REVISION_ID] = { "[revision_id]", parse_revision_id_mode }, + [LINE_MODE_CHIP_NAME] = { "[chip_name]", parse_chip_name_mode }, }; /* check the line starting with '[' -- change the parser mode accodingly */ @@ -846,7 +845,7 @@ int snd_hda_load_patch(struct hda_bus *bus, size_t fw_size, const void *fw_buf) if (*buf == '[') line_mode = parse_line_mode(buf, bus); else if (patch_items[line_mode].parser && - (codec || !patch_items[line_mode].need_codec)) + (codec || line_mode <= LINE_MODE_CODEC)) patch_items[line_mode].parser(buf, bus, &codec); } return 0; -- cgit v1.2.3-70-g09d2 From 8e3ae6f7ad825129ce3691934bc7238f9b70029b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 7 Jan 2014 15:28:51 +0100 Subject: 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 --- sound/pci/hda/hda_hwdep.c | 51 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) (limited to 'sound/pci/hda/hda_hwdep.c') diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index 79b3dd0d4dd..72d8389fb39 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); struct hda_patch_item { const char *tag; + const char *alias; void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc); }; static struct hda_patch_item patch_items[NUM_LINE_MODES] = { - [LINE_MODE_CODEC] = { "[codec]", parse_codec_mode }, - [LINE_MODE_MODEL] = { "[model]", parse_model_mode }, - [LINE_MODE_VERB] = { "[verb]", parse_verb_mode }, - [LINE_MODE_PINCFG] = { "[pincfg]", parse_pincfg_mode }, - [LINE_MODE_HINT] = { "[hint]", parse_hint_mode }, - [LINE_MODE_VENDOR_ID] = { "[vendor_id]", parse_vendor_id_mode }, - [LINE_MODE_SUBSYSTEM_ID] = { "[subsystem_id]", parse_subsystem_id_mode }, - [LINE_MODE_REVISION_ID] = { "[revision_id]", parse_revision_id_mode }, - [LINE_MODE_CHIP_NAME] = { "[chip_name]", parse_chip_name_mode }, + [LINE_MODE_CODEC] = { + .tag = "[codec]", + .parser = parse_codec_mode, + }, + [LINE_MODE_MODEL] = { + .tag = "[model]", + .parser = parse_model_mode, + }, + [LINE_MODE_VERB] = { + .tag = "[verb]", + .alias = "[init_verbs]", + .parser = parse_verb_mode, + }, + [LINE_MODE_PINCFG] = { + .tag = "[pincfg]", + .alias = "[user_pin_configs]", + .parser = parse_pincfg_mode, + }, + [LINE_MODE_HINT] = { + .tag = "[hint]", + .alias = "[hints]", + .parser = parse_hint_mode + }, + [LINE_MODE_VENDOR_ID] = { + .tag = "[vendor_id]", + .parser = parse_vendor_id_mode, + }, + [LINE_MODE_SUBSYSTEM_ID] = { + .tag = "[subsystem_id]", + .parser = parse_subsystem_id_mode, + }, + [LINE_MODE_REVISION_ID] = { + .tag = "[revision_id]", + .parser = parse_revision_id_mode, + }, + [LINE_MODE_CHIP_NAME] = { + .tag = "[chip_name]", + .parser = parse_chip_name_mode, + }, }; /* 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) continue; if (strmatch(buf, patch_items[i].tag)) return i; + if (patch_items[i].alias && strmatch(buf, patch_items[i].alias)) + return i; } return LINE_MODE_NONE; } -- cgit v1.2.3-70-g09d2