Commit d1765575 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Philipp Zabel
Browse files

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: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent ac9b7554
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -362,6 +362,25 @@ __must_check devm_reset_control_get_exclusive_released(struct device *dev,
	return __devm_reset_control_get(dev, id, 0, false, false, false);
	return __devm_reset_control_get(dev, id, 0, false, false, false);
}
}


/**
 * 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()
 * devm_reset_control_get_shared - resource managed reset_control_get_shared()
 * @dev: device to be reset by the controller
 * @dev: device to be reset by the controller