drm/msm/hdmi: Enable HPD after HDMI IRQ is set up
[linux/fpc-iii.git] / drivers / gpu / drm / sun4i / sun6i_mipi_dsi.h
blobdbbc5b3ecbdabcdb68e62a030c928cd484bb9e42
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (c) 2016 Allwinnertech Co., Ltd.
4 * Copyright (C) 2017-2018 Bootlin
6 * Maxime Ripard <maxime.ripard@bootlin.com>
7 */
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>
16 struct sun6i_dphy {
17 struct clk *bus_clk;
18 struct clk *mod_clk;
19 struct regmap *regs;
20 struct reset_control *reset;
23 struct sun6i_dsi {
24 struct drm_connector connector;
25 struct drm_encoder encoder;
26 struct mipi_dsi_host host;
28 struct clk *bus_clk;
29 struct clk *mod_clk;
30 struct regmap *regs;
31 struct reset_control *reset;
32 struct sun6i_dphy *dphy;
34 struct device *dev;
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_ */