ASoC: Intel - Convert to use acpi_dev_get_first_match_name()
Subsystems (3)
PATCH v4 1/1 ASoC: Intel - Convert to use acpi_dev_get_first_match_name()
Instead of home grown snd_soc_acpi_find_name_from_hid() use acpi_dev_get_first_match_name().
---
- rebase on top of topic/intel branch of ASoC tree;
The patch has dependency on Pierre's
"ASoC: Intel: bytcht_es8316: fix HID handling" submitted earlier and pushed AFAICS to sound.git/topic/intel.
include/sound/soc-acpi.h | 7 ------- sound/soc/intel/boards/bytcht_da7213.c | 2 +- sound/soc/intel/boards/bytcht_es8316.c | 2 +- sound/soc/intel/boards/bytcr_rt5640.c | 2 +- sound/soc/intel/boards/bytcr_rt5651.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5645.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- sound/soc/soc-acpi.c | 33 --------------------------------- 8 files changed, 6 insertions(+), 46 deletions(-)
include/sound/soc-acpi.h +0 -7
@@ -31,16 +31,9 @@ struct snd_soc_acpi_package_context {#define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1)#if IS_ENABLED (CONFIG_ACPI ) -/* translation fron HID to I2C name, needed for DAI codec_name */ -const char *snd_soc_acpi_find_name_from_hid (const u8 hid[ACPI_ID_LEN ]);bool snd_soc_acpi_find_package_from_hid (const u8 hid[ACPI_ID_LEN ],struct snd_soc_acpi_package_context *ctx);#else -static inline const char * -snd_soc_acpi_find_name_from_hid (const u8 hid[ACPI_ID_LEN ]) -{ -return NULL ; -}static inline bool snd_soc_acpi_find_package_from_hid (const u8 hid[ACPI_ID_LEN ],struct snd_soc_acpi_package_context *ctx)
sound/soc/intel/boards/bytcht_da7213.c +1 -1
@@ -243,7 +243,7 @@ static int bytcht_da7213_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (codec_name,sizeof (codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/bytcht_es8316.c +1 -1
@@ -258,7 +258,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (codec_name,sizeof (codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/bytcr_rt5640.c +1 -1
@@ -762,7 +762,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (byt_rt5640_codec_name,sizeof (byt_rt5640_codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/bytcr_rt5651.c +1 -1
@@ -539,7 +539,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (byt_rt5651_codec_name,sizeof (byt_rt5651_codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/cht_bsw_rt5645.c +1 -1
@@ -566,7 +566,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (cht_rt5645_codec_name,sizeof (cht_rt5645_codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/cht_bsw_rt5672.c +1 -1
@@ -396,7 +396,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)/* fixup codec name based on HID */ if (mach) { - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (drv->codec_name,sizeof (drv->codec_name),"i2c-%s" , i2c_name);
sound/soc/soc-acpi.c +0 -33
@@ -16,39 +16,6 @@#include <sound/soc-acpi.h> -static acpi_status snd_soc_acpi_find_name (acpi_handle handle,u32 level, -void *context,void **ret) -{ -struct acpi_device *adev; -const char *name =NULL ; - -if (acpi_bus_get_device (handle, &adev)) -return AE_OK ; - -if (adev->status.present && adev->status.functional) { - name =acpi_dev_name (adev); - *(const char **)ret = name; -return AE_CTRL_TERMINATE ; - } - -return AE_OK ; -} - -const char *snd_soc_acpi_find_name_from_hid (const u8 hid[ACPI_ID_LEN ]) -{ -const char *name =NULL ; -acpi_status status; - - status =acpi_get_devices (hid, snd_soc_acpi_find_name,NULL , - (void **)&name); - -if (ACPI_FAILURE (status) || name[0 ] =='\0' ) -return NULL ; - -return name; -} -EXPORT_SYMBOL_GPL (snd_soc_acpi_find_name_from_hid); -struct snd_soc_acpi_mach *snd_soc_acpi_find_machine (struct snd_soc_acpi_mach *machines) {
Signature · 1 line
2.15.1
Mark Brown
maintainerApplied "ASoC: Intel - Convert to use acpi_dev_get_first_match_name()" to the asoc tree
The patch
ASoC: Intel - Convert to use acpi_dev_get_first_match_name()
has been applied to the asoc tree at
https://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
3a1479599a610cd49cbf91da68963ade90ee0fa3Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <[email protected]>
Date: Fri, 12 Jan 2018 23:16:17 +0200
Subject: [PATCH] ASoC: Intel - Convert to use acpi_dev_get_first_match_name()
Instead of home grown snd_soc_acpi_find_name_from_hid() use acpi_dev_get_first_match_name().
--- include/sound/soc-acpi.h | 7 ------- sound/soc/intel/boards/bytcht_da7213.c | 2 +- sound/soc/intel/boards/bytcht_es8316.c | 2 +- sound/soc/intel/boards/bytcr_rt5640.c | 2 +- sound/soc/intel/boards/bytcr_rt5651.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5645.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- sound/soc/soc-acpi.c | 33 --------------------------------- 8 files changed, 6 insertions(+), 46 deletions(-)
include/sound/soc-acpi.h +0 -7
@@ -31,16 +31,9 @@ struct snd_soc_acpi_package_context {#define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1)#if IS_ENABLED (CONFIG_ACPI ) -/* translation fron HID to I2C name, needed for DAI codec_name */ -const char *snd_soc_acpi_find_name_from_hid (const u8 hid[ACPI_ID_LEN ]);bool snd_soc_acpi_find_package_from_hid (const u8 hid[ACPI_ID_LEN ],struct snd_soc_acpi_package_context *ctx);#else -static inline const char * -snd_soc_acpi_find_name_from_hid (const u8 hid[ACPI_ID_LEN ]) -{ -return NULL ; -}static inline bool snd_soc_acpi_find_package_from_hid (const u8 hid[ACPI_ID_LEN ],struct snd_soc_acpi_package_context *ctx)
sound/soc/intel/boards/bytcht_da7213.c +1 -1
@@ -243,7 +243,7 @@ static int bytcht_da7213_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (codec_name,sizeof (codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/bytcht_es8316.c +1 -1
@@ -258,7 +258,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (codec_name,sizeof (codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/bytcr_rt5640.c +1 -1
@@ -762,7 +762,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (byt_rt5640_codec_name,sizeof (byt_rt5640_codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/bytcr_rt5651.c +1 -1
@@ -539,7 +539,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (byt_rt5651_codec_name,sizeof (byt_rt5651_codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/cht_bsw_rt5645.c +1 -1
@@ -566,7 +566,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) }/* fixup codec name based on HID */ - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (cht_rt5645_codec_name,sizeof (cht_rt5645_codec_name),"%s%s" ,"i2c-" , i2c_name);
sound/soc/intel/boards/cht_bsw_rt5672.c +1 -1
@@ -396,7 +396,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)/* fixup codec name based on HID */ if (mach) { - i2c_name =snd_soc_acpi_find_name_from_hid (mach->id); + i2c_name =acpi_dev_get_first_match_name (mach->id,NULL ,-1 );if (i2c_name) {snprintf (drv->codec_name,sizeof (drv->codec_name),"i2c-%s" , i2c_name);
sound/soc/soc-acpi.c +0 -33
@@ -16,39 +16,6 @@#include <sound/soc-acpi.h> -static acpi_status snd_soc_acpi_find_name (acpi_handle handle,u32 level, -void *context,void **ret) -{ -struct acpi_device *adev; -const char *name =NULL ; - -if (acpi_bus_get_device (handle, &adev)) -return AE_OK ; - -if (adev->status.present && adev->status.functional) { - name =acpi_dev_name (adev); - *(const char **)ret = name; -return AE_CTRL_TERMINATE ; - } - -return AE_OK ; -} - -const char *snd_soc_acpi_find_name_from_hid (const u8 hid[ACPI_ID_LEN ]) -{ -const char *name =NULL ; -acpi_status status; - - status =acpi_get_devices (hid, snd_soc_acpi_find_name,NULL , - (void **)&name); - -if (ACPI_FAILURE (status) || name[0 ] =='\0' ) -return NULL ; - -return name; -} -EXPORT_SYMBOL_GPL (snd_soc_acpi_find_name_from_hid); -struct snd_soc_acpi_mach *snd_soc_acpi_find_machine (struct snd_soc_acpi_mach *machines) {
Signature · 1 line
2.15.1