Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38332647rwd; Wed, 12 Jul 2023 06:24:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlE25U1A0GiABo9qb4CgS7sYIJNRLLLA9t6KsTzHFfyWTyqkZkOyWNNHS0ByXaRLy+6JdPfB X-Received: by 2002:a05:6e02:604:b0:345:ab32:11a with SMTP id t4-20020a056e02060400b00345ab32011amr16698759ils.12.1689168254257; Wed, 12 Jul 2023 06:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689168254; cv=none; d=google.com; s=arc-20160816; b=MlS1Ddxeq22oQ7MdlO3JiH5g0d52bK4McSANI3/s+/SpgxuEFauCwzkUd7LJTpa3T2 4B7i62IghqkTxStV9KzS2Qih5Ur5G6dLF5J79e3ON17W//3fY1hqYfXDcVHW0yUSNg+T k6Q2fLlfynHXdXNofT/gYUBi3cXWLVF463pn26hFW+51IMv/r+h8nG7B/bIhkrDFF5kT nJMxxFQf092hou4IY2XqqqSSl0LZRo/FXFTm3bldGlQtR1MraUnaIU4ylCMiZAmwRjxK lzvKlG4dvfE5HaGWjin2T7dF3w+FSEjoWtxiElMf8Q3Ov8zkLryugxtWOVaEUDWyuP1t CC/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tU/awR7VJ+9wRoh43TXucgL8oJaHwew1ED+L14lk9Ew=; fh=/eh5rpPVL1kQ7vTzWkzC1P5WdJJsdxySWChB6MakSCs=; b=QVFviWjkBuHXp3wxNQX9slGTEr//Mzgz3zgnaB7oW3QwJGbukcDoNxRFllnhOrDjw1 1weOqDLJvxRHZzGxVpZTJdmK9ZyEIIxC8hv1/wZ4RRu256kbRxtJi2NdEXekpvfLQm8+ spKHUueRcWenfYCJ8GlZ0XuTQAgR4/3vIMfuJK2mpZai275wpX83FvyzoKglJ0AIK9Ra +CG5bIRzitiY8tM5df0H9QPuRy7S7Z/QkgHseBB3ZU55ilNXsgZH7Tve1ji7Mms3WT8G 24SROrratqvJBO6uRAsXNQ4tHHn6ASK95prdWKGz8S1dpEDjjVI6EHTTauptHCVn2vyf w/JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l41VQkqI; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a630f07000000b0055b0c18704dsi3326605pgl.652.2023.07.12.06.24.01; Wed, 12 Jul 2023 06:24:14 -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=l41VQkqI; 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 S232251AbjGLMUP (ORCPT + 99 others); Wed, 12 Jul 2023 08:20:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbjGLMUN (ORCPT ); Wed, 12 Jul 2023 08:20:13 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0826A7; Wed, 12 Jul 2023 05:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689164412; x=1720700412; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=aHYcX/RpGX8NgxBuDMZyXS2bZgmbpwPq0YBcwOhVdKI=; b=l41VQkqIFAMZ2oOYilNjxoui0QN2ESHzvxiCiOEhQh39VS0wH34U5Fw0 f+8O5fJiYE/L3cboBYjJSA9CP1s/4r0Cv9ckZ7EDJxt59y1F53pUMXur8 r7oAFkekR8aSXSF0LYYGfGP4ObyfRLVIqc8oUjSjifCd9qni6GIbN+Jd8 LRkbyLBcdhomyItutaXzvH4+W8ZvuM6QruhMRoiUk9zYF0rBMFNwlt+oE 8txB/HJt+AKVD1zaRcEsD4yYoadGTOH4SyzwPbt8q484JFPQM75lG0HXp oqxL7csNKBYs+wjQ3DKBKV9EVJknp7/sRwJkMp07npyfq6G1XeSnhGNjg Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="431007174" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="431007174" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 05:19:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="1052168447" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="1052168447" Received: from aslawinx-mobl.ger.corp.intel.com (HELO [10.99.16.144]) ([10.99.16.144]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 05:19:50 -0700 Message-ID: <958f3638-f68a-ebec-29cc-816f823b017f@linux.intel.com> Date: Wed, 12 Jul 2023 14:19:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 13/13] ASoC: Intel: sst: Convert to PCI device IDs defines Content-Language: en-US To: Andy Shevchenko Cc: Bjorn Helgaas , Mark Brown , Takashi Iwai , alsa-devel@alsa-project.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Cezary Rojewski , Pierre-Louis Bossart , Kai Vehmanen , Hans de Goede References: <20230711125726.3509391-1-amadeuszx.slawinski@linux.intel.com> <20230711125726.3509391-14-amadeuszx.slawinski@linux.intel.com> From: =?UTF-8?Q?Amadeusz_S=c5=82awi=c5=84ski?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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 On 7/11/2023 4:33 PM, Andy Shevchenko wrote: > On Tue, Jul 11, 2023 at 02:57:26PM +0200, Amadeusz Sławiński wrote: >> Use PCI device IDs from pci_ids.h header. > > ... > >> switch (sst->dev_id) { >> - case SST_MRFLD_PCI_ID: >> + case PCI_DEVICE_ID_INTEL_ADSP_TNG: >> case SST_BYT_ACPI_ID: >> case SST_CHV_ACPI_ID: > > I think this needs a bit more, i.e. replacing the rest with respective PCI IDs. > > All three will be defined with SST prefix, which makes sense to me. > > ACPI here is a bit misleading, but correct. The ACPI specification assumes that > respective part of the ID space covers 100% of PCI ID space. > > I have briefly checked the code and it seems that ID is used externally only > for PCI case, so we may simply use the lower 16 bits of the ACPI _HID for the > context. > Do I understand correctly that I should just do: #define PCI_DEVICE_ID_INTEL_SST_BYT 0x0F28 #define PCI_DEVICE_ID_INTEL_SST_CHV 0x22A8 and use those IDs instead? > diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c > index a0d29510d2bc..b1f59604d825 100644 > --- a/sound/soc/intel/atom/sst/sst.c > +++ b/sound/soc/intel/atom/sst/sst.c > @@ -222,7 +222,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..c04f033e1d5f 100644 > --- a/sound/soc/intel/atom/sst/sst.h > +++ b/sound/soc/intel/atom/sst/sst.h > @@ -358,7 +358,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 +523,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); > > ... > >> /* 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 > > And kill all three! >