All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jie, Yang" <yang.jie@intel.com>
To: David Henningsson <david.henningsson@canonical.com>,
	Tanu Kaskinen <tanu.kaskinen@linux.intel.com>,
	Takashi Iwai <tiwai@suse.de>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"Girdwood, Liam R" <liam.r.girdwood@intel.com>
Subject: Re: [PATCH v2 1/2] ALSA: jack: create jack kcontrols for every jack input device
Date: Fri, 27 Mar 2015 07:45:04 +0000	[thread overview]
Message-ID: <E7B1D079BA13FB44A978CC8F69C7D6A901BDE7F0@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <5514FDA6.1000705@canonical.com>

> -----Original Message-----
> From: David Henningsson [mailto:david.henningsson@canonical.com]
> Sent: Friday, March 27, 2015 2:50 PM
> To: Jie, Yang; Tanu Kaskinen; Takashi Iwai
> Cc: perex@perex.cz; broonie@kernel.org; alsa-devel@alsa-project.org;
> Girdwood, Liam R; Liam Girdwood
> Subject: Re: [PATCH v2 1/2] ALSA: jack: create jack kcontrols for every jack
> input device
> 
> 
> 
> On 2015-03-26 13:43, Jie, Yang wrote:
> >
> > Sorry, Correct a typo(removing line "create "Mic Jack" kctl;" in
> > default case)
> 
> It looks like your code can be simplified as:
[Keyon] thanks, I will try simplify them.
> 
> switch (type | SND_JACK_HEADSET) {
> 	case SND_JACK_HEADSET:
> 		create "Headset Mic Jack" kctl;
> 		/* fall through */
> 	case SND_JACK_MICROPHONE:
> 	case SND_JACK_HEADPHONE:
> 		create format("%s Jack", id) kctl;
[Keyon] I don't want to fill "id" to kctl name, because sometimes it can be
string which can't be understood by PA, such as:

soc/intel/mfld_machine.c:       ret_val = snd_soc_card_jack_new(runtime->card,
soc/intel/mfld_machine.c-                       "Intel(R) MID Audio Jack", SND_JACK_HEADSET |
soc/intel/mfld_machine.c-                       SND_JACK_BTN_0 | SND_JACK_BTN_1, &mfld_jack,

soc/omap/ams-delta.c:   ret = snd_soc_card_jack_new(card, "hook_switch", SND_JACK_HEADSET,
soc/omap/ams-delta.c-                               &ams_delta_hook_switch, NULL, 0);

> }
> 
> ...that way, prefixes such as "Front Headphone Jack" are preserved too,
[Keyon] if PA can recognize "Front Headphone Jack" and "Rear Headphone Jack", then I
prefer to add a determine here:

	if (!strcmp(id, "Front Headphone Jack") || !strcmp(id, "Rear Headphone Jack"))
		create format("%s Jack", id) kctl;

> which is a good thing.
> 
> // David
> 
> >
> > snd_jack_new(struct snd_card *card, const char *id, int type, struct
> snd_jack **jjack) { ...
> > 	Switch(type | SND_JACK_HEADSET)
> > 	{
> > 		case SND_JACK_MICROPHONE:
> > 			create "Mic Jack" kctl;
> > 			break;
> > 		case SND_JACK_HEADSET:
> > 			if (id == "Headphone Mic Headset") {
> > 				create " Headphone Mic Jack " kctl;
> > 				create " Headset Mic Jack " kctl;
> > 			} else {
> > 				create " Headphone Jack " kctl;
> > 				create " Headset Mic Jack " kctl;
> > 			}
> > 			break;
> > 		case SND_JACK_HEADPHONE:
> > 			if (id == "Headset Mic") {
> > 				create " Headphone Jack " kctl;
> > 			//	create " Headset Mic Phantom Jack " kctl;
> > 			} else if (id == "Headphone Mic")  {
> > 				create " Headphone Mic Jack " kctl;
> > 			} else if (id == "Headset Headphone Mic")  {
> > 				create " Headphone Mic Jack " kctl;
> > 			//	create " Headset Mic Phantom Jack " kctl;
> > 			} else {
> > 				create " Headphone Jack " kctl;
> > 			}
> > 			break;
> > 		default:
> > 			break;
> > 	}
> > ...
> > }
> >
> >
> > Jack Type			Jack name			kctls/switches
> name
> > SND_JACK_HEADPHONE	Headphone			Headphone
> Jack
> > SND_JACK_MICROPHONE	Mic				Mic Jack
> > SND_JACK_HEADSET		Headset			Headphone
> Jack
> > 								Headset Mic
> Jack
> > SND_JACK_HEADPHONE	Headset Mic			Headphone
> Jack
> > 								Headset Mic
> Phantom Jack
> > SND_JACK_HEADPHONE 	Headphone Mic		Headphone
> Mic Jack
> > SND_JACK_HEADPHONE 	Headset Headphone Mic	Headphone
> Mic Jack
> > 								Headset Mic
> Phantom Jack
> > SND_JACK_HEADSET 		Headphone Mic Headset	Headphone
> Mic Jack
> > 								Headset Mic
> Jack
> >
> > ~Keyon
> >
> 
> --
> David Henningsson, Canonical Ltd.
> https://launchpad.net/~diwic

  reply	other threads:[~2015-03-27  7:45 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20  8:55 [PATCH v2 0/2] ALSA: jack: Refactoring for jack kctls Jie Yang
2015-03-20  8:55 ` Jie Yang
2015-03-20  8:55 ` [PATCH v2 1/2] ALSA: jack: create jack kcontrols for every jack input device Jie Yang
2015-03-20  9:27   ` Takashi Iwai
2015-03-20  9:29     ` Takashi Iwai
2015-03-20 12:22     ` Jie, Yang
2015-03-20 12:26       ` Takashi Iwai
2015-03-20 12:50         ` Jie, Yang
2015-03-20 13:21           ` Takashi Iwai
2015-03-20 13:49             ` Jie, Yang
2015-03-20 14:18               ` Takashi Iwai
2015-03-23 10:56                 ` Tanu Kaskinen
2015-03-23 11:51                   ` David Henningsson
2015-03-23 11:59                     ` Takashi Iwai
2015-03-23 16:41                     ` Mark Brown
2015-03-24  6:50                       ` David Henningsson
2015-03-24 17:57                         ` Mark Brown
2015-03-25  0:48                           ` Raymond Yau
2015-03-25  2:14                         ` Raymond Yau
2015-03-25 13:53                     ` Jie, Yang
2015-03-25 16:13                       ` Raymond Yau
2015-03-26  6:42                       ` David Henningsson
2015-03-26  8:29                         ` Jie, Yang
2015-03-26  9:05                           ` David Henningsson
2015-03-26 12:39                             ` Jie, Yang
2015-03-27  0:39                               ` Raymond Yau
2015-03-27  2:13                                 ` Jie, Yang
2015-03-26 12:43                             ` Jie, Yang
2015-03-27  6:50                               ` David Henningsson
2015-03-27  7:45                                 ` Jie, Yang [this message]
2015-03-27  8:01                                   ` David Henningsson
2015-03-27  9:11                                     ` Jie, Yang
2015-03-30  7:27                                       ` David Henningsson
2015-03-26  2:34                     ` Raymond Yau
2015-03-25  7:53                   ` Jie, Yang
2015-03-25  9:27                     ` Tanu Kaskinen
2015-03-25 14:13                       ` Jie, Yang
2015-03-28  6:09           ` Raymond Yau
2015-03-20 10:30   ` Raymond Yau
2015-03-20  8:55 ` [PATCH v2 2/2] ALSA: hda - Remove jack kctls Jie Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E7B1D079BA13FB44A978CC8F69C7D6A901BDE7F0@SHSMSX101.ccr.corp.intel.com \
    --to=yang.jie@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=david.henningsson@canonical.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=tanu.kaskinen@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.