0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __MXSFB_DRV_H__
0009 #define __MXSFB_DRV_H__
0010
0011 #include <drm/drm_crtc.h>
0012 #include <drm/drm_device.h>
0013 #include <drm/drm_encoder.h>
0014 #include <drm/drm_plane.h>
0015
0016 struct clk;
0017
0018 struct mxsfb_devdata {
0019 unsigned int transfer_count;
0020 unsigned int cur_buf;
0021 unsigned int next_buf;
0022 unsigned int hs_wdth_mask;
0023 unsigned int hs_wdth_shift;
0024 bool has_overlay;
0025 bool has_ctrl2;
0026 bool has_crc32;
0027 };
0028
0029 struct mxsfb_drm_private {
0030 const struct mxsfb_devdata *devdata;
0031
0032 void __iomem *base;
0033 struct clk *clk;
0034 struct clk *clk_axi;
0035 struct clk *clk_disp_axi;
0036
0037 unsigned int irq;
0038
0039 struct drm_device *drm;
0040 struct {
0041 struct drm_plane primary;
0042 struct drm_plane overlay;
0043 } planes;
0044 struct drm_crtc crtc;
0045 struct drm_encoder encoder;
0046 struct drm_connector *connector;
0047 struct drm_bridge *bridge;
0048
0049 bool crc_active;
0050 };
0051
0052 static inline struct mxsfb_drm_private *
0053 to_mxsfb_drm_private(struct drm_device *drm)
0054 {
0055 return drm->dev_private;
0056 }
0057
0058 void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
0059 void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
0060
0061 int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb);
0062
0063 #endif