mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
msm: kgsl: Unbind adreno from component device for nogmu
In absence of GMU adreno can’t bind it as component. So invoke adreno_bind/unbind() calls manually to succeed probe. Change-Id: I7a16ea4ca381dc9466e5827ef3f8b98a2aaf39fa Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
This commit is contained in:
parent
e21e07439d
commit
9255ec34c5
1 changed files with 27 additions and 14 deletions
|
|
@ -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,10 +1316,12 @@ int adreno_device_probe(struct platform_device *pdev,
|
|||
* Bind the GMU components (if applicable) before doing the KGSL
|
||||
* platform probe
|
||||
*/
|
||||
status = component_bind_all(dev, NULL);
|
||||
if (status) {
|
||||
kgsl_bus_close(device);
|
||||
return status;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1418,7 +1426,9 @@ int adreno_device_probe(struct platform_device *pdev,
|
|||
err:
|
||||
device->pdev = NULL;
|
||||
|
||||
component_unbind_all(dev, NULL);
|
||||
if (of_find_matching_node(dev->of_node, adreno_gmu_match))
|
||||
component_unbind_all(dev, NULL);
|
||||
|
||||
kgsl_bus_close(device);
|
||||
|
||||
return status;
|
||||
|
|
@ -1511,7 +1521,8 @@ static void adreno_unbind(struct device *dev)
|
|||
|
||||
kgsl_device_platform_remove(device);
|
||||
|
||||
component_unbind_all(dev, NULL);
|
||||
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);
|
||||
clear_bit(ADRENO_DEVICE_INITIALIZED, &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)
|
||||
{
|
||||
component_master_del(&pdev->dev, &adreno_ops);
|
||||
if (of_find_matching_node(NULL, adreno_gmu_match))
|
||||
component_master_del(&pdev->dev, &adreno_ops);
|
||||
else
|
||||
adreno_unbind(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue