summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/hdmi/hdmi.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2013-08-30 13:02:15 -0400
committerDave Airlie <airlied@redhat.com>2013-09-02 10:23:35 +1000
commita3376e3ec81c5dd0622cbc187db76d2824d31c1c (patch)
tree22e4e13c73905a624692cbfd7c7a560d79597b67 /drivers/gpu/drm/msm/hdmi/hdmi.h
parent3b336ec4c5460833ad7573d0b6e22793f6a389ab (diff)
downloadlinux-a3376e3ec81c5dd0622cbc187db76d2824d31c1c.tar.gz
linux-a3376e3ec81c5dd0622cbc187db76d2824d31c1c.tar.bz2
linux-a3376e3ec81c5dd0622cbc187db76d2824d31c1c.zip
drm/msm: convert to drm_bridge
Drop the msm_connector base class, and special calls to base class methods from the encoder, and use instead drm_bridge. This allows for a cleaner division between the hdmi (and in future dsi) blocks, from the mdp block. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/msm/hdmi/hdmi.h')
-rw-r--r--drivers/gpu/drm/msm/hdmi/hdmi.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
index 34703fea22ca..2c2ec566394c 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.h
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
@@ -30,6 +30,8 @@
struct hdmi_phy;
struct hdmi {
+ struct kref refcount;
+
struct drm_device *dev;
struct platform_device *pdev;
@@ -45,6 +47,10 @@ struct hdmi {
struct hdmi_phy *phy;
struct i2c_adapter *i2c;
struct drm_connector *connector;
+ struct drm_bridge *bridge;
+
+ /* the encoder we are hooked to (outside of hdmi block) */
+ struct drm_encoder *encoder;
bool hdmi_mode; /* are we in hdmi mode? */
@@ -58,9 +64,7 @@ struct hdmi_platform_config {
};
void hdmi_set_mode(struct hdmi *hdmi, bool power_on);
-void hdmi_destroy(struct hdmi *hdmi);
-int hdmi_init(struct hdmi *hdmi, struct drm_device *dev,
- struct drm_connector *connector);
+void hdmi_destroy(struct kref *kref);
static inline void hdmi_write(struct hdmi *hdmi, u32 reg, u32 data)
{
@@ -72,6 +76,17 @@ static inline u32 hdmi_read(struct hdmi *hdmi, u32 reg)
return msm_readl(hdmi->mmio + reg);
}
+static inline struct hdmi * hdmi_reference(struct hdmi *hdmi)
+{
+ kref_get(&hdmi->refcount);
+ return hdmi;
+}
+
+static inline void hdmi_unreference(struct hdmi *hdmi)
+{
+ kref_put(&hdmi->refcount, hdmi_destroy);
+}
+
/*
* The phy appears to be different, for example between 8960 and 8x60,
* so split the phy related functions out and load the correct one at
@@ -89,17 +104,21 @@ struct hdmi_phy {
const struct hdmi_phy_funcs *funcs;
};
-/*
- * phy can be different on different generations:
- */
struct hdmi_phy *hdmi_phy_8960_init(struct hdmi *hdmi);
struct hdmi_phy *hdmi_phy_8x60_init(struct hdmi *hdmi);
/*
+ * hdmi bridge:
+ */
+
+struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi);
+
+/*
* hdmi connector:
*/
void hdmi_connector_irq(struct drm_connector *connector);
+struct drm_connector *hdmi_connector_init(struct hdmi *hdmi);
/*
* i2c adapter for ddc: