2022-04-06 16:45:24

by Vinod Koul

[permalink] [raw]
Subject: [PATCH 3/3] dmaengine: qcom: gpi: Add support for ee_offset

Controller on newer SoCs like SM8450 have registers at at offset. Add
ee_offset to driver_data and add this compatible for the driver.

Signed-off-by: Vinod Koul <[email protected]>
---
drivers/dma/qcom/gpi.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
index 3429ceccd13b..0b402d923eae 100644
--- a/drivers/dma/qcom/gpi.c
+++ b/drivers/dma/qcom/gpi.c
@@ -2152,6 +2152,7 @@ static int gpi_probe(struct platform_device *pdev)
{
struct gpi_dev *gpi_dev;
unsigned int i;
+ u32 ee_offset;
int ret;

gpi_dev = devm_kzalloc(&pdev->dev, sizeof(*gpi_dev), GFP_KERNEL);
@@ -2179,6 +2180,9 @@ static int gpi_probe(struct platform_device *pdev)
return ret;
}

+ ee_offset = (uintptr_t)device_get_match_data(gpi_dev->dev);
+ gpi_dev->ee_base = gpi_dev->ee_base - ee_offset;
+
gpi_dev->ev_factor = EV_FACTOR;

ret = dma_set_mask(gpi_dev->dev, DMA_BIT_MASK(64));
@@ -2282,9 +2286,10 @@ static int gpi_probe(struct platform_device *pdev)
}

static const struct of_device_id gpi_of_match[] = {
- { .compatible = "qcom,sdm845-gpi-dma" },
- { .compatible = "qcom,sm8150-gpi-dma" },
- { .compatible = "qcom,sm8250-gpi-dma" },
+ { .compatible = "qcom,sdm845-gpi-dma", .data = (void *)0x0 },
+ { .compatible = "qcom,sm8150-gpi-dma", .data = (void *)0x0 },
+ { .compatible = "qcom,sm8250-gpi-dma", .data = (void *)0x0 },
+ { .compatible = "qcom,sm8450-gpi-dma", .data = (void *)0x10000 },
{ },
};
MODULE_DEVICE_TABLE(of, gpi_of_match);
--
2.34.1


2022-04-13 05:46:35

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 3/3] dmaengine: qcom: gpi: Add support for ee_offset

On Wed 06 Apr 06:25 PDT 2022, Vinod Koul wrote:

> Controller on newer SoCs like SM8450 have registers at at offset. Add
> ee_offset to driver_data and add this compatible for the driver.
>
> Signed-off-by: Vinod Koul <[email protected]>

Reviewed-by: Bjorn Andersson <[email protected]>
Tested-by: Bjorn Andersson <[email protected]>

Regards,
Bjorn

> ---
> drivers/dma/qcom/gpi.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
> index 3429ceccd13b..0b402d923eae 100644
> --- a/drivers/dma/qcom/gpi.c
> +++ b/drivers/dma/qcom/gpi.c
> @@ -2152,6 +2152,7 @@ static int gpi_probe(struct platform_device *pdev)
> {
> struct gpi_dev *gpi_dev;
> unsigned int i;
> + u32 ee_offset;
> int ret;
>
> gpi_dev = devm_kzalloc(&pdev->dev, sizeof(*gpi_dev), GFP_KERNEL);
> @@ -2179,6 +2180,9 @@ static int gpi_probe(struct platform_device *pdev)
> return ret;
> }
>
> + ee_offset = (uintptr_t)device_get_match_data(gpi_dev->dev);
> + gpi_dev->ee_base = gpi_dev->ee_base - ee_offset;
> +
> gpi_dev->ev_factor = EV_FACTOR;
>
> ret = dma_set_mask(gpi_dev->dev, DMA_BIT_MASK(64));
> @@ -2282,9 +2286,10 @@ static int gpi_probe(struct platform_device *pdev)
> }
>
> static const struct of_device_id gpi_of_match[] = {
> - { .compatible = "qcom,sdm845-gpi-dma" },
> - { .compatible = "qcom,sm8150-gpi-dma" },
> - { .compatible = "qcom,sm8250-gpi-dma" },
> + { .compatible = "qcom,sdm845-gpi-dma", .data = (void *)0x0 },
> + { .compatible = "qcom,sm8150-gpi-dma", .data = (void *)0x0 },
> + { .compatible = "qcom,sm8250-gpi-dma", .data = (void *)0x0 },
> + { .compatible = "qcom,sm8450-gpi-dma", .data = (void *)0x10000 },
> { },
> };
> MODULE_DEVICE_TABLE(of, gpi_of_match);
> --
> 2.34.1
>