Commit | Line | Data |
---|---|---|
d219673d BG |
1 | /* |
2 | * Copyright (C) STMicroelectronics SA 2014 | |
3 | * Authors: Benjamin Gaignard <benjamin.gaignard@st.com> | |
4 | * Fabien Dessenne <fabien.dessenne@st.com> | |
5 | * for STMicroelectronics. | |
6 | * License terms: GNU General Public License (GPL), version 2 | |
7 | */ | |
8 | ||
9 | #ifndef _STI_COMPOSITOR_H_ | |
10 | #define _STI_COMPOSITOR_H_ | |
11 | ||
12 | #include <linux/clk.h> | |
13 | #include <linux/kernel.h> | |
14 | ||
d219673d | 15 | #include "sti_mixer.h" |
9e1f05b2 | 16 | #include "sti_plane.h" |
d219673d BG |
17 | |
18 | #define WAIT_NEXT_VSYNC_MS 50 /*ms*/ | |
19 | ||
d219673d | 20 | #define STI_MAX_MIXER 2 |
871bcdfe | 21 | #define STI_MAX_VID 1 |
d219673d BG |
22 | |
23 | enum sti_compositor_subdev_type { | |
24 | STI_MIXER_MAIN_SUBDEV, | |
25 | STI_MIXER_AUX_SUBDEV, | |
26 | STI_GPD_SUBDEV, | |
27 | STI_VID_SUBDEV, | |
28 | STI_CURSOR_SUBDEV, | |
29 | }; | |
30 | ||
31 | struct sti_compositor_subdev_descriptor { | |
32 | enum sti_compositor_subdev_type type; | |
33 | int id; | |
34 | unsigned int offset; | |
35 | }; | |
36 | ||
37 | /** | |
38 | * STI Compositor data structure | |
39 | * | |
40 | * @nb_subdev: number of subdevices supported by the compositor | |
41 | * @subdev_desc: subdev list description | |
42 | */ | |
43 | #define MAX_SUBDEV 9 | |
44 | struct sti_compositor_data { | |
45 | unsigned int nb_subdev; | |
46 | struct sti_compositor_subdev_descriptor subdev_desc[MAX_SUBDEV]; | |
47 | }; | |
48 | ||
49 | /** | |
50 | * STI Compositor structure | |
51 | * | |
52 | * @dev: driver device | |
53 | * @regs: registers (main) | |
54 | * @data: device data | |
55 | * @clk_compo_main: clock for main compo | |
56 | * @clk_compo_aux: clock for aux compo | |
57 | * @clk_pix_main: pixel clock for main path | |
58 | * @clk_pix_aux: pixel clock for aux path | |
59 | * @rst_main: reset control of the main path | |
60 | * @rst_aux: reset control of the aux path | |
61 | * @mixer: array of mixers | |
871bcdfe | 62 | * @vid: array of vids |
d219673d BG |
63 | * @vtg_main: vtg for main data path |
64 | * @vtg_aux: vtg for auxillary data path | |
d219673d BG |
65 | * @vtg_vblank_nb: callback for VTG VSYNC notification |
66 | */ | |
67 | struct sti_compositor { | |
68 | struct device *dev; | |
69 | void __iomem *regs; | |
70 | struct sti_compositor_data data; | |
71 | struct clk *clk_compo_main; | |
72 | struct clk *clk_compo_aux; | |
73 | struct clk *clk_pix_main; | |
74 | struct clk *clk_pix_aux; | |
75 | struct reset_control *rst_main; | |
76 | struct reset_control *rst_aux; | |
77 | struct sti_mixer *mixer[STI_MAX_MIXER]; | |
871bcdfe | 78 | struct sti_vid *vid[STI_MAX_VID]; |
d219673d BG |
79 | struct sti_vtg *vtg_main; |
80 | struct sti_vtg *vtg_aux; | |
d219673d BG |
81 | struct notifier_block vtg_vblank_nb; |
82 | }; | |
83 | ||
83af0a48 BG |
84 | int sti_compositor_debufs_init(struct sti_compositor *compo, |
85 | struct drm_minor *minor); | |
86 | ||
d219673d | 87 | #endif |