* [PATCH v2 0/1] ASoC: Intel: Use acpi_dev_present() @ 2016-01-14 20:57 Lukas Wunner 2016-01-14 20:57 ` [PATCH v2 1/1] " Lukas Wunner 0 siblings, 1 reply; 7+ messages in thread From: Lukas Wunner @ 2016-01-14 20:57 UTC (permalink / raw) To: Mark Brown; +Cc: Vinod Koul, Fang, Yang A, alsa-devel, Pierre-Louis Bossart Hi Mark, the acpi_dev_present() API has now landed in Linus' tree. Thus, after Linus' tree gets merged back into yours, it would be possible to use the API in the ASoC drivers as per the following patch. I've also pushed it to GitHub in case anyone prefers perusing it in a browser: https://github.com/l1k/linux/commit/f9011bb760cf5296474191406116e989dd292bf0 v1 of this patch was originally submitted with: Message-Id: <b7bd5f48fd254fb743b99d5c3e63f95ea8dfd8a7.1448282995.git.lukas@wunner.de> Link: http://mailman.alsa-project.org/pipermail/alsa-devel/2015-November/100922.html Thanks, Lukas Lukas Wunner (1): ASoC: Intel: Use acpi_dev_present() sound/soc/intel/boards/cht_bsw_max98090_ti.c | 17 ++--------------- sound/soc/intel/boards/cht_bsw_rt5645.c | 13 +------------ sound/soc/intel/common/sst-match-acpi.c | 16 +--------------- 3 files changed, 4 insertions(+), 42 deletions(-) -- 1.8.5.2 (Apple Git-48) ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/1] ASoC: Intel: Use acpi_dev_present() 2016-01-14 20:57 [PATCH v2 0/1] ASoC: Intel: Use acpi_dev_present() Lukas Wunner @ 2016-01-14 20:57 ` Lukas Wunner 2016-01-18 16:29 ` Vinod Koul ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Lukas Wunner @ 2016-01-14 20:57 UTC (permalink / raw) To: Mark Brown; +Cc: Vinod Koul, Fang, Yang A, alsa-devel, Pierre-Louis Bossart Use shiny new acpi_dev_present() and remove all the boilerplate to search for a particular ACPI device. No functional change. Cf. 2d12b6b381ba ("ACPI / utils: Add acpi_dev_present()"). v2: Rebase on commit 95f098014815 ("ASoC: Intel: Move apci find machine routines"). Cc: Mark Brown <broonie@kernel.org> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Fang, Yang A <yang.a.fang@intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> --- sound/soc/intel/boards/cht_bsw_max98090_ti.c | 17 ++--------------- sound/soc/intel/boards/cht_bsw_rt5645.c | 13 +------------ sound/soc/intel/common/sst-match-acpi.c | 16 +--------------- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c index 90588d6..e609f08 100644 --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c @@ -287,33 +287,20 @@ static struct snd_soc_card snd_soc_card_cht = { .num_controls = ARRAY_SIZE(cht_mc_controls), }; -static acpi_status snd_acpi_codec_match(acpi_handle handle, u32 level, - void *context, void **ret) -{ - *(bool *)context = true; - return AE_OK; -} - static int snd_cht_mc_probe(struct platform_device *pdev) { int ret_val = 0; - bool found = false; struct cht_mc_private *drv; drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); if (!drv) return -ENOMEM; - if (ACPI_SUCCESS(acpi_get_devices( - "104C227E", - snd_acpi_codec_match, - &found, NULL)) && found) { - drv->ts3a227e_present = true; - } else { + drv->ts3a227e_present = acpi_dev_present("104C227E"); + if (!drv->ts3a227e_present) { /* no need probe TI jack detection chip */ snd_soc_card_cht.aux_dev = NULL; snd_soc_card_cht.num_aux_devs = 0; - drv->ts3a227e_present = false; } /* register the soc card */ diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index 2d3afdd..e6cf800 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -333,20 +333,12 @@ static struct cht_acpi_card snd_soc_cards[] = { {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650}, }; -static acpi_status snd_acpi_codec_match(acpi_handle handle, u32 level, - void *context, void **ret) -{ - *(bool *)context = true; - return AE_OK; -} - static int snd_cht_mc_probe(struct platform_device *pdev) { int ret_val = 0; int i; struct cht_mc_private *drv; struct snd_soc_card *card = snd_soc_cards[0].soc_card; - bool found = false; char codec_name[16]; drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); @@ -354,10 +346,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) return -ENOMEM; for (i = 0; i < ARRAY_SIZE(snd_soc_cards); i++) { - if (ACPI_SUCCESS(acpi_get_devices( - snd_soc_cards[i].codec_id, - snd_acpi_codec_match, - &found, NULL)) && found) { + if (acpi_dev_present(snd_soc_cards[i].codec_id)) { dev_dbg(&pdev->dev, "found codec %s\n", snd_soc_cards[i].codec_id); card = snd_soc_cards[i].soc_card; diff --git a/sound/soc/intel/common/sst-match-acpi.c b/sound/soc/intel/common/sst-match-acpi.c index dd077e1..c429e22 100644 --- a/sound/soc/intel/common/sst-match-acpi.c +++ b/sound/soc/intel/common/sst-match-acpi.c @@ -13,29 +13,15 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. */ -#include <linux/acpi.h> -#include <linux/device.h> -#include <linux/module.h> -#include <linux/platform_device.h> #include "sst-acpi.h" -static acpi_status sst_acpi_mach_match(acpi_handle handle, u32 level, - void *context, void **ret) -{ - *(bool *)context = true; - return AE_OK; -} - struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines) { struct sst_acpi_mach *mach; - bool found = false; for (mach = machines; mach->id[0]; mach++) - if (ACPI_SUCCESS(acpi_get_devices(mach->id, - sst_acpi_mach_match, - &found, NULL)) && found) + if (acpi_dev_present(mach->id)) return mach; return NULL; -- 1.8.5.2 (Apple Git-48) ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/1] ASoC: Intel: Use acpi_dev_present() 2016-01-14 20:57 ` [PATCH v2 1/1] " Lukas Wunner @ 2016-01-18 16:29 ` Vinod Koul 2016-01-25 15:48 ` Mark Brown 2016-01-27 18:37 ` Applied "ASoC: Intel: Use acpi_dev_present()" to the asoc tree Mark Brown 2 siblings, 0 replies; 7+ messages in thread From: Vinod Koul @ 2016-01-18 16:29 UTC (permalink / raw) To: Lukas Wunner; +Cc: Fang, Yang A, alsa-devel, Mark Brown, Pierre-Louis Bossart On Thu, Jan 14, 2016 at 09:57:20PM +0100, Lukas Wunner wrote: > Use shiny new acpi_dev_present() and remove all the boilerplate > to search for a particular ACPI device. No functional change. > Cf. 2d12b6b381ba ("ACPI / utils: Add acpi_dev_present()"). > > v2: Rebase on commit 95f098014815 ("ASoC: Intel: Move apci find > machine routines"). > > Cc: Mark Brown <broonie@kernel.org> > Cc: Vinod Koul <vinod.koul@intel.com> > Cc: Fang, Yang A <yang.a.fang@intel.com> > Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> > Signed-off-by: Lukas Wunner <lukas@wunner.de> Looks good to me but would like to test it, so once-rc1 is out, will test that and come back -- ~Vinod ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/1] ASoC: Intel: Use acpi_dev_present() 2016-01-14 20:57 ` [PATCH v2 1/1] " Lukas Wunner 2016-01-18 16:29 ` Vinod Koul @ 2016-01-25 15:48 ` Mark Brown 2016-01-25 21:13 ` Lukas Wunner 2016-01-27 18:37 ` Applied "ASoC: Intel: Use acpi_dev_present()" to the asoc tree Mark Brown 2 siblings, 1 reply; 7+ messages in thread From: Mark Brown @ 2016-01-25 15:48 UTC (permalink / raw) To: Lukas Wunner; +Cc: Vinod Koul, Fang, Yang A, alsa-devel, Pierre-Louis Bossart [-- Attachment #1.1: Type: text/plain, Size: 570 bytes --] On Thu, Jan 14, 2016 at 09:57:20PM +0100, Lukas Wunner wrote: > Use shiny new acpi_dev_present() and remove all the boilerplate > to search for a particular ACPI device. No functional change. > Cf. 2d12b6b381ba ("ACPI / utils: Add acpi_dev_present()"). > > v2: Rebase on commit 95f098014815 ("ASoC: Intel: Move apci find > machine routines"). As covered in SubmittingPatches don't include inter-version changelogs in the body of your commit log, put them after the ---. They are meaningless once the change is applied without the rest of the history. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/1] ASoC: Intel: Use acpi_dev_present() 2016-01-25 15:48 ` Mark Brown @ 2016-01-25 21:13 ` Lukas Wunner 2016-01-27 13:32 ` Mark Brown 0 siblings, 1 reply; 7+ messages in thread From: Lukas Wunner @ 2016-01-25 21:13 UTC (permalink / raw) To: Mark Brown; +Cc: Vinod Koul, Fang, Yang A, alsa-devel, Pierre-Louis Bossart Hi Mark, On Mon, Jan 25, 2016 at 03:48:46PM +0000, Mark Brown wrote: > On Thu, Jan 14, 2016 at 09:57:20PM +0100, Lukas Wunner wrote: > > Use shiny new acpi_dev_present() and remove all the boilerplate > > to search for a particular ACPI device. No functional change. > > Cf. 2d12b6b381ba ("ACPI / utils: Add acpi_dev_present()"). > > > > v2: Rebase on commit 95f098014815 ("ASoC: Intel: Move apci find > > machine routines"). > > As covered in SubmittingPatches don't include inter-version changelogs > in the body of your commit log, put them after the ---. They are > meaningless once the change is applied without the rest of the history. I'm used to the drm and drm-intel practice of including the changelog in the commit message, but will remember to move it to the git notes when posting to alsa-devel in the future. Thanks, Lukas ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/1] ASoC: Intel: Use acpi_dev_present() 2016-01-25 21:13 ` Lukas Wunner @ 2016-01-27 13:32 ` Mark Brown 0 siblings, 0 replies; 7+ messages in thread From: Mark Brown @ 2016-01-27 13:32 UTC (permalink / raw) To: Lukas Wunner; +Cc: Vinod Koul, Fang, Yang A, alsa-devel, Pierre-Louis Bossart [-- Attachment #1.1: Type: text/plain, Size: 602 bytes --] On Mon, Jan 25, 2016 at 10:13:58PM +0100, Lukas Wunner wrote: > On Mon, Jan 25, 2016 at 03:48:46PM +0000, Mark Brown wrote: > > As covered in SubmittingPatches don't include inter-version changelogs > > in the body of your commit log, put them after the ---. They are > > meaningless once the change is applied without the rest of the history. > I'm used to the drm and drm-intel practice of including the changelog > in the commit message, but will remember to move it to the git notes > when posting to alsa-devel in the future. drm is pretty much the only subsystem that does that. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 473 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Applied "ASoC: Intel: Use acpi_dev_present()" to the asoc tree 2016-01-14 20:57 ` [PATCH v2 1/1] " Lukas Wunner 2016-01-18 16:29 ` Vinod Koul 2016-01-25 15:48 ` Mark Brown @ 2016-01-27 18:37 ` Mark Brown 2 siblings, 0 replies; 7+ messages in thread From: Mark Brown @ 2016-01-27 18:37 UTC (permalink / raw) To: Lukas Wunner, Mark Brown; +Cc: alsa-devel The patch ASoC: Intel: Use acpi_dev_present() 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 6f08cbdaac5a3050ea1898aef8ce326030fd1117 Mon Sep 17 00:00:00 2001 From: Lukas Wunner <lukas@wunner.de> Date: Thu, 14 Jan 2016 21:57:20 +0100 Subject: [PATCH] ASoC: Intel: Use acpi_dev_present() Use shiny new acpi_dev_present() and remove all the boilerplate to search for a particular ACPI device. No functional change. Cf. 2d12b6b381ba ("ACPI / utils: Add acpi_dev_present()"). Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Mark Brown <broonie@kernel.org> --- sound/soc/intel/boards/cht_bsw_max98090_ti.c | 17 ++--------------- sound/soc/intel/boards/cht_bsw_rt5645.c | 13 +------------ sound/soc/intel/common/sst-match-acpi.c | 16 +--------------- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c index 90588d6e64fc..e609f089593a 100644 --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c @@ -287,33 +287,20 @@ static struct snd_soc_card snd_soc_card_cht = { .num_controls = ARRAY_SIZE(cht_mc_controls), }; -static acpi_status snd_acpi_codec_match(acpi_handle handle, u32 level, - void *context, void **ret) -{ - *(bool *)context = true; - return AE_OK; -} - static int snd_cht_mc_probe(struct platform_device *pdev) { int ret_val = 0; - bool found = false; struct cht_mc_private *drv; drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); if (!drv) return -ENOMEM; - if (ACPI_SUCCESS(acpi_get_devices( - "104C227E", - snd_acpi_codec_match, - &found, NULL)) && found) { - drv->ts3a227e_present = true; - } else { + drv->ts3a227e_present = acpi_dev_present("104C227E"); + if (!drv->ts3a227e_present) { /* no need probe TI jack detection chip */ snd_soc_card_cht.aux_dev = NULL; snd_soc_card_cht.num_aux_devs = 0; - drv->ts3a227e_present = false; } /* register the soc card */ diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index 2d3afddb0a2e..e6cf800ab231 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -333,20 +333,12 @@ static struct cht_acpi_card snd_soc_cards[] = { {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650}, }; -static acpi_status snd_acpi_codec_match(acpi_handle handle, u32 level, - void *context, void **ret) -{ - *(bool *)context = true; - return AE_OK; -} - static int snd_cht_mc_probe(struct platform_device *pdev) { int ret_val = 0; int i; struct cht_mc_private *drv; struct snd_soc_card *card = snd_soc_cards[0].soc_card; - bool found = false; char codec_name[16]; drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); @@ -354,10 +346,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) return -ENOMEM; for (i = 0; i < ARRAY_SIZE(snd_soc_cards); i++) { - if (ACPI_SUCCESS(acpi_get_devices( - snd_soc_cards[i].codec_id, - snd_acpi_codec_match, - &found, NULL)) && found) { + if (acpi_dev_present(snd_soc_cards[i].codec_id)) { dev_dbg(&pdev->dev, "found codec %s\n", snd_soc_cards[i].codec_id); card = snd_soc_cards[i].soc_card; diff --git a/sound/soc/intel/common/sst-match-acpi.c b/sound/soc/intel/common/sst-match-acpi.c index dd077e116d25..c429e2226d40 100644 --- a/sound/soc/intel/common/sst-match-acpi.c +++ b/sound/soc/intel/common/sst-match-acpi.c @@ -13,29 +13,15 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. */ -#include <linux/acpi.h> -#include <linux/device.h> -#include <linux/module.h> -#include <linux/platform_device.h> #include "sst-acpi.h" -static acpi_status sst_acpi_mach_match(acpi_handle handle, u32 level, - void *context, void **ret) -{ - *(bool *)context = true; - return AE_OK; -} - struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines) { struct sst_acpi_mach *mach; - bool found = false; for (mach = machines; mach->id[0]; mach++) - if (ACPI_SUCCESS(acpi_get_devices(mach->id, - sst_acpi_mach_match, - &found, NULL)) && found) + if (acpi_dev_present(mach->id)) return mach; return NULL; -- 2.7.0.rc3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-01-27 18:37 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-01-14 20:57 [PATCH v2 0/1] ASoC: Intel: Use acpi_dev_present() Lukas Wunner 2016-01-14 20:57 ` [PATCH v2 1/1] " Lukas Wunner 2016-01-18 16:29 ` Vinod Koul 2016-01-25 15:48 ` Mark Brown 2016-01-25 21:13 ` Lukas Wunner 2016-01-27 13:32 ` Mark Brown 2016-01-27 18:37 ` Applied "ASoC: Intel: Use acpi_dev_present()" to the asoc tree Mark Brown
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).