[alsa-devel] [PATCH] ASoC: Intel: Baytrail: add quirk for Aegex 10 (RU2) tablet

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Tue May 28 18:47:11 CEST 2019



On 5/24/19 12:03 PM, Tamás Kovács wrote:
> This tablet has an incorrect acpi identifier, which is why it is trying to
> load the RT5640 driver instead of the RT5762 driver. The RT5640 driver, on
> the other hand, checks the hardware ID, so no drivers are loaded during
> boot.
> This fix resolves to load the RT5672 driver on this tablet during boot. It
> also provides the correct IO configuration, like the jack detect mode 3,
> for 1.8V pullup.
> I would like to thank Pierre-Louis Bossart for helping with this patch.
> 
> Signed-off-by: Kovács Tamás <kepszlok at gmail.com>


Thanks for the changes Tamas.
I could not apply this patch, some sort of email uuencode error? see 
also comments below. If you can update this patch and provide a v2 it'd 
be great.
Also always Cc: maintainers (Mark Brown and Takashi Iwai, added to this 
thread) if you want a patch to be applied.
-Pierre

> ---
> diff --git a/ori/sound/soc/intel/common/soc-acpi-intel-byt-match.c
> b/new/sound/soc/intel/common/soc-acpi-intel-byt-match.c
> index fe812a9..e549950 100644
> --- a/ori/sound/soc/intel/common/soc-acpi-intel-byt-match.c
> +++ b/new/sound/soc/intel/common/soc-acpi-intel-byt-match.c
> @@ -1,4 +1,4 @@
> -/*
> +/*

no need for change here.

>    * soc-apci-intel-byt-match.c - tables and support for BYT ACPI
> enumeration.
>    *
>    * Copyright (c) 2017, Intel Corporation.
> @@ -22,6 +22,7 @@ static unsigned long byt_machine_id;
> 
>   #define BYT_THINKPAD_10  1
>   #define BYT_POV_P1006W   2
> +#define BYT_AEGEX_10     3
> 
>   static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id)
>   {
> @@ -35,6 +36,12 @@ static int byt_pov_p1006w_quirk_cb(const struct
> dmi_system_id *id)
>    return 1;
>   }
> 
> +static int byt_aegex10_quirk_cb(const struct dmi_system_id *id)
> +{
> + byt_machine_id = BYT_AEGEX_10;
> + return 1;
> +}

indentation issues?

>   static const struct dmi_system_id byt_table[] = {
>    {
>    .callback = byt_thinkpad10_quirk_cb,
> @@ -75,6 +82,14 @@ static const struct dmi_system_id byt_table[] = {
>    DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
>    },
>    },
> + {
> + /* Aegex 10 tablet (RU2) */
> + .callback = byt_aegex10_quirk_cb,
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
> + DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
> + },
> + },

indentation and kernel style?

>    { }
>   };
> 
> @@ -96,6 +111,15 @@ static struct snd_soc_acpi_mach byt_pov_p1006w = {
>    .sof_tplg_filename = "sof-byt-rt5651.tplg",
>   };
> 
> +static struct snd_soc_acpi_mach byt_aegex_10 = {
> + .id = "10EC5640",
> + .drv_name = "cht-bsw-rt5672",
> + .fw_filename = "intel/fw_sst_0f28.bin",
> + .board = "cht-bsw",
> + .sof_fw_filename = "intel/sof-byt.ri",
> + .sof_tplg_filename = "intel/sof-byt-rt5670.tplg",

the intel/ prefix is no longer used for SOF.


Also since you are using exactly the same quirk as for BYT_THINKPAD_10 
you could use a common structure instead of a duplicated one.

> +};
> +
>   static struct snd_soc_acpi_mach *byt_quirk(void *arg)
>   {
>    struct snd_soc_acpi_mach *mach = arg;
> @@ -107,6 +131,8 @@ static struct snd_soc_acpi_mach *byt_quirk(void *arg
>    return &byt_thinkpad_10;
>    case BYT_POV_P1006W:
>    return &byt_pov_p1006w;
> + case BYT_AEGEX_10:
> + return &byt_aegex_10;

indentation?

>    default:
>    return mach;
>    }
> 
> diff --git a/ori/sound/soc/codecs/rt5670.c b/new/sound/soc/codecs/rt5670.c
> index 9a03710..37cce04 100644
> --- a/ori/sound/soc/codecs/rt5670.c
> +++ b/new/sound/soc/codecs/rt5670.c
> @@ -1,4 +1,4 @@
> -/*
> +/*

no need for change here

>    * rt5670.c  --  RT5670 ALSA SoC audio codec driver
>    *
>    * Copyright 2014 Realtek Semiconductor Corp.
> @@ -2882,6 +2882,18 @@ static const struct dmi_system_id
> dmi_platform_intel_quirks[] = {
>    RT5670_DEV_GPIO |
>    RT5670_JD_MODE3),
>    },
> + {
> + .callback = rt5670_quirk_cb,
> + .ident = "Aegex 10 tablet (RU2)",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
> + DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
> + },
> + .driver_data = (unsigned long *)(RT5670_DMIC_EN |
> + RT5670_DMIC2_INR |
> + RT5670_DEV_GPIO |
> + RT5670_JD_MODE3),
> + },
>    {}
>   };
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 


More information about the Alsa-devel mailing list