linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 3/3] dmaengine: qcom_hidma: add identity register support
Date: Wed,  8 Nov 2017 11:29:42 -0500	[thread overview]
Message-ID: <1510158582-5343-3-git-send-email-okaya@codeaurora.org> (raw)
In-Reply-To: <1510158582-5343-1-git-send-email-okaya@codeaurora.org>

The location for destination event channel register has been relocated from
offset 0x28 to 0x40. Update the code accordingly.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/dma/qcom/hidma.c | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 4ef7d6f..e8b7be0 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -126,6 +126,18 @@ struct hidma_cap {
 	}
 };
 
+static struct hidma_cap hidma_identity_cap = {
+	.of = {
+		{.compatible = "qcom,hidma-1.2",},
+		{},
+	},
+
+	.acpi = {
+		{"QCOM8063"},
+		{},
+	}
+};
+
 /* process completed descriptors */
 static void hidma_process_completed(struct hidma_chan *mchan)
 {
@@ -772,6 +784,22 @@ static bool hidma_msi_capable(struct device *dev)
 	return ret;
 }
 
+static bool hidma_identity_capable(struct device *dev)
+{
+	struct acpi_device *adev = ACPI_COMPANION(dev);
+	int ret;
+
+	if (!adev || acpi_disabled)
+		ret = of_match_device(hidma_identity_cap.of, dev) != NULL;
+	else {
+#ifdef CONFIG_ACPI
+		ret = acpi_match_device(hidma_identity_cap.acpi, dev) != NULL;
+#endif
+	}
+
+	return ret;
+}
+
 static int hidma_probe(struct platform_device *pdev)
 {
 	struct hidma_dev *dmadev;
@@ -863,7 +891,10 @@ static int hidma_probe(struct platform_device *pdev)
 	if (!dmadev->nr_descriptors)
 		dmadev->nr_descriptors = HIDMA_NR_DEFAULT_DESC;
 
-	dmadev->chidx = readl(dmadev->dev_trca + 0x28);
+	if (hidma_identity_capable(&pdev->dev))
+		dmadev->chidx = readl(dmadev->dev_trca + 0x40);
+	else
+		dmadev->chidx = readl(dmadev->dev_trca + 0x28);
 
 	/* Set DMA mask to 64 bits. */
 	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-- 
1.9.1

      parent reply	other threads:[~2017-11-08 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 16:29 [PATCH V2 1/3] Documentation: DT: qcom_hidma: bump HW revision for the bugfixed HW Sinan Kaya
2017-11-08 16:29 ` [PATCH V2 2/3] dmaengine: qcom_hidma: add support for the new revision Sinan Kaya
2017-11-08 16:49   ` Timur Tabi
2017-11-08 16:58     ` Sinan Kaya
2017-11-08 17:12       ` Timur Tabi
2017-11-08 17:37         ` Sinan Kaya
2017-11-08 17:51           ` Timur Tabi
2017-11-08 17:51   ` Robin Murphy
2017-11-10 14:03     ` Sinan Kaya
2017-11-10 14:14       ` Timur Tabi
2017-11-10 14:17       ` Robin Murphy
2017-11-08 16:29 ` Sinan Kaya [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=1510158582-5343-3-git-send-email-okaya@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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).