Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) STMicroelectronics SA 2014
0004  * Authors: Benjamin Gaignard <benjamin.gaignard@st.com>
0005  *          Fabien Dessenne <fabien.dessenne@st.com>
0006  *          for STMicroelectronics.
0007  */
0008 
0009 #ifndef _STI_COMPOSITOR_H_
0010 #define _STI_COMPOSITOR_H_
0011 
0012 #include <linux/clk.h>
0013 #include <linux/kernel.h>
0014 
0015 #include "sti_mixer.h"
0016 #include "sti_plane.h"
0017 
0018 #define WAIT_NEXT_VSYNC_MS      50 /*ms*/
0019 
0020 #define STI_MAX_MIXER 2
0021 #define STI_MAX_VID   1
0022 
0023 enum sti_compositor_subdev_type {
0024     STI_MIXER_MAIN_SUBDEV,
0025     STI_MIXER_AUX_SUBDEV,
0026     STI_GPD_SUBDEV,
0027     STI_VID_SUBDEV,
0028     STI_CURSOR_SUBDEV,
0029 };
0030 
0031 struct sti_compositor_subdev_descriptor {
0032     enum sti_compositor_subdev_type type;
0033     int id;
0034     unsigned int offset;
0035 };
0036 
0037 /**
0038  * STI Compositor data structure
0039  *
0040  * @nb_subdev: number of subdevices supported by the compositor
0041  * @subdev_desc: subdev list description
0042  */
0043 #define MAX_SUBDEV 9
0044 struct sti_compositor_data {
0045     unsigned int nb_subdev;
0046     struct sti_compositor_subdev_descriptor subdev_desc[MAX_SUBDEV];
0047 };
0048 
0049 /**
0050  * STI Compositor structure
0051  *
0052  * @dev: driver device
0053  * @regs: registers (main)
0054  * @data: device data
0055  * @clk_compo_main: clock for main compo
0056  * @clk_compo_aux: clock for aux compo
0057  * @clk_pix_main: pixel clock for main path
0058  * @clk_pix_aux: pixel clock for aux path
0059  * @rst_main: reset control of the main path
0060  * @rst_aux: reset control of the aux path
0061  * @mixer: array of mixers
0062  * @vid: array of vids
0063  * @vtg: array of vtgs
0064  * @vtg_vblank_nb: array of callbacks for VTG VSYNC notification
0065  */
0066 struct sti_compositor {
0067     struct device *dev;
0068     void __iomem *regs;
0069     struct sti_compositor_data data;
0070     struct clk *clk_compo_main;
0071     struct clk *clk_compo_aux;
0072     struct clk *clk_pix_main;
0073     struct clk *clk_pix_aux;
0074     struct reset_control *rst_main;
0075     struct reset_control *rst_aux;
0076     struct sti_mixer *mixer[STI_MAX_MIXER];
0077     struct sti_vid *vid[STI_MAX_VID];
0078     struct sti_vtg *vtg[STI_MAX_MIXER];
0079     struct notifier_block vtg_vblank_nb[STI_MAX_MIXER];
0080 };
0081 
0082 void sti_compositor_debugfs_init(struct sti_compositor *compo,
0083                  struct drm_minor *minor);
0084 
0085 #endif