crtc->port = port;
ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
- &ade_crtc_funcs, NULL);
+ ade_driver_data.crtc_funcs, NULL);
if (ret) {
DRM_ERROR("failed to init crtc.\n");
return ret;
}
- drm_crtc_helper_add(crtc, &ade_crtc_helper_funcs);
+ drm_crtc_helper_add(crtc, ade_driver_data.crtc_helper_funcs);
return 0;
}
if (ret)
return ret;
- ret = drm_universal_plane_init(dev, &kplane->base, 1, &ade_plane_funcs,
- fmts, fmts_cnt, NULL, type, NULL);
+ ret = drm_universal_plane_init(dev, &kplane->base, 1,
+ ade_driver_data.plane_funcs, fmts,
+ fmts_cnt, NULL, type, NULL);
if (ret) {
DRM_ERROR("fail to init plane, ch=%d\n", kplane->ch);
return ret;
}
- drm_plane_helper_add(&kplane->base, &ade_plane_helper_funcs);
+ drm_plane_helper_add(&kplane->base, ade_driver_data.plane_helper_funcs);
return 0;
}
}
struct kirin_drm_data ade_driver_data = {
+ .crtc_helper_funcs = &ade_crtc_helper_funcs,
+ .crtc_funcs = &ade_crtc_funcs,
+ .plane_helper_funcs = &ade_plane_helper_funcs,
+ .plane_funcs = &ade_plane_funcs,
.init = ade_drm_init,
.cleanup = ade_drm_cleanup
};
/* display controller init/cleanup ops */
struct kirin_drm_data {
+ const struct drm_crtc_helper_funcs *crtc_helper_funcs;
+ const struct drm_crtc_funcs *crtc_funcs;
+ const struct drm_plane_helper_funcs *plane_helper_funcs;
+ const struct drm_plane_funcs *plane_funcs;
+
int (*init)(struct platform_device *pdev);
void (*cleanup)(struct platform_device *pdev);
};