Linux Audio

Check our new training course

Loading...
Note: File does not exist in v3.15.
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 4 */
 5
 6#ifndef __EDP_CONNECTOR_H__
 7#define __EDP_CONNECTOR_H__
 8
 9#include <linux/i2c.h>
10#include <linux/interrupt.h>
11#include <linux/kernel.h>
12#include <linux/platform_device.h>
13#include <drm/drm_bridge.h>
14#include <drm/drm_crtc.h>
15#include <drm/drm_dp_helper.h>
16
17#include "msm_drv.h"
18
19#define edp_read(offset) msm_readl((offset))
20#define edp_write(offset, data) msm_writel((data), (offset))
21
22struct edp_ctrl;
23struct edp_aux;
24struct edp_phy;
25
26struct msm_edp {
27	struct drm_device *dev;
28	struct platform_device *pdev;
29
30	struct drm_connector *connector;
31	struct drm_bridge *bridge;
32
33	/* the encoder we are hooked to (outside of eDP block) */
34	struct drm_encoder *encoder;
35
36	struct edp_ctrl *ctrl;
37
38	int irq;
39};
40
41/* eDP bridge */
42struct drm_bridge *msm_edp_bridge_init(struct msm_edp *edp);
43void edp_bridge_destroy(struct drm_bridge *bridge);
44
45/* eDP connector */
46struct drm_connector *msm_edp_connector_init(struct msm_edp *edp);
47
48/* AUX */
49void *msm_edp_aux_init(struct msm_edp *edp, void __iomem *regbase, struct drm_dp_aux **drm_aux);
50void msm_edp_aux_destroy(struct device *dev, struct edp_aux *aux);
51irqreturn_t msm_edp_aux_irq(struct edp_aux *aux, u32 isr);
52void msm_edp_aux_ctrl(struct edp_aux *aux, int enable);
53
54/* Phy */
55bool msm_edp_phy_ready(struct edp_phy *phy);
56void msm_edp_phy_ctrl(struct edp_phy *phy, int enable);
57void msm_edp_phy_vm_pe_init(struct edp_phy *phy);
58void msm_edp_phy_vm_pe_cfg(struct edp_phy *phy, u32 v0, u32 v1);
59void msm_edp_phy_lane_power_ctrl(struct edp_phy *phy, bool up, u32 max_lane);
60void *msm_edp_phy_init(struct device *dev, void __iomem *regbase);
61
62/* Ctrl */
63irqreturn_t msm_edp_ctrl_irq(struct edp_ctrl *ctrl);
64void msm_edp_ctrl_power(struct edp_ctrl *ctrl, bool on);
65int msm_edp_ctrl_init(struct msm_edp *edp);
66void msm_edp_ctrl_destroy(struct edp_ctrl *ctrl);
67bool msm_edp_ctrl_panel_connected(struct edp_ctrl *ctrl);
68int msm_edp_ctrl_get_panel_info(struct edp_ctrl *ctrl,
69	struct drm_connector *connector, struct edid **edid);
70int msm_edp_ctrl_timing_cfg(struct edp_ctrl *ctrl,
71				const struct drm_display_mode *mode,
72				const struct drm_display_info *info);
73/* @pixel_rate is in kHz */
74bool msm_edp_ctrl_pixel_clock_valid(struct edp_ctrl *ctrl,
75	u32 pixel_rate, u32 *pm, u32 *pn);
76
77#endif /* __EDP_CONNECTOR_H__ */