Loading...
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2016 Marek Vasut <marex@denx.de>
4 *
5 * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver.
6 */
7
8#ifndef __MXSFB_DRV_H__
9#define __MXSFB_DRV_H__
10
11struct mxsfb_devdata {
12 unsigned int transfer_count;
13 unsigned int cur_buf;
14 unsigned int next_buf;
15 unsigned int debug0;
16 unsigned int hs_wdth_mask;
17 unsigned int hs_wdth_shift;
18 unsigned int ipversion;
19};
20
21struct mxsfb_drm_private {
22 const struct mxsfb_devdata *devdata;
23
24 void __iomem *base; /* registers */
25 struct clk *clk;
26 struct clk *clk_axi;
27 struct clk *clk_disp_axi;
28
29 struct drm_simple_display_pipe pipe;
30 struct drm_connector connector;
31 struct drm_panel *panel;
32};
33
34int mxsfb_setup_crtc(struct drm_device *dev);
35int mxsfb_create_output(struct drm_device *dev);
36
37void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
38void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
39
40void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb);
41void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb);
42void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb,
43 struct drm_plane_state *state);
44
45#endif /* __MXSFB_DRV_H__ */
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2016 Marek Vasut <marex@denx.de>
4 *
5 * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver.
6 */
7
8#ifndef __MXSFB_DRV_H__
9#define __MXSFB_DRV_H__
10
11#include <drm/drm_crtc.h>
12#include <drm/drm_device.h>
13#include <drm/drm_encoder.h>
14#include <drm/drm_plane.h>
15
16struct clk;
17
18struct 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;
25 bool has_ctrl2;
26 bool has_crc32;
27};
28
29struct mxsfb_drm_private {
30 const struct mxsfb_devdata *devdata;
31
32 void __iomem *base; /* registers */
33 struct clk *clk;
34 struct clk *clk_axi;
35 struct clk *clk_disp_axi;
36
37 unsigned int irq;
38
39 struct drm_device *drm;
40 struct {
41 struct drm_plane primary;
42 struct drm_plane overlay;
43 } planes;
44 struct drm_crtc crtc;
45 struct drm_encoder encoder;
46 struct drm_connector *connector;
47 struct drm_bridge *bridge;
48
49 bool crc_active;
50};
51
52static inline struct mxsfb_drm_private *
53to_mxsfb_drm_private(struct drm_device *drm)
54{
55 return drm->dev_private;
56}
57
58void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
59void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
60
61int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb);
62
63#endif /* __MXSFB_DRV_H__ */