162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) STMicroelectronics SA 2014
462306a36Sopenharmony_ci * Author: Benjamin Gaignard <benjamin.gaignard@st.com> for STMicroelectronics.
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#ifndef _STI_VTG_H_
862306a36Sopenharmony_ci#define _STI_VTG_H_
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#define VTG_TOP_FIELD_EVENT     1
1162306a36Sopenharmony_ci#define VTG_BOTTOM_FIELD_EVENT  2
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#define VTG_SYNC_ID_HDMI        1
1462306a36Sopenharmony_ci#define VTG_SYNC_ID_HDDCS       2
1562306a36Sopenharmony_ci#define VTG_SYNC_ID_HDF         3
1662306a36Sopenharmony_ci#define VTG_SYNC_ID_DVO         4
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_cistruct sti_vtg;
1962306a36Sopenharmony_cistruct drm_crtc;
2062306a36Sopenharmony_cistruct drm_display_mode;
2162306a36Sopenharmony_cistruct notifier_block;
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_cistruct sti_vtg *of_vtg_find(struct device_node *np);
2462306a36Sopenharmony_civoid sti_vtg_set_config(struct sti_vtg *vtg,
2562306a36Sopenharmony_ci		const struct drm_display_mode *mode);
2662306a36Sopenharmony_ciint sti_vtg_register_client(struct sti_vtg *vtg, struct notifier_block *nb,
2762306a36Sopenharmony_ci			    struct drm_crtc *crtc);
2862306a36Sopenharmony_ciint sti_vtg_unregister_client(struct sti_vtg *vtg,
2962306a36Sopenharmony_ci		struct notifier_block *nb);
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciu32 sti_vtg_get_line_number(struct drm_display_mode mode, int y);
3262306a36Sopenharmony_ciu32 sti_vtg_get_pixel_number(struct drm_display_mode mode, int x);
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#endif
35