Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87ff01a7 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Unbind adreno from component device for nogmu"

parents a6326762 9255ec34
Loading
Loading
Loading
Loading
+27 −14
Original line number Diff line number Diff line
@@ -1274,6 +1274,12 @@ static void adreno_setup_device(struct adreno_device *adreno_dev)
	}
}

static const struct of_device_id adreno_gmu_match[] = {
	{ .compatible = "qcom,gpu-gmu" },
	{ .compatible = "qcom,gpu-rgmu" },
	{},
};

int adreno_device_probe(struct platform_device *pdev,
		struct adreno_device *adreno_dev)
{
@@ -1310,11 +1316,13 @@ int adreno_device_probe(struct platform_device *pdev,
	 * Bind the GMU components (if applicable) before doing the KGSL
	 * platform probe
	 */
	if (of_find_matching_node(dev->of_node, adreno_gmu_match)) {
		status = component_bind_all(dev, NULL);
		if (status) {
			kgsl_bus_close(device);
			return status;
		}
	}

	/*
	 * The SMMU APIs use unsigned long for virtual addresses which means
@@ -1418,7 +1426,9 @@ int adreno_device_probe(struct platform_device *pdev,
err:
	device->pdev = NULL;

	if (of_find_matching_node(dev->of_node, adreno_gmu_match))
		component_unbind_all(dev, NULL);

	kgsl_bus_close(device);

	return status;
@@ -1511,6 +1521,7 @@ static void adreno_unbind(struct device *dev)

	kgsl_device_platform_remove(device);

	if (of_find_matching_node(dev->of_node, adreno_gmu_match))
		component_unbind_all(dev, NULL);

	clear_bit(ADRENO_DEVICE_PWRON_FIXUP, &adreno_dev->priv);
@@ -3755,12 +3766,6 @@ const struct adreno_power_ops adreno_power_operations = {
	.touch_wakeup = adreno_touch_wakeup,
};

static const struct of_device_id adreno_gmu_match[] = {
	{ .compatible = "qcom,gpu-gmu" },
	{ .compatible = "qcom,gpu-rgmu" },
	{},
};

static int _compare_of(struct device *dev, void *data)
{
	return (dev->of_node == data);
@@ -3795,12 +3800,20 @@ static int adreno_probe(struct platform_device *pdev)

	adreno_add_gmu_components(&pdev->dev, &match);

	return component_master_add_with_match(&pdev->dev, &adreno_ops, match);
	if (match)
		return component_master_add_with_match(&pdev->dev,
				&adreno_ops, match);
	else
		return adreno_bind(&pdev->dev);
}

static int adreno_remove(struct platform_device *pdev)
{
	if (of_find_matching_node(NULL, adreno_gmu_match))
		component_master_del(&pdev->dev, &adreno_ops);
	else
		adreno_unbind(&pdev->dev);

	return 0;
}