From patchwork Mon Oct 17 17:12:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3613 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1557645wrs; Mon, 17 Oct 2022 10:16:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4keUF97FEEucbwdQH/QmKSTUp1LfH8NSoZVn2BmXmMD3eQWbyQerm2jxzR5p4q2nqgwQ7G X-Received: by 2002:a63:85c6:0:b0:46b:41a1:6322 with SMTP id u189-20020a6385c6000000b0046b41a16322mr5301766pgd.403.1666026987726; Mon, 17 Oct 2022 10:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666026987; cv=none; d=google.com; s=arc-20160816; b=W6JC9q4LOe3nIpIwvE1saG301eeRodjDEhxbfl/mMFa1f1N/nnyHGg11x5xWHWBo6O Wv9EO8c3qlqKDdANgEedg7OJe2Bg0Vtu0vr6tfGwwKdFM8TpjbsplQaGrNHivwXuriMf X0pZmdfBiU+K06cj8xC1F+ulNO0Ygva99hTvtApPj7yy7qjH8vE7j9OmzIPT1zfXHxFa cYL74BkHzYl6RYToG9Dm7ZYWOIwu8Hp7pyUPlxtzZBju/3FonhrfesfmJ62ZJT3MnxDt nZNPJZ5j7RpxeKrCN+K914MTZXHyf+LgeGCNHMOrF5GhSMZDu88Vu2sTg2HnZbAecoZo kJfA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=d+ZsTZrdfEqp9qMcITBBFMTCn477IjCv4tix1fNizDE=; b=sc6E7ujfUUFTPrhdHRZFt59eQQjW6civuqBhv0+Fe00JaDqrZHCge7HRpbdY+1Q7cu wQaYcA/5bFEsqALSOgeyVqWeb5yQlr0Wypk1Mj39tPSl+ROAL+VDgXj/W15XmtV9S/sp JyvDVf/mw8lYth/tClObc7sI258Pf6tNTML7IoQe2Hf8xR/rkvV216+CsEfMGrpLix0Z 4J9PngH9hfQeTpZdUN54oIn/uaxNRRjIH7+C5+fTcND9JMi+mxls9VaxFuMATleTfaIH SqkRsK1f19btWXAkLeAdwvsDrCMl1a2EUDGwU/wuffCdp8JP4ELYNaoaorj9neX44DPb FNMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Mw+WegJS; 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 w5-20020a639345000000b0043a345c65f3si11778865pgm.755.2022.10.17.10.16.14; Mon, 17 Oct 2022 10:16:27 -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=Mw+WegJS; 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 S230038AbiJQRMc (ORCPT + 99 others); Mon, 17 Oct 2022 13:12:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiJQRM3 (ORCPT ); Mon, 17 Oct 2022 13:12:29 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03DA167059; Mon, 17 Oct 2022 10:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666026749; x=1697562749; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eEL0Wkgz2QTB6hPhPIAefByf4yM70/tBp3XIDpf3g4Y=; b=Mw+WegJSWyGn9/wX52ebCAgKuATaxnBjIJdONaBZ/GHuCQn8iMS4nIR+ maJYJgMu4ad+gzAVU+VPBKXZGd1xxIhE4ZGt5c3VyUdws/JTVSPwvp2v8 sxDx7LOOQfEeMdr0DgMtX9KGkRNloV8SBqmIRQvZ3JG3zs6DDUYVhOxoa SJi9sKYDL3yNIzsxS6zDMFdV2LYZkequ+DDSTOD865fKptzodgucHW1xZ UGK9U2QgMhwOGwGLxfBNFAiY917OrwFsapw0Rqap33o0Tqip87hcnU4g2 q+2KUiEnSN4VZ8iT2HYwddU+Hp/B0Gv1K+orqWZb2rYWk9Lwdlzlte51d A==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="367886364" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="367886364" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 10:12:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="733239970" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="733239970" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 17 Oct 2022 10:12:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6542426D; Mon, 17 Oct 2022 20:12:47 +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 v1 1/6] spi: pxa2xx: Simplify with devm_platform_get_and_ioremap_resource() Date: Mon, 17 Oct 2022 20:12:38 +0300 Message-Id: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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?1746955914836026372?= X-GMAIL-MSGID: =?utf-8?q?1746955914836026372?= Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. No functional changes. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 2bf21c2e7a52..03ed6d4a14cd 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1482,8 +1482,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) ssp = &pdata->ssp; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ssp->mmio_base = devm_ioremap_resource(&pdev->dev, res); + ssp->mmio_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(ssp->mmio_base)) return ERR_CAST(ssp->mmio_base); From patchwork Mon Oct 17 17:12:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1557667wrs; Mon, 17 Oct 2022 10:16:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ejRRxfK2sOfoNQzbTCxfxh7zPhmmkmNP1VkcDQKKLM3dZqb5pKad1c8u0QEEtjwVTvkC4 X-Received: by 2002:a63:594b:0:b0:453:c041:7e with SMTP id j11-20020a63594b000000b00453c041007emr11573685pgm.87.1666026989488; Mon, 17 Oct 2022 10:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666026989; cv=none; d=google.com; s=arc-20160816; b=lHK4wy+RwSSXX6oGBQZ0I5IqPMKcTvAKnl8dP1l5ozMKLXMOynV/yIS07/fWjbJbnl aJVOItCvOBwI/twHDybf67KJhtTkSbwqquGKdNKiD2J0FJdHdJg66EbQaW6JEPsq3yYX 30PY8I4gVEKgObnjF3ilkf8QqvIPI73bzmqQjpqLqQS+n18KAqexuNanUzzOdYvnxBTK dnbItVJZx5eQMeM2idrKFH7il96FzKOugQ9hfiF6gS76kYwRh8AyDZlw8Egl6dFvDfuQ qwzMiaT7ArYlwqF55eHOydsMJ5t09nlsDU/oK68Ab8kiX6YhkYimfWMUqy5WEIwk6CrC b+Uw== 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=oN6xjEPnA3cRolRYKf4Aj9BRbKg6tneV70IdDwPJSMk=; b=f9fn+nhhqwyW8mRbqyxloPVQiF566ZP5lq4Q/Z4zwZ4lSZG7VEf0BpLmYbEnHQH5/F swDgWVOgFuxwPz+z7uxEoLQ45CXlwxYnWlo/iv3CdVXK1tO4Sic2mR4tZqkjz8UlQxM1 RySRLKf5zw1UXst9cj0Yr3JJr+/XJScxz35EK0gQf/gN9hsbcT7x88A5sOgmstEXUHTy UFg19AoFbOT7j7ur0YcujexABroAH+jq/JUDeC0YE7nDnnBYKOgNwtEKF9/YhGvX0jdx rRvNA2+7SnjR2PYZdy5yuN82G0m/mpfMBkwuikE9e8sArWEJYy1uL5Zq4zf1OF3s25RR tY9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="AKLR/u5j"; 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 c16-20020a63ef50000000b0043ba2df0855si11539159pgk.726.2022.10.17.10.16.14; Mon, 17 Oct 2022 10:16:29 -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="AKLR/u5j"; 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 S230113AbiJQRMf (ORCPT + 99 others); Mon, 17 Oct 2022 13:12:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiJQRMa (ORCPT ); Mon, 17 Oct 2022 13:12:30 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECD1A696F7; Mon, 17 Oct 2022 10:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666026749; x=1697562749; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hWe3aaoOgf+xq5Pq0douiTL3qv6/yUoCMHsfExvmaKw=; b=AKLR/u5jqtntQ8BCQJr/+MbgSZ236t3OxVV/ZJJDgoxCsa3ZiXHQLbOw T5shub33VMi1sSQnL2yuSJHPC/sMeXHWuH28sc8LSEmca0oMHbYm8vQCU Pt6tQmHySyVZZRyXDkJFPPkXz9cSRq+JuoaG0ExokCvQ4b/CbNApSuKKz 05oXDZQ3VXa111EkUrYvFY4r+8DHr9ga1XPYtCvWGBfqY+8ij9Dl6KPLb b/hzuzeHj7U1GfZQPZCsX0F6yHvEHT/eDvoaUNsj/CbAGWSaEcY2SQMH9 zbt9Im2Zb6CgS0g5iWU0ci4sAe5goV4FL/0sAdzHPN6ylVTvRXcirAIEx A==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="305849453" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="305849453" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 10:12:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="957417116" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="957417116" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2022 10:12:27 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E7641291; Mon, 17 Oct 2022 20:12:48 +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 v1 2/6] spi: pxa2xx: Respect Intel SSP type given by a property Date: Mon, 17 Oct 2022 20:12:39 +0300 Message-Id: <20221017171243.57078-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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?1746955916498414644?= X-GMAIL-MSGID: =?utf-8?q?1746955916498414644?= Allow to set the Intel SSP type by reading the property. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 6 ++++++ include/linux/pxa2xx_ssp.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 03ed6d4a14cd..857732a54ca7 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1460,6 +1460,7 @@ 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; const void *match; int status; @@ -1468,9 +1469,14 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) if (pcidev) pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); + /* Always try to read property */ + device_property_read_u32(&pdev->dev, "intel,spi-pxa2xx-type", &value); + 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 Mon Oct 17 17:12:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3615 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1557681wrs; Mon, 17 Oct 2022 10:16:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xrekP3HExWlsBfhe7uzHMH5cs+uWPmTvE7Lq0dyTsR4qMBlAZWN787SFshhMDt2ojf5Lz X-Received: by 2002:a17:903:40c3:b0:180:cfb7:827b with SMTP id t3-20020a17090340c300b00180cfb7827bmr12984279pld.0.1666026992308; Mon, 17 Oct 2022 10:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666026992; cv=none; d=google.com; s=arc-20160816; b=QZ2UW8PhKZZnurVXOyUG1HUO4xMJVxNhG8zjEltoOcoQ1yWkmZUwiqgjxbc0Wd9Qbb RwIDbYG41726/fLQyhYZ8Dqkdobz87NxTe6HK/nLgkyOrCVTuS6tGPCLu/B1JnxHoiXG Lkkku1zw6cV2oYwfbCi+EEeBSYs+wQwCh6Bge7qnDfJfhCtKEDj68WP7ryvQTj3MeKjN /JJH0W/FBwN9sXOij6XPinMBjiN+u0BBhoJwyxoS2942ib4WHV2Tv10PhOLSQ4BhK8/h Y7b8MX3R717Yz+/xj5iM2KSDBcs6zCSpDF1RgndCibuDU/nlqZs5hyD0w402bunLGIL3 uBcA== 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=wrjFeUcgSX6FabgS6Q66GklLRP1b4SA7UoMmA9jsAZ4=; b=zWD5YFxQPJWoS6K/Ni7btC3xsf0uYHHIvv0CJldeh/V6R6lUUniumLvMuLmrwRTS75 rOFBJT8hQSSHRREG2xLrey4+SWlg2VFnzr4HHfRSB0ZACOmLauHXfY/UB1XkD5BTGgLW pyRyRXaJ3R++uZ5sEh9fTiEWN/zhlhLqrhc3WmA3lkK6diF9jgGt7p9igQQUIIfl3vIF xdoxs0A3Mt2w1gfAiyPlBC7FAelnVlux81xu1o+D8cA+HJ4hdJ2yo2bJMb0wPLyTG2VK iTS0YFCNHhISPl2p4jrwvIdZZ8b1akAnzQ5a88UoyHvxt+twsHSLb/sZtBVpW1Ujhy0S 95Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cXwuZBNp; 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 s9-20020a17090302c900b0017f5ea214a8si12802905plk.462.2022.10.17.10.16.18; Mon, 17 Oct 2022 10:16:32 -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=cXwuZBNp; 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 S230120AbiJQRMk (ORCPT + 99 others); Mon, 17 Oct 2022 13:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiJQRMb (ORCPT ); Mon, 17 Oct 2022 13:12:31 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A17E67059; Mon, 17 Oct 2022 10:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666026750; x=1697562750; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tLH6McL/k+1AdtQX5dfk1xHgIg0bo2xOAuTSBmeqVyU=; b=cXwuZBNpqcYISgJElNqP/f2pbda/zGrv4u+YTI+3W4W/JpnfH/D6QYn0 U27eeHCItuJby/DLHatisO9ThrDYveOCFkqAgjV5+v+HGCB/l8sGMUsh9 wb2nyFSCv0589ejMtXSU3DvJCAof4niaGZu95kLl/LZDg/U1nBxvN+wQ0 y4SQLMMDXz5aLkPVZzVgd+wKO5EUphScCV/1YhaIwEe3jLL5yNxctcCxh RrYpy+wBnr7Ei9BadNUX5Q8zgBCijBQd6A6IDe4gYsSVBcMJDkg2pBEhG 6c1DJ3EMCwucXGXsgfrjc8hR1RmYl6lUJG4YMAbUnA69YiyX5sqbvBv5V g==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="305849456" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="305849456" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 10:12:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="957417119" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="957417119" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2022 10:12:28 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C0D9243F; Mon, 17 Oct 2022 20:12:49 +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 v1 3/6] spi: pxa2xx: Remove no more needed PCI ID table Date: Mon, 17 Oct 2022 20:12:40 +0300 Message-Id: <20221017171243.57078-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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?1746955919618578088?= X-GMAIL-MSGID: =?utf-8?q?1746955919618578088?= 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 857732a54ca7..1d36d055a9d6 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,17 +1353,12 @@ 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; const void *match; int status; u64 uid; - if (pcidev) - pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match, pcidev); - /* Always try to read property */ device_property_read_u32(&pdev->dev, "intel,spi-pxa2xx-type", &value); @@ -1477,8 +1367,6 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) 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); @@ -1494,13 +1382,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 (platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv")) { 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 Mon Oct 17 17:12:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3617 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1557737wrs; Mon, 17 Oct 2022 10:16:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6SHZawWlMHpnkRADqNak0WjM4dKT2qNGw41NyC9eoz1GYHtqeAi5j/mJF48KNjudWMwklb X-Received: by 2002:a63:d314:0:b0:452:598a:cc5a with SMTP id b20-20020a63d314000000b00452598acc5amr11785840pgg.299.1666026998977; Mon, 17 Oct 2022 10:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666026998; cv=none; d=google.com; s=arc-20160816; b=KwUCdo49z7Firo1wnogPm5snw8qed7uw+CYODnPO1BbtDsKvdaF81z8zptnsy+pVp/ EL/hZgqQTbAGSiLYqZVOGZPyYAP//rIS3AgVJD+1W0TBaWkXESvdm8D21bI/iOhPpDiF 35NmtQb50fSDqlV4HIHYoOQAYifF5Beb2NIlHQNKfTJO0Q/jamms/01n6VMlpW9zhjOi rfCEv0YJle/bbhTpGF4XZZea1oD+w7Sx7jgAz3NXAMuT7Yor2UWu+11Chfl53y7dKX1A ehEP6wyDI7ISopQnO1c5tKxHIdv+vmSe6vYWQoSr8SlaF6ewaizlhD6MZKDiL+kW6XJD u7Yw== 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=SUsqh44yz67MZi+PLVc6evmnn/PmOlsg9PVknHREaKo=; b=ZWUrjN6cXt0TLTizItdJtJ7POU425eWPZPaF7tvgwFf0ydlQoE51phvPtWLjygUVWI jbkbJB/9TXZRl+BgYuGymMUk52HJe9+fUZ1euEjkzukfozM9GA8DzjTDlKO9uethImLk 6mg/fXo1EIyIZIi8h14KPDRbOfFp3lhCqK96hx2+bFLbHaRFNAL/f2zh99MthdM32LhW 9bk27jfp8i29tfIcpwOQxqp87QoSThqXvpn8dfUFz/gan3ve+oeQS6hHcqNSRfJbz5li RYLkCZ9awFE0IROMWjd2RvZ7RTJYPRfqiadUetdU8RRMklxALdsfgvAXaGnhToR7KMYW C1ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gm8J49xc; 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 q12-20020a170902eb8c00b0017f61ac5a53si10855729plg.111.2022.10.17.10.16.26; Mon, 17 Oct 2022 10:16:38 -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=gm8J49xc; 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 S230125AbiJQRMh (ORCPT + 99 others); Mon, 17 Oct 2022 13:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229962AbiJQRMb (ORCPT ); Mon, 17 Oct 2022 13:12:31 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD76696F7; Mon, 17 Oct 2022 10:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666026751; x=1697562751; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7hGgSA2GsBhzJwzVfaWPKJQVLq/322V9p+NlpEwW/lY=; b=gm8J49xcqyw0dE1jjakGsV4vCaUvxyjGKz8jlhi4KsQDmm0Q2/Ct2Gu/ wr+iXG10jMKoJXaK2qFmFHzKa2hcjBYGSfqM/meVMUGQGOLdnAyIhbtTj GzC4Civ3mfGkN3bJBr/JLb5U8k0qX6aVa1ZOY92KJoBvzOsKcAqzs+PK8 TGZVkkMCg6qPT7vKkooWkNvG+ATocDvZv/IEpIRbWxtMYXWUkFO47YzYS JgzgsaRueyTVQJ2lLreQb3lNYvsO9KcGiPCINCQ97ZbG7Gjoapt7KxRl5 w76lQNY2u/Y2et4PJF95XlT6fxgT35JjYVXATllXM6CTJvSC/7ok2SpMa w==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="305849458" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="305849458" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 10:12:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="957417121" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="957417121" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2022 10:12:28 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5F493625; Mon, 17 Oct 2022 20:12:50 +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 v1 4/6] spi: pxa2xx: Remove no more needed driver data Date: Mon, 17 Oct 2022 20:12:41 +0300 Message-Id: <20221017171243.57078-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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?1746955926409848432?= X-GMAIL-MSGID: =?utf-8?q?1746955926409848432?= Since the ACPI enumerated devices provide a property with SSP type, there is no more necessity to bear the copy of them in the ID table. Drop the driver data in ACPI ID table. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 1d36d055a9d6..31927493eeb0 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1323,12 +1323,12 @@ static void cleanup(struct spi_device *spi) #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 }, + { "INT33C0" }, + { "INT33C1" }, + { "INT3430" }, + { "INT3431" }, + { "80860F0E" }, + { "8086228E" }, { }, }; MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); From patchwork Mon Oct 17 17:12:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1557716wrs; Mon, 17 Oct 2022 10:16:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM686TmflsvCUmS0XVCXp4TUWMUSiYIPSXDnK6Dzob0KWHAv6+VFpPZMCXioIwnjGPgG19g4 X-Received: by 2002:a17:902:bd98:b0:182:631b:7dd5 with SMTP id q24-20020a170902bd9800b00182631b7dd5mr12712861pls.165.1666026994925; Mon, 17 Oct 2022 10:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666026994; cv=none; d=google.com; s=arc-20160816; b=ULunJP4tlhvTGuYLB40iZUurrYVQCRyzLlGELanVLGUrIqQVBjqelNg4yhATIUmEHA I1c3dnuvzt11gkDdHvppG18Pme6yJF6rEWYotyiA5AyXL6hthWTCRhyCv2yunYp3Z5Df dgSLpV8ABHWRYtDLF12PacFL9Ecg3iUX23YivnKfRLhDcy+F3x1CMmdhYRLd0M+2DsZC vuZnmXjg7jokrQPT0waQPTwc7S3iFze7TjoT6fjy8Ad7gsMooRVWeRYfCSTsRCBVSimg hgx4mgOGuPPqXsCJBQG1A13rBuHO6ouN53IDkxDRurBzgwWvYFHsjrdjPvuoX2lVukvi DHjw== 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=kj3flBS8jRJCDm/6iMh6Wugi6AtDY8VFGPPFxUuNgyo=; b=qtf5pwCAebMEsdyL5nhpjouaFlCDL4a4Zfs5jcTlI9OodGbfJlcu5z8EZoWo2aOg3F kUX8FOc0u7vjvpcJ6i399juGHNKPgY61sxLIiswzK/J6+Wv3uu2dqnbq+Brcy9JXyeq9 ZbA/XJj4XEl4nUdNv2DIhp8O35YVMJi6Z/SHSm80yTLiZX4GFk1Xk0tjRGEPuP1sWBFr 2Q40izU2tj/Nfx+QI/mTH4aeDHUvIrfUbZpAoDc89Al1lbl3NfPsphNysbaU5mP8NVnI j3lOPPg0Bgs1kpjOy7u/wHhw2Qy2u8mOAH6ahTdFsN6iR/YqsZPd0MFGeLDhabaAjYyv 2G5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=N0VcCb31; 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 17-20020a630311000000b0043090081d69si11774385pgd.82.2022.10.17.10.16.21; Mon, 17 Oct 2022 10:16:34 -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=N0VcCb31; 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 S229925AbiJQRMp (ORCPT + 99 others); Mon, 17 Oct 2022 13:12:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbiJQRMc (ORCPT ); Mon, 17 Oct 2022 13:12:32 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A1916C12C; Mon, 17 Oct 2022 10:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666026752; x=1697562752; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ADkxelsrZAI/xTgM7q/ZgWlu+FGtliIPT22gKCweeCM=; b=N0VcCb31/R50pCWXM8xRpfSFtwK/9Zccn4bIG8qvMP1cn/DnZKhsVQ6x AQdZenamRL96Jn6zMYSX6Mc/dlK1xkNttPOMXxJLeF3F0lXlzDrbhkXqh LrK6IiHJfzaR4aOrF+kaHtt260jcv3E3KTCgGSn/7DTPxBFRQciJbTZPR 92n/fLGCYGYG00N4epWHHgrz0DEdL8v1/ToaNsNbqhOIsi9qVfBsRqNwa caRH2azvxu/hwPNgpkCWfR0ugtbs0bRI1iPr8e00YQ5EWWFx9PVPRPqJS bRXnBk8JiM3HeNpQNVhiW7QGNivKieGwAbJJuaSIPNTUh5Eo33DhbMxQv g==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="305849468" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="305849468" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 10:12:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="957417124" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="957417124" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2022 10:12:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3123D26D; Mon, 17 Oct 2022 20:12:51 +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 v1 5/6] spi: pxa2xx: Move OF and ACPI ID tables closer to their user Date: Mon, 17 Oct 2022 20:12:42 +0300 Message-Id: <20221017171243.57078-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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?1746955922168512085?= X-GMAIL-MSGID: =?utf-8?q?1746955922168512085?= 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 --- 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 31927493eeb0..76046612466d 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" }, - { "INT33C1" }, - { "INT3430" }, - { "INT3431" }, - { "80860F0E" }, - { "8086228E" }, - { }, -}; -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; @@ -1759,6 +1740,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" }, + { "8086228E" }, + { "INT33C0" }, + { "INT33C1" }, + { "INT3430" }, + { "INT3431" }, + {} +}; +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 Mon Oct 17 17:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3619 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1558410wrs; Mon, 17 Oct 2022 10:18:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6R5IoYFdTsZ8K4oUW+9+c3rfHuUL42pEAd2JYRTp5fj6SJmDzJiuODsju9OIYIzrP9sDD+ X-Received: by 2002:a63:1c43:0:b0:45e:1e2b:291d with SMTP id c3-20020a631c43000000b0045e1e2b291dmr11311868pgm.204.1666027086564; Mon, 17 Oct 2022 10:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666027086; cv=none; d=google.com; s=arc-20160816; b=amYDALhjFojGyx73DyGDgttSccPfsgwDwubGsEEa7rwWVoK0xpV0tZJwePNBFpsZXx qERoJP4a+xLhvNgxX7I6/0nqu7/Pwpvzyrh/O+c0s+tQ5758RREIwFdOPQMn6XkCfft9 /GZQmHHRocmmcKgd/lK/Aut/yyiGK3tB6YBM7HFlA2BZqobbVzwyOcdtLVOI9AIKcDhG z8rVMIXNL9bWJBh3aZHYNvWncaxh1th5G+uc7o6gOFdiZCGTo04evoxX1iQAbW1B9qSs 8fQseWlJuuGCJuUkrsKRF1Jl081mKoDnity940V1kFbykCHftEYZT8BugoJ1dPE+YShi YN2g== 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=EiBzRhdFNtZC8ggQWILwxH0mWpEU34USSvGckG708/o=; b=JuFJeAE3+n13QmlZxsIbb5L3DRWdlSVu/wDfBQAjl1IcNXUG2k/9MTm0bMmmB+anSG jjZjdSFpMFaRxGXfdK75Cei/Bt2GgJEz2e1tUsebnLJjghGSVFHY9LJc6XU56N130RGU gsiKQ/0hZtwEEJBr6GVRH2aWH50xABfyf8MAj5b4CTRA15s2natqCp1dbIe3BDwT19pB CavJ/j6gbsiyuhDWpOKHSeaAK4+vwtUvZlo5u74x3p1txFii2d4KBB2sJ/bV91RlUhf6 KvhxEyVz6mKwXet47b4OMJQ7zFxTXZH4am73UprZ+GExu2PoqcCm44w8rUC0yCroMQDF fJjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JHgz3CtC; 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 in17-20020a17090b439100b00205de9ed2ffsi10563201pjb.43.2022.10.17.10.17.50; Mon, 17 Oct 2022 10:18:06 -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=JHgz3CtC; 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 S230148AbiJQRMv (ORCPT + 99 others); Mon, 17 Oct 2022 13:12:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiJQRMd (ORCPT ); Mon, 17 Oct 2022 13:12:33 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17CD06A4B6; Mon, 17 Oct 2022 10:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666026753; x=1697562753; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XlIOXCJHhj4h3agf1DUjrph2j3laCRQuoVVmOELxnfg=; b=JHgz3CtCH9taDVxIKmavTPcdAFJeC3Q/E2/5HCGVztpLOkbf2uDp6GWY 39AJv41JpgtOD+LzheQ+XgIlr7E4h3F+o6zbPUP1sZudWiVV0O9yz2D/6 3uIpjomK12NKIBqe7fnAV9I9qnRMMzCWqKUs3Ap6EulCBLpiTaTbI4B6Y t5Wz4Msl6PP3RdiQ0XoXoEsxQr/SdykGvQvi7SFnOPIDh0OUJiUm2XvG9 fjj6eXrHDegV69R/ZhXO0XFAMrx11Gd43AZX9phChml5sYcnYFPt4xPOr wL5P/m0shp3lDspzq542Q1xaKK3sNHwkVZD18RRxOORIT9QA0Z9eaZOYn g==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="285584014" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="285584014" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 10:12:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="697131922" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="697131922" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 17 Oct 2022 10:12:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id BD17C666; Mon, 17 Oct 2022 20:12:51 +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 v1 6/6] spi: pxa2xx: Switch from PM ifdeffery to pm_ptr() Date: Mon, 17 Oct 2022 20:12:43 +0300 Message-Id: <20221017171243.57078-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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?1746956018453377883?= X-GMAIL-MSGID: =?utf-8?q?1746956018453377883?= 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 --- 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 76046612466d..60cab241200b 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1680,7 +1680,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); @@ -1715,9 +1714,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); @@ -1732,12 +1729,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 @@ -1762,7 +1757,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), },