Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / mxsfb / mxsfb_drv.h
blob399d23e91ed10badde03b1c448b0c81c98633f2b
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Copyright (C) 2016 Marek Vasut <marex@denx.de>
5 * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver.
6 */
8 #ifndef __MXSFB_DRV_H__
9 #define __MXSFB_DRV_H__
11 #include <drm/drm_crtc.h>
12 #include <drm/drm_device.h>
13 #include <drm/drm_encoder.h>
14 #include <drm/drm_plane.h>
16 struct clk;
18 struct mxsfb_devdata {
19 unsigned int transfer_count;
20 unsigned int cur_buf;
21 unsigned int next_buf;
22 unsigned int hs_wdth_mask;
23 unsigned int hs_wdth_shift;
24 bool has_overlay;
27 struct mxsfb_drm_private {
28 const struct mxsfb_devdata *devdata;
30 void __iomem *base; /* registers */
31 struct clk *clk;
32 struct clk *clk_axi;
33 struct clk *clk_disp_axi;
35 struct drm_device *drm;
36 struct {
37 struct drm_plane primary;
38 struct drm_plane overlay;
39 } planes;
40 struct drm_crtc crtc;
41 struct drm_encoder encoder;
42 struct drm_connector *connector;
43 struct drm_bridge *bridge;
46 static inline struct mxsfb_drm_private *
47 to_mxsfb_drm_private(struct drm_device *drm)
49 return drm->dev_private;
52 void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
53 void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
55 int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb);
57 #endif /* __MXSFB_DRV_H__ */