From patchwork Mon Jul 4 16:53:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Just X-Patchwork-Id: 9212975 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C32D60572 for ; Mon, 4 Jul 2016 16:56:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A25C28748 for ; Mon, 4 Jul 2016 16:56:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E9A62874A; Mon, 4 Jul 2016 16:56:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B4C528748 for ; Mon, 4 Jul 2016 16:56:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7279A2666F5; Mon, 4 Jul 2016 18:56:56 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9D2C72666D8; Mon, 4 Jul 2016 18:55:06 +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 A0E5B2666C3; Mon, 4 Jul 2016 18:55:04 +0200 (CEST) Received: from mail-it0-f65.google.com (mail-it0-f65.google.com [209.85.214.65]) by alsa0.perex.cz (Postfix) with ESMTP id 8E616265611; Mon, 4 Jul 2016 18:54:24 +0200 (CEST) Received: by mail-it0-f65.google.com with SMTP id h190so9271532ith.3; Mon, 04 Jul 2016 09:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gj5l5cG0oG0/bYXg99ScU8l7x0FB7mPN6MrlqNTivvA=; b=vxMS6YkXU5uka+ghCJrxcN8NUNP1kkZJCGreRLnU8OoD64VlT3U+BR3SGJeuUdPRqO 7s2Ur+trfSZqs1QZA0psBT414TCGSKp0UVqx+44uPKgyc+BrA1IPHMAB/vGBDZVQ7X1T FlbLOQVW9tcG8i5r9jeSEVQbHgpHK11seUeUCeDBdahT0ByJyyGY2tLvTYl9JffruCHJ ftGFvDCkOk/rIoUBa9g1C4pgAkMg/uBiiMcTI/h5kQ5eldEWwVj9488PBZFRs03iKEjJ 4ICNzvRFzFBbS0CX9s9hWV81WMb4QvZ4TVKOKJb9z+BbX46QCCUPFTpfl3TQG/lfcAXx Fe1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Gj5l5cG0oG0/bYXg99ScU8l7x0FB7mPN6MrlqNTivvA=; b=Vo4pj0Bw5EuKUwuFaomK7kyJKFqJHLOLmvAP87Y8cYneVBuYk+uXTLxdbIthDqZtQ7 T8uGQy97YOp2EK8/Z/O/9A9BHJQzgymBSAg9O4/3XpXPsNPdpiCYOUH1MKxGQQnWSoB3 a27pJWMLqz/PtnM+tDYWwcsugtcw8VKo4bD5IOeaVcdcM85eCD7HvSvI+yY9TftK6LiJ yPenFhuMR7Q68RySyHNKcwStFx1DDRJqKt3blyUMGivNbrNMPLrbppEM6TzCNrtaArjL qxYfLSEXZ0muRDHAhCsddKTrrVse4kGjINIX8QGAecY/eSuw4nFAJbF3MTY9gDOgxjKJ ZKEg== X-Gm-Message-State: ALyK8tIh60CKOXGUCN3bhLL6OeCo8vUOmVVoyJT9Msd+1syE5P2S4/ldSQ/Z1CCT23jOaA== X-Received: by 10.36.29.66 with SMTP id 63mr9638283itj.84.1467651263991; Mon, 04 Jul 2016 09:54:23 -0700 (PDT) Received: from localhost.localdomain (199-7-157-76.eng.wind.ca. [199.7.157.76]) by smtp.gmail.com with ESMTPSA id e69sm193963ite.2.2016.07.04.09.54.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2016 09:54:23 -0700 (PDT) From: Stephen Just To: patch@alsa-project.org Date: Mon, 4 Jul 2016 10:53:48 -0600 Message-Id: <20160704165348.2558-3-stephenjust@gmail.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160704165348.2558-1-stephenjust@gmail.com> References: <20160704165348.2558-1-stephenjust@gmail.com> Cc: Vinod Koul , alsa-devel@alsa-project.org, Mark Brown , Pierre-Louis Bossart , Stephen Just Subject: [alsa-devel] [PATCH v2 2/2] ASoC: Intel: Atom: add quirk for CHT w/ RT5645 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 X-Virus-Scanned: ClamAV using ClamSMTP The Surface 3 uses an RT5645 audio codec, but the ACPI identifier used is that for the RT5640. Use a DMI match to override the driver_data provided by ACPI to workaround ID conflict. Cc: Pierre-Louis Bossart Cc: Mark Brown Cc: Vinod Koul Signed-off-by: Stephen Just --- sound/soc/intel/atom/sst/sst_acpi.c | 29 ++++++++++++++++++++++++++++- sound/soc/intel/boards/cht_bsw_rt5645.c | 1 + 2 files changed, 29 insertions(+), 1 deletion(-) v1 -> v2: No change diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c index 3bc4b63..ef40608 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c @@ -19,6 +19,7 @@ */ #include +#include #include #include #include @@ -131,6 +132,8 @@ static struct sst_platform_info chv_platform_data = { .platform = "sst-mfld-platform", }; +static const struct dmi_system_id dmi_platform_quirk_table[]; + static int sst_platform_get_resources(struct intel_sst_drv *ctx) { struct resource *rsrc; @@ -224,6 +227,7 @@ static int sst_acpi_probe(struct platform_device *pdev) struct platform_device *mdev; struct platform_device *plat_dev; struct sst_platform_info *pdata; + const struct dmi_system_id *dmi_match; unsigned int dev_id; id = acpi_match_device(dev->driver->acpi_match_table, dev); @@ -231,7 +235,13 @@ static int sst_acpi_probe(struct platform_device *pdev) return -ENODEV; dev_dbg(dev, "for %s", id->id); - mach = (struct sst_acpi_mach *)id->driver_data; + /* check for quirk when getting driver_data */ + dmi_match = dmi_first_match(dmi_platform_quirk_table); + if (dmi_match) + mach = (struct sst_acpi_mach *)dmi_match->driver_data; + else + mach = (struct sst_acpi_mach *)id->driver_data; + mach = sst_acpi_find_machine(mach); if (mach == NULL) { dev_err(dev, "No matching machine driver found\n"); @@ -345,7 +355,24 @@ static struct sst_acpi_mach sst_acpi_chv[] = { /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */ {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", NULL, &chv_platform_data }, + {}, +}; +static struct sst_acpi_mach sst_acpi_chv_quirk[] = { + /* some CHT-T platforms rely on RT5645 but use the ID from RT5640 */ + {"10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, + &chv_platform_data }, + {}, +}; + +static const struct dmi_system_id dmi_platform_quirk_table[] = { + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"), + }, + .driver_data = (unsigned long *) &sst_acpi_chv_quirk, + }, {}, }; diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index d7ef292..bf99efb 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -340,6 +340,7 @@ static struct snd_soc_card snd_soc_card_chtrt5650 = { }; static struct cht_acpi_card snd_soc_cards[] = { + {"10EC5640", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645}, {"10EC5645", CODEC_TYPE_RT5645, &snd_soc_card_chtrt5645}, {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650}, };