linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dilip Kota <eswara.kota@linux.intel.com>
To: broonie@kernel.org, robh@kernel.org, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, daniel.schwierzeck@gmail.com,
	hauke@hauke-m.de, andriy.shevchenko@intel.com,
	cheol.yong.kim@intel.com, chuanhua.lei@linux.intel.com,
	qi-ming.wu@intel.com, Dilip Kota <eswara.kota@linux.intel.com>
Subject: [PATCH 4/4] spi: lantiq: Add support to Lightning Mountain SoC
Date: Fri, 24 Apr 2020 18:42:33 +0800	[thread overview]
Message-ID: <5431aaf70b59ff668b347bc84782296a5f950439.1587702428.git.eswara.kota@linux.intel.com> (raw)
In-Reply-To: <cover.1587702428.git.eswara.kota@linux.intel.com>
In-Reply-To: <cover.1587702428.git.eswara.kota@linux.intel.com>

Add support to SPI controller on Intel Atom based Lightning Mountain
SoC which reuses Lantiq SPI controller IP.

Signed-off-by: Dilip Kota <eswara.kota@linux.intel.com>
---
 drivers/spi/Kconfig          |  4 ++--
 drivers/spi/spi-lantiq-ssc.c | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 4887be7f16de..089b0ba4afe3 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -495,11 +495,11 @@ config SPI_NPCM_PSPI
 
 config SPI_LANTIQ_SSC
 	tristate "Lantiq SSC SPI controller"
-	depends on LANTIQ || COMPILE_TEST
+	depends on (LANTIQ || X86) || COMPILE_TEST
 	help
 	  This driver supports the Lantiq SSC SPI controller in master
 	  mode. This controller is found on Intel (former Lantiq) SoCs like
-	  the Danube, Falcon, xRX200, xRX300.
+	  the Danube, Falcon, xRX200, xRX300, Lightning Mountain.
 
 config SPI_OC_TINY
 	tristate "OpenCores tiny SPI"
diff --git a/drivers/spi/spi-lantiq-ssc.c b/drivers/spi/spi-lantiq-ssc.c
index 74a5d36c5048..f07fa6fbadbe 100644
--- a/drivers/spi/spi-lantiq-ssc.c
+++ b/drivers/spi/spi-lantiq-ssc.c
@@ -789,6 +789,18 @@ static int lantiq_ssc_transfer_one(struct spi_master *master,
 	return transfer_start(spi, spidev, t);
 }
 
+static int intel_cfg_irq(struct platform_device *pdev, struct lantiq_ssc_spi *spi)
+{
+	int irq;
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
+
+	return devm_request_threaded_irq(&pdev->dev, irq, NULL, lantiq_ssc_isr,
+					IRQF_ONESHOT, "spi", spi);
+}
+
 static int lantiq_cfg_irq(struct platform_device *pdev, struct lantiq_ssc_spi *spi)
 {
 	int irq, err;
@@ -837,10 +849,18 @@ static const struct lantiq_ssc_hwcfg lantiq_ssc_xrx = {
 	.irq_ack	= false,
 };
 
+static const struct lantiq_ssc_hwcfg intel_ssc_lgm = {
+	.irnen_r	= LTQ_SPI_IRNEN_R_XRX,
+	.irnen_t	= LTQ_SPI_IRNEN_T_XRX,
+	.fifo_size_mask	= GENMASK(7, 0),
+	.cfg_irq	= intel_cfg_irq,
+};
+
 static const struct of_device_id lantiq_ssc_match[] = {
 	{ .compatible = "lantiq,ase-spi", .data = &lantiq_ssc_xway, },
 	{ .compatible = "lantiq,falcon-spi", .data = &lantiq_ssc_xrx, },
 	{ .compatible = "lantiq,xrx100-spi", .data = &lantiq_ssc_xrx, },
+	{ .compatible = "intel,lgm-spi", .data = &intel_ssc_lgm, },
 	{},
 };
 MODULE_DEVICE_TABLE(of, lantiq_ssc_match);
-- 
2.11.0


      parent reply	other threads:[~2020-04-24 10:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 10:42 [PATCH 0/4] spi: lantiq: Synchronize interrupts, transfers and add new features Dilip Kota
2020-04-24 10:42 ` [PATCH 1/4] spi: lantiq: Synchronize interrupt handlers and transfers Dilip Kota
2020-04-24 11:25   ` Mark Brown
2020-04-27  6:01     ` Dilip Kota
2020-04-27 13:45       ` Mark Brown
2020-04-28  5:39         ` Dilip Kota
2020-04-28 10:00           ` Mark Brown
2020-04-29  7:20             ` Dilip Kota
2020-04-29 12:27               ` Mark Brown
2020-04-27 21:52   ` Hauke Mehrtens
2020-04-28  6:03     ` Dilip Kota
2020-04-28 11:10   ` Daniel Schwierzeck
2020-04-28 11:30     ` Hauke Mehrtens
2020-04-29  8:22       ` Dilip Kota
2020-04-29  8:20     ` Dilip Kota
2020-04-29 12:13       ` Mark Brown
2020-05-04 10:15         ` Dilip Kota
2020-05-05 11:23           ` Mark Brown
2020-05-06  7:40             ` Dilip Kota
2020-07-16  9:36               ` Dilip Kota
2020-04-24 10:42 ` [PATCH 2/4] spi: lantiq: Dynamic configuration of interrupts and FIFO size Dilip Kota
2020-04-24 10:42 ` [PATCH 3/4] dt-bindings: spi: Add support to Lightning Mountain SoC Dilip Kota
2020-05-11 21:22   ` Rob Herring
2020-04-24 10:42 ` Dilip Kota [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5431aaf70b59ff668b347bc84782296a5f950439.1587702428.git.eswara.kota@linux.intel.com \
    --to=eswara.kota@linux.intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=broonie@kernel.org \
    --cc=cheol.yong.kim@intel.com \
    --cc=chuanhua.lei@linux.intel.com \
    --cc=daniel.schwierzeck@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hauke@hauke-m.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=qi-ming.wu@intel.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).