From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752860AbdKHQaI (ORCPT ); Wed, 8 Nov 2017 11:30:08 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:36108 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbdKHQ3x (ORCPT ); Wed, 8 Nov 2017 11:29:53 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6E4BB607B5 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: dmaengine@vger.kernel.org, timur@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , linux-kernel@vger.kernel.org Subject: [PATCH V2 3/3] dmaengine: qcom_hidma: add identity register support Date: Wed, 8 Nov 2017 11:29:42 -0500 Message-Id: <1510158582-5343-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510158582-5343-1-git-send-email-okaya@codeaurora.org> References: <1510158582-5343-1-git-send-email-okaya@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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