@@ -236,6 +236,21 @@ void tegra_output_connector_destroy(struct drm_connector *connector);
void tegra_output_encoder_destroy(struct drm_encoder *encoder);
+static inline int devm_acquire_tegra_output(struct device *dev,
+ const struct devm_resource *resource)
+{
+ struct tegra_output *output = dev_get_drvdata(dev) + resource->offset;
+
+ output->dev = dev;
+
+ return tegra_output_probe(output);
+}
+
+#define DEVM_TEGRA_OUTPUT(_struct, _member) { \
+ .initfunc = devm_acquire_tegra_output, \
+ .offset = offsetof_t(struct _struct, _member, struct tegra_output), \
+}
+
/* from dpaux.c */
struct tegra_dpaux;
struct drm_dp_link;
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> --- drivers/gpu/drm/tegra/drm.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)