aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-23 03:42:57 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-23 03:42:57 -0500
commit346ff70fdbe9093947b9494fe714c89cafcceade (patch)
tree6c961c9c8956a291cad2e40c9b442022b2863769 /sound
parentc17a1abae2f29047a0f57324240b01609489261b (diff)
ALSA: hda - Rename {override,cur}_pin with {user,driver}_pin
Rename from override_pin and cur_pin with user_pin and driver_pin, respectively, to be a bit more intuitive. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c18
-rw-r--r--sound/pci/hda/hda_codec.h4
-rw-r--r--sound/pci/hda/hda_hwdep.c32
3 files changed, 27 insertions, 27 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 8ec2dfca9a6..df9453d0122 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -755,7 +755,7 @@ int snd_hda_add_pincfg(struct hda_codec *codec, struct snd_array *list,
755int snd_hda_codec_set_pincfg(struct hda_codec *codec, 755int snd_hda_codec_set_pincfg(struct hda_codec *codec,
756 hda_nid_t nid, unsigned int cfg) 756 hda_nid_t nid, unsigned int cfg)
757{ 757{
758 return snd_hda_add_pincfg(codec, &codec->cur_pins, nid, cfg); 758 return snd_hda_add_pincfg(codec, &codec->driver_pins, nid, cfg);
759} 759}
760EXPORT_SYMBOL_HDA(snd_hda_codec_set_pincfg); 760EXPORT_SYMBOL_HDA(snd_hda_codec_set_pincfg);
761 761
@@ -764,11 +764,11 @@ unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid)
764{ 764{
765 struct hda_pincfg *pin; 765 struct hda_pincfg *pin;
766 766
767 pin = look_up_pincfg(codec, &codec->cur_pins, nid); 767 pin = look_up_pincfg(codec, &codec->driver_pins, nid);
768 if (pin) 768 if (pin)
769 return pin->cfg; 769 return pin->cfg;
770#ifdef CONFIG_SND_HDA_HWDEP 770#ifdef CONFIG_SND_HDA_HWDEP
771 pin = look_up_pincfg(codec, &codec->override_pins, nid); 771 pin = look_up_pincfg(codec, &codec->user_pins, nid);
772 if (pin) 772 if (pin)
773 return pin->cfg; 773 return pin->cfg;
774#endif 774#endif
@@ -797,12 +797,12 @@ static void free_hda_cache(struct hda_cache_rec *cache);
797/* restore the initial pin cfgs and release all pincfg lists */ 797/* restore the initial pin cfgs and release all pincfg lists */
798static void restore_init_pincfgs(struct hda_codec *codec) 798static void restore_init_pincfgs(struct hda_codec *codec)
799{ 799{
800 /* first free cur_pins and override_pins, then call restore_pincfg 800 /* first free driver_pins and user_pins, then call restore_pincfg
801 * so that only the values in init_pins are restored 801 * so that only the values in init_pins are restored
802 */ 802 */
803 snd_array_free(&codec->cur_pins); 803 snd_array_free(&codec->driver_pins);
804#ifdef CONFIG_SND_HDA_HWDEP 804#ifdef CONFIG_SND_HDA_HWDEP
805 snd_array_free(&codec->override_pins); 805 snd_array_free(&codec->user_pins);
806#endif 806#endif
807 restore_pincfgs(codec); 807 restore_pincfgs(codec);
808 snd_array_free(&codec->init_pins); 808 snd_array_free(&codec->init_pins);
@@ -874,7 +874,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr
874 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head)); 874 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head));
875 snd_array_init(&codec->mixers, sizeof(struct snd_kcontrol *), 32); 875 snd_array_init(&codec->mixers, sizeof(struct snd_kcontrol *), 32);
876 snd_array_init(&codec->init_pins, sizeof(struct hda_pincfg), 16); 876 snd_array_init(&codec->init_pins, sizeof(struct hda_pincfg), 16);
877 snd_array_init(&codec->cur_pins, sizeof(struct hda_pincfg), 16); 877 snd_array_init(&codec->driver_pins, sizeof(struct hda_pincfg), 16);
878 if (codec->bus->modelname) { 878 if (codec->bus->modelname) {
879 codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL); 879 codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL);
880 if (!codec->modelname) { 880 if (!codec->modelname) {
@@ -1463,8 +1463,8 @@ void snd_hda_codec_reset(struct hda_codec *codec)
1463 free_hda_cache(&codec->cmd_cache); 1463 free_hda_cache(&codec->cmd_cache);
1464 init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info)); 1464 init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info));
1465 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head)); 1465 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head));
1466 /* free only cur_pins so that init_pins + override_pins are restored */ 1466 /* free only driver_pins so that init_pins + user_pins are restored */
1467 snd_array_free(&codec->cur_pins); 1467 snd_array_free(&codec->driver_pins);
1468 restore_pincfgs(codec); 1468 restore_pincfgs(codec);
1469 codec->num_pcms = 0; 1469 codec->num_pcms = 0;
1470 codec->pcm_info = NULL; 1470 codec->pcm_info = NULL;
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 6d01a8058f0..2ea628478a9 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -779,13 +779,13 @@ struct hda_codec {
779 unsigned int spdif_in_enable; /* SPDIF input enable? */ 779 unsigned int spdif_in_enable; /* SPDIF input enable? */
780 hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */ 780 hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
781 struct snd_array init_pins; /* initial (BIOS) pin configurations */ 781 struct snd_array init_pins; /* initial (BIOS) pin configurations */
782 struct snd_array cur_pins; /* current pin configurations */ 782 struct snd_array driver_pins; /* pin configs set by codec parser */
783 783
784#ifdef CONFIG_SND_HDA_HWDEP 784#ifdef CONFIG_SND_HDA_HWDEP
785 struct snd_hwdep *hwdep; /* assigned hwdep device */ 785 struct snd_hwdep *hwdep; /* assigned hwdep device */
786 struct snd_array init_verbs; /* additional init verbs */ 786 struct snd_array init_verbs; /* additional init verbs */
787 struct snd_array hints; /* additional hints */ 787 struct snd_array hints; /* additional hints */
788 struct snd_array override_pins; /* default pin configs to override */ 788 struct snd_array user_pins; /* default pin configs to override */
789#endif 789#endif
790 790
791 /* misc flags */ 791 /* misc flags */
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 71039a6dec2..c660383ef38 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -109,7 +109,7 @@ static void clear_hwdep_elements(struct hda_codec *codec)
109 for (i = 0; i < codec->hints.used; i++, head++) 109 for (i = 0; i < codec->hints.used; i++, head++)
110 kfree(*head); 110 kfree(*head);
111 snd_array_free(&codec->hints); 111 snd_array_free(&codec->hints);
112 snd_array_free(&codec->override_pins); 112 snd_array_free(&codec->user_pins);
113} 113}
114 114
115static void hwdep_free(struct snd_hwdep *hwdep) 115static void hwdep_free(struct snd_hwdep *hwdep)
@@ -142,7 +142,7 @@ int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec)
142 142
143 snd_array_init(&codec->init_verbs, sizeof(struct hda_verb), 32); 143 snd_array_init(&codec->init_verbs, sizeof(struct hda_verb), 32);
144 snd_array_init(&codec->hints, sizeof(char *), 32); 144 snd_array_init(&codec->hints, sizeof(char *), 32);
145 snd_array_init(&codec->override_pins, sizeof(struct hda_pincfg), 16); 145 snd_array_init(&codec->user_pins, sizeof(struct hda_pincfg), 16);
146 146
147 return 0; 147 return 0;
148} 148}
@@ -340,29 +340,29 @@ static ssize_t init_pin_configs_show(struct device *dev,
340 return pin_configs_show(codec, &codec->init_pins, buf); 340 return pin_configs_show(codec, &codec->init_pins, buf);
341} 341}
342 342
343static ssize_t override_pin_configs_show(struct device *dev, 343static ssize_t user_pin_configs_show(struct device *dev,
344 struct device_attribute *attr, 344 struct device_attribute *attr,
345 char *buf) 345 char *buf)
346{ 346{
347 struct snd_hwdep *hwdep = dev_get_drvdata(dev); 347 struct snd_hwdep *hwdep = dev_get_drvdata(dev);
348 struct hda_codec *codec = hwdep->private_data; 348 struct hda_codec *codec = hwdep->private_data;
349 return pin_configs_show(codec, &codec->override_pins, buf); 349 return pin_configs_show(codec, &codec->user_pins, buf);
350} 350}
351 351
352static ssize_t cur_pin_configs_show(struct device *dev, 352static ssize_t driver_pin_configs_show(struct device *dev,
353 struct device_attribute *attr, 353 struct device_attribute *attr,
354 char *buf) 354 char *buf)
355{ 355{
356 struct snd_hwdep *hwdep = dev_get_drvdata(dev); 356 struct snd_hwdep *hwdep = dev_get_drvdata(dev);
357 struct hda_codec *codec = hwdep->private_data; 357 struct hda_codec *codec = hwdep->private_data;
358 return pin_configs_show(codec, &codec->cur_pins, buf); 358 return pin_configs_show(codec, &codec->driver_pins, buf);
359} 359}
360 360
361#define MAX_PIN_CONFIGS 32 361#define MAX_PIN_CONFIGS 32
362 362
363static ssize_t override_pin_configs_store(struct device *dev, 363static ssize_t user_pin_configs_store(struct device *dev,
364 struct device_attribute *attr, 364 struct device_attribute *attr,
365 const char *buf, size_t count) 365 const char *buf, size_t count)
366{ 366{
367 struct snd_hwdep *hwdep = dev_get_drvdata(dev); 367 struct snd_hwdep *hwdep = dev_get_drvdata(dev);
368 struct hda_codec *codec = hwdep->private_data; 368 struct hda_codec *codec = hwdep->private_data;
@@ -373,7 +373,7 @@ static ssize_t override_pin_configs_store(struct device *dev,
373 return -EINVAL; 373 return -EINVAL;
374 if (!nid) 374 if (!nid)
375 return -EINVAL; 375 return -EINVAL;
376 err = snd_hda_add_pincfg(codec, &codec->override_pins, nid, cfg); 376 err = snd_hda_add_pincfg(codec, &codec->user_pins, nid, cfg);
377 if (err < 0) 377 if (err < 0)
378 return err; 378 return err;
379 return count; 379 return count;
@@ -397,8 +397,8 @@ static struct device_attribute codec_attrs[] = {
397 CODEC_ATTR_WO(init_verbs), 397 CODEC_ATTR_WO(init_verbs),
398 CODEC_ATTR_WO(hints), 398 CODEC_ATTR_WO(hints),
399 CODEC_ATTR_RO(init_pin_configs), 399 CODEC_ATTR_RO(init_pin_configs),
400 CODEC_ATTR_RW(override_pin_configs), 400 CODEC_ATTR_RW(user_pin_configs),
401 CODEC_ATTR_RO(cur_pin_configs), 401 CODEC_ATTR_RO(driver_pin_configs),
402 CODEC_ATTR_WO(reconfig), 402 CODEC_ATTR_WO(reconfig),
403 CODEC_ATTR_WO(clear), 403 CODEC_ATTR_WO(clear),
404}; 404};