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 struct drm_device; 12 13 struct mxsfb_devdata { 14 unsigned int transfer_count; 15 unsigned int cur_buf; 16 unsigned int next_buf; 17 unsigned int debug0; 18 unsigned int hs_wdth_mask; 19 unsigned int hs_wdth_shift; 20 unsigned int ipversion; 21 }; 22 23 struct mxsfb_drm_private { 24 const struct mxsfb_devdata *devdata; 25 26 void __iomem *base; /* registers */ 27 struct clk *clk; 28 struct clk *clk_axi; 29 struct clk *clk_disp_axi; 30 31 struct drm_device *drm; 32 struct drm_simple_display_pipe pipe; 33 struct drm_connector *connector; 34 struct drm_bridge *bridge; 35 }; 36 37 int mxsfb_setup_crtc(struct drm_device *dev); 38 int mxsfb_create_output(struct drm_device *dev); 39 40 void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb); 41 void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb); 42 43 void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb); 44 void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb); 45 void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, 46 struct drm_plane_state *state); 47 48 #endif /* __MXSFB_DRV_H__ */ 49