1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Allwinnertech Co., Ltd.
4 * Copyright (C) 2017-2018 Bootlin
6 * Maxime Ripard <maxime.ripard@bootlin.com>
9 #ifndef _SUN6I_MIPI_DSI_H_
10 #define _SUN6I_MIPI_DSI_H_
12 #include <drm/drm_connector.h>
13 #include <drm/drm_encoder.h>
14 #include <drm/drm_mipi_dsi.h>
20 struct reset_control
*reset
;
24 struct drm_connector connector
;
25 struct drm_encoder encoder
;
26 struct mipi_dsi_host host
;
31 struct reset_control
*reset
;
32 struct sun6i_dphy
*dphy
;
35 struct sun4i_drv
*drv
;
36 struct mipi_dsi_device
*device
;
37 struct drm_panel
*panel
;
40 static inline struct sun6i_dsi
*host_to_sun6i_dsi(struct mipi_dsi_host
*host
)
42 return container_of(host
, struct sun6i_dsi
, host
);
45 static inline struct sun6i_dsi
*connector_to_sun6i_dsi(struct drm_connector
*connector
)
47 return container_of(connector
, struct sun6i_dsi
, connector
);
50 static inline struct sun6i_dsi
*encoder_to_sun6i_dsi(const struct drm_encoder
*encoder
)
52 return container_of(encoder
, struct sun6i_dsi
, encoder
);
55 int sun6i_dphy_probe(struct sun6i_dsi
*dsi
, struct device_node
*node
);
56 int sun6i_dphy_remove(struct sun6i_dsi
*dsi
);
58 int sun6i_dphy_init(struct sun6i_dphy
*dphy
, unsigned int lanes
);
59 int sun6i_dphy_power_on(struct sun6i_dphy
*dphy
, unsigned int lanes
);
60 int sun6i_dphy_power_off(struct sun6i_dphy
*dphy
);
61 int sun6i_dphy_exit(struct sun6i_dphy
*dphy
);
63 #endif /* _SUN6I_MIPI_DSI_H_ */