alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Bard Liao <bardliao@realtek.com>,
	Oder Chiou <oder_chiou@realtek.com>
Cc: alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 19/19] ASoC: Intel: bytcr_rt5640: Set card long_name based on quirks
Date: Tue, 8 May 2018 13:35:59 -0500	[thread overview]
Message-ID: <6793d0f6-223b-2f11-17ad-d4ab839b4ac4@linux.intel.com> (raw)
In-Reply-To: <20180508153604.23711-20-hdegoede@redhat.com>

On 5/8/18 10:36 AM, Hans de Goede wrote:
> Many X86 devices using a BYT SoC + RT5640 codec are cheap devices with
> generic DMI strings, causing snd_soc_set_dmi_name() to fail to set a
> long_name, making it impossible for userspace to have a correct UCM
> profile which only uses inputs / outputs which are actually hooked up
> on the device.
> 
> Our quirks already specify which input the internal mic is connected to
> and if a single (mono) speaker is used or if the device has stereo
> speakers.
> 
> This commit sets a long_name based on the quirks so that userspace can
> have UCM profiles doing the right thing based on the long_name.

Isn't this going to be complicated to manage for UCM? Just with this 
patch alone, you'd need 8 UCM files to cover all the combinations. 16 if 
you add the 'sof-' prefix.

seems like UCM should become more 'dynamic' and get quirk information 
somehow (sysfs?) to enable/disable endpoints rather than rely on name 
encoding to select the right profile?

> 
> Note that if we ever encounter the need for a special UCM profile for
> some device we can add a quirk to set a specific long_name for the
> device,
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   sound/soc/intel/boards/bytcr_rt5640.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
> index cfc520200214..9a1204dcdbc6 100644
> --- a/sound/soc/intel/boards/bytcr_rt5640.c
> +++ b/sound/soc/intel/boards/bytcr_rt5640.c
> @@ -929,6 +929,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
>   static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN];
>   static char byt_rt5640_codec_aif_name[12]; /*  = "rt5640-aif[1|2]" */
>   static char byt_rt5640_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */
> +static char byt_rt5640_long_name[40]; /* = "bytcr-rt5640-*-spk-*-mic" */
>   
>   static int byt_rt5640_suspend(struct snd_soc_card *card)
>   {
> @@ -1000,6 +1001,7 @@ struct acpi_chan_package {   /* ACPICA seems to require 64 bit integers */
>   
>   static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
>   {
> +	const char * const map_name[] = { "dmic1", "dmic2", "in1", "in3" };
>   	const struct dmi_system_id *dmi_id;
>   	struct byt_rt5640_private *priv;
>   	struct snd_soc_acpi_mach *mach;
> @@ -1163,6 +1165,13 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
>   		}
>   	}
>   
> +	snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
> +		 "bytcr-rt5640-%s-spk-%s-mic",
> +		 (byt_rt5640_quirk & BYT_RT5640_MONO_SPEAKER) ?
> +			"mono" : "stereo",
> +		 map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
> +	byt_rt5640_card.long_name = byt_rt5640_long_name;
> +
>   	ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_rt5640_card);
>   
>   	if (ret_val) {
> 

  reply	other threads:[~2018-05-08 18:36 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08 15:35 [PATCH 00/19] ASoC: rt5640: Add jack-detect and button-press support Hans de Goede
2018-05-08 15:35 ` [PATCH 01/19] ASoC: rt5640: Remove is_sys_clk_from_pll, it has ordering issues Hans de Goede
2018-05-08 15:35 ` [PATCH 02/19] ASoC: rt5640: Add devicetree-bindings for dmic, jack-detect Hans de Goede
2018-05-08 15:35 ` [PATCH 03/19] ASoC: rt5640: Remove unused rt5640_platform_data Hans de Goede
2018-05-11  2:16   ` Mark Brown
2018-05-11  2:52   ` Applied "ASoC: rt5640: Remove unused rt5640_platform_data" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 04/19] ASoC: rt5640: Move checking of device-properties to component probe callback Hans de Goede
2018-05-11  2:51   ` Applied "ASoC: rt5640: Move checking of device-properties to component probe callback" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 05/19] ASoC: rt5640: Allow specifying dmic data pins through device-properties Hans de Goede
2018-05-11  2:51   ` Applied "ASoC: rt5640: Allow specifying dmic data pins through device-properties" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 06/19] ASoC: rt5640: Add jack-detect support Hans de Goede
2018-05-11  2:50   ` Applied "ASoC: rt5640: Add jack-detect support" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 07/19] ASoC: rt5640: Add button press support Hans de Goede
2018-05-11  2:50   ` Applied "ASoC: rt5640: Add button press support" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 08/19] ASoC: Intel: bytcr_rt5640: Configure PLL1 before using it Hans de Goede
2018-05-11  2:48   ` Applied "ASoC: Intel: bytcr_rt5640: Configure PLL1 before using it" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 09/19] ASoC: Intel: bytcr_rt5640: Use device-property for differential mics Hans de Goede
2018-05-11  2:48   ` Applied "ASoC: Intel: bytcr_rt5640: Use device-property for differential mics" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 10/19] ASoC: Intel: bytcr_rt5640: Use device properties for setting up dmic Hans de Goede
2018-05-11  2:25   ` Mark Brown
2018-05-08 15:35 ` [PATCH 11/19] ASoC: Intel: bytcr_rt5640: Fix Dell Venue 8 5830 Pro quirk Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Fix Dell Venue 8 5830 Pro quirk" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 12/19] ASoC: Intel: bytcr_rt5640: Enable jack detection Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Enable jack detection" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 13/19] ASoC: Intel: bytcr_rt5640: Change BYTCR default input to IN3 Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Change BYTCR default input to IN3" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 14/19] ASoC: Intel: bytcr_rt5640: Unify BYTCR input defaults Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Unify BYTCR input defaults" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 15/19] ASoC: Intel: bytcr_rt5640: Add default jack-detect settings Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Add default jack-detect settings" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 16/19] ASoC: Intel: bytcr_rt5640: Sort DMI quirk list alphabetically Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Sort DMI quirk list alphabetically" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 17/19] ASoC: Intel: bytcr_rt5640: Use dmi_first_match() for DMI quirk handling Hans de Goede
2018-05-17 16:38   ` Applied "ASoC: Intel: bytcr_rt5640: Use dmi_first_match() for DMI quirk handling" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 18/19] ASoC: Intel: bytcr_rt5640: Add quirks for various devices Hans de Goede
2018-05-08 15:36 ` [PATCH 19/19] ASoC: Intel: bytcr_rt5640: Set card long_name based on quirks Hans de Goede
2018-05-08 18:35   ` Pierre-Louis Bossart [this message]
2018-05-10 10:27     ` Hans de Goede
2018-05-10 15:00       ` Pierre-Louis Bossart
2018-05-10 15:48         ` Hans de Goede
2018-05-10 17:46           ` Pierre-Louis Bossart
2018-05-10 18:01             ` Hans de Goede
2018-05-12 21:21               ` Pierre-Louis Bossart
2018-05-13  7:11                 ` Takashi Iwai
2018-05-13  7:28                   ` Hans de Goede
2018-05-18 15:55           ` Hans de Goede
2018-05-18 16:21             ` Pierre-Louis Bossart
2018-05-17 16:38   ` Applied "ASoC: Intel: bytcr_rt5640: Set card long_name based on quirks" to the asoc tree Mark Brown
2018-05-08 18:42 ` [PATCH 00/19] ASoC: rt5640: Add jack-detect and button-press support Pierre-Louis Bossart

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=6793d0f6-223b-2f11-17ad-d4ab839b4ac4@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=tiwai@suse.com \
    /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 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).