blob: bc6d6f6419a93751c4710e2cb9c38e8601df41f2 [file] [log] [blame]
Yannick Fertreb7590122017-04-14 12:13:34 +02001/*
2 * Copyright (C) STMicroelectronics SA 2017
3 *
4 * Authors: Philippe Cornu <philippe.cornu@st.com>
5 * Yannick Fertre <yannick.fertre@st.com>
6 * Fabien Dessenne <fabien.dessenne@st.com>
7 * Mickael Reulier <mickael.reulier@st.com>
8 *
9 * License terms: GNU General Public License (GPL), version 2
10 */
11
12#ifndef _LTDC_H_
13#define _LTDC_H_
14
15struct ltdc_caps {
16 u32 hw_version; /* hardware version */
17 u32 nb_layers; /* number of supported layers */
18 u32 reg_ofs; /* register offset for applicable regs */
19 u32 bus_width; /* bus width (32 or 64 bits) */
20 const u32 *pix_fmt_hw; /* supported pixel formats */
21};
22
23struct ltdc_device {
24 struct drm_fbdev_cma *fbdev;
25 void __iomem *regs;
26 struct clk *pixel_clk; /* lcd pixel clock */
Philippe CORNUbdf31bc2017-07-17 09:40:18 +020027 struct drm_bridge *bridge;
28 bool is_panel_bridge;
Yannick Fertreb7590122017-04-14 12:13:34 +020029 struct mutex err_lock; /* protecting error_status */
30 struct ltdc_caps caps;
Yannick Fertreb7590122017-04-14 12:13:34 +020031 u32 error_status;
32 u32 irq_status;
33};
34
35int ltdc_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe);
36void ltdc_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe);
37int ltdc_load(struct drm_device *ddev);
38void ltdc_unload(struct drm_device *ddev);
39
40#endif