[alsa-devel] [PATCH 0/3] ASoC: Intel: Add support for surface3 tablet
Surface3 tablet is CHT based device which used RT5645 codec. But the ACPI ID is 10EC5640 which belong to RT5640 codec :( So we add quirk support to load cht-machine driver for surface tablet combination, add the ACPI id and DMI fix for jack detect in codec and finally machine update.
This fixes Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 Please verify and send your tested-by.
Vinod Koul (3): ASoC: Intel: Atom: Add quirk for Surface 3 ASoC: rt5645: Add ACPI ID 10EC5640 ASoC: Intel: Add surface3 entry in CHT-RT5645 machine
sound/soc/codecs/rt5645.c | 7 ++++++ sound/soc/intel/atom/sst/sst_acpi.c | 44 ++++++++++++++++++++++++++++++++- sound/soc/intel/boards/cht_bsw_rt5645.c | 20 ++++++++++++++- sound/soc/intel/common/sst-acpi.h | 2 +- 4 files changed, 70 insertions(+), 3 deletions(-)
Surface 3 is CHT based device which shows up with RT5645 codec. But the BIOS reports ACPI ID as 5640!
To solve this, add a DMI overide for cht-5640 machine.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 Signed-off-by: Sachin Mokashi sachinx.mokashi@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/intel/atom/sst/sst_acpi.c | 44 ++++++++++++++++++++++++++++++++++++- sound/soc/intel/common/sst-acpi.h | 2 +- 2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c index 3bc4b63b2f9d..82a374d885a7 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c @@ -28,6 +28,7 @@ #include <linux/firmware.h> #include <linux/pm_runtime.h> #include <linux/pm_qos.h> +#include <linux/dmi.h> #include <linux/acpi.h> #include <asm/platform_sst_audio.h> #include <sound/core.h> @@ -237,6 +238,9 @@ static int sst_acpi_probe(struct platform_device *pdev) dev_err(dev, "No matching machine driver found\n"); return -ENODEV; } + if (mach->machine_quirk) + mach = mach->machine_quirk(mach); + pdata = mach->pdata;
ret = kstrtouint(id->id, 16, &dev_id); @@ -320,6 +324,44 @@ static int sst_acpi_remove(struct platform_device *pdev) return 0; }
+static unsigned long cht_machine_id; + +#define CHT_SURFACE_MACH 1 + +static int cht_surface_quirk_cb(const struct dmi_system_id *id) +{ + cht_machine_id = CHT_SURFACE_MACH; + return 1; +} + + +static const struct dmi_system_id cht_table[] = { + { + .callback = cht_surface_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"), + }, + }, +}; + + +static struct sst_acpi_mach cht_surface_mach = { + "10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, + &chv_platform_data }; + +struct sst_acpi_mach *cht_quirk(void *arg) +{ + struct sst_acpi_mach *mach = arg; + + dmi_check_system(cht_table); + + if (cht_machine_id == CHT_SURFACE_MACH) + return &cht_surface_mach; + else + return mach; +} + static struct sst_acpi_mach sst_acpi_bytcr[] = { {"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL, &byt_rvp_platform_data }, @@ -343,7 +385,7 @@ static struct sst_acpi_mach sst_acpi_chv[] = { {"193C9890", "cht-bsw-max98090", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, &chv_platform_data }, /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */ - {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", NULL, + {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", cht_quirk, &chv_platform_data },
{}, diff --git a/sound/soc/intel/common/sst-acpi.h b/sound/soc/intel/common/sst-acpi.h index 8398cb227ba9..504b0e4fedd4 100644 --- a/sound/soc/intel/common/sst-acpi.h +++ b/sound/soc/intel/common/sst-acpi.h @@ -40,6 +40,6 @@ struct sst_acpi_mach {
/* board name */ const char *board; - void (*machine_quirk)(void); + struct sst_acpi_mach * (*machine_quirk)(void *arg); void *pdata; };
The patch
ASoC: Intel: Atom: Add quirk for Surface 3
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 73a33f6f6d44db203d0324b67ffed1d86d4c1c9a Mon Sep 17 00:00:00 2001
From: Vinod Koul vinod.koul@intel.com Date: Fri, 8 Jul 2016 15:39:49 +0530 Subject: [PATCH] ASoC: Intel: Atom: Add quirk for Surface 3
Surface 3 is CHT based device which shows up with RT5645 codec. But the BIOS reports ACPI ID as 5640!
To solve this, add a DMI overide for cht-5640 machine.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 Signed-off-by: Sachin Mokashi sachinx.mokashi@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/intel/atom/sst/sst_acpi.c | 44 ++++++++++++++++++++++++++++++++++++- sound/soc/intel/common/sst-acpi.h | 2 +- 2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c index 3bc4b63b2f9d..82a374d885a7 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c @@ -28,6 +28,7 @@ #include <linux/firmware.h> #include <linux/pm_runtime.h> #include <linux/pm_qos.h> +#include <linux/dmi.h> #include <linux/acpi.h> #include <asm/platform_sst_audio.h> #include <sound/core.h> @@ -237,6 +238,9 @@ static int sst_acpi_probe(struct platform_device *pdev) dev_err(dev, "No matching machine driver found\n"); return -ENODEV; } + if (mach->machine_quirk) + mach = mach->machine_quirk(mach); + pdata = mach->pdata;
ret = kstrtouint(id->id, 16, &dev_id); @@ -320,6 +324,44 @@ static int sst_acpi_remove(struct platform_device *pdev) return 0; }
+static unsigned long cht_machine_id; + +#define CHT_SURFACE_MACH 1 + +static int cht_surface_quirk_cb(const struct dmi_system_id *id) +{ + cht_machine_id = CHT_SURFACE_MACH; + return 1; +} + + +static const struct dmi_system_id cht_table[] = { + { + .callback = cht_surface_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"), + }, + }, +}; + + +static struct sst_acpi_mach cht_surface_mach = { + "10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, + &chv_platform_data }; + +struct sst_acpi_mach *cht_quirk(void *arg) +{ + struct sst_acpi_mach *mach = arg; + + dmi_check_system(cht_table); + + if (cht_machine_id == CHT_SURFACE_MACH) + return &cht_surface_mach; + else + return mach; +} + static struct sst_acpi_mach sst_acpi_bytcr[] = { {"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL, &byt_rvp_platform_data }, @@ -343,7 +385,7 @@ static struct sst_acpi_mach sst_acpi_chv[] = { {"193C9890", "cht-bsw-max98090", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, &chv_platform_data }, /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */ - {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", NULL, + {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", cht_quirk, &chv_platform_data },
{}, diff --git a/sound/soc/intel/common/sst-acpi.h b/sound/soc/intel/common/sst-acpi.h index b02f12900b93..5d2949324d0e 100644 --- a/sound/soc/intel/common/sst-acpi.h +++ b/sound/soc/intel/common/sst-acpi.h @@ -40,6 +40,6 @@ struct sst_acpi_mach {
/* board name */ const char *board; - void (*machine_quirk)(void); + struct sst_acpi_mach * (*machine_quirk)(void *arg); void *pdata; };
Some CHT platforms use RT5645 codec which has entry 10EC5640 so add it. Also add DMI quirk for jack detection.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 Signed-off-by: Sachin Mokashi sachinx.mokashi@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com [Jack detection] Suggested-by: Stephen Just stephenjust@gmail.com --- sound/soc/codecs/rt5645.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 3c6594da6c9c..761ca88c4cdd 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -3531,6 +3531,7 @@ MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id); static const struct acpi_device_id rt5645_acpi_match[] = { { "10EC5645", 0 }, { "10EC5650", 0 }, + { "10EC5640", 0 }, {}, }; MODULE_DEVICE_TABLE(acpi, rt5645_acpi_match); @@ -3561,6 +3562,12 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"), }, }, + { + .ident = "Microsoft Surface 3", + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"), + }, + }, { } };
Surface3 device is a CHT machine, so add entry for it. Also update the HID from BIOS.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 Signed-off-by: Sachin Mokashi sachinx.mokashi@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/intel/boards/cht_bsw_rt5645.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index d7ef292c402d..f26c7b8545ae 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -30,6 +30,7 @@ #include <sound/jack.h> #include "../../codecs/rt5645.h" #include "../atom/sst-atom-controls.h" +#include "../common/sst-acpi.h"
#define CHT_PLAT_CLK_3_HZ 19200000 #define CHT_CODEC_DAI "rt5645-aif1" @@ -340,10 +341,13 @@ static struct snd_soc_card snd_soc_card_chtrt5650 = { };
static struct cht_acpi_card snd_soc_cards[] = { + {"10EC5640", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645}, {"10EC5645", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645}, {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650}, };
+static char cht_rt5640_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ + static int snd_cht_mc_probe(struct platform_device *pdev) { int ret_val = 0; @@ -351,6 +355,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev) struct cht_mc_private *drv; struct snd_soc_card *card = snd_soc_cards[0].soc_card; char codec_name[16]; + struct sst_acpi_mach *mach; + const char *i2c_name = NULL; + int dai_index;
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); if (!drv) @@ -366,12 +373,23 @@ static int snd_cht_mc_probe(struct platform_device *pdev) } } card->dev = &pdev->dev; + mach = card->dev->platform_data; sprintf(codec_name, "i2c-%s:00", drv->acpi_card->codec_id);
/* set correct codec name */ for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) - if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00")) + if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00")) { card->dai_link[i].codec_name = kstrdup(codec_name, GFP_KERNEL); + dai_index = i; + } + + /* fixup codec name based on HID */ + i2c_name = sst_acpi_find_name_from_hid(mach->id); + if (i2c_name != NULL) { + snprintf(cht_rt5640_codec_name, sizeof(cht_rt5640_codec_name), + "%s%s", "i2c-", i2c_name); + cht_dailink[dai_index].codec_name = cht_rt5640_codec_name; + }
snd_soc_card_set_drvdata(card, drv); ret_val = devm_snd_soc_register_card(&pdev->dev, card);
The patch
ASoC: Intel: Add surface3 entry in CHT-RT5645 machine
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 07d5c17b80f67d1b2cc2c8243590e2abed4bd7ae Mon Sep 17 00:00:00 2001
From: Vinod Koul vinod.koul@intel.com Date: Fri, 8 Jul 2016 15:39:51 +0530 Subject: [PATCH] ASoC: Intel: Add surface3 entry in CHT-RT5645 machine
Surface3 device is a CHT machine, so add entry for it. Also update the HID from BIOS.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 Signed-off-by: Sachin Mokashi sachinx.mokashi@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/intel/boards/cht_bsw_rt5645.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index d7ef292c402d..f26c7b8545ae 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -30,6 +30,7 @@ #include <sound/jack.h> #include "../../codecs/rt5645.h" #include "../atom/sst-atom-controls.h" +#include "../common/sst-acpi.h"
#define CHT_PLAT_CLK_3_HZ 19200000 #define CHT_CODEC_DAI "rt5645-aif1" @@ -340,10 +341,13 @@ static struct snd_soc_card snd_soc_card_chtrt5650 = { };
static struct cht_acpi_card snd_soc_cards[] = { + {"10EC5640", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645}, {"10EC5645", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645}, {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650}, };
+static char cht_rt5640_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ + static int snd_cht_mc_probe(struct platform_device *pdev) { int ret_val = 0; @@ -351,6 +355,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev) struct cht_mc_private *drv; struct snd_soc_card *card = snd_soc_cards[0].soc_card; char codec_name[16]; + struct sst_acpi_mach *mach; + const char *i2c_name = NULL; + int dai_index;
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); if (!drv) @@ -366,12 +373,23 @@ static int snd_cht_mc_probe(struct platform_device *pdev) } } card->dev = &pdev->dev; + mach = card->dev->platform_data; sprintf(codec_name, "i2c-%s:00", drv->acpi_card->codec_id);
/* set correct codec name */ for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) - if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00")) + if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00")) { card->dai_link[i].codec_name = kstrdup(codec_name, GFP_KERNEL); + dai_index = i; + } + + /* fixup codec name based on HID */ + i2c_name = sst_acpi_find_name_from_hid(mach->id); + if (i2c_name != NULL) { + snprintf(cht_rt5640_codec_name, sizeof(cht_rt5640_codec_name), + "%s%s", "i2c-", i2c_name); + cht_dailink[dai_index].codec_name = cht_rt5640_codec_name; + }
snd_soc_card_set_drvdata(card, drv); ret_val = devm_snd_soc_register_card(&pdev->dev, card);
On Fri, 2016-07-08 at 15:39 +0530, Vinod Koul wrote:
Surface3 device is a CHT machine, so add entry for it. Also update the HID from BIOS.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98001 Signed-off-by: Sachin Mokashi sachinx.mokashi@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com
sound/soc/intel/boards/cht_bsw_rt5645.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index d7ef292c402d..f26c7b8545ae 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -30,6 +30,7 @@ #include #include "../../codecs/rt5645.h" #include "../atom/sst-atom-controls.h" +#include "../common/sst-acpi.h" #define CHT_PLAT_CLK_3_HZ 19200000 #define CHT_CODEC_DAI "rt5645-aif1" @@ -340,10 +341,13 @@ static struct snd_soc_card snd_soc_card_chtrt5650 = { }; static struct cht_acpi_card snd_soc_cards[] = {
- {"10EC5640", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645},
{"10EC5645", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645}, {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650}, }; +static char cht_rt5640_codec_name[16]; /* i2c-:00 with HID being 8 chars */
static int snd_cht_mc_probe(struct platform_device *pdev) { int ret_val = 0; @@ -351,6 +355,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev) struct cht_mc_private *drv; struct snd_soc_card *card = snd_soc_cards[0].soc_card; char codec_name[16];
- struct sst_acpi_mach *mach;
- const char *i2c_name = NULL;
- int dai_index;
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); if (!drv) @@ -366,12 +373,23 @@ static int snd_cht_mc_probe(struct platform_device *pdev) } } card->dev = &pdev->dev;
- mach = card->dev->platform_data;
sprintf(codec_name, "i2c-%s:00", drv->acpi_card->codec_id); /* set correct codec name */ for (i = 0; i < ARRAY_SIZE(cht_dailink); i++)
if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00"))
if (!strcmp(card->dai_link[i].codec_name, "i2c-10EC5645:00")) {
card->dai_link[i].codec_name = kstrdup(codec_name, GFP_KERNEL);
dai_index = i;
}
- /* fixup codec name based on HID */
- i2c_name = sst_acpi_find_name_from_hid(mach->id);
- if (i2c_name != NULL) {
snprintf(cht_rt5640_codec_name, sizeof(cht_rt5640_codec_name),
"%s%s", "i2c-", i2c_name);
cht_dailink[dai_index].codec_name = cht_rt5640_codec_name;
FWIW, I get: sound/soc/intel/boards/cht_bsw_rt5645.c: In function 'snd_cht_mc_probe': sound/soc/intel/boards/cht_bsw_rt5645.c:391:37: warning: 'dai_index' may be used uninitialized in this function [-Wmaybe-uninitialized] cht_dailink[dai_index].codec_name = cht_rt5640_codec_name; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
- }
snd_soc_card_set_drvdata(card, drv); ret_val = devm_snd_soc_register_card(&pdev->dev, card);
On Tue, Jul 19, 2016 at 04:56:24PM +0200, Bastien Nocera wrote:
- /* fixup codec name based on HID */
- i2c_name = sst_acpi_find_name_from_hid(mach->id);
- if (i2c_name != NULL) {
snprintf(cht_rt5640_codec_name, sizeof(cht_rt5640_codec_name),
"%s%s", "i2c-", i2c_name);
cht_dailink[dai_index].codec_name = cht_rt5640_codec_name;
FWIW, I get: sound/soc/intel/boards/cht_bsw_rt5645.c: In function 'snd_cht_mc_probe': sound/soc/intel/boards/cht_bsw_rt5645.c:391:37: warning: 'dai_index' may be used uninitialized in this function [-Wmaybe-uninitialized] cht_dailink[dai_index].codec_name = cht_rt5640_codec_name; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Yeah I notice them a bit later. The fixes are already in mark's-next.
On Wed, 2016-07-20 at 09:28 +0530, Vinod Koul wrote:
On Tue, Jul 19, 2016 at 04:56:24PM +0200, Bastien Nocera wrote:
- /* fixup codec name based on HID */
- i2c_name = sst_acpi_find_name_from_hid(mach->id);
- if (i2c_name != NULL) {
snprintf(cht_rt5640_codec_name,
sizeof(cht_rt5640_codec_name),
"%s%s", "i2c-", i2c_name);
cht_dailink[dai_index].codec_name =
cht_rt5640_codec_name;
FWIW, I get: sound/soc/intel/boards/cht_bsw_rt5645.c: In function 'snd_cht_mc_probe': sound/soc/intel/boards/cht_bsw_rt5645.c:391:37: warning: 'dai_index' may be used uninitialized in this function [-Wmaybe- uninitialized] cht_dailink[dai_index].codec_name = cht_rt5640_codec_name; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Yeah I notice them a bit later. The fixes are already in mark's-next.
Care to be a bit more specific. Kind of hard to know which Mark you're talking about when there's no one of that name in the CC: list above.
Mark Brown is the maintainer of sound tree. He is included in cc: broonie@kernel.org :)
-----Original Message----- From: Bastien Nocera [mailto:hadess@hadess.net] Sent: Wednesday, July 20, 2016 4:57 PM To: Koul, Vinod vinod.koul@intel.com Cc: alsa-devel@alsa-project.org; broonie@kernel.org; liam.r.girdwood@linux.intel.com; Patches Audio patches.audio@intel.com; Stephen Just stephenjust@gmail.com; Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com; apterix@gmail.com; bugzilla@hadess.net; Mokashi, SachinX sachinx.mokashi@intel.com Subject: Re: [PATCH 3/3] ASoC: Intel: Add surface3 entry in CHT-RT5645 machine
On Wed, 2016-07-20 at 09:28 +0530, Vinod Koul wrote:
On Tue, Jul 19, 2016 at 04:56:24PM +0200, Bastien Nocera wrote:
- /* fixup codec name based on HID */
- i2c_name = sst_acpi_find_name_from_hid(mach->id);
- if (i2c_name != NULL) {
snprintf(cht_rt5640_codec_name,
sizeof(cht_rt5640_codec_name),
"%s%s", "i2c-", i2c_name);
cht_dailink[dai_index].codec_name =
cht_rt5640_codec_name;
FWIW, I get: sound/soc/intel/boards/cht_bsw_rt5645.c: In function 'snd_cht_mc_probe': sound/soc/intel/boards/cht_bsw_rt5645.c:391:37: warning: 'dai_index' may be used uninitialized in this function [-Wmaybe- uninitialized] cht_dailink[dai_index].codec_name = cht_rt5640_codec_name; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Yeah I notice them a bit later. The fixes are already in mark's-next.
Care to be a bit more specific. Kind of hard to know which Mark you're talking about when there's no one of that name in the CC: list above.
On Wed, 2016-07-20 at 11:33 +0000, Mokashi, SachinX wrote:
Mark Brown is the maintainer of sound tree.
Ha, the *ASoC* sound tree maintainer.
Picked up the 2 patches from: https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=for... https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=for...
He is included in cc: broonie@kernel.org :)
Cheers
On Fri, 2016-07-08 at 15:39 +0530, Vinod Koul wrote:
Surface3 tablet is CHT based device which used RT5645 codec. But the ACPI ID is 10EC5640 which belong to RT5640 codec :( So we add quirk support to load cht-machine driver for surface tablet combination, add the ACPI id and DMI fix for jack detect in codec and finally machine update.
This fixes Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=9800 1 Please verify and send your tested-by.
Did anyone test this?
I get this output: Jul 20 16:20:32 surface kernel: rt5640 i2c-10EC5640:00: Device with ID register 0x6308 is not rt5640/39 Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645: snd-soc-dummy-dai <-> media-cpu-dai mapping ok Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok Jul 20 16:20:34 surface kernel: compress asoc: snd-soc-dummy-dai <-> compress-cpu-dai mapping ok Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645: rt5645-aif1 <-> ssp2-port mapping ok Jul 20 16:20:34 surface kernel: input: chtrt5645 Headset as /devices/pci0000:00/808622A8:00/cht-bsw-rt5645/sound/card0/input25
With the early warning telling me it's probably not going through the quirks, though the rest of the output makes me think otherwise.
After PulseAudio starts I get: Jul 20 16:20:40 surface pulseaudio[1315]: [pulseaudio] module-alsa-card.c: Failed to find a working profile. Jul 20 16:41:32 surface pulseaudio[1315]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="platform-cht-bsw-rt5645" card_name="alsa_card.platform-cht-bsw-rt5645" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed. Jul 20 16:20:40 surface kernel: Audio Port: ASoC: no backend DAIs enabled for Audio Port [and plenty more of that last line]
$ journalctl -b | grep "Audio Port: ASoC: no backend DAIs enabled for Audio Port" | wc -l 1802
Ideas?
On Jul 20, 2016 8:48 AM, "Bastien Nocera" hadess@hadess.net wrote:
On Fri, 2016-07-08 at 15:39 +0530, Vinod Koul wrote:
Surface3 tablet is CHT based device which used RT5645 codec. But the ACPI ID is 10EC5640 which belong to RT5640 codec :( So we add quirk support to load cht-machine driver for surface tablet combination, add the ACPI id and DMI fix for jack detect in codec and finally machine update.
This fixes Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=9800 1 Please verify and send your tested-by.
Did anyone test this?
At least I did
I get this output: Jul 20 16:20:32 surface kernel: rt5640 i2c-10EC5640:00: Device with ID
register 0x6308 is not rt5640/39
Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645:
snd-soc-dummy-dai <-> media-cpu-dai mapping ok
Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645:
snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
Jul 20 16:20:34 surface kernel: compress asoc: snd-soc-dummy-dai <->
compress-cpu-dai mapping ok
Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645:
rt5645-aif1 <-> ssp2-port mapping ok
Jul 20 16:20:34 surface kernel: input: chtrt5645 Headset as
/devices/pci0000:00/808622A8:00/cht-bsw-rt5645/sound/card0/input25
With the early warning telling me it's probably not going through the quirks, though the rest of the output makes me think otherwise.
Both rt5640 and rt5645 drivers pick up the sound chip, but only the correct one succeeds.
After PulseAudio starts I get: Jul 20 16:20:40 surface pulseaudio[1315]: [pulseaudio]
module-alsa-card.c: Failed to find a working profile.
Jul 20 16:41:32 surface pulseaudio[1315]: [pulseaudio] module.c: Failed
to load module "module-alsa-card" (argument: "device_id="0" name="platform-cht-bsw-rt5645" card_name="alsa_card.platform-cht-bsw-rt5645" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Jul 20 16:20:40 surface kernel: Audio Port: ASoC: no backend DAIs
enabled for Audio Port
[and plenty more of that last line]
$ journalctl -b | grep "Audio Port: ASoC: no backend DAIs enabled for
Audio Port" | wc -l
1802
Ideas?
Are you using the alsa-lib patch to add UCM configuration too [1]? Pulseaudio needs it to initialize properly (without other manual intervention described in the bugzilla ticket for these patches).
[1] http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=b6c69d7067a1818e53da7...
On Wed, 2016-07-20 at 09:05 -0600, Stephen J wrote:
On Jul 20, 2016 8:48 AM, "Bastien Nocera" hadess@hadess.net wrote:
On Fri, 2016-07-08 at 15:39 +0530, Vinod Koul wrote:
Surface3 tablet is CHT based device which used RT5645 codec. But
the
ACPI ID is 10EC5640 which belong to RT5640 codec :( So we add quirk support to load cht-machine driver for surface
tablet
combination, add the ACPI id and DMI fix for jack detect in codec
and
finally machine update.
This fixes Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=
9800
1 Please verify and send your tested-by.
Did anyone test this?
At least I did
Fair enough.
I get this output: Jul 20 16:20:32 surface kernel: rt5640 i2c-10EC5640:00: Device with
ID register 0x6308 is not rt5640/39
Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645: snd-
soc-dummy-dai <-> media-cpu-dai mapping ok
Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645: snd-
soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
Jul 20 16:20:34 surface kernel: compress asoc: snd-soc-dummy-dai <- compress-cpu-dai mapping ok Jul 20 16:20:34 surface kernel: cht-bsw-rt5645 cht-bsw-rt5645:
rt5645-aif1 <-> ssp2-port mapping ok
Jul 20 16:20:34 surface kernel: input: chtrt5645 Headset as
/devices/pci0000:00/808622A8:00/cht-bsw-rt5645/sound/card0/input25
With the early warning telling me it's probably not going through
the
quirks, though the rest of the output makes me think otherwise.
Both rt5640 and rt5645 drivers pick up the sound chip, but only the correct one succeeds.
Good then.
After PulseAudio starts I get: Jul 20 16:20:40 surface pulseaudio[1315]: [pulseaudio] module-alsa-
card.c: Failed to find a working profile.
Jul 20 16:41:32 surface pulseaudio[1315]: [pulseaudio] module.c:
Failed to load module "module-alsa-card" (argument: "device_id="0" name="platform-cht-bsw-rt5645" card_name="alsa_card.platform-cht-bsw- rt5645" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module- udev-detect.discovered=1""): initialization failed.
Jul 20 16:20:40 surface kernel: Audio Port: ASoC: no backend DAIs
enabled for Audio Port
[and plenty more of that last line]
$ journalctl -b | grep "Audio Port: ASoC: no backend DAIs enabled
for Audio Port" | wc -l
1802
Ideas?
Are you using the alsa-lib patch to add UCM configuration too [1]? Pulseaudio needs it to initialize properly (without other manual intervention described in the bugzilla ticket for these patches). [1] http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=b6c69d7067 a1818e53da774bdbdc3023f299d579
Looks like I cocked up the patch application in my updated alsa-ucm package. It works correctly afterwards, including the internal microphone and speakers, and headset output (mic + headphones).
I also noticed that alsa-ucm isn't in the default Fedora package set.
Sorry about the spam.
participants (5)
-
Bastien Nocera
-
Mark Brown
-
Mokashi, SachinX
-
Stephen J
-
Vinod Koul