From patchwork Tue Mar 2 07:51:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 12111057 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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 89FAEC433DB for ; Tue, 2 Mar 2021 07:53:04 +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 752AA61494 for ; Tue, 2 Mar 2021 07:53:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 752AA61494 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 E13871686; Tue, 2 Mar 2021 08:52:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E13871686 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614671582; bh=V4xv2RDaZhr9iYZ6GgweyeyUC8a2jPHV4H7vZHHdAkg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Zr6coU1/mORje9r6DdUla+oPI2d8KChqFi8KNYMTTGsMtjkpRHGtrWJZcc0SOBrbe LCtexihHytV/Xo+k5jY0sT80WvwV94r1ACQSEByn2nSeUcWGDNRzAQp5oyvbtPlMML mbnLYt8xX81q+7wF4MJjEZdIJtyU6wJqLJ7Ep51Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7B49AF80269; Tue, 2 Mar 2021 08:51:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 30FCAF802CA; Tue, 2 Mar 2021 08:51:26 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 E1842F80088 for ; Tue, 2 Mar 2021 08:51:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E1842F80088 IronPort-SDR: UWr18j04RCkMq1ILEpBKzJuzOocBKQJND+dwwzLBC1UDgkHdc2JSP33F6Gt8c/+2sksdFmHK3/ NtF4s4eaI6kA== X-IronPort-AV: E=McAfee;i="6000,8403,9910"; a="186782233" X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="186782233" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 23:51:12 -0800 IronPort-SDR: Ty2gXSthuG83IcKpD6Fh4A7tEcHjHullYgyy6DLzHkzTUvzN6v57U8Q1hFz1T10rcCPMzRyzKK /HmwwQlPXDbA== X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="406597576" Received: from bard-ubuntu.sh.intel.com ([10.239.13.33]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 23:51:08 -0800 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Subject: [PATCH v2 1/3] soundwire: add override addr ops Date: Tue, 2 Mar 2021 15:51:03 +0800 Message-Id: <20210302075105.11515-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210302075105.11515-1-yung-chuan.liao@linux.intel.com> References: <20210302075105.11515-1-yung-chuan.liao@linux.intel.com> Cc: vinod.koul@linaro.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, hui.wang@canonical.com, srinivas.kandagatla@linaro.org, sanyog.r.kale@intel.com, rander.wang@linux.intel.com, bard.liao@intel.com 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" From: Vinod Koul Platform firmware may have incorrect _ADR values causing the driver probes to fail. Add the override_ops, which when configured will allow for quirks based on DMI etc to override the addr values. Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Vinod Koul Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski --- drivers/soundwire/slave.c | 8 +++++++- include/linux/soundwire/sdw.h | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c index 180f38bd003b..112b21967c7a 100644 --- a/drivers/soundwire/slave.c +++ b/drivers/soundwire/slave.c @@ -95,7 +95,7 @@ static bool find_slave(struct sdw_bus *bus, struct acpi_device *adev, struct sdw_slave_id *id) { - unsigned long long addr; + u64 addr; unsigned int link_id; acpi_status status; @@ -108,6 +108,12 @@ static bool find_slave(struct sdw_bus *bus, return false; } + if (bus->ops->override_adr) + addr = bus->ops->override_adr(bus, addr); + + if (!addr) + return false; + /* Extract link id from ADR, Bit 51 to 48 (included) */ link_id = SDW_DISCO_LINK_ID(addr); diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index d08039d65825..f0a3895e8faf 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -804,6 +804,7 @@ struct sdw_defer { /** * struct sdw_master_ops - Master driver ops * @read_prop: Read Master properties + * @override_adr: Override value read from firmware (quirk for buggy firmware) * @xfer_msg: Transfer message callback * @xfer_msg_defer: Defer version of transfer message callback * @reset_page_addr: Reset the SCP page address registers @@ -813,7 +814,8 @@ struct sdw_defer { */ struct sdw_master_ops { int (*read_prop)(struct sdw_bus *bus); - + u64 (*override_adr) + (struct sdw_bus *bus, u64 addr); enum sdw_command_response (*xfer_msg) (struct sdw_bus *bus, struct sdw_msg *msg); enum sdw_command_response (*xfer_msg_defer) From patchwork Tue Mar 2 07:51:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 12111059 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=-21.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 61D6AC433DB for ; Tue, 2 Mar 2021 07:53:09 +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 7E8F464DEE for ; Tue, 2 Mar 2021 07:53:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E8F464DEE 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 D50CD1698; Tue, 2 Mar 2021 08:52:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D50CD1698 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614671586; bh=eEb8IJ2sy/nTaPUfMObQX3rz99RgMJSsoREzSyVgH8s=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=F97Nv1Lo04LfcQB3QkJHwcn0PZwSXavc8FJquA5imG7rLkK1LTGV2DraAGab4Akp8 TMHQao/Xxc8Km1xgoqp4tmn5DQLYZ54A6p2WNTdH0L+TgEP0+jElWL7g+ii021UCkR cnExrJEoH6BkbWqkLmGq0YTBvG4RewBcuzfuDhXo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2724CF802E3; Tue, 2 Mar 2021 08:51:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3F1A5F80277; Tue, 2 Mar 2021 08:51:27 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 B0241F80269 for ; Tue, 2 Mar 2021 08:51:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B0241F80269 IronPort-SDR: 4e/HHfZFE37i4A2qNDsgYIb8yP2LTJwNH2auFmQIHBdPOUj0ezmVpJjYZHKC23LaniPXq7dS0y 7R2muxIgsa2g== X-IronPort-AV: E=McAfee;i="6000,8403,9910"; a="186782242" X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="186782242" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 23:51:15 -0800 IronPort-SDR: byUiS9rIG5lwheUs1+zg2/hXGgKivn3c6WOCps3Zt4idWWDPolVmperYxRX50vogzV7Q4B7B8l CQ0s8Ev5U0GA== X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="406597597" Received: from bard-ubuntu.sh.intel.com ([10.239.13.33]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 23:51:11 -0800 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Subject: [PATCH v2 2/3] soundwire: Intel: introduce DMI quirks for HP Spectre x360 Convertible Date: Tue, 2 Mar 2021 15:51:04 +0800 Message-Id: <20210302075105.11515-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210302075105.11515-1-yung-chuan.liao@linux.intel.com> References: <20210302075105.11515-1-yung-chuan.liao@linux.intel.com> Cc: vinod.koul@linaro.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, hui.wang@canonical.com, srinivas.kandagatla@linaro.org, sanyog.r.kale@intel.com, rander.wang@linux.intel.com, bard.liao@intel.com 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" From: Pierre-Louis Bossart HP Spectre x360 Convertible devices expose invalid _ADR fields in the DSDT, which prevents codec drivers from probing. A possible solution is to override the DSDT, but that's just too painful for users. This patch suggests a simple DMI-based quirk to remap the existing invalid ADR information into valid ones. BugLink: https://github.com/thesofproject/linux/issues/2700 Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski --- drivers/soundwire/Makefile | 2 +- drivers/soundwire/bus.h | 2 ++ drivers/soundwire/dmi-quirks.c | 66 ++++++++++++++++++++++++++++++++++ drivers/soundwire/intel.c | 1 + 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 drivers/soundwire/dmi-quirks.c diff --git a/drivers/soundwire/Makefile b/drivers/soundwire/Makefile index bf1e250d50dd..986776787b9e 100644 --- a/drivers/soundwire/Makefile +++ b/drivers/soundwire/Makefile @@ -20,7 +20,7 @@ soundwire-cadence-y := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.o #Intel driver -soundwire-intel-y := intel.o intel_init.o +soundwire-intel-y := intel.o intel_init.o dmi-quirks.o obj-$(CONFIG_SOUNDWIRE_INTEL) += soundwire-intel.o #Qualcomm driver diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h index 2e049d39c6e5..40354469860a 100644 --- a/drivers/soundwire/bus.h +++ b/drivers/soundwire/bus.h @@ -7,6 +7,8 @@ #define DEFAULT_BANK_SWITCH_TIMEOUT 3000 #define DEFAULT_PROBE_TIMEOUT 2000 +u64 sdw_dmi_override_adr(struct sdw_bus *bus, u64 addr); + #if IS_ENABLED(CONFIG_ACPI) int sdw_acpi_find_slaves(struct sdw_bus *bus); #else diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c new file mode 100644 index 000000000000..249e476e49ea --- /dev/null +++ b/drivers/soundwire/dmi-quirks.c @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) +// Copyright(c) 2021 Intel Corporation. + +/* + * Soundwire DMI quirks + */ + +#include +#include +#include +#include "bus.h" + +struct adr_remap { + u64 adr; + u64 remapped_adr; +}; + +/* + * HP Spectre 360 Convertible devices do not expose the correct _ADR + * in the DSDT. + * Remap the bad _ADR values to the ones reported by hardware + */ +static const struct adr_remap hp_spectre_360[] = { + { + 0x000010025D070100, + 0x000020025D071100 + }, + { + 0x000110025d070100, + 0x000120025D130800 + }, + {} +}; + +static const struct dmi_system_id adr_remap_quirk_table[] = { + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Convertible"), + }, + .driver_data = (void *)hp_spectre_360, + }, + {} +}; + +u64 sdw_dmi_override_adr(struct sdw_bus *bus, u64 addr) +{ + const struct dmi_system_id *dmi_id; + + /* check if any address remap quirk applies */ + dmi_id = dmi_first_match(adr_remap_quirk_table); + if (dmi_id) { + struct adr_remap *map = dmi_id->driver_data; + + for (map = dmi_id->driver_data; map->adr; map++) { + if (map->adr == addr) { + dev_dbg(bus->dev, "remapped _ADR 0x%llx as 0x%llx\n", + addr, map->remapped_adr); + addr = map->remapped_adr; + break; + } + } + } + + return addr; +} diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index a2d5cdaa9998..a401e270a47f 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1302,6 +1302,7 @@ static int intel_prop_read(struct sdw_bus *bus) static struct sdw_master_ops sdw_intel_ops = { .read_prop = sdw_master_read_prop, + .override_adr = sdw_dmi_override_adr, .xfer_msg = cdns_xfer_msg, .xfer_msg_defer = cdns_xfer_msg_defer, .reset_page_addr = cdns_reset_page_addr, From patchwork Tue Mar 2 07:51:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 12111061 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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 3C553C433E0 for ; Tue, 2 Mar 2021 07:53:48 +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 0544861494 for ; Tue, 2 Mar 2021 07:53:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0544861494 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 80DEC16A2; Tue, 2 Mar 2021 08:52:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 80DEC16A2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614671625; bh=h/H+xLf9uu49Lu/5VXsNxSLikuxnG2R8cOuSVJ3o5HU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JhLL5x5SQpiDpXChDdznOAci1gnDKAouZHMa1exnq4KaK4qLYG2eostUg8CdILDsh Eh2Sv3ZnAGq9suAu7PewBqksUqQjzLn/R/LvEeLiYOT9Vqb+ozEJIj9HmF90ZfQSzr Pp7F0ESeZOAzaF5VCXE56oUxO5C4Gh+5tc+QKi54= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AE25AF8032C; Tue, 2 Mar 2021 08:51:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8854EF802A9; Tue, 2 Mar 2021 08:51:31 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 35B2AF802A9 for ; Tue, 2 Mar 2021 08:51:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 35B2AF802A9 IronPort-SDR: rni5FAyoL5KeQ4AVCjxHwG5nt4iFBimpCVPR/Vx4vIWwF2ACat/FDSZXe84FagtUtovq1EIBLh jmmd7YO1Gnfg== X-IronPort-AV: E=McAfee;i="6000,8403,9910"; a="186782249" X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="186782249" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 23:51:18 -0800 IronPort-SDR: rRLCUJqweNM8xiqk/1TUkIdq0Zb+mCgiA0ko5v3fufJG+lBob8szTNJz08aOmL/JoQgBzs7l6W eMALVJM2ekkQ== X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="406597610" Received: from bard-ubuntu.sh.intel.com ([10.239.13.33]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 23:51:15 -0800 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Subject: [PATCH v2 3/3] soundwire: Intel: add DMI quirk for Dell SKU 0A3E Date: Tue, 2 Mar 2021 15:51:05 +0800 Message-Id: <20210302075105.11515-4-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210302075105.11515-1-yung-chuan.liao@linux.intel.com> References: <20210302075105.11515-1-yung-chuan.liao@linux.intel.com> Cc: vinod.koul@linaro.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, hui.wang@canonical.com, srinivas.kandagatla@linaro.org, sanyog.r.kale@intel.com, rander.wang@linux.intel.com, bard.liao@intel.com 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" From: Pierre-Louis Bossart We've been handling ACPI issues on early versions of the product with a local ACPI initrd override but now that we have the possibility of a kernel quirk let's get rid of the initrd override. This helps make sure that the kernel will support all versions of the BIOS, with or without updates. Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Guennadi Liakhovetski --- drivers/soundwire/dmi-quirks.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c index 249e476e49ea..82061c1d9835 100644 --- a/drivers/soundwire/dmi-quirks.c +++ b/drivers/soundwire/dmi-quirks.c @@ -32,6 +32,29 @@ static const struct adr_remap hp_spectre_360[] = { {} }; +/* + * The initial version of the Dell SKU 0A3E did not expose the devices + * on the correct links. + */ +static const struct adr_remap dell_sku_0A3E[] = { + /* rt715 on link0 */ + { + 0x00020025d071100, + 0x00021025d071500 + }, + /* rt711 on link1 */ + { + 0x000120025d130800, + 0x000120025d071100, + }, + /* rt1308 on link2 */ + { + 0x000220025d071500, + 0x000220025d130800 + }, + {} +}; + static const struct dmi_system_id adr_remap_quirk_table[] = { { .matches = { @@ -40,6 +63,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { }, .driver_data = (void *)hp_spectre_360, }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A3E") + }, + .driver_data = (void *)dell_sku_0A3E, + }, {} };