Skip to content

Commit 07741c8

Browse files
akhilpo-qcomJie Zhang
authored andcommitted
FROMLIST: drm/msm/a6xx: Retrieve gmu core range by index
Some GPUs like A612 doesn't use a named register range resource. This is because the reg-name property is discouraged when there is just a single resource. To address this, retrieve the 'gmu' register range by its index. It is always guaranteed to be at index 0. Signed-off-by: Akhil P Oommen <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5a22de7 commit 07741c8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gmu.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,21 +1902,19 @@ static int cxpd_notifier_cb(struct notifier_block *nb,
19021902
return 0;
19031903
}
19041904

1905-
static void __iomem *a6xx_gmu_get_mmio(struct platform_device *pdev,
1906-
const char *name, resource_size_t *start)
1905+
static void __iomem *a6xx_gmu_get_mmio(struct platform_device *pdev, resource_size_t *start)
19071906
{
1907+
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
19081908
void __iomem *ret;
1909-
struct resource *res = platform_get_resource_byname(pdev,
1910-
IORESOURCE_MEM, name);
19111909

19121910
if (!res) {
1913-
DRM_DEV_ERROR(&pdev->dev, "Unable to find the %s registers\n", name);
1911+
DRM_DEV_ERROR(&pdev->dev, "Unable to find the gmu core registers\n");
19141912
return ERR_PTR(-EINVAL);
19151913
}
19161914

19171915
ret = ioremap(res->start, resource_size(res));
19181916
if (!ret) {
1919-
DRM_DEV_ERROR(&pdev->dev, "Unable to map the %s registers\n", name);
1917+
DRM_DEV_ERROR(&pdev->dev, "Unable to map the gmu core registers\n");
19201918
return ERR_PTR(-EINVAL);
19211919
}
19221920

@@ -1958,7 +1956,7 @@ int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
19581956
gmu->nr_clocks = ret;
19591957

19601958
/* Map the GMU registers */
1961-
gmu->mmio = a6xx_gmu_get_mmio(pdev, "gmu", &start);
1959+
gmu->mmio = a6xx_gmu_get_mmio(pdev, &start);
19621960
if (IS_ERR(gmu->mmio)) {
19631961
ret = PTR_ERR(gmu->mmio);
19641962
goto err_mmio;
@@ -2115,7 +2113,7 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
21152113
goto err_memory;
21162114

21172115
/* Map the GMU registers */
2118-
gmu->mmio = a6xx_gmu_get_mmio(pdev, "gmu", &start);
2116+
gmu->mmio = a6xx_gmu_get_mmio(pdev, &start);
21192117
if (IS_ERR(gmu->mmio)) {
21202118
ret = PTR_ERR(gmu->mmio);
21212119
goto err_memory;

0 commit comments

Comments
 (0)