From patchwork Thu Oct 20 19:44:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 6369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp294207wrr; Thu, 20 Oct 2022 12:51:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NMCPd5jWF4oCNjrKAIrYsSwOVnhuPkayRDqLP4gzeWGIvZgZ8BB7fxh2LUOU0kGQT1QBZ X-Received: by 2002:aa7:858e:0:b0:562:fcad:49d6 with SMTP id w14-20020aa7858e000000b00562fcad49d6mr15703003pfn.77.1666295490491; Thu, 20 Oct 2022 12:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666295490; cv=none; d=google.com; s=arc-20160816; b=p760fYfocz+NuTHsWzyreEcjCDhZU3u0UjeNi0LQpLfIKFaLMjAsyWHRassyv/FRey N+8+TYHtdIIqpl3ymIoVAgz9S+gGH+KO0N6LuBYjUc0aJYfQr6/foreFwW/LqNI1fc2m Mc6Nm63L2XXlcZGe5j9RLidFhLrczc+Vl/d37T25eJW5wsBa24vc+yT18iraFurjZv/I Ah0dCLOZjX4F70s4heG+Ep1OLBqzhkrnljd78xnNxZDixoz2J4zvecRxnvC7AaUAKV91 7z/1wBw/H+TKiRIW7vpefrzVl/itZakI7LAwUYg6Ym5uIDMQKYWJz7CslsLHmJIKNarB ow+A== 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=ae21alGcwqif4hnxLm8RYgVt9jf4+BEQbP704ygKJqM=; b=lWVqHKiEYYSDVQFd/s4bJAlB7GP98g21AghOWhVhMIHIOsd84/ykyU5iFbOVsnVOcR rjB8HB/D40RFkeBYLlIjTMk4523z08EFEumpBU/SZFn9qzfTz/MwZkA2lsv79juYeylE rGE9ai0QoZicdcGdm9vaMGoHFPEmcqSc3PaR3cCOmhm5CL6CBnRnFit7Z8Ze29t9BWrq fd9ULygVEKPK3WO7TUW7EO2ZP+HGoW0qkq3YysqMqGeminRccNxXKOMpUMrX5+hMVMdc wOwzlfVSdj1HKajtrD0199JS7qyy4SNuGeSeOQr7VXpLiSfCHefJ9QlnXfU71BfpXo17 bsEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ahomm5ct; 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 pj4-20020a17090b4f4400b001fe1cc52234si4326656pjb.67.2022.10.20.12.51.16; Thu, 20 Oct 2022 12:51:30 -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=Ahomm5ct; 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 S230040AbiJTTot (ORCPT + 99 others); Thu, 20 Oct 2022 15:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbiJTToq (ORCPT ); Thu, 20 Oct 2022 15:44:46 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABED331EEF; Thu, 20 Oct 2022 12:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666295084; x=1697831084; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jRtLRvDs43iHgGkeKwqBjox9tFRe2xXnZgo9MxkWuFY=; b=Ahomm5ctWySbz6QrAxPe/StG/DghkJyq3wi40dyp991KVVZ/uNjLBfO/ tlDKBNo7s7bscIz/LQhBEWXfiRrCFKXnKODEFWVKafkYbRpc6tcSJ3+kW FodSnIgpP+dIuvm2++IgfaddPY/44X8s0VYEQ1lvXqFz8wujEk83IeV4R ZmkAblSs35Pmdta8vyna+Z3V1a5aq+ng76F49v+PC2oLfQjGJg7gUdzZZ XqvIuwa3CLBhu6XW+vK5KcBYhtBZXJ3Rw69UoLM2S4KUA7HL6FaXFT8xE lviUb4Sj73D5X451sAEw7sgRyjmBzEy3nrHHtKZlYBt/U8nESP19+BX0h w==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="333392704" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="333392704" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 12:44:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="875210362" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="875210362" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 20 Oct 2022 12:44:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E5740D0; Thu, 20 Oct 2022 22:45:03 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown Subject: [PATCH v4 1/5] spi: pxa2xx: Respect Intel SSP type given by a property Date: Thu, 20 Oct 2022 22:44:56 +0300 Message-Id: <20221020194500.10225-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> References: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747237459886372674?= X-GMAIL-MSGID: =?utf-8?q?1747237459886372674?= Allow to set the Intel SSP type by reading the property. Only apply this to the known MFD enumerated devices. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 12 ++++++++++++ include/linux/pxa2xx_ssp.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 03ed6d4a14cd..f3ba1b0588fb 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1460,17 +1460,29 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) struct resource *res; struct pci_dev *pcidev = dev_is_pci(parent) ? to_pci_dev(parent) : NULL; const struct pci_device_id *pcidev_id = NULL; + u32 value = SSP_UNDEFINED; enum pxa_ssp_type type; + bool mfd_enumerated; const void *match; int status; u64 uid; + /* For MFD enumerated devices always ask for a property */ + mfd_enumerated = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv"); + if (mfd_enumerated) { + status = device_property_read_u32(dev, "intel,spi-pxa2xx-type", &value); + if (status) + return ERR_PTR(status); + } + if (pcidev) pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); match = device_get_match_data(&pdev->dev); if (match) type = (enum pxa_ssp_type)match; + else if (value > SSP_UNDEFINED && value < SSP_MAX) + type = (enum pxa_ssp_type)value; else if (pcidev_id) type = (enum pxa_ssp_type)pcidev_id->driver_data; else diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index a3fec2de512f..cd1973e6ac4b 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h @@ -229,6 +229,7 @@ enum pxa_ssp_type { LPSS_SPT_SSP, LPSS_BXT_SSP, LPSS_CNL_SSP, + SSP_MAX }; struct ssp_device { From patchwork Thu Oct 20 19:44:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 6370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp295091wrr; Thu, 20 Oct 2022 12:53:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BQFdoyxn0Fve91eTcb1j3zjxeJybOqVT9pgARHu7IELPplQcALbH15psParUY7ydU3R15 X-Received: by 2002:a63:1a65:0:b0:460:d5db:8688 with SMTP id a37-20020a631a65000000b00460d5db8688mr13027363pgm.221.1666295589610; Thu, 20 Oct 2022 12:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666295589; cv=none; d=google.com; s=arc-20160816; b=dsce3ggIceBq1E3zusrBrEletF87yDTUGDgWXXETtqNevEx6pLdxIsGLAFXQBS9Qkn XANQd46F+f/zCaWxsDTRZZgcMMdasQB14UCIp5kiM3sHlSA445JjJN/aB9uObHSQeYCQ XKDE6XefRKardS/PEnTJxfb9y1MxtYOyea41VrFKQt/X69vpAmx8uL80jP5+AMa1GEp0 Y/yuDgAkw8Ht0q9+DHoylHAFuSlA5DC7oxmF1aachr6UZQ3q8dmQWHJsbZIEToTFLzdA hNS/RHElCXzAAUPfaYy9Ro00rzfzMQEWABtHeFypcFivmO/FaqZme+vlrZxJ3QEoXou5 lxdg== 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=1LcWu9Qlrof9qXt95zub/SV7gg5tHOZrQTnqOjQ1msM=; b=phbJKUdwXL6kh41TPfrbbKvCdq0D9Eu3TDwg9Rx6Iq/8SQ2nmvPG+HNYM+J5DjOYvd NitozICMEe9iQeHQULvdd2ell0xc9m8tFNlR/zGvTWfU7eMvug/gSzIOrcfKzEWB/XWZ R7Ixsb5+4Vguj/fQ1DQ0CySjVYsBzrR6tGse9akaQpPejWgt6FN2pdc6hIhFFqpoBKEl PkJz58ZQB6ENAK/3fNrAXlu5Ge0XRTXAWMOlFZET1aODiLG6wH7RJ0Fe4qsHQGtgLgU9 nC+WKCtio0ypLxynO5iyrqMP8zRycYbgJg6f6gpXzxdW0WjCH2jCS1WDD8g9sBy3l28e QhAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=n+5tbwXj; 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 na2-20020a17090b4c0200b00200ad6b1554si4922164pjb.6.2022.10.20.12.52.56; Thu, 20 Oct 2022 12:53:09 -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=n+5tbwXj; 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 S230060AbiJTTpD (ORCPT + 99 others); Thu, 20 Oct 2022 15:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbiJTTot (ORCPT ); Thu, 20 Oct 2022 15:44:49 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24BE14003C; Thu, 20 Oct 2022 12:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666295087; x=1697831087; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VsRgjea9MgWlVLsbOj4OD1KnCuyr+jeXtAYbkZexWv8=; b=n+5tbwXjuhVaZvPz/HXvzSmfG3s6MvvC1mnxCVbJB8+rLTdmIf+FgPSb bdUOUCQeUG3dsR4eHhSM7tuYs00DaVb5WmEZJqa3qb8aFuo1LqGS9CFd0 gf1rLW1uWcM4aUusV316gN+haSA+iyeS1n+W3/bcJe78+yuj4/l4aYFmD DuWUb/vOZe22kSzc3ov6zob+LrWvR+vd471QmLzVquA0ekm7NLoOPfGvz P86mFy/uGRVUFPq30E5jOpDY+tSly9xohK90YoJ7aeaFQOTkkbUkfS6v8 vIcyXWorNnWNU/c3Df+ejg+NO2jk5SY3kvVrcTcyjxMlREWPdDWKU9Amh A==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="333392707" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="333392707" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 12:44:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="875210367" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="875210367" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 20 Oct 2022 12:44:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EAA72291; Thu, 20 Oct 2022 22:45:03 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown Subject: [PATCH v4 2/5] spi: pxa2xx: Remove no more needed PCI ID table Date: Thu, 20 Oct 2022 22:44:57 +0300 Message-Id: <20221020194500.10225-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> References: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747237564245432363?= X-GMAIL-MSGID: =?utf-8?q?1747237564245432363?= Since the PCI enumerated devices provide a property with SSP type, there is no more necessity to bear the copy of the ID table here. Remove it for good. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 117 +-------------------------------------- 1 file changed, 2 insertions(+), 115 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index f3ba1b0588fb..96c9bb7925de 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -1335,121 +1334,17 @@ static const struct acpi_device_id pxa2xx_spi_acpi_match[] = { MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); #endif -/* - * PCI IDs of compound devices that integrate both host controller and private - * integrated DMA engine. Please note these are not used in module - * autoloading and probing in this module but matching the LPSS SSP type. - */ -static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = { - /* SPT-LP */ - { PCI_VDEVICE(INTEL, 0x9d29), LPSS_SPT_SSP }, - { PCI_VDEVICE(INTEL, 0x9d2a), LPSS_SPT_SSP }, - /* SPT-H */ - { PCI_VDEVICE(INTEL, 0xa129), LPSS_SPT_SSP }, - { PCI_VDEVICE(INTEL, 0xa12a), LPSS_SPT_SSP }, - /* KBL-H */ - { PCI_VDEVICE(INTEL, 0xa2a9), LPSS_SPT_SSP }, - { PCI_VDEVICE(INTEL, 0xa2aa), LPSS_SPT_SSP }, - /* CML-V */ - { PCI_VDEVICE(INTEL, 0xa3a9), LPSS_SPT_SSP }, - { PCI_VDEVICE(INTEL, 0xa3aa), LPSS_SPT_SSP }, - /* BXT A-Step */ - { PCI_VDEVICE(INTEL, 0x0ac2), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x0ac4), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x0ac6), LPSS_BXT_SSP }, - /* BXT B-Step */ - { PCI_VDEVICE(INTEL, 0x1ac2), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x1ac4), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x1ac6), LPSS_BXT_SSP }, - /* GLK */ - { PCI_VDEVICE(INTEL, 0x31c2), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x31c4), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x31c6), LPSS_BXT_SSP }, - /* ICL-LP */ - { PCI_VDEVICE(INTEL, 0x34aa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x34ab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x34fb), LPSS_CNL_SSP }, - /* EHL */ - { PCI_VDEVICE(INTEL, 0x4b2a), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x4b2b), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x4b37), LPSS_BXT_SSP }, - /* JSL */ - { PCI_VDEVICE(INTEL, 0x4daa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x4dab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x4dfb), LPSS_CNL_SSP }, - /* TGL-H */ - { PCI_VDEVICE(INTEL, 0x43aa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x43ab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x43fb), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x43fd), LPSS_CNL_SSP }, - /* ADL-P */ - { PCI_VDEVICE(INTEL, 0x51aa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x51ab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x51fb), LPSS_CNL_SSP }, - /* ADL-M */ - { PCI_VDEVICE(INTEL, 0x54aa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x54ab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x54fb), LPSS_CNL_SSP }, - /* APL */ - { PCI_VDEVICE(INTEL, 0x5ac2), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x5ac4), LPSS_BXT_SSP }, - { PCI_VDEVICE(INTEL, 0x5ac6), LPSS_BXT_SSP }, - /* RPL-S */ - { PCI_VDEVICE(INTEL, 0x7a2a), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7a2b), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7a79), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7a7b), LPSS_CNL_SSP }, - /* ADL-S */ - { PCI_VDEVICE(INTEL, 0x7aaa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7aab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7af9), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7afb), LPSS_CNL_SSP }, - /* MTL-P */ - { PCI_VDEVICE(INTEL, 0x7e27), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7e30), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x7e46), LPSS_CNL_SSP }, - /* CNL-LP */ - { PCI_VDEVICE(INTEL, 0x9daa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x9dab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x9dfb), LPSS_CNL_SSP }, - /* CNL-H */ - { PCI_VDEVICE(INTEL, 0xa32a), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa32b), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa37b), LPSS_CNL_SSP }, - /* CML-LP */ - { PCI_VDEVICE(INTEL, 0x02aa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x02ab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x02fb), LPSS_CNL_SSP }, - /* CML-H */ - { PCI_VDEVICE(INTEL, 0x06aa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x06ab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0x06fb), LPSS_CNL_SSP }, - /* TGL-LP */ - { PCI_VDEVICE(INTEL, 0xa0aa), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa0ab), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa0de), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa0df), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa0fb), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa0fd), LPSS_CNL_SSP }, - { PCI_VDEVICE(INTEL, 0xa0fe), LPSS_CNL_SSP }, - { }, -}; - static const struct of_device_id pxa2xx_spi_of_match[] = { { .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP }, {}, }; MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match); -#ifdef CONFIG_PCI - static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param) { return param == chan->device->dev; } -#endif /* CONFIG_PCI */ - static struct pxa2xx_spi_controller * pxa2xx_spi_init_pdata(struct platform_device *pdev) { @@ -1458,8 +1353,6 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) struct device *parent = dev->parent; struct ssp_device *ssp; struct resource *res; - struct pci_dev *pcidev = dev_is_pci(parent) ? to_pci_dev(parent) : NULL; - const struct pci_device_id *pcidev_id = NULL; u32 value = SSP_UNDEFINED; enum pxa_ssp_type type; bool mfd_enumerated; @@ -1475,16 +1368,11 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) return ERR_PTR(status); } - if (pcidev) - pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); - match = device_get_match_data(&pdev->dev); if (match) type = (enum pxa_ssp_type)match; else if (value > SSP_UNDEFINED && value < SSP_MAX) type = (enum pxa_ssp_type)value; - else if (pcidev_id) - type = (enum pxa_ssp_type)pcidev_id->driver_data; else return ERR_PTR(-EINVAL); @@ -1500,13 +1388,12 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ssp->phys_base = res->start; -#ifdef CONFIG_PCI - if (pcidev_id) { + /* Platforms with iDMA 64-bit */ + if (mfd_enumerated) { pdata->tx_param = parent; pdata->rx_param = parent; pdata->dma_filter = pxa2xx_spi_idma_filter; } -#endif ssp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(ssp->clk)) From patchwork Thu Oct 20 19:44:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 6371 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp295149wrr; Thu, 20 Oct 2022 12:53:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rcUHTpJRPsUFx3rwqrceoq+4MGYzXELrDxOvljXPK+Bvd7Dh+PbhtlYsfdIkG7uDt6Xdq X-Received: by 2002:a17:90a:7849:b0:20d:2d54:65d with SMTP id y9-20020a17090a784900b0020d2d54065dmr53653366pjl.219.1666295598623; Thu, 20 Oct 2022 12:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666295598; cv=none; d=google.com; s=arc-20160816; b=JTeCRyF+7vSikBE5nqI8N6AzZURpOBC64hrZUim5fT+FWCqSc2oWCz09iR9InGAAcW elbVcJlQd1mgeSMPIWc12iCQjd99hez/RfjBWI3sKc9s5xvKUbu4AjiOnGFDh1IBnlTU oKkPW5p5+a5PTK7ck4Id5AmyHHbE+2MdsnVHdk+ZnrMnKqiphP0ZUhFlF6xtn2nWrsvr 5oiLXZxZURE1n35rP1tjcr6Ay1elU37Dh3k39DCX/CBnAZKGYTPzlEUKz7vgDFIYpxUd 92vqFXp5xnkRDdjt6fnkZFKeULzhl2DwQrzZqg3FF3VnpT3y/kDfqgplXVmK2bgFSWY0 tJRw== 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=nWsr7/vBkFGc7pqjO7kEum0IV3FTlAKwhv3gI0YS6yg=; b=lMLng6pdIYLDOb2wmrdOfr+zikoSZwe1Qt2Q/a6NAXjOEd0WWs9sVlIWG5ep4JIy0A GG6VDpClyYo/9e1BWdqYww+aR+IU+0y+Hr+SRmUWg0nGRtTrQf2Dg5SrEt0No3x8Ot81 vitd0mpMy8Wp4EzWyRMYy7H8BJfgUDVRCPUC4voLiU+e+ACLC0dtWmcZpPI3oyBo/ohB gyQ+eHIUbwMSN6TnQszmptUCsJmyUh+b0aqbfEuoNTeOn6xx7yDJRbFkBAJL0x5Bq4wq N7c2qxmMSq57fslfoMDJVPcw+u5R53bwr5pVsan/Y+c/ynYFltNqftf1HYIsOWErt4HK WEPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aQLuDej1; 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 21-20020a630315000000b0046afcdae036si21785751pgd.427.2022.10.20.12.53.05; Thu, 20 Oct 2022 12:53:18 -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=aQLuDej1; 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 S229817AbiJTTpH (ORCPT + 99 others); Thu, 20 Oct 2022 15:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbiJTTou (ORCPT ); Thu, 20 Oct 2022 15:44:50 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F190B495EF; Thu, 20 Oct 2022 12:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666295088; x=1697831088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mvA9eCR+rKOtsB1zGltIo6l+ymy8s9rrgGnqv92uqD8=; b=aQLuDej1GSBC/RbxkcAjLL/O17aRqZD0FTpYURy1CMVnfd9P8ceCTks0 HIKKEQ/3235MskZq2ZP+MUztUERpSWYZ6F+LiTvr931fo1FVLFlEOEstc SSInQ4zrwDkiJAMZtvJ90CxkKMhXTwpFCRGYtrc/EDPqQ7Q5ZBGrohhrR fQdPddrPLf6cMm7UL7u7Sy4s2ICeN372XrheSf6QPVpD7bUyDx65phaiG vT7ma/vX8+8a/gJyxWXPkY2tfvhXPW2Nd4QzuCb2P9Zm4CCVJXNaUQ2zz j0z1kCZNu91/P9Wa++PJotAyjyU+t4hhUkmx4S5ldu+XCT5r+G8PqNIBU A==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="333392708" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="333392708" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 12:44:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="875210365" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="875210365" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 20 Oct 2022 12:44:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0502B4FD; Thu, 20 Oct 2022 22:45:03 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , Jonathan Cameron Subject: [PATCH v4 3/5] spi: pxa2xx: Move OF and ACPI ID tables closer to their user Date: Thu, 20 Oct 2022 22:44:58 +0300 Message-Id: <20221020194500.10225-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> References: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747237574037568597?= X-GMAIL-MSGID: =?utf-8?q?1747237574037568597?= There is no code that uses ID tables directly, except the struct device_driver at the end of the file. Hence, move tables closer to its user. It's always possible to access them via pointer to a platform device. Signed-off-by: Andy Shevchenko Reviewed-by: Jonathan Cameron --- drivers/spi/spi-pxa2xx.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 96c9bb7925de..0824965e894d 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1321,25 +1321,6 @@ static void cleanup(struct spi_device *spi) kfree(chip); } -#ifdef CONFIG_ACPI -static const struct acpi_device_id pxa2xx_spi_acpi_match[] = { - { "INT33C0", LPSS_LPT_SSP }, - { "INT33C1", LPSS_LPT_SSP }, - { "INT3430", LPSS_LPT_SSP }, - { "INT3431", LPSS_LPT_SSP }, - { "80860F0E", LPSS_BYT_SSP }, - { "8086228E", LPSS_BSW_SSP }, - { }, -}; -MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); -#endif - -static const struct of_device_id pxa2xx_spi_of_match[] = { - { .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP }, - {}, -}; -MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match); - static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param) { return param == chan->device->dev; @@ -1765,6 +1746,25 @@ static const struct dev_pm_ops pxa2xx_spi_pm_ops = { pxa2xx_spi_runtime_resume, NULL) }; +#ifdef CONFIG_ACPI +static const struct acpi_device_id pxa2xx_spi_acpi_match[] = { + { "80860F0E", LPSS_BYT_SSP }, + { "8086228E", LPSS_BSW_SSP }, + { "INT33C0", LPSS_LPT_SSP }, + { "INT33C1", LPSS_LPT_SSP }, + { "INT3430", LPSS_LPT_SSP }, + { "INT3431", LPSS_LPT_SSP }, + {} +}; +MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); +#endif + +static const struct of_device_id pxa2xx_spi_of_match[] = { + { .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP }, + {} +}; +MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match); + static struct platform_driver driver = { .driver = { .name = "pxa2xx-spi", From patchwork Thu Oct 20 19:44:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 6373 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp295545wrr; Thu, 20 Oct 2022 12:54:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Kofzp6CsJoJ+PVhJehjPmvyatCfebX6LIGzGL6PeLUa4hA/1eL7qhNXHeeS6xAclCMVIm X-Received: by 2002:a17:906:ee8e:b0:730:3646:d178 with SMTP id wt14-20020a170906ee8e00b007303646d178mr12617061ejb.426.1666295677838; Thu, 20 Oct 2022 12:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666295677; cv=none; d=google.com; s=arc-20160816; b=xz2QCRx8Q4KdqJYnycRkmrHR4Xd+IeIGHJlb/83pRnqXI4NY5nIaPuv2D21EJJKVLA T1l2FFyitUjFjYyf2O0Hju2/XiBNoey3paoYHWN61K1Xxs/oLEtnGN1SXIGCoeOnLmY4 9yNayWNTe2n2ThlpIrvst6u1nGviTIV9UednJybK9Cg9vRDPDXjNgpoBFjpYu5CqFXvh ipqHb3xJzg/q7nRGJXw5oOmgUeRn9SL7ovH3TJ5Gmcn5isKSq6sHr8CGkN5YLA2tfCtQ 7JAt+3rtr3LS9/ig+NRnnYey/X6ehNi0DjQstbsDO1Vj1XoVTJqefuEceFHSgG+G6F2/ tX4w== 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=cb8PPEcGFaFqm/P6X7+NZ4pDfwxzIWJokX7wyeMiylg=; b=P5OpfZ0GARwj0sewzXfE6qVwCqUdZYrr7ZwFKv2pd8GN9QktBWgmuckHwTmyMs8u4t udlMnwMBEYTb8y6pEWIfDA5e4M/S+BXXUpQ9faKYSihQFqKGywcTE/zR4HUFvjCKOE9P Dsr/4EzGZzrDUIrFYyDmYwGRY4EJ5CySLMsYsdRxaWb3EeM31dyepIkW+1wuXea6BKD1 AyQiEAcOrDoxRHhJE23Ka1s0u1l+Bo41G7IQg5ZMZLvvOzms9n01C60/bmUNGjM3hgOu acRXnNqMcqgO/j6a91D1Ufqixly7V7kmVUZBDdYm5sUVYBwNmz6QFCFW3+r0i4MULRYR whww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QABKFpUG; 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 ji3-20020a170907980300b0078e254ae419si20780341ejc.643.2022.10.20.12.54.13; Thu, 20 Oct 2022 12:54:37 -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=QABKFpUG; 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 S230071AbiJTTo7 (ORCPT + 99 others); Thu, 20 Oct 2022 15:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbiJTTot (ORCPT ); Thu, 20 Oct 2022 15:44:49 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BA1B3FECC; Thu, 20 Oct 2022 12:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666295086; x=1697831086; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zkf3kxbtj/cO1oGXalV1myW08PGzo34Wex6zNG0q3+g=; b=QABKFpUGMf+IDvrB8TtYZiPmRqAB8hO7R9K2G3umU8K4Uz4fltAjj54Z TICQTU+JQIMOrAC/RS350Fc3Kz5LK0C7gDvuLfawaZQAjz/TgEcvqkMMv or+/ReN02g6yySey6rykkSAWFxDDHGJOvNC3/NnnCMg0AtLFCGak6bucg ETcVKoN+bhbTA1FEdWuTceI/5eLfhSfeyCHy3HqmMvSbZgQNQZtkPfijy YiW9Ai+GFldBj0TvIrHIgGNipvAo4dICGgxxg/+Gv4ZzZvTqTUM3Rkt+5 g4J0N2vteXM7otn2JdAxO+qChD7KOxnFKtipSif+EuQ7ivb4EL4G8p8nh Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="333392706" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="333392706" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 12:44:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="875210366" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="875210366" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 20 Oct 2022 12:44:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0C7EF3F9; Thu, 20 Oct 2022 22:45:04 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown Subject: [PATCH v4 4/5] spi: pxa2xx: Consistently use dev variable in pxa2xx_spi_init_pdata() Date: Thu, 20 Oct 2022 22:44:59 +0300 Message-Id: <20221020194500.10225-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> References: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747237656341226386?= X-GMAIL-MSGID: =?utf-8?q?1747237656341226386?= We have a temporary variable to keep a pointer to a struct device in the pxa2xx_spi_init_pdata(). Use it consistently there. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 0824965e894d..00c07e93d414 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1349,7 +1349,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) return ERR_PTR(status); } - match = device_get_match_data(&pdev->dev); + match = device_get_match_data(dev); if (match) type = (enum pxa_ssp_type)match; else if (value > SSP_UNDEFINED && value < SSP_MAX) @@ -1357,7 +1357,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) else return ERR_PTR(-EINVAL); - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) return ERR_PTR(-ENOMEM); @@ -1376,7 +1376,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) pdata->dma_filter = pxa2xx_spi_idma_filter; } - ssp->clk = devm_clk_get(&pdev->dev, NULL); + ssp->clk = devm_clk_get(dev, NULL); if (IS_ERR(ssp->clk)) return ERR_CAST(ssp->clk); @@ -1385,7 +1385,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) return ERR_PTR(ssp->irq); ssp->type = type; - ssp->dev = &pdev->dev; + ssp->dev = dev; status = acpi_dev_uid_to_integer(ACPI_COMPANION(dev), &uid); if (status) @@ -1393,7 +1393,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) else ssp->port_id = uid; - pdata->is_slave = device_property_read_bool(&pdev->dev, "spi-slave"); + pdata->is_slave = device_property_read_bool(dev, "spi-slave"); pdata->num_chipselect = 1; pdata->enable_dma = true; pdata->dma_burst_size = 1; From patchwork Thu Oct 20 19:45:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 6372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp295207wrr; Thu, 20 Oct 2022 12:53:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6c1o3iyYrE+sP+GffgmdywwZNfi59Bi8dyisRfCIw8g9lXjv6JTFnrQBoSqz+2fTutaLSO X-Received: by 2002:a05:6a00:218d:b0:569:84e0:19e5 with SMTP id h13-20020a056a00218d00b0056984e019e5mr3579727pfi.11.1666295610529; Thu, 20 Oct 2022 12:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666295610; cv=none; d=google.com; s=arc-20160816; b=SON/nmZ1SEfX3aClMwIMjJhXAo0qRLeJ4GlJpfIuzrJd0ZW5Cd4uMMwfcpC3+aWXVW SaKs6Y3VJvNuIgR/jZJ1a69VEVOtx7L3/B9bENxTFRqDo8CFaep8SXlxQRu0xHNs4s+G ViKnYnaB7QOdquEr9xKRwkyaZcOEzsZP+lQvpaLotPYGLY7FlZ+JNig4GjWOsqUk9tgc rTsNhvX4r3SPqGliSyGX+Nlb8PMBzYLUUE+g/Q47GYdntApCEM+S9YjWmsWO2r6Qs2+/ 79rBTaRN6ed/tC+oAbbbLXRB9p4L3T0RNSqKFX80xgenq9bpkMhU9z6+15BbGvuKuyOH PK+Q== 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=9kxqyxoP68tDrKRsxswXlR88kW6Cvdz6xgpIzKrbMFM=; b=Bjlymx5Yk/VR1NeHgMqb0683P4jBG7JBKsPyWUvf8M/sl3/q8ZepyJoVXnS71cxZAG Zzc3Pjy36JGjiu9gJ61vZy7VW4ybp+J2AAj+5n1k87osIv/Zs5OW685lbuhRXhBGEdh5 ZmcUrowVUF1KE7JwL3GG5BFuSCa4f5sonsdxe+uWOrFSHio2K+uYyrruA3ARLFJaRc0u il4KJxScZhRdvo1i5wZiS3CcOeQsXYdjYVTlP0CzNKRzyQ7jYKmZKRw01m6scpiuu2/u UuHwBLWmXOx9W68BfJ2KJGbP5kTmdT5awR69z5W8XQVIHcF83zdjdcRQufaH+8JSUEyD Hc9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WtlUhxKr; 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 ml5-20020a17090b360500b001fe30e92b36si3807696pjb.153.2022.10.20.12.53.16; Thu, 20 Oct 2022 12:53:30 -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=WtlUhxKr; 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 S230091AbiJTTpY (ORCPT + 99 others); Thu, 20 Oct 2022 15:45:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbiJTTpP (ORCPT ); Thu, 20 Oct 2022 15:45:15 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C4765255; Thu, 20 Oct 2022 12:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666295106; x=1697831106; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=InX6kdnk54UP7BwE44PrXA1cQrsW+VErocObGJ8rYEU=; b=WtlUhxKr9cOAko0S7A2PD3tHUdr5CAyfpfy3qWh6OTbkQWIa+V3WUfBs SCgPD9D/zWUEo61qki6aRFILML5j34nbqFoTM+xrS8gOZyZ7QF5RGFzcA qhxmSBHq+WqkMyPw+vDjdbv+9IgMqfnXSe1ajzYb0oEvdkA/al3farv6y Ras7RYmL6CLo47heS0bk2pWP5Q/TsNaHJAKV4jOq74S4B6yztqh2u62Ss e2iivQ7fSIUG7Z3obx+ZpLnf03a9uTJZMM2gHpyW8utswdHcr+rm0xUTZ F3K468O70pEWrUcWG4Qeepdfe+bSsDCT4Joq40qEs01V6I7DOb60EFp/6 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="333392718" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="333392718" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 12:44:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="875210384" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="875210384" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 20 Oct 2022 12:44:45 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1AEEA6DC; Thu, 20 Oct 2022 22:45:04 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , Jonathan Cameron Subject: [PATCH v4 5/5] spi: pxa2xx: Switch from PM ifdeffery to pm_ptr() Date: Thu, 20 Oct 2022 22:45:00 +0300 Message-Id: <20221020194500.10225-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> References: <20221020194500.10225-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747237586038443992?= X-GMAIL-MSGID: =?utf-8?q?1747237586038443992?= Cleaning up the driver to use pm_ptr() macro instead of ifdeffery that makes it simpler and allows the compiler to remove those functions if built without CONFIG_PM and CONFIG_PM_SLEEP support. Signed-off-by: Andy Shevchenko Reviewed-by: Jonathan Cameron --- drivers/spi/spi-pxa2xx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 00c07e93d414..d47c14c89ff4 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1686,7 +1686,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int pxa2xx_spi_suspend(struct device *dev) { struct driver_data *drv_data = dev_get_drvdata(dev); @@ -1721,9 +1720,7 @@ static int pxa2xx_spi_resume(struct device *dev) /* Start the queue running */ return spi_controller_resume(drv_data->controller); } -#endif -#ifdef CONFIG_PM static int pxa2xx_spi_runtime_suspend(struct device *dev) { struct driver_data *drv_data = dev_get_drvdata(dev); @@ -1738,12 +1735,10 @@ static int pxa2xx_spi_runtime_resume(struct device *dev) return clk_prepare_enable(drv_data->ssp->clk); } -#endif static const struct dev_pm_ops pxa2xx_spi_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pxa2xx_spi_suspend, pxa2xx_spi_resume) - SET_RUNTIME_PM_OPS(pxa2xx_spi_runtime_suspend, - pxa2xx_spi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(pxa2xx_spi_suspend, pxa2xx_spi_resume) + RUNTIME_PM_OPS(pxa2xx_spi_runtime_suspend, pxa2xx_spi_runtime_resume, NULL) }; #ifdef CONFIG_ACPI @@ -1768,7 +1763,7 @@ MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match); static struct platform_driver driver = { .driver = { .name = "pxa2xx-spi", - .pm = &pxa2xx_spi_pm_ops, + .pm = pm_ptr(&pxa2xx_spi_pm_ops), .acpi_match_table = ACPI_PTR(pxa2xx_spi_acpi_match), .of_match_table = of_match_ptr(pxa2xx_spi_of_match), },