Marek Vasut | 45d59d7 | 2016-08-18 20:23:01 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 Marek Vasut <marex@denx.de> |
| 3 | * |
| 4 | * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (at your option) any later version. |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #ifndef __MXSFB_DRV_H__ |
| 17 | #define __MXSFB_DRV_H__ |
| 18 | |
| 19 | struct mxsfb_devdata { |
| 20 | unsigned int transfer_count; |
| 21 | unsigned int cur_buf; |
| 22 | unsigned int next_buf; |
| 23 | unsigned int debug0; |
| 24 | unsigned int hs_wdth_mask; |
| 25 | unsigned int hs_wdth_shift; |
| 26 | unsigned int ipversion; |
| 27 | }; |
| 28 | |
| 29 | struct 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 | struct drm_simple_display_pipe pipe; |
| 38 | struct drm_connector connector; |
| 39 | struct drm_panel *panel; |
| 40 | struct drm_fbdev_cma *fbdev; |
| 41 | }; |
| 42 | |
| 43 | int mxsfb_setup_crtc(struct drm_device *dev); |
| 44 | int mxsfb_create_output(struct drm_device *dev); |
| 45 | |
| 46 | void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb); |
| 47 | void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb); |
| 48 | |
| 49 | void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb); |
| 50 | void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb); |
| 51 | void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb, |
| 52 | struct drm_plane_state *state); |
| 53 | |
| 54 | #endif /* __MXSFB_DRV_H__ */ |