aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/mipi.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/drivers/gpu/host1x/mipi.c b/drivers/gpu/host1x/mipi.c
index 52a6fd224127..e00809d996a2 100644
--- a/drivers/gpu/host1x/mipi.c
+++ b/drivers/gpu/host1x/mipi.c
@@ -242,20 +242,6 @@ struct tegra_mipi_device *tegra_mipi_request(struct device *device)
dev->pads = args.args[0];
dev->device = device;
- mutex_lock(&dev->mipi->lock);
-
- if (dev->mipi->usage_count++ == 0) {
- err = tegra_mipi_power_up(dev->mipi);
- if (err < 0) {
- dev_err(dev->mipi->dev,
- "failed to power up MIPI bricks: %d\n",
- err);
- return ERR_PTR(err);
- }
- }
-
- mutex_unlock(&dev->mipi->lock);
-
return dev;
put:
@@ -270,29 +256,42 @@ EXPORT_SYMBOL(tegra_mipi_request);
void tegra_mipi_free(struct tegra_mipi_device *device)
{
- int err;
+ platform_device_put(device->pdev);
+ kfree(device);
+}
+EXPORT_SYMBOL(tegra_mipi_free);
- mutex_lock(&device->mipi->lock);
+int tegra_mipi_enable(struct tegra_mipi_device *dev)
+{
+ int err = 0;
- if (--device->mipi->usage_count == 0) {
- err = tegra_mipi_power_down(device->mipi);
- if (err < 0) {
- /*
- * Not much that can be done here, so an error message
- * will have to do.
- */
- dev_err(device->mipi->dev,
- "failed to power down MIPI bricks: %d\n",
- err);
- }
- }
+ mutex_lock(&dev->mipi->lock);
- mutex_unlock(&device->mipi->lock);
+ if (dev->mipi->usage_count++ == 0)
+ err = tegra_mipi_power_up(dev->mipi);
+
+ mutex_unlock(&dev->mipi->lock);
+
+ return err;
- platform_device_put(device->pdev);
- kfree(device);
}
-EXPORT_SYMBOL(tegra_mipi_free);
+EXPORT_SYMBOL(tegra_mipi_enable);
+
+int tegra_mipi_disable(struct tegra_mipi_device *dev)
+{
+ int err = 0;
+
+ mutex_lock(&dev->mipi->lock);
+
+ if (--dev->mipi->usage_count == 0)
+ err = tegra_mipi_power_down(dev->mipi);
+
+ mutex_unlock(&dev->mipi->lock);
+
+ return err;
+
+}
+EXPORT_SYMBOL(tegra_mipi_disable);
static int tegra_mipi_wait(struct tegra_mipi *mipi)
{
ection while cloning"Johannes Schindelin2-27/+1 2024-05-21init: use the correct path of the templates directory againJohannes Schindelin1-1/+1 2024-05-21hook: plug a new memory leakJohannes Schindelin1-1/+3 2024-05-21ci: stop installing "gcc-13" for osx-gccJeff King1-1/+0 2024-05-21ci: avoid bare "gcc" for osx-gcc jobJeff King1-1/+1 2024-05-21ci: drop mention of BREW_INSTALL_PACKAGES variableJeff King1-2/+0 2024-05-21send-email: avoid creating more than one Term::ReadLine objectJeff King2-7/+16 2024-05-21send-email: drop FakeTerm hackJeff King1-20/+2 2024-04-19Git 2.44.1v2.44.1Johannes Schindelin3-2/+10 2024-04-19Git 2.43.4v2.43.4Johannes Schindelin3-2/+9 2024-04-19Git 2.42.2v2.42.2Johannes Schindelin3-2/+9 2024-04-19Git 2.41.1v2.41.1Johannes Schindelin3-2/+9 2024-04-19Git 2.40.2v2.40.2Johannes Schindelin3-2/+9 2024-04-19Git 2.39.4v2.39.4Johannes Schindelin3-2/+81 2024-04-19fsck: warn about symlink pointing inside a gitdirJohannes Schindelin4-0/+117 2024-04-19core.hooksPath: add some protection while cloningJohannes Schindelin2-1/+27 2024-04-19init.templateDir: consider this config setting protectedJohannes Schindelin2-7/+61 2024-04-19clone: prevent hooks from running during a cloneJohannes Schindelin3-1/+94 2024-04-19Add a helper function to compare file contentsJohannes Schindelin4-0/+123 2024-04-17init: refactor the template directory discovery into its own functionJohannes Schindelin3-18/+37 2024-04-17find_hook(): refactor the `STRIP_EXTENSION` logicJohannes Schindelin1-7/+11 2024-04-17clone: when symbolic links collide with directories, keep the latterJohannes Schindelin3-2/+31 2024-04-17entry: report more colliding pathsJohannes Schindelin3-1/+20 2024-04-17t5510: verify that D/F confusion cannot lead to an RCEJohannes Schindelin1-0/+24 2024-04-17submodule: require the submodule path to contain directories onlyJohannes Schindelin4-5/+113 2024-04-17clone_submodule: avoid using `access()` on directoriesJohannes Schindelin1-1/+1 2024-04-17submodules: submodule paths must not contain symlinksJohannes Schindelin2-0/+83 2024-04-17clone: prevent clashing git dirs when cloning submodule in parallelFilip Hejsek3-2/+66