Commit 9e532b3a authored by Thierry Reding's avatar Thierry Reding

drm/tegra: dpaux: Disable interrupt when detached

When the DPAUX isn't attached to an SOR the interrupts are not useful.
This also prevents a race that could potentially cause a crash on driver
removal.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 3227166c
...@@ -352,6 +352,8 @@ static int tegra_dpaux_probe(struct platform_device *pdev) ...@@ -352,6 +352,8 @@ static int tegra_dpaux_probe(struct platform_device *pdev)
return err; return err;
} }
disable_irq(dpaux->irq);
dpaux->aux.transfer = tegra_dpaux_transfer; dpaux->aux.transfer = tegra_dpaux_transfer;
dpaux->aux.dev = &pdev->dev; dpaux->aux.dev = &pdev->dev;
...@@ -468,8 +470,10 @@ int tegra_dpaux_attach(struct tegra_dpaux *dpaux, struct tegra_output *output) ...@@ -468,8 +470,10 @@ int tegra_dpaux_attach(struct tegra_dpaux *dpaux, struct tegra_output *output)
enum drm_connector_status status; enum drm_connector_status status;
status = tegra_dpaux_detect(dpaux); status = tegra_dpaux_detect(dpaux);
if (status == connector_status_connected) if (status == connector_status_connected) {
enable_irq(dpaux->irq);
return 0; return 0;
}
usleep_range(1000, 2000); usleep_range(1000, 2000);
} }
...@@ -482,6 +486,8 @@ int tegra_dpaux_detach(struct tegra_dpaux *dpaux) ...@@ -482,6 +486,8 @@ int tegra_dpaux_detach(struct tegra_dpaux *dpaux)
unsigned long timeout; unsigned long timeout;
int err; int err;
disable_irq(dpaux->irq);
err = regulator_disable(dpaux->vdd); err = regulator_disable(dpaux->vdd);
if (err < 0) if (err < 0)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment