summaryrefslogtreecommitdiffstats
path: root/include/linux/reset.h
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2021-01-23 19:34:45 +0300
committerPhilipp Zabel <p.zabel@pengutronix.de>2021-01-25 17:32:10 +0100
commitd17655759b3fc660ea49bd7be665c193030c77c0 (patch)
tree90313be1c5d19d349460dc592d3f1bea86d10963 /include/linux/reset.h
parentac9b7554afeb455a74bd69dc4a8eecf49886ff48 (diff)
downloadlinux-d17655759b3fc660ea49bd7be665c193030c77c0.tar.gz
linux-d17655759b3fc660ea49bd7be665c193030c77c0.tar.bz2
linux-d17655759b3fc660ea49bd7be665c193030c77c0.zip
reset: Add devm_reset_control_get_optional_exclusive_released()
NVIDIA Tegra DRM and media drivers will need a resource-managed-optional variant of reset_control_get_exclusive_released() in order to switch away from a legacy Tegra-specific PD API to a GENPD API without much hassle. Add the new reset helper to the reset API. Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30 Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20 Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30 Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'include/linux/reset.h')
-rw-r--r--include/linux/reset.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 439fec7112a9..b9109efa2a5c 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -363,6 +363,25 @@ __must_check devm_reset_control_get_exclusive_released(struct device *dev,
}
/**
+ * devm_reset_control_get_optional_exclusive_released - resource managed
+ * reset_control_get_optional_exclusive_released()
+ * @dev: device to be reset by the controller
+ * @id: reset line name
+ *
+ * Managed-and-optional variant of reset_control_get_exclusive_released(). For
+ * reset controllers returned from this function, reset_control_put() is called
+ * automatically on driver detach.
+ *
+ * See reset_control_get_exclusive_released() for more information.
+ */
+static inline struct reset_control *
+__must_check devm_reset_control_get_optional_exclusive_released(struct device *dev,
+ const char *id)
+{
+ return __devm_reset_control_get(dev, id, 0, false, true, false);
+}
+
+/**
* devm_reset_control_get_shared - resource managed reset_control_get_shared()
* @dev: device to be reset by the controller
* @id: reset line name