ASoC: cht_bsw_rt5672: Use HID translation unit
Subsystems (3)
PATCH 1/1 ASoC: cht_bsw_rt5672: Use HID translation unit
Instead of hard-coded "i2c-10EC5670:00", use the translation helper to avoid the mismatch between i2c-codec and ACPI strings just like what we've done for bytcr_rt5640. This gives more robust binding on funky devices like Dell Wyse 3040.
--- sound/soc/intel/boards/cht_bsw_rt5672.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
sound/soc/intel/boards/cht_bsw_rt5672.c +28 -2
@@ -25,12 +25,14 @@#include <sound/jack.h> #include "../../codecs/rt5670.h" #include "../atom/sst-atom-controls.h" +#include "../common/sst-acpi.h" /* The platform clock #3 outputs 19.2Mhz clock to codec as I2S MCLK */ #define CHT_PLAT_CLK_3_HZ 19200000#define CHT_CODEC_DAI "rt5670-aif1"static struct snd_soc_jack cht_bsw_headset; +static char cht_bsw_codec_name[16 ];/* Headset jack detection DAPM pins */ static struct snd_soc_jack_pin cht_bsw_headset_pins[] = {
@@ -295,7 +297,7 @@ static int cht_suspend_pre(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"disabling jack detect before going to suspend.\n" );rt5670_jack_suspend (codec);break ;
@@ -309,7 +311,7 @@ static int cht_resume_post(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"enabling jack detect for resume.\n" );rt5670_jack_resume (codec);break ;
@@ -335,9 +337,33 @@ static struct snd_soc_card snd_soc_card_cht = { .resume_post = cht_resume_post, }; +#define RT5672_I2C_DEFAULT "i2c-10EC5670:00" +static int snd_cht_mc_probe (struct platform_device *pdev) {int ret_val =0 ; +struct sst_acpi_mach *mach = pdev->dev.platform_data; +const char *i2c_name; +int i; + +strcpy (cht_bsw_codec_name,RT5672_I2C_DEFAULT ); + +/* fixup codec name based on HID */ +if (mach) { + i2c_name =sst_acpi_find_name_from_hid (mach->id); +if (i2c_name) { +snprintf (cht_bsw_codec_name,sizeof (cht_bsw_codec_name), +"i2c-%s" , i2c_name); +for (i =0 ; i <ARRAY_SIZE (cht_dailink); i++) { +if (!strcmp (cht_dailink[i].codec_name, +RT5672_I2C_DEFAULT )) { + cht_dailink[i].codec_name = + cht_bsw_codec_name; +break ; + } + } + } + }/* register the soc card */ snd_soc_card_cht.dev = &pdev->dev;
Signature · 1 line
2.10.2
Quoted 7 lines · Takashi Iwai
Instead of hard-coded "i2c-10EC5670:00", use the translation helper to avoid the mismatch between i2c-codec and ACPI strings just like what we've done for
bytcr_rt5640. This gives more robust binding on funky devices like Dell Wyse 3040.Signed-off-by Takashi Iwai <[email protected]>
Vinod, Pierre, Liam, could you guys review?
thanks,
Takashi
Quoted 83 lines
--- sound/soc/intel/boards/cht_bsw_rt5672.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)sound/soc/intel/boards/cht_bsw_rt5672.c +28
-2@@ -25,12 +25,14 @@#include <sound/jack.h> #include "../../codecs/rt5670.h" #include "../atom/sst-atom-controls.h" +#include "../common/sst-acpi.h" /* The platform clock #3 outputs 19.2Mhz clock to codec as I2S MCLK */ #define CHT_PLAT_CLK_3_HZ 19200000#define CHT_CODEC_DAI "rt5670-aif1"static struct snd_soc_jack cht_bsw_headset; +static char cht_bsw_codec_name[16 ];/* Headset jack detection DAPM pins */ static struct snd_soc_jack_pin cht_bsw_headset_pins[] = {@@ -295,7 +297,7 @@ static int cht_suspend_pre(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"disabling jack detect before going to suspend.\n" );rt5670_jack_suspend (codec);break ;@@ -309,7 +311,7 @@ static int cht_resume_post(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"enabling jack detect for resume.\n" );rt5670_jack_resume (codec);break ;@@ -335,9 +337,33 @@ static struct snd_soc_card snd_soc_card_cht = { .resume_post = cht_resume_post, }; +#define RT5672_I2C_DEFAULT "i2c-10EC5670:00" +static int snd_cht_mc_probe (struct platform_device *pdev) {int ret_val =0 ; +struct sst_acpi_mach *mach = pdev->dev.platform_data; +const char *i2c_name; +int i; + +strcpy (cht_bsw_codec_name,RT5672_I2C_DEFAULT ); + +/* fixup codec name based on HID */ +if (mach) { + i2c_name =sst_acpi_find_name_from_hid (mach->id); +if (i2c_name) { +snprintf (cht_bsw_codec_name,sizeof (cht_bsw_codec_name), +"i2c-%s" , i2c_name); +for (i =0 ; i <ARRAY_SIZE (cht_dailink); i++) { +if (!strcmp (cht_dailink[i].codec_name, +RT5672_I2C_DEFAULT )) { + cht_dailink[i].codec_name = + cht_bsw_codec_name; +break ; + } + } + } + }/* register the soc card */ snd_soc_card_cht.dev = &pdev->dev;Signature · 6 lines
2.10.2 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Pierre-Louis Bossart
Reviewed-byQuoted 11 lines · Takashi Iwai
Quoted 7 lines · Takashi Iwai
Instead of hard-coded "i2c-10EC5670:00", use the translation helper to avoid the mismatch between i2c-codec and ACPI strings just like what we've done for
bytcr_rt5640. This gives more robust binding on funky devices like Dell Wyse 3040.Signed-off-by Takashi Iwai <[email protected]>Vinod, Pierre, Liam, could you guys review?
Sounds ok
On a side note there may be additional changes for rt5645 and rt5672 drivers since those codecs are apparently used for Baytrail as well, and we need to clock patches to set the MCLK to 19.2MHz explicitly.
Quoted 89 lines
thanks,
Takashi
Quoted 83 lines
--- sound/soc/intel/boards/cht_bsw_rt5672.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)sound/soc/intel/boards/cht_bsw_rt5672.c +28
-3@@ -25,12 +25,14 @@#include <sound/jack.h> #include "../../codecs/rt5670.h" #include "../atom/sst-atom-controls.h" +#include "../common/sst-acpi.h" /* The platform clock #3 outputs 19.2Mhz clock to codec as I2S MCLK */ #define CHT_PLAT_CLK_3_HZ 19200000#define CHT_CODEC_DAI "rt5670-aif1"static struct snd_soc_jack cht_bsw_headset; +static char cht_bsw_codec_name[16 ];/* Headset jack detection DAPM pins */ static struct snd_soc_jack_pin cht_bsw_headset_pins[] = {@@ -295,7 +297,7 @@ static int cht_suspend_pre(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"disabling jack detect before going to suspend.\n" );rt5670_jack_suspend (codec);break ;@@ -309,7 +311,7 @@ static int cht_resume_post(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"enabling jack detect for resume.\n" );rt5670_jack_resume (codec);break ;@@ -335,9 +337,33 @@ static struct snd_soc_card snd_soc_card_cht = { .resume_post = cht_resume_post, }; +#define RT5672_I2C_DEFAULT "i2c-10EC5670:00" +static int snd_cht_mc_probe (struct platform_device *pdev) {int ret_val =0 ; +struct sst_acpi_mach *mach = pdev->dev.platform_data; +const char *i2c_name; +int i; + +strcpy (cht_bsw_codec_name,RT5672_I2C_DEFAULT ); + +/* fixup codec name based on HID */ +if (mach) { + i2c_name =sst_acpi_find_name_from_hid (mach->id); +if (i2c_name) { +snprintf (cht_bsw_codec_name,sizeof (cht_bsw_codec_name), +"i2c-%s" , i2c_name); +for (i =0 ; i <ARRAY_SIZE (cht_dailink); i++) { +if (!strcmp (cht_dailink[i].codec_name, +RT5672_I2C_DEFAULT )) { + cht_dailink[i].codec_name = + cht_bsw_codec_name; +break ; + } + } + } + }/* register the soc card */ snd_soc_card_cht.dev = &pdev->dev; --2.10.2
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 4 lines · Takashi Iwai
Instead of hard-coded "i2c-10EC5670:00", use the translation helper to avoid the mismatch between i2c-codec and ACPI strings just like what we've done for
bytcr_rt5640. This gives more robust binding on funky devices like Dell Wyse 3040.
Looks good to me.
Signature · 1 line
~Vinod
Mark Brown
maintainerApplied "ASoC: cht_bsw_rt5672: Use HID translation unit" to the asoc tree
In reply to Takashi IwaiThe patch
ASoC: cht_bsw_rt5672: Use HID translation unit
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
Quoted 1 line
From
fee3244cd1f5af813a24537950e211eee4f33297Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 25 Nov 2016 15:40:18 +0100
Subject: [PATCH] ASoC: cht_bsw_rt5672: Use HID translation unit
Instead of hard-coded "i2c-10EC5670:00", use the translation helper to avoid the mismatch between i2c-codec and ACPI strings just like what we've done for bytcr_rt5640. This gives more robust binding on funky devices like Dell Wyse 3040.
--- sound/soc/intel/boards/cht_bsw_rt5672.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
sound/soc/intel/boards/cht_bsw_rt5672.c +28 -2
@@ -25,12 +25,14 @@#include <sound/jack.h> #include "../../codecs/rt5670.h" #include "../atom/sst-atom-controls.h" +#include "../common/sst-acpi.h" /* The platform clock #3 outputs 19.2Mhz clock to codec as I2S MCLK */ #define CHT_PLAT_CLK_3_HZ 19200000#define CHT_CODEC_DAI "rt5670-aif1"static struct snd_soc_jack cht_bsw_headset; +static char cht_bsw_codec_name[16 ];/* Headset jack detection DAPM pins */ static struct snd_soc_jack_pin cht_bsw_headset_pins[] = {
@@ -295,7 +297,7 @@ static int cht_suspend_pre(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"disabling jack detect before going to suspend.\n" );rt5670_jack_suspend (codec);break ;
@@ -309,7 +311,7 @@ static int cht_resume_post(struct snd_soc_card *card)struct snd_soc_codec *codec;list_for_each_entry (codec, &card->codec_dev_list, card_list) { -if (!strcmp (codec->component.name,"i2c-10EC5670:00" )) { +if (!strcmp (codec->component.name, cht_bsw_codec_name)) {dev_dbg (codec->dev,"enabling jack detect for resume.\n" );rt5670_jack_resume (codec);break ;
@@ -335,9 +337,33 @@ static struct snd_soc_card snd_soc_card_cht = { .resume_post = cht_resume_post, }; +#define RT5672_I2C_DEFAULT "i2c-10EC5670:00" +static int snd_cht_mc_probe (struct platform_device *pdev) {int ret_val =0 ; +struct sst_acpi_mach *mach = pdev->dev.platform_data; +const char *i2c_name; +int i; + +strcpy (cht_bsw_codec_name,RT5672_I2C_DEFAULT ); + +/* fixup codec name based on HID */ +if (mach) { + i2c_name =sst_acpi_find_name_from_hid (mach->id); +if (i2c_name) { +snprintf (cht_bsw_codec_name,sizeof (cht_bsw_codec_name), +"i2c-%s" , i2c_name); +for (i =0 ; i <ARRAY_SIZE (cht_dailink); i++) { +if (!strcmp (cht_dailink[i].codec_name, +RT5672_I2C_DEFAULT )) { + cht_dailink[i].codec_name = + cht_bsw_codec_name; +break ; + } + } + } + }/* register the soc card */ snd_soc_card_cht.dev = &pdev->dev;
Signature · 1 line
2.10.2