From patchwork Wed Mar 27 19:29:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607340 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02A0614D45F; Wed, 27 Mar 2024 19:31:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567908; cv=none; b=tlLbF9V56VfdQWfbhdOHXKe8F37EC4IQ12WEGQfXerxxrurtdinHpFUe+CDKoxs1qHYVsgdelHnXH1m/jjxfW+m1K/n9osrd3eFvPoNJX4Bsebg/AjLoc7Wmw3QPTxGOAkBkAxhEaYwoNZLgNQ6W+nab8IicpbALF4Y3FB19qMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567908; c=relaxed/simple; bh=szcPeNpPGwcpTv/vYr7M/HOPTxqfODzCAhPTU5Lf2p8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J2FWhpTe+RH1jXhzjIeRTyJt29NB+CWvJgG/GJVB2VCcEWed7soCl2CePxmk9C3BUVqkfzSJKpKSaBJjrYy759SFw0Fr/PmVMabgrHH0VMRmQ7vNVU8piI6mKQBvXIh8D8I3N8P5w4MupqttAXzdDc/QehDQLb7D7jpGm/WEwnA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TfjkrigF; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TfjkrigF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567906; x=1743103906; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=szcPeNpPGwcpTv/vYr7M/HOPTxqfODzCAhPTU5Lf2p8=; b=TfjkrigF67j7HTPhFvjep4uHHFFHai8UvJi0UwcBk7EK4FfrYc3SLf6N 6MbzxyCSVlSVGNp2lyWFfrIhTtRTcRMS7nklg8WLDqZiqAk4tks9nOrtn Xh3XZ845Sx4v/GItCfAzw3DIheLbzNya6bry2Pk9CICpAzF2hlHcwGe/A vue09EzlVPMWnfDQHFrZrmYWExohAMqaO7Lgfztb6u0RBqHWCkZL9/4yb ai6BPytBPYzcidcCqSyId6XslC7KjfiPUEv68EBaeKfToM/mlJOg1BzHY ntbulodjIl73DPtxe7/RTHNZz+hyLn3nYFNY/fUd4yJ20L95/zftcog47 A==; X-CSE-ConnectionGUID: SZeVmNAQQLGZmLzLQHYksQ== X-CSE-MsgGUID: zKy3ztoYSQ23/RMnlhPg4g== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187276" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187276" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075022" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075022" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 85059284; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 1/9] spi: pxa2xx: Narrow the Kconfig option visibility Date: Wed, 27 Mar 2024 21:29:20 +0200 Message-ID: <20240327193138.2385910-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The PCI || ACPI dependency is the historical part of the x86 support. Narrow the Kconfig option visibility by limiting this dependency to x86. The drop of x86 for PCI case had happened in the commit 2b49ebda39d6 ("spi/pxa2xx: allow building on a 64-bit kernel"), while the ACPI was specifically added for Intel Lynx Point in the commit a3496855d9f1 ("spi/pxa2xx: add support for Lynxpoint SPI controllers"). Note that X86 covers both 32- and 64-bit variants. Suggested-by: Mark Brown Signed-off-by: Andy Shevchenko --- drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 26ba34a4100b..c1bb1895009c 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -817,7 +817,7 @@ config SPI_PPC4xx config SPI_PXA2XX tristate "PXA2xx SSP SPI master" - depends on ARCH_PXA || ARCH_MMP || PCI || ACPI || COMPILE_TEST + depends on ARCH_PXA || ARCH_MMP || (X86 && (PCI || ACPI)) || COMPILE_TEST select PXA_SSP if ARCH_PXA || ARCH_MMP help This enables using a PXA2xx or Sodaville SSP port as a SPI master From patchwork Wed Mar 27 19:29:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607344 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 966E6152512; Wed, 27 Mar 2024 19:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567912; cv=none; b=rBvaP9H3CGwjSSLe7PG87vBs/LZV9Rt42JSFJEI5bUmAYjc021hkvZ1tUUvi+b5vmx+0Do7PDqGkxCmGvabbWUt2zIhTdR9WAQTG9/SoHQvB/pH2MQwP9KDb56sZfibcWRLJCEHv0vwwMEb+HPng7BJUDyXgHV9CUQYwzfHfJOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567912; c=relaxed/simple; bh=kgE+EkgRK0Q0USsISvasAwmIHSRztSfu+eyxHqW1wf8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DWyfQbgvBFNysgwWvUE0/wTCVk3Xp4rS0aPj3M5gl2vsp7Lbh8h4+Ttzi6EkwAYwf2upv3ABdUhe5grkzqYzOGaqbvU1APQAazT159toGg6BBvYVn2liDJQgUYuwCdXiwb036ATOK+AEMiLqueFWpbC1qnxyukTkKWY1iEyhNDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=L00S3sVV; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="L00S3sVV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567910; x=1743103910; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kgE+EkgRK0Q0USsISvasAwmIHSRztSfu+eyxHqW1wf8=; b=L00S3sVVWJopznoQbRcqzrhQYccc4HWdYdZewy1mTdRkCXUg5huJQhxJ qqNS968DxxhLpt8UISEU1uyAq8YEWGxguvvRs9IGVzw2lHjSUK9WXM36A TQaHAYlR8SpUErvjsVCj/zBtPd2t2BVUxT0elU+LExcY7EclDPWY6+d7C cfRYHlykU364udNlk+de52K8r7CFPFA/tIsnxMCrI8UWCtWtXfvoDYqOh uvWoNQBl18kWNb42EcsU9To67O0byH1rJSMxworn0MJuurahkx6PKwxqz FqkvPxMlX6A6OWvOk3vYgeqYgGDly7jZ5jDuRcKNjB8aP/faRzNhfHF30 Q==; X-CSE-ConnectionGUID: zSLnaNYvRPecEEcDIYUMwQ== X-CSE-MsgGUID: uIC2wkuYQCuRdTWjEWhsog== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187304" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187304" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075026" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075026" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 982124F6; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 2/9] spi: pxa2xx: Drop ACPI_PTR() and of_match_ptr() Date: Wed, 27 Mar 2024 21:29:21 +0200 Message-ID: <20240327193138.2385910-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Drop rather useless use of ACPI_PTR() and of_match_ptr(). It also removes the necessity to be dependent of.h inclusion. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 1d43346b4436..75d208087748 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -1725,7 +1724,6 @@ static const struct dev_pm_ops pxa2xx_spi_pm_ops = { RUNTIME_PM_OPS(pxa2xx_spi_runtime_suspend, 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 }, @@ -1736,9 +1734,8 @@ static const struct acpi_device_id pxa2xx_spi_acpi_match[] = { {} }; MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); -#endif -static const struct of_device_id pxa2xx_spi_of_match[] __maybe_unused = { +static const struct of_device_id pxa2xx_spi_of_match[] = { { .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP }, {} }; @@ -1748,8 +1745,8 @@ static struct platform_driver driver = { .driver = { .name = "pxa2xx-spi", .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), + .acpi_match_table = pxa2xx_spi_acpi_match, + .of_match_table = pxa2xx_spi_of_match, }, .probe = pxa2xx_spi_probe, .remove_new = pxa2xx_spi_remove, From patchwork Wed Mar 27 19:29:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607341 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6ADD14D6E3; Wed, 27 Mar 2024 19:31:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567910; cv=none; b=N0T15JZSXyO/eCDkTFBmil/IXFnl9C+iTSzHneOW4W7r8HMkfH34qS/64ckpx76/9dDF84hOjDBytw9IINp23QFqXnk+0WWzqgpk4qEFnLfSNxrUkuZR7++khx5/237N6Y5graPdrIpx/hECyZEoAzzzwSFRad0E0xbFmWGbPLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567910; c=relaxed/simple; bh=/NCY6D6sJSA8qtx+EX1W99OV2q8Lk5IqUKEVfKBSw0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ODP/6roYvojpSx3NxvoQ+lXrdm8qoP1oBhXt5xs0/f7ZC6lLQTW48gStS/UBqfAJxTofgsPD7rquu3wwH0J1hSfVwxfWZnuB242ZKc0KrK1O3JhqOt573ha4E9i97pbEN94gXO2vF9cXb/M7u/T58BYvX4Vw8RTwEn8CWBToKkg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PHFrnOoj; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PHFrnOoj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567908; x=1743103908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/NCY6D6sJSA8qtx+EX1W99OV2q8Lk5IqUKEVfKBSw0Q=; b=PHFrnOojUFYeEOghuBYYfygBG61DCO+XZixbM5jugJN/C+E2DrErS0Ag tx3Zl0A/QMYk5mS7feC75JPf9wkTMrgCJFcp7QR0XoeR+8Wjxzgf+44T+ u9fR780IperdvtREv9BH+1BEBxEVWxSEJXKqxKez9T9qlVwEnJNiFbeGz zGxSqf60oEytVsaeEjZIj9itRC7q4UvGgvTQRn7CdUICQt83jhHdqiRRJ rrYqaeOQd3wyi5ioSL8bsR3prnCynyN5KEPUGqWa9mylBYJIv7hMZeGQO 47lsalhtmktXlH8OhsBJQ3G+s2CCMbGWCaVfCbJokmKq/8M7jT+Fat9dJ w==; X-CSE-ConnectionGUID: M8k0y7pzRMaM1fcZl+hPRQ== X-CSE-MsgGUID: BzUxu8a9QDSTFM7ohgqprQ== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187286" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187286" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075025" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075025" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A15722F0; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 3/9] spi: pxa2xx: Extract pxa2xx_spi_init_ssp() helper Date: Wed, 27 Mar 2024 21:29:22 +0200 Message-ID: <20240327193138.2385910-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Refactor pxa2xx_spi_init_pdata() by extracting a new pxa2xx_spi_init_ssp() helper which makes code less twisted. It will be easier to continue refactoring for a new coming modification. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 66 +++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 75d208087748..e7072727c25c 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1314,19 +1314,50 @@ static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param) return param == chan->device->dev; } +static int +pxa2xx_spi_init_ssp(struct platform_device *pdev, struct ssp_device *ssp, enum pxa_ssp_type type) +{ + struct device *dev = &pdev->dev; + struct resource *res; + int status; + u64 uid; + + ssp->mmio_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(ssp->mmio_base)) + return PTR_ERR(ssp->mmio_base); + + ssp->phys_base = res->start; + + ssp->clk = devm_clk_get(dev, NULL); + if (IS_ERR(ssp->clk)) + return PTR_ERR(ssp->clk); + + ssp->irq = platform_get_irq(pdev, 0); + if (ssp->irq < 0) + return ssp->irq; + + ssp->type = type; + ssp->dev = dev; + + status = acpi_dev_uid_to_integer(ACPI_COMPANION(dev), &uid); + if (status) + ssp->port_id = -1; + else + ssp->port_id = uid; + + return 0; +} + static struct pxa2xx_spi_controller * pxa2xx_spi_init_pdata(struct platform_device *pdev) { struct pxa2xx_spi_controller *pdata; struct device *dev = &pdev->dev; struct device *parent = dev->parent; - struct ssp_device *ssp; - struct resource *res; enum pxa_ssp_type type = SSP_UNDEFINED; const void *match; bool is_lpss_priv; int status; - u64 uid; is_lpss_priv = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv"); @@ -1351,14 +1382,6 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) if (!pdata) return ERR_PTR(-ENOMEM); - ssp = &pdata->ssp; - - ssp->mmio_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); - if (IS_ERR(ssp->mmio_base)) - return ERR_CAST(ssp->mmio_base); - - ssp->phys_base = res->start; - /* Platforms with iDMA 64-bit */ if (is_lpss_priv) { pdata->tx_param = parent; @@ -1366,28 +1389,15 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) pdata->dma_filter = pxa2xx_spi_idma_filter; } - ssp->clk = devm_clk_get(dev, NULL); - if (IS_ERR(ssp->clk)) - return ERR_CAST(ssp->clk); - - ssp->irq = platform_get_irq(pdev, 0); - if (ssp->irq < 0) - return ERR_PTR(ssp->irq); - - ssp->type = type; - ssp->dev = dev; - - status = acpi_dev_uid_to_integer(ACPI_COMPANION(dev), &uid); - if (status) - ssp->port_id = -1; - else - ssp->port_id = uid; - pdata->is_target = device_property_read_bool(dev, "spi-slave"); pdata->num_chipselect = 1; pdata->enable_dma = true; pdata->dma_burst_size = 1; + status = pxa2xx_spi_init_ssp(pdev, &pdata->ssp, type); + if (status) + return ERR_PTR(status); + return pdata; } From patchwork Wed Mar 27 19:29:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607342 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84D4515250B; Wed, 27 Mar 2024 19:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567911; cv=none; b=q9aaXb3++5Ad8uQjxfX8q+E3IHrokmxcEmnT3uldS+oYQKJwVcjozZNfY3L+bfwhANpeG6yIaWcnOJ4dtOm8idOK+Cqqo0pp87KMPNtPDT81vuGQn9VqK/qJvFp9hLFgplhlNQR721eIfPfVwxfrRwpThQNPUyRCVWh787R+YSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567911; c=relaxed/simple; bh=jFzgo5+g95yyxQjjsoDzp1sVeyMA6hDbVV6LnWCwoqk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hxnXuArZvD1KGLnxwzUsBjvD2/lYI3ASg9DLaO3VewHe3n+v34rxEZde6DjKVp9jYqjevuXt60eVyVMv6c4VgLZ/9lOgo3BBX40WWvq5RRi5IIGYbcgcGbhDKdSXR/mrpEVWDegiiEimqvgL5uZqoyYhUhup1GeUjxDyeFSmThg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SF+XflXm; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SF+XflXm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567909; x=1743103909; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jFzgo5+g95yyxQjjsoDzp1sVeyMA6hDbVV6LnWCwoqk=; b=SF+XflXmuBkbet4ftEMXMWxInBSFXpIZ5EETV2+fO9H7iCCPD14lqAAT q4UDLdkINK7C3tsgL5zSMuJyFnvKyfLXJ8pSDMrn41jqcpPZW9wIDBQrh t0sVkQKghEpkEYGSWFbW5qifpR0EwKTs8a3bDcGaX+D31eDOAU+3fQycr s+DYyzZRIUi7wy1fi7cMGnNAheNSf5LBPmQ4EupiMF6P15ekxv07FmS4+ GpYTErGmbBarB8T2x9gXg11hZ8+6pIMmh646hieWtw8MOPrr5hTt2DeyV XiGoEXt+Gz5rVavLKa+9SYcSxlYsUIR7NVrlyO6Uha96o/m/0H5BJp59I w==; X-CSE-ConnectionGUID: bTjCszQ8RfGsYp8ISDhKag== X-CSE-MsgGUID: ky3U/v/dSEa8kMnX0JTwrQ== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187296" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187296" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075024" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075024" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id AB9E9524; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 4/9] spi: pxa2xx: Skip SSP initialization if it's done elsewhere Date: Wed, 27 Mar 2024 21:29:23 +0200 Message-ID: <20240327193138.2385910-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If SSP has been enumerated elsewhere, skip its initialization in pxa2xx_spi_init_pdata(). Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index e7072727c25c..b01a18c89b6b 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1355,6 +1355,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device *parent = dev->parent; enum pxa_ssp_type type = SSP_UNDEFINED; + struct ssp_device *ssp = NULL; const void *match; bool is_lpss_priv; int status; @@ -1372,6 +1373,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) return ERR_PTR(status); type = (enum pxa_ssp_type)value; + } else { + ssp = pxa_ssp_request(pdev->id, pdev->name); + if (ssp) + type = ssp->type; } /* Validate the SSP type correctness */ @@ -1394,6 +1399,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) pdata->enable_dma = true; pdata->dma_burst_size = 1; + /* If SSP has been already enumerated, use it */ + if (ssp) + return pdata; + status = pxa2xx_spi_init_ssp(pdev, &pdata->ssp, type); if (status) return ERR_PTR(status); From patchwork Wed Mar 27 19:29:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607345 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CC2715252A; Wed, 27 Mar 2024 19:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567912; cv=none; b=fT5VjcJoSDy+jYBnGJyq7PXiVBsW9+42SLeRZ7ul6/6HaNjrwnOK8P4CiZiRVQdMBNQlv1S2PRBu+cV9tixqsX4YFUeqFGK4Qn4vSmCbOzHws6wxvQzXCiaPfYcYED2zZF8X6ia67VykffWtpZeeRRulo1p+kzVGc37qXzPdJyI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567912; c=relaxed/simple; bh=lzLjtivrQxAS+WqTg89dinGS46hcsyGbp0QSkCiy2Ns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ozhBjYPNDgrIeGLUo33Uo18nRxqhWhtdX1Z7K1XsO/E5itVvXchoDJnODhmt3k287QK8EeDU9nv8a4Cg7KFdCjL6NxYkU2r0LWXZIG/D5IQs5ue+CGU+Q68vyZ/nJfe/yVeiIQguugG+XkyWaS9iI5bbvXEjoPvHdz8+7Up0CYs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IzIxRQdM; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IzIxRQdM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567910; x=1743103910; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lzLjtivrQxAS+WqTg89dinGS46hcsyGbp0QSkCiy2Ns=; b=IzIxRQdMMqmuVjlIbFYhylGaDuRGNkkO1PZtV9Bv/Lca2vvwDueVJw2S NtiUReIBdg4BYzcUNXIy6e2hQiio7RHiQUE4xz2qcFzbna+ttv+lt1Erg WehSkxtkHKl8cWZ8BWBc0puFhgTk+z2kqSeUHBiguWlLGfJ6CLi3l7+Ip U8WMQABlJ5RElH/e+d1AdFN8B1JKFDu8NWXLcKxseCjhH/2BkjoF0xZ1W nQVQpkGWGscHe+1qvOTgVY3J+01Clf1ydOimtJPuCd1W3Ky5she2FC3/k mab8i7sGEEY/BA/rKdblI2+xm6hdZX6IxsGmP1XVGmZg+HhXAhdwq8PV3 A==; X-CSE-ConnectionGUID: aOvVydyZT3WuJjS3NKcd8A== X-CSE-MsgGUID: 7CZ0QEtXQfaso0uLwMUjsQ== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187337" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187337" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075028" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075028" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C04E2643; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 5/9] spi: pxa2xx: Allow number of chip select pins to be read from property Date: Wed, 27 Mar 2024 21:29:24 +0200 Message-ID: <20240327193138.2385910-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In some cases the number of the chip select pins might come from the device property. Allow driver to use it. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index b01a18c89b6b..f4435c39d096 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1358,6 +1358,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) struct ssp_device *ssp = NULL; const void *match; bool is_lpss_priv; + u32 num_cs = 1; int status; is_lpss_priv = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv"); @@ -1394,8 +1395,11 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) pdata->dma_filter = pxa2xx_spi_idma_filter; } + /* Read number of chip select pins, if provided */ + device_property_read_u32(dev, "num-cs", &num_cs); + + pdata->num_chipselect = num_cs; pdata->is_target = device_property_read_bool(dev, "spi-slave"); - pdata->num_chipselect = 1; pdata->enable_dma = true; pdata->dma_burst_size = 1; From patchwork Wed Mar 27 19:29:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607348 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA151152E13; Wed, 27 Mar 2024 19:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567914; cv=none; b=oYTC342Lt//IF7XYB58Di5esR53kLTXAs1iuhulL3dbkKaVTekOA1ZAQhi0SANm968Rd2WEEWDuL4OjBV/NncXMYDvkOWux4oxT+cxKLjYrcPpOgoFoDg58sJFecDBn8D3adxpPVZRTL5sYNn/QI+6DfwCElF5ON5O1bi3oVc7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567914; c=relaxed/simple; bh=H2+f29cgQEQ3T7alzF7pBJizvVEK6UHSDOHh2UhgE0c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eK8lazkhiUe14yniaU7GjgX40PeF9W9nweOpPRnIgUCQ5f9O7dvooctcKj2Y5x9ObepfjAPM/4O6V0tIEZCR4a1y7vpDer9uMF55aIsqWIE0u6lPyfP2EEqGCst+YzoB9FoVYGXEedhvz/BYWXzr2mGlFYfdUdhQvSTluQ2nnMs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NDsKTrJf; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NDsKTrJf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567912; x=1743103912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H2+f29cgQEQ3T7alzF7pBJizvVEK6UHSDOHh2UhgE0c=; b=NDsKTrJfVP5mvz2sY91ApzrYfD6tN/h6GY0oQniL4i76C+AMlJVQ5Qo+ BNJfbZjmZ/uRQyq3tEUVel+q6Tlixp8VAYjHJFJrZEPdkvORMO1cukC+M 8Dv4/uaUA4a8R84GGYzsnOsRogBuTh4AXYtfjRyya2tBqhztTA1OoOAUu 3Gwvz0tab3W/Nb44V4I8UXFdaf1Y5Sf0Ji2XRCDM9PVgVjYsZF/OFAoqB NAwDJCdwjsrTCesLCxYvHwfqaCgZ+7XuTmBQ8o2H3XjYCc7S6HhRKorMy 3HK4Psi9byaLmwgHVsYW7oq/L6JhwTlmHdUs9v5zN3Q65nxoMgliWVsFb A==; X-CSE-ConnectionGUID: X71LatsAQia/p0+mdGKWKg== X-CSE-MsgGUID: FDy+TLKGS3Glp1xSmPYRag== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187324" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187324" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075027" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075027" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C5F135A8; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 6/9] spi: pxa2xx: Provide num-cs for Sharp PDAs via device properties Date: Wed, 27 Mar 2024 21:29:25 +0200 Message-ID: <20240327193138.2385910-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since driver can parse num-cs device property, replace platform data with this new approach. This pursues the following objectives: - getting rid of the public header that barely used outside of the SPI subsystem (more specifically the SPI PXA2xx drivers) - making a trampoline for the driver to support non-default number of the chip select pins in case the original code is going to be converted to Device Tree model It's not expected to have more users in board files except this one. Signed-off-by: Andy Shevchenko --- arch/arm/mach-pxa/spitz.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 318402ad685e..3c5f5a3cb480 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -18,10 +18,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -569,10 +569,6 @@ static struct spi_board_info spitz_spi_devices[] = { }, }; -static struct pxa2xx_spi_controller spitz_spi_info = { - .num_chipselect = 3, -}; - static struct gpiod_lookup_table spitz_spi_gpio_table = { .dev_id = "spi2", .table = { @@ -583,10 +579,20 @@ static struct gpiod_lookup_table spitz_spi_gpio_table = { }, }; +static const struct property_entry spitz_spi_properties[] = { + PROPERTY_ENTRY_U32("num-cs", 3), + { } +}; + +static const struct software_node spitz_spi_node = { + .properties = spitz_spi_properties, +}; + static void __init spitz_spi_init(void) { struct platform_device *pd; int id = 2; + int err; if (machine_is_akita()) gpiod_add_lookup_table(&akita_lcdcon_gpio_table); @@ -601,8 +607,13 @@ static void __init spitz_spi_init(void) if (pd == NULL) { pr_err("pxa2xx-spi: failed to allocate device id %d\n", id); } else { - pd->dev.platform_data = &spitz_spi_info; - platform_device_add(pd); + err = device_add_software_node(&pd->dev, &spitz_spi_node); + if (err) { + platform_device_put(pd); + pr_err("pxa2xx-spi: failed to add software node\n"); + } else { + platform_device_add(pd); + } } spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); From patchwork Wed Mar 27 19:29:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607347 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A7E5152DFE; Wed, 27 Mar 2024 19:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567914; cv=none; b=ruJn8/ZCjKPeiAakbIqtqCgEFMHKtccBvfqgCMIJ/e9S5b/6NF1bDIOWGy1pl/RdhQuku1D5DCyjKuFFyM0ySdDjwAANKUybFcyJmrzih0tB/CwNvHNk1fhB6S7FL1UhSOUMrGXMAxZ0HIfB+tMzB/rvGb4LazMRJ+3eLvAAv2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567914; c=relaxed/simple; bh=y3OFV8ojkqypOZZ1eY8yTN0O6AaepbldILI9QHFUGRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZObr1BlFTZwdxnqS3mdB5xHx1iDYc/ze0tv2CcNnWjN/g+VzxMBejiL6nl/adQWtpyO+tyhA4jL7a+9hoUz593nA2tEsNeS9nbAyzw8ScTf4+w1MQ9DLGHOoVebxiyianfY/NqBxzjTEzqa28jP3rI5cDOqfufvVQ7xFGNSoQww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OxQmHu7b; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OxQmHu7b" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567911; x=1743103911; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y3OFV8ojkqypOZZ1eY8yTN0O6AaepbldILI9QHFUGRI=; b=OxQmHu7bRaWpotklmuGW23zTDraonTlkx+uXTuNBO7b8RbX9CwATEbZx 38eYWGWs3YhjeRVExiX+04fArcJ2sokT+tS9WxTtPPThX7Uws1cND5hFn Cfwgbpg7zz3nr3zc+FjJBf4+ryDD0N8AlirqZ6LsQvAj4h8bn9yLVhQP8 FeUhccax5XQQUs9mtH32GD14iLT45MoIYCMwqt3/oodv/+xAxRL5xkWkr k79vrM0REv5iMAWwwg9V6+UO858muHdMA3SeSEM0wfXjjEKEjPTmuua+r AVPqjqtCkVcxkliicpSl2s6XsPStDXDem8VYt0n1riBNlUhP4rbVODMAj A==; X-CSE-ConnectionGUID: q0Uxl6YUQb6AGtGbXTcHPw== X-CSE-MsgGUID: 6mG1WueTTcOVm+PmPz9qSg== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187347" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187347" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075029" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075029" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id CFD966AF; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Arnd Bergmann Subject: [PATCH v2 7/9] spi: pxa2xx: Move contents of linux/spi/pxa2xx_spi.h to a local one Date: Wed, 27 Mar 2024 21:29:26 +0200 Message-ID: <20240327193138.2385910-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is no user of the linux/spi/pxa2xx_spi.h. Move its contents to the drivers/spi/spi-pxa2xx.h. Suggested-by: Arnd Bergmann Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx-dma.c | 1 - drivers/spi/spi-pxa2xx-pci.c | 4 +-- drivers/spi/spi-pxa2xx.c | 1 - drivers/spi/spi-pxa2xx.h | 36 ++++++++++++++++++++++++- include/linux/spi/pxa2xx_spi.h | 48 ---------------------------------- 5 files changed, 37 insertions(+), 53 deletions(-) delete mode 100644 include/linux/spi/pxa2xx_spi.h diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c index be563f0dd03a..26416ced6505 100644 --- a/drivers/spi/spi-pxa2xx-dma.c +++ b/drivers/spi/spi-pxa2xx-dma.c @@ -12,7 +12,6 @@ #include #include -#include #include #include "spi-pxa2xx.h" diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c index 861b21c63504..e11a613bc340 100644 --- a/drivers/spi/spi-pxa2xx-pci.c +++ b/drivers/spi/spi-pxa2xx-pci.c @@ -10,11 +10,11 @@ #include #include -#include - #include #include +#include "spi-pxa2xx.h" + #define PCI_DEVICE_ID_INTEL_QUARK_X1000 0x0935 #define PCI_DEVICE_ID_INTEL_BYT 0x0f0e #define PCI_DEVICE_ID_INTEL_MRFLD 0x1194 diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index f4435c39d096..e22d9d29c7e9 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -24,7 +24,6 @@ #include #include -#include #include #include "spi-pxa2xx.h" diff --git a/drivers/spi/spi-pxa2xx.h b/drivers/spi/spi-pxa2xx.h index 45cdbbc71c4b..08296729ea80 100644 --- a/drivers/spi/spi-pxa2xx.h +++ b/drivers/spi/spi-pxa2xx.h @@ -7,6 +7,7 @@ #ifndef SPI_PXA2XX_H #define SPI_PXA2XX_H +#include #include #include #include @@ -15,7 +16,40 @@ #include struct gpio_desc; -struct pxa2xx_spi_controller; + +/* + * The platform data for SSP controller devices + * (resides in device.platform_data). + */ +struct pxa2xx_spi_controller { + u8 num_chipselect; + u8 enable_dma; + u8 dma_burst_size; + bool is_target; + + /* DMA engine specific config */ + dma_filter_fn dma_filter; + void *tx_param; + void *rx_param; + + /* For non-PXA arches */ + struct ssp_device ssp; +}; + +/* + * The controller specific data for SPI target devices + * (resides in spi_board_info.controller_data), + * copied to spi_device.platform_data ... mostly for + * DMA tuning. + */ +struct pxa2xx_spi_chip { + u8 tx_threshold; + u8 tx_hi_threshold; + u8 rx_threshold; + u8 dma_burst_size; + u32 timeout; +}; + struct spi_controller; struct spi_device; struct spi_transfer; diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h deleted file mode 100644 index e5a4a045fb67..000000000000 --- a/include/linux/spi/pxa2xx_spi.h +++ /dev/null @@ -1,48 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs - */ -#ifndef __LINUX_SPI_PXA2XX_SPI_H -#define __LINUX_SPI_PXA2XX_SPI_H - -#include -#include - -#include - -struct dma_chan; - -/* - * The platform data for SSP controller devices - * (resides in device.platform_data). - */ -struct pxa2xx_spi_controller { - u8 num_chipselect; - u8 enable_dma; - u8 dma_burst_size; - bool is_target; - - /* DMA engine specific config */ - dma_filter_fn dma_filter; - void *tx_param; - void *rx_param; - - /* For non-PXA arches */ - struct ssp_device ssp; -}; - -/* - * The controller specific data for SPI target devices - * (resides in spi_board_info.controller_data), - * copied to spi_device.platform_data ... mostly for - * DMA tuning. - */ -struct pxa2xx_spi_chip { - u8 tx_threshold; - u8 tx_hi_threshold; - u8 rx_threshold; - u8 dma_burst_size; - u32 timeout; -}; - -#endif /* __LINUX_SPI_PXA2XX_SPI_H */ From patchwork Wed Mar 27 19:29:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607346 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE2A9152DE9; Wed, 27 Mar 2024 19:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567913; cv=none; b=m1tANl+VyInn9EZZCZKJchp/UWZFVoH+bqNdbdP4we9qJukVaJXMY/BwGjD9u9EpgVHvcW24e0Uxhe0K7lstzLwtZzfRwlxvRWHg6nMLc0LbTAfP5+TWCNkH+/LJcH+/zWH8HOOgAmS0h0wpRpKCuKX2CEXDBPqT/U8oCqTPYa4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567913; c=relaxed/simple; bh=/BHAdaF+s+CWPuV02pEylhhQSEZjjV8zTiRovVO1XXs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jS2sYynL/Hn7kpp483PYnBCLL6peZ0dyKwSgY+gOdzXK3tTwN7oRY/5TES24HlpjAlVF4itJKeMevQ5nSJZnHU3yXaZmJk7vK2GqDicS8SzZIC2+l3+XUuSjd8SRLFXmKR06rha1iYSaCuJweEDCB7+IxOeI3B1yDyXVQaMUidY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VspDePx/; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VspDePx/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567911; x=1743103911; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/BHAdaF+s+CWPuV02pEylhhQSEZjjV8zTiRovVO1XXs=; b=VspDePx/cBlHlnmagPSNLq5yApj3cYcgilguSfE1xyitNRxhon3oeroc WnQU/hJEZrJrbFxsuepvw2EtDDuV1utWikj4hq6Oht9nUSBZZq7zDPNFM idRvEqcSOPHzPfom2dWPYKU/Wrwcv1uZftE985HDLTQglh6LoZS8o+MVS 5W8U4uKrNKrMKIeX5IGwQadLXlzMj6Lm8l6mAdL3I0J2qQt/t8MQ2EewB /EWctNxWuI01en7b0WRVuW0zAk4TdE4D+NnqIeGbwrxwH/5KQrlWA+ggE 9O/mFOuBZykusKjehQg5kFZxHcrk4Mt/s0bGbiJ6iHSZwDWGLR/KJbo+j g==; X-CSE-ConnectionGUID: 9xckIqMRTl29UKh8icdfRw== X-CSE-MsgGUID: zkDsx+2QQP+/kOVlsDL+KQ== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187340" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187340" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075030" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075030" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DB2867C4; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 8/9] spi: pxa2xx: Remove outdated documentation Date: Wed, 27 Mar 2024 21:29:27 +0200 Message-ID: <20240327193138.2385910-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The documentation is referring to the legacy enumeration of the SPI host controllers and target devices. It has nothing to do with the modern way, which is the only supported in kernel right now. Hence, remove outdated documentation file. Signed-off-by: Andy Shevchenko --- Documentation/spi/pxa2xx.rst | 208 ----------------------------------- drivers/spi/Kconfig | 3 +- 2 files changed, 1 insertion(+), 210 deletions(-) delete mode 100644 Documentation/spi/pxa2xx.rst diff --git a/Documentation/spi/pxa2xx.rst b/Documentation/spi/pxa2xx.rst deleted file mode 100644 index 33d2ad95901e..000000000000 --- a/Documentation/spi/pxa2xx.rst +++ /dev/null @@ -1,208 +0,0 @@ -============================== -PXA2xx SPI on SSP driver HOWTO -============================== - -This a mini HOWTO on the pxa2xx_spi driver. The driver turns a PXA2xx -synchronous serial port into an SPI host controller -(see Documentation/spi/spi-summary.rst). The driver has the following features - -- Support for any PXA2xx and compatible SSP. -- SSP PIO and SSP DMA data transfers. -- External and Internal (SSPFRM) chip selects. -- Per peripheral device (chip) configuration. -- Full suspend, freeze, resume support. - -The driver is built around a &struct spi_message FIFO serviced by kernel -thread. The kernel thread, spi_pump_messages(), drives message FIFO and -is responsible for queuing SPI transactions and setting up and launching -the DMA or interrupt driven transfers. - -Declaring PXA2xx host controllers ---------------------------------- -Typically, for a legacy platform, an SPI host controller is defined in the -arch/.../mach-*/board-*.c as a "platform device". The host controller configuration -is passed to the driver via a table found in include/linux/spi/pxa2xx_spi.h:: - - struct pxa2xx_spi_controller { - u8 num_chipselect; - u8 enable_dma; - ... - }; - -The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of -peripheral devices (chips) attached to this SPI host controller. - -The "pxa2xx_spi_controller.enable_dma" field informs the driver that SSP DMA should -be used. This caused the driver to acquire two DMA channels: Rx channel and -Tx channel. The Rx channel has a higher DMA service priority than the Tx channel. -See the "PXA2xx Developer Manual" section "DMA Controller". - -For the new platforms the description of the controller and peripheral devices -comes from Device Tree or ACPI. - -NSSP HOST SAMPLE ----------------- -Below is a sample configuration using the PXA255 NSSP for a legacy platform:: - - static struct resource pxa_spi_nssp_resources[] = { - [0] = { - .start = __PREG(SSCR0_P(2)), /* Start address of NSSP */ - .end = __PREG(SSCR0_P(2)) + 0x2c, /* Range of registers */ - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_NSSP, /* NSSP IRQ */ - .end = IRQ_NSSP, - .flags = IORESOURCE_IRQ, - }, - }; - - static struct pxa2xx_spi_controller pxa_nssp_controller_info = { - .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ - .enable_dma = 1, /* Enables NSSP DMA */ - }; - - static struct platform_device pxa_spi_nssp = { - .name = "pxa2xx-spi", /* MUST BE THIS VALUE, so device match driver */ - .id = 2, /* Bus number, MUST MATCH SSP number 1..n */ - .resource = pxa_spi_nssp_resources, - .num_resources = ARRAY_SIZE(pxa_spi_nssp_resources), - .dev = { - .platform_data = &pxa_nssp_controller_info, /* Passed to driver */ - }, - }; - - static struct platform_device *devices[] __initdata = { - &pxa_spi_nssp, - }; - - static void __init board_init(void) - { - (void)platform_add_device(devices, ARRAY_SIZE(devices)); - } - -Declaring peripheral devices ----------------------------- -Typically, for a legacy platform, each SPI peripheral device (chip) is defined in the -arch/.../mach-*/board-*.c using the "spi_board_info" structure found in -"linux/spi/spi.h". See "Documentation/spi/spi-summary.rst" for additional -information. - -Each peripheral device (chip) attached to the PXA2xx must provide specific chip configuration -information via the structure "pxa2xx_spi_chip" found in -"include/linux/spi/pxa2xx_spi.h". The PXA2xx host controller driver will use -the configuration whenever the driver communicates with the peripheral -device. All fields are optional. - -:: - - struct pxa2xx_spi_chip { - u8 tx_threshold; - u8 rx_threshold; - u8 dma_burst_size; - u32 timeout; - }; - -The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are -used to configure the SSP hardware FIFO. These fields are critical to the -performance of pxa2xx_spi driver and misconfiguration will result in rx -FIFO overruns (especially in PIO mode transfers). Good default values are:: - - .tx_threshold = 8, - .rx_threshold = 8, - -The range is 1 to 16 where zero indicates "use default". - -The "pxa2xx_spi_chip.dma_burst_size" field is used to configure PXA2xx DMA -engine and is related the "spi_device.bits_per_word" field. Read and understand -the PXA2xx "Developer Manual" sections on the DMA controller and SSP Controllers -to determine the correct value. An SSP configured for byte-wide transfers would -use a value of 8. The driver will determine a reasonable default if -dma_burst_size == 0. - -The "pxa2xx_spi_chip.timeout" fields is used to efficiently handle -trailing bytes in the SSP receiver FIFO. The correct value for this field is -dependent on the SPI bus speed ("spi_board_info.max_speed_hz") and the specific -peripheral device. Please note that the PXA2xx SSP 1 does not support trailing byte -timeouts and must busy-wait any trailing bytes. - -NOTE: the SPI driver cannot control the chip select if SSPFRM is used, so the -chipselect is dropped after each spi_transfer. Most devices need chip select -asserted around the complete message. Use SSPFRM as a GPIO (through a descriptor) -to accommodate these chips. - - -NSSP PERIPHERAL SAMPLE ----------------------- -For a legacy platform or in some other cases, the pxa2xx_spi_chip structure -is passed to the pxa2xx_spi driver in the "spi_board_info.controller_data" -field. Below is a sample configuration using the PXA255 NSSP. - -:: - - static struct pxa2xx_spi_chip cs8415a_chip_info = { - .tx_threshold = 8, /* SSP hardware FIFO threshold */ - .rx_threshold = 8, /* SSP hardware FIFO threshold */ - .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ - .timeout = 235, /* See Intel documentation */ - }; - - static struct pxa2xx_spi_chip cs8405a_chip_info = { - .tx_threshold = 8, /* SSP hardware FIFO threshold */ - .rx_threshold = 8, /* SSP hardware FIFO threshold */ - .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ - .timeout = 235, /* See Intel documentation */ - }; - - static struct spi_board_info streetracer_spi_board_info[] __initdata = { - { - .modalias = "cs8415a", /* Name of spi_driver for this device */ - .max_speed_hz = 3686400, /* Run SSP as fast a possible */ - .bus_num = 2, /* Framework bus number */ - .chip_select = 0, /* Framework chip select */ - .platform_data = NULL; /* No spi_driver specific config */ - .controller_data = &cs8415a_chip_info, /* Host controller config */ - .irq = STREETRACER_APCI_IRQ, /* Peripheral device interrupt */ - }, - { - .modalias = "cs8405a", /* Name of spi_driver for this device */ - .max_speed_hz = 3686400, /* Run SSP as fast a possible */ - .bus_num = 2, /* Framework bus number */ - .chip_select = 1, /* Framework chip select */ - .controller_data = &cs8405a_chip_info, /* Host controller config */ - .irq = STREETRACER_APCI_IRQ, /* Peripheral device interrupt */ - }, - }; - - static void __init streetracer_init(void) - { - spi_register_board_info(streetracer_spi_board_info, - ARRAY_SIZE(streetracer_spi_board_info)); - } - - -DMA and PIO I/O Support ------------------------ -The pxa2xx_spi driver supports both DMA and interrupt driven PIO message -transfers. The driver defaults to PIO mode and DMA transfers must be enabled -by setting the "enable_dma" flag in the "pxa2xx_spi_controller" structure. -For the newer platforms, that are known to support DMA, the driver will enable -it automatically and try it first with a possible fallback to PIO. The DMA -mode supports both coherent and stream based DMA mappings. - -The following logic is used to determine the type of I/O to be used on -a per "spi_transfer" basis:: - - if spi_message.len > 65536 then - print "rate limited" warning - use PIO transfers - - if enable_dma and the size is in the range [DMA burst size..65536] then - use streaming DMA mode - - otherwise - use PIO transfer - -THANKS TO ---------- -David Brownell and others for mentoring the development of this driver. diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index c1bb1895009c..11d7ac8aed4a 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -821,8 +821,7 @@ config SPI_PXA2XX select PXA_SSP if ARCH_PXA || ARCH_MMP help This enables using a PXA2xx or Sodaville SSP port as a SPI master - controller. The driver can be configured to use any SSP port and - additional documentation can be found a Documentation/spi/pxa2xx.rst. + controller. The driver can be configured to use any SSP port. config SPI_PXA2XX_PCI def_tristate SPI_PXA2XX && PCI && COMMON_CLK From patchwork Wed Mar 27 19:29:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13607349 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E37F2153509; Wed, 27 Mar 2024 19:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567915; cv=none; b=pQjb2SZ6JesHmBrzwQLnwltd6f35mLoLbdxsLzpDVvt3VD6GtHYSkq06VyURYfDXDrbdx+H3qZsw5wSKaoQr/JIj/bD4pfl/KlJr3pdBlg2hM69E1mNzMJW0jEIGtGbQpfZjNocflmlq6Mllbc8dzD2mS5HwWR6Hg29p7yibawE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711567915; c=relaxed/simple; bh=j5gvoDGybQmWLbfFLzUmE6T0bPJCKLuCLg7N7OevHog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jB1BQ/dHINlwmi11hIhLHNZZREwFa0tGFS4fjG03Nn7WZs8C06x9lSMYEBp70JWP0DdYO+1q8xJhflkmdpFqKpGD7jpfYAGjyKcGPbZKPhgZgztkFEQz1Akf6Ksrt7X6V1lktvvDj9325arjrLu8gYHB1JVXppkxfsOHB4Gyw80= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=DWWIWSIw; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DWWIWSIw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711567913; x=1743103913; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j5gvoDGybQmWLbfFLzUmE6T0bPJCKLuCLg7N7OevHog=; b=DWWIWSIwt7n9keJSVSeIKrWnp753znnPj4J6QLjHO/FRaSkuT6eI6+bS Y2x/qnZqIlcl5gyCQzqQ5Aat6dKg2uFqSQHtoniFfto/x7QIDPA3x9tx/ QLMO/ljUCu+kQ9ZMIpj6+/U5nJ3ucqib6BnCDLftKxOInp3W/R/BMfHZv W7LFtPdhSENODYj89PElSApxTzXKwhPr3c97iP8P5JfvfWU33mJhdxwfb 2ohGYEVZ7rB+xpYsYVP96QmMKsCbVfjvtoRjjga85zeHgEw2kbsoTvSSk t3BuyWGOe11a1DH2WaUBZe8vV0JL98CZ269zXZEjehqOEsmuBoQl5P/GD Q==; X-CSE-ConnectionGUID: D5LKvjZCTL23mU2M+HjRIA== X-CSE-MsgGUID: X2iM317xSOul6PKwjZh1Jg== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="24187357" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="24187357" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 12:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="937075031" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="937075031" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2024 12:31:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EBC4A8D9; Wed, 27 Mar 2024 21:31:42 +0200 (EET) From: Andy Shevchenko To: Mark Brown , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v2 9/9] spi: pxa2xx: Don't use "proxy" headers Date: Wed, 27 Mar 2024 21:29:28 +0200 Message-ID: <20240327193138.2385910-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> References: <20240327193138.2385910-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update header inclusions to follow IWYU (Include What You Use) principle. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx-dma.c | 10 ++++++++-- drivers/spi/spi-pxa2xx-pci.c | 6 ++++++ drivers/spi/spi-pxa2xx.c | 10 +++++++--- drivers/spi/spi-pxa2xx.h | 3 +-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c index 26416ced6505..751cb0f77b62 100644 --- a/drivers/spi/spi-pxa2xx-dma.c +++ b/drivers/spi/spi-pxa2xx-dma.c @@ -6,16 +6,22 @@ * Author: Mika Westerberg */ -#include +#include +#include #include #include +#include +#include #include -#include +#include +#include #include #include "spi-pxa2xx.h" +struct device; + static void pxa2xx_spi_dma_transfer_complete(struct driver_data *drv_data, bool error) { diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c index e11a613bc340..6d2efdb0e95f 100644 --- a/drivers/spi/spi-pxa2xx-pci.c +++ b/drivers/spi/spi-pxa2xx-pci.c @@ -6,9 +6,15 @@ * Copyright (C) 2016, 2021 Intel Corporation */ #include +#include +#include #include #include #include +#include +#include +#include +#include #include #include diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index e22d9d29c7e9..86d0f1064a45 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -5,24 +5,28 @@ */ #include +#include #include +#include #include #include #include #include #include -#include #include #include #include +#include #include -#include -#include +#include +#include #include +#include #include #include #include #include +#include #include diff --git a/drivers/spi/spi-pxa2xx.h b/drivers/spi/spi-pxa2xx.h index 08296729ea80..f1097c96c50f 100644 --- a/drivers/spi/spi-pxa2xx.h +++ b/drivers/spi/spi-pxa2xx.h @@ -8,8 +8,7 @@ #define SPI_PXA2XX_H #include -#include -#include +#include #include #include