xref: /linux/drivers/gpu/drm/mxsfb/mxsfb_drv.h (revision c42001e357f7de11e882f54461be27757a7fe51a)
1c942fddfSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
245d59d70SMarek Vasut /*
345d59d70SMarek Vasut  * Copyright (C) 2016 Marek Vasut <marex@denx.de>
445d59d70SMarek Vasut  *
545d59d70SMarek Vasut  * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver.
645d59d70SMarek Vasut  */
745d59d70SMarek Vasut 
845d59d70SMarek Vasut #ifndef __MXSFB_DRV_H__
945d59d70SMarek Vasut #define __MXSFB_DRV_H__
1045d59d70SMarek Vasut 
11*c42001e3SLaurent Pinchart struct drm_device;
12*c42001e3SLaurent Pinchart 
1345d59d70SMarek Vasut struct mxsfb_devdata {
1445d59d70SMarek Vasut 	unsigned int	 transfer_count;
1545d59d70SMarek Vasut 	unsigned int	 cur_buf;
1645d59d70SMarek Vasut 	unsigned int	 next_buf;
1745d59d70SMarek Vasut 	unsigned int	 debug0;
1845d59d70SMarek Vasut 	unsigned int	 hs_wdth_mask;
1945d59d70SMarek Vasut 	unsigned int	 hs_wdth_shift;
2045d59d70SMarek Vasut 	unsigned int	 ipversion;
2145d59d70SMarek Vasut };
2245d59d70SMarek Vasut 
2345d59d70SMarek Vasut struct mxsfb_drm_private {
2445d59d70SMarek Vasut 	const struct mxsfb_devdata	*devdata;
2545d59d70SMarek Vasut 
2645d59d70SMarek Vasut 	void __iomem			*base;	/* registers */
2745d59d70SMarek Vasut 	struct clk			*clk;
2845d59d70SMarek Vasut 	struct clk			*clk_axi;
2945d59d70SMarek Vasut 	struct clk			*clk_disp_axi;
3045d59d70SMarek Vasut 
31*c42001e3SLaurent Pinchart 	struct drm_device		*drm;
3245d59d70SMarek Vasut 	struct drm_simple_display_pipe	pipe;
33d0234043SRobert Chiras 	struct drm_connector		*connector;
34d0234043SRobert Chiras 	struct drm_bridge		*bridge;
3545d59d70SMarek Vasut };
3645d59d70SMarek Vasut 
3745d59d70SMarek Vasut int mxsfb_setup_crtc(struct drm_device *dev);
3845d59d70SMarek Vasut int mxsfb_create_output(struct drm_device *dev);
3945d59d70SMarek Vasut 
4045d59d70SMarek Vasut void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
4145d59d70SMarek Vasut void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
4245d59d70SMarek Vasut 
4345d59d70SMarek Vasut void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb);
4445d59d70SMarek Vasut void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb);
4545d59d70SMarek Vasut void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb,
4645d59d70SMarek Vasut 			       struct drm_plane_state *state);
4745d59d70SMarek Vasut 
4845d59d70SMarek Vasut #endif /* __MXSFB_DRV_H__ */
49