From patchwork Fri Jul 14 20:24:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 120470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2481997vqm; Fri, 14 Jul 2023 05:55:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlH1XmuIr0w3iatO6BJ375SngYxqtjVCe1ISd59fV7zC+pm40f+sKFFIcnJZzeTS1QDctWjH X-Received: by 2002:a17:906:c357:b0:991:e2b6:2189 with SMTP id ci23-20020a170906c35700b00991e2b62189mr3742187ejb.43.1689339320867; Fri, 14 Jul 2023 05:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689339320; cv=none; d=google.com; s=arc-20160816; b=IU/bzptHGP7ayoGgp1g8ndu8O7NyLlSCkjsvRUnxoWr7wWEuvjPqlqqyuQxPem3sqi WL2DgioeUf8QNqgXsBR743Hw+xtzpE3LyQcy60DYOZJ40n4OmH4ariXkp5IAg5gsDwcM 4pqVophgoX7uS/zgP0U3Qsx/D8kcy+W0l0KzfeuErgVF7IFNsaXJiTGEPygv1gtOUSvd X9CFg+75pa2A/a/272KnZ+SW1qTJudPtvl+0p7g5tBduUXhMfNG1vABSBz85rUpRpIS9 yLME2eLYuViPBC5xymcx3B7Vc1n5uTJf5Yd8y2t/9/PZ7DKjZtfoS04/Nb82wfVPCCVg 0mtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Sl1vf44/WZBI1Yk2UGU9oKTVRqfcUlbcqdyekza3c9g=; fh=iLu8mJV3L09dzJN6VXkKj+SRT/C9p8fR4gJYErWu4bc=; b=rcnRUScSj0N2K4/pbYPDxrmu86hCGKcBy6ncUk9vVVRE0R3Ndu4z8wg1t2CBI+Qn1j CYWLg7gqhlCSgSRa5HdfUY0QozURUwra0KEJsV8PJpYgiUsQ87D8mhKP+H2OnXiEaNZw zQElWnNwORCl/RAZQ4sR/0DEw/a6ydmiyMTbzlqGiw5cLXtdmTpLTh22h2FD3dH7qQjC KlQMPxg3RCrVnrbY0LLFKwPASdXJVCShSIBzxhHFOVDO//GdnuH1zYMJS6F0zIkT1NrG j7fJp3Gt6ZoX8L0njccfB0g/RZvBmxTUzA216fSnI9l45koYIN5Q8PaSUU7ee2xAAZmy zhiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SVFMGr1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mc9-20020a170906eb4900b0099364d9f0e7si8906894ejb.543.2023.07.14.05.54.55; Fri, 14 Jul 2023 05:55:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SVFMGr1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235254AbjGNMZv (ORCPT + 99 others); Fri, 14 Jul 2023 08:25:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235946AbjGNMZ3 (ORCPT ); Fri, 14 Jul 2023 08:25:29 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF04D3ABD; Fri, 14 Jul 2023 05:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689337498; x=1720873498; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9rLxITniA1sLQNMmewKfuHQKCayEQypmbjbNmv3sb5I=; b=SVFMGr1m8k8DJNNjzPQDlA7A4Ju+gkPsVghSZcLmxjB9Ne4X/HXs6hhM PlilqkxMOSqib4MFR7m4Ap+npNUI7cJ7PKbGKXGwjj5Gi9pvnZm/D1LK5 LNJTJZewJbp+AxfTYBI/f/EzeMsqLxDYZj+4R6/M8jJofQapnw7jTPDPH nE+DxfKdwkJdaWBGdxTVrEFZziEQjvyX0Ma5mpmuILpDvZRnQGxDnWUSH XH5bO1udJyC2g4GLaTMl0ALTfE93/aDhgi9bKJuNbLCMQ5Q6AMV3HYUso Pm5ZHCF+tgN4RYs3SKzjn2BQHMd3x+2dui0Yqno1G+SN6Qmry6OpSfJ47 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="429225921" X-IronPort-AV: E=Sophos;i="6.01,205,1684825200"; d="scan'208";a="429225921" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2023 05:24:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="1053035016" X-IronPort-AV: E=Sophos;i="6.01,205,1684825200"; d="scan'208";a="1053035016" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga005.fm.intel.com with ESMTP; 14 Jul 2023 05:24:23 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Bjorn Helgaas , Mark Brown , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Cezary Rojewski , Pierre-Louis Bossart , Kai Vehmanen , Andy Shevchenko , Hans de Goede , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Andy Shevchenko Subject: [PATCH v3 15/15] ASoC: Intel: sst: Convert to PCI device IDs defines Date: Fri, 14 Jul 2023 22:24:57 +0200 Message-Id: <20230714202457.423866-16-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230714202457.423866-1-amadeuszx.slawinski@linux.intel.com> References: <20230714202457.423866-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771400668151162771 X-GMAIL-MSGID: 1771400668151162771 Use PCI device IDs from pci_ids.h header. BSW replaces CHV, as 0x22a8 was added in PCI header as BSW ID for consistency, as they are same (similar) platforms. The ACPI IDs are used only internally and lower 16 bits uniquely define the device as vendor ID for Intel is 8086 for all of them. Use PCI_DEVICE_DATA() to match PCI device to be consistent with other Intel audio drivers. Suggested-by: Andy Shevchenko Signed-off-by: Amadeusz Sławiński Reviewed-by: Andy Shevchenko --- sound/soc/intel/atom/sst/sst.c | 9 +++++---- sound/soc/intel/atom/sst/sst.h | 7 ++----- sound/soc/intel/atom/sst/sst_pci.c | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c index a0d29510d2bc..1807813298cb 100644 --- a/sound/soc/intel/atom/sst/sst.c +++ b/sound/soc/intel/atom/sst/sst.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -174,9 +175,9 @@ int sst_driver_ops(struct intel_sst_drv *sst) { switch (sst->dev_id) { - case SST_MRFLD_PCI_ID: - case SST_BYT_ACPI_ID: - case SST_CHV_ACPI_ID: + case PCI_DEVICE_ID_INTEL_SST_TNG: + case PCI_DEVICE_ID_INTEL_SST_BYT: + case PCI_DEVICE_ID_INTEL_SST_BSW: sst->tstamp = SST_TIME_STAMP_MRFLD; sst->ops = &mrfld_ops; return 0; @@ -222,7 +223,7 @@ static void sst_init_locks(struct intel_sst_drv *ctx) } int sst_alloc_drv_context(struct intel_sst_drv **ctx, - struct device *dev, unsigned int dev_id) + struct device *dev, unsigned short dev_id) { *ctx = devm_kzalloc(dev, sizeof(struct intel_sst_drv), GFP_KERNEL); if (!(*ctx)) diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h index 4d37d39fd8f4..126903e126e4 100644 --- a/sound/soc/intel/atom/sst/sst.h +++ b/sound/soc/intel/atom/sst/sst.h @@ -20,9 +20,6 @@ /* driver names */ #define SST_DRV_NAME "intel_sst_driver" -#define SST_MRFLD_PCI_ID 0x119A -#define SST_BYT_ACPI_ID 0x80860F28 -#define SST_CHV_ACPI_ID 0x808622A8 #define SST_SUSPEND_DELAY 2000 #define FW_CONTEXT_MEM (64*1024) @@ -358,7 +355,7 @@ struct sst_fw_save { struct intel_sst_drv { int sst_state; int irq_num; - unsigned int dev_id; + unsigned short dev_id; void __iomem *ddr; void __iomem *shim; void __iomem *mailbox; @@ -523,7 +520,7 @@ int sst_register(struct device *); int sst_unregister(struct device *); int sst_alloc_drv_context(struct intel_sst_drv **ctx, - struct device *dev, unsigned int dev_id); + struct device *dev, unsigned short dev_id); int sst_context_init(struct intel_sst_drv *ctx); void sst_context_cleanup(struct intel_sst_drv *ctx); void sst_configure_runtime_pm(struct intel_sst_drv *ctx); diff --git a/sound/soc/intel/atom/sst/sst_pci.c b/sound/soc/intel/atom/sst/sst_pci.c index 4058b4f80a0c..d1e64c3500be 100644 --- a/sound/soc/intel/atom/sst/sst_pci.c +++ b/sound/soc/intel/atom/sst/sst_pci.c @@ -32,7 +32,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx) /* map registers */ /* DDR base */ - if (ctx->dev_id == SST_MRFLD_PCI_ID) { + if (ctx->dev_id == PCI_DEVICE_ID_INTEL_SST_TNG) { ctx->ddr_base = pci_resource_start(pci, 0); /* check that the relocated IMR base matches with FW Binary */ ddr_base = relocate_imr_addr_mrfld(ctx->ddr_base); @@ -173,7 +173,7 @@ static void intel_sst_remove(struct pci_dev *pci) /* PCI Routines */ static const struct pci_device_id intel_sst_ids[] = { - { PCI_VDEVICE(INTEL, SST_MRFLD_PCI_ID), 0}, + { PCI_DEVICE_DATA(INTEL, SST_TNG, 0) }, { 0, } };