From patchwork Mon Jan 20 16:08:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 193792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9519DC33CAA for ; Mon, 20 Jan 2020 16:11:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19ACD217F4 for ; Mon, 20 Jan 2020 16:11:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="UoZiwgDy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19ACD217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E88591675; Mon, 20 Jan 2020 17:10:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E88591675 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1579536706; bh=oeXO+ty+XFRuc1dIgJCIAyc0hxfzfcWcFzxpb4m8F1Q=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UoZiwgDymvdhJa0kaS0rhPOwYU1ApX3WyE03S1gu6SPHYWrj4yiduELel+go9KroX NAaB300DL/fj738LORr28r0SCualzy6jP6qh0uuElcJ1525OgmzVlA7Gh/G4dohDwP gSR1wcnbd7L1ico9R+zx2KAUAEOI13FECZnE966g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8C9E7F80278; Mon, 20 Jan 2020 17:08:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4D4AEF80273; Mon, 20 Jan 2020 17:08:35 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BB2DBF8022D for ; Mon, 20 Jan 2020 17:08:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BB2DBF8022D X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jan 2020 08:08:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,342,1574150400"; d="scan'208";a="426796861" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 20 Jan 2020 08:08:16 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 33ED24DB; Mon, 20 Jan 2020 18:08:13 +0200 (EET) From: Andy Shevchenko To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Mark Brown , linux-kernel@vger.kernel.org Date: Mon, 20 Jan 2020 18:08:00 +0200 Message-Id: <20200120160801.53089-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200120160801.53089-1-andriy.shevchenko@linux.intel.com> References: <20200120160801.53089-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Jie Yang , Pierre-Louis Bossart , Liam Girdwood , Andy Shevchenko Subject: [alsa-devel] [PATCH v2 8/9] ASoC: rt5645: Switch DMI table match to a test of variable X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Since we have a common x86 quirk that provides an exported variable, use it instead of local DMI table match. Note, arch/x86/kernel/quirks.c::early_platform_detect_quirk() prints the detected platform. Cc: Cezary Rojewski Cc: Pierre-Louis Bossart Cc: Liam Girdwood Cc: Jie Yang Cc: Mark Brown Cc: alsa-devel@alsa-project.org Signed-off-by: Andy Shevchenko --- sound/soc/codecs/rt5645.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 92d67010aeed..3ccecb81bc37 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -3674,13 +3675,6 @@ static const struct dmi_system_id dmi_platform_data[] = { }, .driver_data = (void *)&intel_braswell_platform_data, }, - { - .ident = "Microsoft Surface 3", - .matches = { - DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"), - }, - .driver_data = (void *)&intel_braswell_platform_data, - }, { /* * Match for the GPDwin which unfortunately uses somewhat @@ -3789,7 +3783,7 @@ static int rt5645_parse_dt(struct rt5645_priv *rt5645, struct device *dev) static int rt5645_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct rt5645_platform_data *pdata = dev_get_platdata(&i2c->dev); + const struct rt5645_platform_data *pdata = dev_get_platdata(&i2c->dev); const struct dmi_system_id *dmi_data; struct rt5645_priv *rt5645; int ret, i; @@ -3804,6 +3798,10 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, rt5645->i2c = i2c; i2c_set_clientdata(i2c, rt5645); + /* Put it first to allow DMI to override, if needed */ + if (x86_microsoft_surface_3_machine) + pdata = &intel_braswell_platform_data; + dmi_data = dmi_first_match(dmi_platform_data); if (dmi_data) { dev_info(&i2c->dev, "Detected %s platform\n", dmi_data->ident); From patchwork Mon Jan 20 16:08:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 193793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 154A1C2D0DB for ; Mon, 20 Jan 2020 16:10:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95448217F4 for ; Mon, 20 Jan 2020 16:10:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="IR92qfe+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95448217F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DB842167A; Mon, 20 Jan 2020 17:09:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB842167A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1579536611; bh=zEXyISN/+aqXWum9hqy+2cmL1WTcr55+QdOjqACtTIc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IR92qfe+VgfIYGrhYvT4M4fXdk2Eg6J/iE40WRIODgXOjShMjgQ306QD9cMw/ykma m62+CBnGXpPrHrG1MjDeDVTte8Nl9EUAm8rcNLKxRzOMamEsLfLImPE4fMIngErW29 xLcytLhyogTJcx43UdueH6u17VTy5aRa0HT3QxxY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 35081F80248; Mon, 20 Jan 2020 17:08:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A90BEF80248; Mon, 20 Jan 2020 17:08:28 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0FE3CF800C6 for ; Mon, 20 Jan 2020 17:08:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0FE3CF800C6 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jan 2020 08:08:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,342,1574150400"; d="scan'208";a="220704899" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 20 Jan 2020 08:08:16 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3F952525; Mon, 20 Jan 2020 18:08:13 +0200 (EET) From: Andy Shevchenko To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Mark Brown , linux-kernel@vger.kernel.org Date: Mon, 20 Jan 2020 18:08:01 +0200 Message-Id: <20200120160801.53089-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200120160801.53089-1-andriy.shevchenko@linux.intel.com> References: <20200120160801.53089-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Jie Yang , Pierre-Louis Bossart , Liam Girdwood , Andy Shevchenko Subject: [alsa-devel] [PATCH v2 9/9] ASoC: Intel: Switch DMI table match to a test of variable X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Since we have a common x86 quirk that provides an exported variable, use it instead of local DMI table match. Cc: Cezary Rojewski Cc: Pierre-Louis Bossart Cc: Liam Girdwood Cc: Jie Yang Cc: Mark Brown Cc: alsa-devel@alsa-project.org Signed-off-by: Andy Shevchenko --- .../intel/common/soc-acpi-intel-cht-match.c | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/sound/soc/intel/common/soc-acpi-intel-cht-match.c b/sound/soc/intel/common/soc-acpi-intel-cht-match.c index d0fb43c2b9f6..c35766125d5e 100644 --- a/sound/soc/intel/common/soc-acpi-intel-cht-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-cht-match.c @@ -5,31 +5,11 @@ * Copyright (c) 2017, Intel Corporation. */ -#include +#include + #include #include -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 snd_soc_acpi_mach cht_surface_mach = { .id = "10EC5640", .drv_name = "cht-bsw-rt5645", @@ -41,14 +21,7 @@ static struct snd_soc_acpi_mach cht_surface_mach = { static struct snd_soc_acpi_mach *cht_quirk(void *arg) { - struct snd_soc_acpi_mach *mach = arg; - - dmi_check_system(cht_table); - - if (cht_machine_id == CHT_SURFACE_MACH) - return &cht_surface_mach; - else - return mach; + return x86_microsoft_surface_3_machine ? &cht_surface_mach : arg; } /* Cherryview-based platforms: CherryTrail and Braswell */