2019-06-03 13:44:50 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Red Hat
|
|
|
|
* Author: Rob Clark <robdclark@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __HDMI_CONNECTOR_H__
|
|
|
|
#define __HDMI_CONNECTOR_H__
|
|
|
|
|
|
|
|
#include <linux/i2c.h>
|
|
|
|
#include <linux/clk.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <linux/regulator/consumer.h>
|
2019-06-29 20:59:31 +08:00
|
|
|
#include <linux/gpio/consumer.h>
|
2013-12-12 03:44:02 +08:00
|
|
|
#include <linux/hdmi.h>
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
2019-08-26 23:26:29 +08:00
|
|
|
#include <drm/drm_bridge.h>
|
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
#include "msm_drv.h"
|
|
|
|
#include "hdmi.xml.h"
|
|
|
|
|
2016-02-25 13:52:36 +08:00
|
|
|
#define HDMI_MAX_NUM_GPIO 6
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
|
|
|
struct hdmi_phy;
|
2013-12-02 01:12:54 +08:00
|
|
|
struct hdmi_platform_config;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
2016-02-25 13:52:36 +08:00
|
|
|
struct hdmi_gpio_data {
|
2019-06-29 20:59:31 +08:00
|
|
|
struct gpio_desc *gpiod;
|
2016-02-25 13:52:36 +08:00
|
|
|
bool output;
|
|
|
|
int value;
|
|
|
|
};
|
|
|
|
|
2013-12-12 03:44:02 +08:00
|
|
|
struct hdmi_audio {
|
|
|
|
bool enabled;
|
|
|
|
struct hdmi_audio_infoframe infoframe;
|
|
|
|
int rate;
|
|
|
|
};
|
|
|
|
|
2015-04-03 05:49:01 +08:00
|
|
|
struct hdmi_hdcp_ctrl;
|
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
struct hdmi {
|
|
|
|
struct drm_device *dev;
|
|
|
|
struct platform_device *pdev;
|
2016-06-10 17:45:56 +08:00
|
|
|
struct platform_device *audio_pdev;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
2013-12-02 01:12:54 +08:00
|
|
|
const struct hdmi_platform_config *config;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
2013-12-12 03:44:02 +08:00
|
|
|
/* audio state: */
|
|
|
|
struct hdmi_audio audio;
|
|
|
|
|
|
|
|
/* video state: */
|
|
|
|
bool power_on;
|
|
|
|
unsigned long int pixclock;
|
|
|
|
|
2013-12-02 01:12:54 +08:00
|
|
|
void __iomem *mmio;
|
2015-04-03 05:49:01 +08:00
|
|
|
void __iomem *qfprom_mmio;
|
|
|
|
phys_addr_t mmio_phy_addr;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
2015-01-14 03:33:40 +08:00
|
|
|
struct regulator **hpd_regs;
|
|
|
|
struct regulator **pwr_regs;
|
|
|
|
struct clk **hpd_clks;
|
|
|
|
struct clk **pwr_clks;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
|
|
|
struct hdmi_phy *phy;
|
2016-02-25 13:52:40 +08:00
|
|
|
struct device *phy_dev;
|
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
struct i2c_adapter *i2c;
|
|
|
|
struct drm_connector *connector;
|
2013-08-31 01:02:15 +08:00
|
|
|
struct drm_bridge *bridge;
|
|
|
|
|
|
|
|
/* the encoder we are hooked to (outside of hdmi block) */
|
|
|
|
struct drm_encoder *encoder;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
|
|
|
bool hdmi_mode; /* are we in hdmi mode? */
|
|
|
|
|
|
|
|
int irq;
|
2015-04-03 05:49:01 +08:00
|
|
|
struct workqueue_struct *workq;
|
|
|
|
|
|
|
|
struct hdmi_hdcp_ctrl *hdcp_ctrl;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* spinlock to protect registers shared by different execution
|
|
|
|
* REG_HDMI_CTRL
|
|
|
|
* REG_HDMI_DDC_ARBITRATION
|
|
|
|
* REG_HDMI_HDCP_INT_CTRL
|
|
|
|
* REG_HDMI_HPD_CTRL
|
|
|
|
*/
|
|
|
|
spinlock_t reg_lock;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* platform config data (ie. from DT, or pdata) */
|
|
|
|
struct hdmi_platform_config {
|
2013-12-02 01:12:54 +08:00
|
|
|
const char *mmio_name;
|
2015-04-03 05:49:01 +08:00
|
|
|
const char *qfprom_mmio_name;
|
2013-12-02 01:12:54 +08:00
|
|
|
|
|
|
|
/* regulators that need to be on for hpd: */
|
|
|
|
const char **hpd_reg_names;
|
|
|
|
int hpd_reg_cnt;
|
|
|
|
|
|
|
|
/* regulators that need to be on for screen pwr: */
|
|
|
|
const char **pwr_reg_names;
|
|
|
|
int pwr_reg_cnt;
|
|
|
|
|
|
|
|
/* clks that need to be on for hpd: */
|
|
|
|
const char **hpd_clk_names;
|
2014-06-06 22:03:32 +08:00
|
|
|
const long unsigned *hpd_freq;
|
2013-12-02 01:12:54 +08:00
|
|
|
int hpd_clk_cnt;
|
|
|
|
|
|
|
|
/* clks that need to be on for screen pwr (ie pixel clk): */
|
|
|
|
const char **pwr_clk_names;
|
|
|
|
int pwr_clk_cnt;
|
|
|
|
|
|
|
|
/* gpio's: */
|
2016-02-25 13:52:36 +08:00
|
|
|
struct hdmi_gpio_data gpios[HDMI_MAX_NUM_GPIO];
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
};
|
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
|
|
|
static inline void hdmi_write(struct hdmi *hdmi, u32 reg, u32 data)
|
|
|
|
{
|
|
|
|
msm_writel(data, hdmi->mmio + reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline u32 hdmi_read(struct hdmi *hdmi, u32 reg)
|
|
|
|
{
|
|
|
|
return msm_readl(hdmi->mmio + reg);
|
|
|
|
}
|
|
|
|
|
2015-04-03 05:49:01 +08:00
|
|
|
static inline u32 hdmi_qfprom_read(struct hdmi *hdmi, u32 reg)
|
|
|
|
{
|
|
|
|
return msm_readl(hdmi->qfprom_mmio + reg);
|
|
|
|
}
|
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
/*
|
2016-02-25 13:52:38 +08:00
|
|
|
* hdmi phy:
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
*/
|
|
|
|
|
2016-02-25 13:52:38 +08:00
|
|
|
enum hdmi_phy_type {
|
|
|
|
MSM_HDMI_PHY_8x60,
|
|
|
|
MSM_HDMI_PHY_8960,
|
|
|
|
MSM_HDMI_PHY_8x74,
|
2016-02-25 13:52:44 +08:00
|
|
|
MSM_HDMI_PHY_8996,
|
2016-02-25 13:52:38 +08:00
|
|
|
MSM_HDMI_PHY_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hdmi_phy_cfg {
|
|
|
|
enum hdmi_phy_type type;
|
|
|
|
void (*powerup)(struct hdmi_phy *phy, unsigned long int pixclock);
|
|
|
|
void (*powerdown)(struct hdmi_phy *phy);
|
|
|
|
const char * const *reg_names;
|
|
|
|
int num_regs;
|
|
|
|
const char * const *clk_names;
|
|
|
|
int num_clks;
|
|
|
|
};
|
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
extern const struct hdmi_phy_cfg msm_hdmi_phy_8x60_cfg;
|
|
|
|
extern const struct hdmi_phy_cfg msm_hdmi_phy_8960_cfg;
|
|
|
|
extern const struct hdmi_phy_cfg msm_hdmi_phy_8x74_cfg;
|
|
|
|
extern const struct hdmi_phy_cfg msm_hdmi_phy_8996_cfg;
|
2016-02-25 13:52:38 +08:00
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
struct hdmi_phy {
|
2016-02-25 13:52:38 +08:00
|
|
|
struct platform_device *pdev;
|
|
|
|
void __iomem *mmio;
|
|
|
|
struct hdmi_phy_cfg *cfg;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
const struct hdmi_phy_funcs *funcs;
|
2016-02-25 13:52:38 +08:00
|
|
|
struct regulator **regs;
|
|
|
|
struct clk **clks;
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
};
|
|
|
|
|
2016-02-25 13:52:38 +08:00
|
|
|
static inline void hdmi_phy_write(struct hdmi_phy *phy, u32 reg, u32 data)
|
|
|
|
{
|
|
|
|
msm_writel(data, phy->mmio + reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline u32 hdmi_phy_read(struct hdmi_phy *phy, u32 reg)
|
|
|
|
{
|
|
|
|
return msm_readl(phy->mmio + reg);
|
|
|
|
}
|
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy);
|
|
|
|
void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy);
|
|
|
|
void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock);
|
|
|
|
void msm_hdmi_phy_powerdown(struct hdmi_phy *phy);
|
|
|
|
void __init msm_hdmi_phy_driver_register(void);
|
|
|
|
void __exit msm_hdmi_phy_driver_unregister(void);
|
2016-02-25 13:52:38 +08:00
|
|
|
|
2016-02-25 13:52:39 +08:00
|
|
|
#ifdef CONFIG_COMMON_CLK
|
2016-02-23 05:08:35 +08:00
|
|
|
int msm_hdmi_pll_8960_init(struct platform_device *pdev);
|
|
|
|
int msm_hdmi_pll_8996_init(struct platform_device *pdev);
|
2016-02-25 13:52:39 +08:00
|
|
|
#else
|
2016-03-23 22:09:00 +08:00
|
|
|
static inline int msm_hdmi_pll_8960_init(struct platform_device *pdev)
|
2016-02-25 13:52:39 +08:00
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
2016-02-25 13:52:44 +08:00
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
static inline int msm_hdmi_pll_8996_init(struct platform_device *pdev)
|
2016-02-25 13:52:44 +08:00
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
2016-02-25 13:52:39 +08:00
|
|
|
#endif
|
|
|
|
|
2013-12-12 03:44:02 +08:00
|
|
|
/*
|
|
|
|
* audio:
|
|
|
|
*/
|
2016-06-10 17:45:56 +08:00
|
|
|
/* Supported HDMI Audio channels and rates */
|
|
|
|
#define MSM_HDMI_AUDIO_CHANNEL_2 0
|
|
|
|
#define MSM_HDMI_AUDIO_CHANNEL_4 1
|
|
|
|
#define MSM_HDMI_AUDIO_CHANNEL_6 2
|
|
|
|
#define MSM_HDMI_AUDIO_CHANNEL_8 3
|
|
|
|
|
|
|
|
#define HDMI_SAMPLE_RATE_32KHZ 0
|
|
|
|
#define HDMI_SAMPLE_RATE_44_1KHZ 1
|
|
|
|
#define HDMI_SAMPLE_RATE_48KHZ 2
|
|
|
|
#define HDMI_SAMPLE_RATE_88_2KHZ 3
|
|
|
|
#define HDMI_SAMPLE_RATE_96KHZ 4
|
|
|
|
#define HDMI_SAMPLE_RATE_176_4KHZ 5
|
|
|
|
#define HDMI_SAMPLE_RATE_192KHZ 6
|
2013-12-12 03:44:02 +08:00
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
int msm_hdmi_audio_update(struct hdmi *hdmi);
|
|
|
|
int msm_hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled,
|
2013-12-12 03:44:02 +08:00
|
|
|
uint32_t num_of_channels, uint32_t channel_allocation,
|
|
|
|
uint32_t level_shift, bool down_mix);
|
2016-02-23 05:08:35 +08:00
|
|
|
void msm_hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate);
|
2013-12-12 03:44:02 +08:00
|
|
|
|
|
|
|
|
2013-08-31 01:02:15 +08:00
|
|
|
/*
|
|
|
|
* hdmi bridge:
|
|
|
|
*/
|
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi);
|
|
|
|
void msm_hdmi_bridge_destroy(struct drm_bridge *bridge);
|
2013-08-31 01:02:15 +08:00
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
/*
|
|
|
|
* hdmi connector:
|
|
|
|
*/
|
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
void msm_hdmi_connector_irq(struct drm_connector *connector);
|
|
|
|
struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi);
|
2018-10-19 22:07:22 +08:00
|
|
|
int msm_hdmi_hpd_enable(struct drm_connector *connector);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* i2c adapter for ddc:
|
|
|
|
*/
|
|
|
|
|
2016-02-23 05:08:35 +08:00
|
|
|
void msm_hdmi_i2c_irq(struct i2c_adapter *i2c);
|
|
|
|
void msm_hdmi_i2c_destroy(struct i2c_adapter *i2c);
|
|
|
|
struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi);
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
|
2015-04-03 05:49:01 +08:00
|
|
|
/*
|
|
|
|
* hdcp
|
|
|
|
*/
|
2016-03-20 22:16:29 +08:00
|
|
|
#ifdef CONFIG_DRM_MSM_HDMI_HDCP
|
2016-02-23 05:08:35 +08:00
|
|
|
struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi);
|
|
|
|
void msm_hdmi_hdcp_destroy(struct hdmi *hdmi);
|
|
|
|
void msm_hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl);
|
|
|
|
void msm_hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl);
|
|
|
|
void msm_hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl);
|
2016-03-20 22:16:29 +08:00
|
|
|
#else
|
|
|
|
static inline struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-ENXIO);
|
|
|
|
}
|
|
|
|
static inline void msm_hdmi_hdcp_destroy(struct hdmi *hdmi) {}
|
|
|
|
static inline void msm_hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl) {}
|
|
|
|
static inline void msm_hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl) {}
|
|
|
|
static inline void msm_hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl) {}
|
|
|
|
#endif
|
2015-04-03 05:49:01 +08:00
|
|
|
|
drm/msm: basic KMS driver for snapdragon
The snapdragon chips have multiple different display controllers,
depending on which chip variant/version. (As far as I can tell, current
devices have either MDP3 or MDP4, and upcoming devices have MDSS.) And
then external to the display controller are HDMI, DSI, etc. blocks which
may be shared across devices which have different display controller
blocks.
To more easily add support for different display controller blocks, the
display controller specific bits are split out into a "kms" module,
which provides the kms plane/crtc/encoder objects.
The external HDMI, DSI, etc. blocks are part encoder, and part connector
currently. But I think I will pull in the drm_bridge patches from
chromeos tree, and split them into a bridge+connector, with the
registers that need to be set in modeset handled by the bridge. This
would remove the 'msm_connector' base class. But some things need to be
double checked to make sure I could get the correct ON/OFF sequencing..
This patch adds support for mdp4 crtc (including hw cursor), dtv encoder
(part of MDP4 block), and hdmi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-06-27 00:44:06 +08:00
|
|
|
#endif /* __HDMI_CONNECTOR_H__ */
|