summaryrefslogtreecommitdiff
path: root/include/drm/bridge/dw_mipi_dsi.h
blob: 9b30fec302c8cd84e0621b20e4c0ccc92cf24165 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (C) STMicroelectronics SA 2017
 *
 * Authors: Philippe Cornu <philippe.cornu@st.com>
 *          Yannick Fertre <yannick.fertre@st.com>
 *
 * License terms:  GNU General Public License (GPL), version 2
 */

#ifndef __DW_MIPI_DSI__
#define __DW_MIPI_DSI__

struct dw_mipi_dsi_phy_ops {
	int (*init)(void *priv_data);
	int (*get_lane_mbps)(void *priv_data, struct drm_display_mode *mode,
			     unsigned long mode_flags, u32 lanes, u32 format,
			     unsigned int *lane_mbps);
};

struct dw_mipi_dsi_plat_data {
	void __iomem *base;
	unsigned int max_data_lanes;

	enum drm_mode_status (*mode_valid)(void *priv_data,
					   const struct drm_display_mode *mode);

	const struct dw_mipi_dsi_phy_ops *phy_ops;

	void *priv_data;
};

int dw_mipi_dsi_probe(struct platform_device *pdev,
		      const struct dw_mipi_dsi_plat_data *plat_data);
void dw_mipi_dsi_remove(struct platform_device *pdev);
int dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
		     const struct dw_mipi_dsi_plat_data *plat_data);
void dw_mipi_dsi_unbind(struct device *dev);

#endif /* __DW_MIPI_DSI__ */