From patchwork Wed May 24 17:41:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 104357 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp390668qge; Wed, 24 May 2017 10:43:16 -0700 (PDT) X-Received: by 10.28.238.67 with SMTP id m64mr6721684wmh.57.1495647796549; Wed, 24 May 2017 10:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495647796; cv=none; d=google.com; s=arc-20160816; b=epgwKGe2V6+fEawek+Usy6FHzalwA+u0M+RPW1Ck6CuyAV4++k/5v+MC6QW8RfcAKZ ZJlH3PdgbW9Cpz62XFinsS1/gzGr72NTYdt3mdsX4xOjJf/K9NmrpF9qdMMNbhGeCIcm MTxbGQTXr8vFxeYMHLs/RMPe/4UBIcpHQxPDVgoDUXurLVis5Q1tMPKa3GYREZ9Zfv1D JQvuMEY7tqV6ElVQ0ALlhg9IgcXtJ22OVohb1R7Kmfv8wZKpBpwhEOLi0JJl2PnUAb/r zHVFwaTHG637wGtLdlenx/pOAhG0NVLTTQW+DXcCpM6irw1n/NIR5dJkAGmZfgxbX6Pm 5DMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :delivered-to:arc-authentication-results; bh=Y9ZtawmzRXFP+EEaSK0hWqdm9F132rOTgT609BSDZgA=; b=v8sDtvZNq0r9maeGaeE4551KbemZNQtJZawWTgVogmc7qRfLg9JGMCstTpBVXHjtxA UbZI3tOdHKZmthhLn1rqU2RiMDXDLphDcxREOEiX8d8QSfJICeDKVVQPDpiwUVOU4v2e 30Rr4DPmFhqmyNNv+NfG6rJSP9s5Cjh+DIVuehn/inesUVa9iYRZPGE58BPo4QZbcZT3 4yom++n4Ud41ybROaP7KuA+28/sWZNscTmGjYNev3lO8grUdjpCC2OnMRUB2JlPDrhjy NK9bXw3iJ0HqH2NNYSGkd1fHVwZ10XX6PRO0MqWVFM9F+gK0JM6LNgYR/Htlmgp/nGrM LfgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id o40si21588499wrc.80.2017.05.24.10.43.16; Wed, 24 May 2017 10:43:16 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B7444267375; Wed, 24 May 2017 19:41:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1A6D5267389; Wed, 24 May 2017 19:41:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 6F2AD266C4D for ; Wed, 24 May 2017 19:41:41 +0200 (CEST) Received: from [2001:470:1f1d:6b5::3] (helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dDaHw-0004v9-KU; Wed, 24 May 2017 17:41:38 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dDaHt-0002kF-UZ; Wed, 24 May 2017 18:41:33 +0100 From: Mark Brown To: Naveen M In-Reply-To: <1494235140-29369-2-git-send-email-naveen.m@intel.com> Message-Id: Date: Wed, 24 May 2017 18:41:33 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: alsa-devel@alsa-project.org, Harsha Priya , liam.r.girdwood@linux.intel.com, vinod.koul@intel.com, broonie@kernel.org, naveen.m@intel.com, pierre-louis.bossart@intel.com Subject: [alsa-devel] Applied "ASoC: Intel: Create a helper to search for matching machine" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: Intel: Create a helper to search for matching 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 915ae2b9f0fe0357a8f9cc53a7eb18ded03d11a4 Mon Sep 17 00:00:00 2001 From: Naveen M Date: Mon, 15 May 2017 13:42:13 +0530 Subject: [PATCH] ASoC: Intel: Create a helper to search for matching machine Create a helper function to search for a matching machine based on HID. No functional change Signed-off-by: Naveen M Signed-off-by: Harsha Priya Acked-by: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/common/sst-acpi.h | 3 +++ sound/soc/intel/common/sst-match-acpi.c | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) -- 2.11.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/common/sst-acpi.h b/sound/soc/intel/common/sst-acpi.h index 214e000667ae..3649d3b08c9e 100644 --- a/sound/soc/intel/common/sst-acpi.h +++ b/sound/soc/intel/common/sst-acpi.h @@ -43,6 +43,9 @@ static inline bool sst_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], /* acpi match */ struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines); +/* acpi check hid */ +bool sst_acpi_check_hid(const u8 hid[ACPI_ID_LEN]); + /* Descriptor for SST ASoC machine driver */ struct sst_acpi_mach { /* ACPI ID for the matching machine driver. Audio codec for instance */ diff --git a/sound/soc/intel/common/sst-match-acpi.c b/sound/soc/intel/common/sst-match-acpi.c index 1070f3ad23e5..f4af3d144b82 100644 --- a/sound/soc/intel/common/sst-match-acpi.c +++ b/sound/soc/intel/common/sst-match-acpi.c @@ -63,15 +63,26 @@ static acpi_status sst_acpi_mach_match(acpi_handle handle, u32 level, return AE_OK; } +bool sst_acpi_check_hid(const u8 hid[ACPI_ID_LEN]) +{ + acpi_status status; + bool found = false; + + status = acpi_get_devices(hid, sst_acpi_mach_match, &found, NULL); + + if (ACPI_FAILURE(status)) + return false; + + return found; +} +EXPORT_SYMBOL_GPL(sst_acpi_check_hid); + 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 (sst_acpi_check_hid(mach->id) == true) return mach; return NULL; }