2 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #ifndef __EDP_CONNECTOR_H__
15 #define __EDP_CONNECTOR_H__
17 #include <linux/i2c.h>
18 #include <linux/interrupt.h>
19 #include <linux/kernel.h>
20 #include <linux/platform_device.h>
23 #include "drm_dp_helper.h"
26 #define edp_read(offset) msm_readl((offset))
27 #define edp_write(offset, data) msm_writel((data), (offset))
34 struct drm_device
*dev
;
35 struct platform_device
*pdev
;
37 struct drm_connector
*connector
;
38 struct drm_bridge
*bridge
;
40 /* the encoder we are hooked to (outside of eDP block) */
41 struct drm_encoder
*encoder
;
43 struct edp_ctrl
*ctrl
;
49 struct drm_bridge
*msm_edp_bridge_init(struct msm_edp
*edp
);
50 void edp_bridge_destroy(struct drm_bridge
*bridge
);
53 struct drm_connector
*msm_edp_connector_init(struct msm_edp
*edp
);
56 void *msm_edp_aux_init(struct device
*dev
, void __iomem
*regbase
,
57 struct drm_dp_aux
**drm_aux
);
58 void msm_edp_aux_destroy(struct device
*dev
, struct edp_aux
*aux
);
59 irqreturn_t
msm_edp_aux_irq(struct edp_aux
*aux
, u32 isr
);
60 void msm_edp_aux_ctrl(struct edp_aux
*aux
, int enable
);
63 bool msm_edp_phy_ready(struct edp_phy
*phy
);
64 void msm_edp_phy_ctrl(struct edp_phy
*phy
, int enable
);
65 void msm_edp_phy_vm_pe_init(struct edp_phy
*phy
);
66 void msm_edp_phy_vm_pe_cfg(struct edp_phy
*phy
, u32 v0
, u32 v1
);
67 void msm_edp_phy_lane_power_ctrl(struct edp_phy
*phy
, bool up
, u32 max_lane
);
68 void *msm_edp_phy_init(struct device
*dev
, void __iomem
*regbase
);
71 irqreturn_t
msm_edp_ctrl_irq(struct edp_ctrl
*ctrl
);
72 void msm_edp_ctrl_power(struct edp_ctrl
*ctrl
, bool on
);
73 int msm_edp_ctrl_init(struct msm_edp
*edp
);
74 void msm_edp_ctrl_destroy(struct edp_ctrl
*ctrl
);
75 bool msm_edp_ctrl_panel_connected(struct edp_ctrl
*ctrl
);
76 int msm_edp_ctrl_get_panel_info(struct edp_ctrl
*ctrl
,
77 struct drm_connector
*connector
, struct edid
**edid
);
78 int msm_edp_ctrl_timing_cfg(struct edp_ctrl
*ctrl
,
79 const struct drm_display_mode
*mode
,
80 const struct drm_display_info
*info
);
81 /* @pixel_rate is in kHz */
82 bool msm_edp_ctrl_pixel_clock_valid(struct edp_ctrl
*ctrl
,
83 u32 pixel_rate
, u32
*pm
, u32
*pn
);
85 #endif /* __EDP_CONNECTOR_H__ */