alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] ALSA: Integrate control based jack reporting with core jack reporting
@ 2012-03-01 17:48 Takashi Iwai
  2012-03-02  6:26 ` David Henningsson
  0 siblings, 1 reply; 32+ messages in thread
From: Takashi Iwai @ 2012-03-01 17:48 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, David Henningsson

So, a question of "Line Out" to be hyphened or not to be hyphened.

The problem is less serious than Hamlet, and I think we can get rid of
the redundant hyphen.  Not only because many women dislike hyphened
names nowadays (as you can find easily in Google), the naming rule
with a direction suffix looks more flexible, and I saw that both or
Mark and David don't matter much (so written in their posts).

The fix patch is below.  David, if you think it's too bad (that makes
your code too messy), please speak up.  Or, this is utterly broken,
also let me know.


thanks,

Takashi

---
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] ALSA: hda/realtek - Kill hyphnated names

Kill hyphens from "Line-Out" name strings, as suggested by Mark Brown.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/hda_codec.c     |    4 ++--
 sound/pci/hda/patch_realtek.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 0ae6eb2..6843073 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5118,7 +5118,7 @@ static int fill_audio_out_name(struct hda_codec *codec, hda_nid_t nid,
 	const char *pfx = "", *sfx = "";
 
 	/* handle as a speaker if it's a fixed line-out */
-	if (!strcmp(name, "Line-Out") && attr == INPUT_PIN_ATTR_INT)
+	if (!strcmp(name, "Line Out") && attr == INPUT_PIN_ATTR_INT)
 		name = "Speaker";
 	/* check the location */
 	switch (attr) {
@@ -5177,7 +5177,7 @@ int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid,
 
 	switch (get_defcfg_device(def_conf)) {
 	case AC_JACK_LINE_OUT:
-		return fill_audio_out_name(codec, nid, cfg, "Line-Out",
+		return fill_audio_out_name(codec, nid, cfg, "Line Out",
 					   label, maxlen, indexp);
 	case AC_JACK_SPEAKER:
 		return fill_audio_out_name(codec, nid, cfg, "Speaker",
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 4fe2d59..a5be866 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1856,7 +1856,7 @@ static const char * const alc_slave_vols[] = {
 	"Headphone Playback Volume",
 	"Speaker Playback Volume",
 	"Mono Playback Volume",
-	"Line-Out Playback Volume",
+	"Line Out Playback Volume",
 	"CLFE Playback Volume",
 	"Bass Speaker Playback Volume",
 	"PCM Playback Volume",
@@ -1873,7 +1873,7 @@ static const char * const alc_slave_sws[] = {
 	"Speaker Playback Switch",
 	"Mono Playback Switch",
 	"IEC958 Playback Switch",
-	"Line-Out Playback Switch",
+	"Line Out Playback Switch",
 	"CLFE Playback Switch",
 	"Bass Speaker Playback Switch",
 	"PCM Playback Switch",
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 32+ messages in thread
* [PATCH 1/2] ALSA: Use a define for the number of jack switch types
@ 2012-02-07 19:48 Mark Brown
  2012-02-07 19:48 ` [PATCH 2/2] ALSA: Integrate control based jack reporting with core jack reporting Mark Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-02-07 19:48 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, patches, Mark Brown

This is intended to facilitate the merge of the two jack detection
mechanisms.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/sound/jack.h |    3 +++
 sound/core/jack.c    |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/sound/jack.h b/include/sound/jack.h
index 63c7907..5891657 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -53,6 +53,9 @@ enum snd_jack_types {
 	SND_JACK_BTN_5		= 0x0200,
 };
 
+/* Keep in sync with definitions above */
+#define SND_JACK_SWITCH_TYPES 6
+
 struct snd_jack {
 	struct input_dev *input_dev;
 	int registered;
diff --git a/sound/core/jack.c b/sound/core/jack.c
index 26edf63..471e1e3 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -25,7 +25,7 @@
 #include <sound/jack.h>
 #include <sound/core.h>
 
-static int jack_switch_types[] = {
+static int jack_switch_types[SND_JACK_SWITCH_TYPES] = {
 	SW_HEADPHONE_INSERT,
 	SW_MICROPHONE_INSERT,
 	SW_LINEOUT_INSERT,
@@ -128,7 +128,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
 
 	jack->type = type;
 
-	for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++)
+	for (i = 0; i < SND_JACK_SWITCH_TYPES; i++)
 		if (type & (1 << i))
 			input_set_capability(jack->input_dev, EV_SW,
 					     jack_switch_types[i]);
-- 
1.7.9.rc1

^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2012-03-02 11:45 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 17:48 [PATCH 2/2] ALSA: Integrate control based jack reporting with core jack reporting Takashi Iwai
2012-03-02  6:26 ` David Henningsson
2012-03-02  7:16   ` Takashi Iwai
2012-03-02 11:45     ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2012-02-07 19:48 [PATCH 1/2] ALSA: Use a define for the number of jack switch types Mark Brown
2012-02-07 19:48 ` [PATCH 2/2] ALSA: Integrate control based jack reporting with core jack reporting Mark Brown
2012-02-08  8:36   ` David Henningsson
2012-02-08 11:46     ` Mark Brown
2012-02-08 13:35       ` David Henningsson
2012-02-08 13:57         ` Mark Brown
2012-02-10 10:55         ` Takashi Iwai
2012-02-10 11:36           ` Mark Brown
2012-02-10 12:16             ` Takashi Iwai
2012-02-10 13:08           ` David Henningsson
2012-02-10 15:50             ` Mark Brown
2012-02-10 16:09               ` David Henningsson
2012-02-10 16:39                 ` Mark Brown
2012-02-13 13:56                   ` Takashi Iwai
2012-02-13 15:44                     ` Mark Brown
2012-02-13 17:40                       ` Takashi Iwai
2012-02-13 19:23                         ` Mark Brown
2012-02-14  7:20                         ` David Henningsson
2012-02-15  2:04                           ` Mark Brown
2012-02-22 16:52                           ` Takashi Iwai
2012-02-22 17:18                             ` Mark Brown
2012-02-22 17:34                               ` Takashi Iwai
2012-02-22 18:54                                 ` Mark Brown
2012-02-22 20:35                                   ` Takashi Iwai
2012-02-22 20:55                                     ` Mark Brown
2012-02-23  8:10                                       ` Takashi Iwai
2012-02-23  7:25                             ` David Henningsson
2012-02-14  1:29           ` Raymond Yau
2012-02-16 19:59             ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).