Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03a11129 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm: add HDCP 2.2 module for DRM HDMI"

parents 4af98252 be53b222
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
MSM HDCP driver

Standalone driver managing HDCP related communications
between TZ and HLOS for MSM chipset.

Required properties:

compatible = "qcom,msm-hdcp";

Example:

qcom_msmhdcp: qcom,msm_hdcp {
       compatible = "qcom,msm-hdcp";
};
+4 −0
Original line number Diff line number Diff line
@@ -2366,6 +2366,10 @@
		hyplog-size-offset = <0x414>;    /* 0x066BFB34 */
	};

	qcom_msmhdcp: qcom,msm_hdcp {
		compatible = "qcom,msm-hdcp";
	};

	qcom_crypto: qcrypto@1DE0000 {
		compatible = "qcom,qcrypto";
		reg = <0x1DE0000 0x20000>,
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ msm_drm-$(CONFIG_DRM_SDE_HDMI) += \
	hdmi-staging/sde_hdmi.o \
	hdmi-staging/sde_hdmi_bridge.o \
	hdmi-staging/sde_hdmi_audio.o \
	hdmi-staging/sde_hdmi_hdcp2p2.o \

msm_drm-$(CONFIG_DRM_MSM_DSI_PLL) += dsi/pll/dsi_pll.o \
				dsi/pll/dsi_pll_28nm.o
+37 −13
Original line number Diff line number Diff line
@@ -1039,6 +1039,7 @@ static void _sde_hdmi_cec_update_phys_addr(struct sde_hdmi *display)
static void _sde_hdmi_init_ddc(struct sde_hdmi *display, struct hdmi *hdmi)
{
	display->ddc_ctrl.io = &display->io[HDMI_TX_CORE_IO];
	init_completion(&display->ddc_ctrl.rx_status_done);
}

static void _sde_hdmi_map_regs(struct sde_hdmi *display, struct hdmi *hdmi)
@@ -1127,32 +1128,39 @@ static void _sde_hdmi_cec_irq(struct sde_hdmi *sde_hdmi)

static irqreturn_t _sde_hdmi_irq(int irq, void *dev_id)
{
	struct sde_hdmi *sde_hdmi = dev_id;
	struct sde_hdmi *display = dev_id;
	struct hdmi *hdmi;

	if (!sde_hdmi || !sde_hdmi->ctrl.ctrl) {
		SDE_ERROR("sde_hdmi=%p or hdmi is NULL\n", sde_hdmi);
	if (!display || !display->ctrl.ctrl) {
		SDE_ERROR("sde_hdmi=%pK or hdmi is NULL\n", display);
		return IRQ_NONE;
	}
	hdmi = sde_hdmi->ctrl.ctrl;

	hdmi = display->ctrl.ctrl;
	/* Process HPD: */
	_sde_hdmi_connector_irq(sde_hdmi);
	_sde_hdmi_connector_irq(display);

	/* Process Scrambling ISR */
	sde_hdmi_ddc_scrambling_isr((void *)display);

	/* Process DDC2 */
	sde_hdmi_ddc_hdcp2p2_isr((void *)display);

	/* Process DDC: */
	hdmi_i2c_irq(hdmi->i2c);

	/* Process HDCP: */
	if (sde_hdmi->hdcp_ops && sde_hdmi->hdcp_data) {
		if (sde_hdmi->hdcp_ops->isr) {
			if (sde_hdmi->hdcp_ops->isr(
				sde_hdmi->hdcp_data))
	if (display->hdcp_ops && display->hdcp_data) {
		if (display->hdcp_ops->isr) {
			if (display->hdcp_ops->isr(
				display->hdcp_data))
				DEV_ERR("%s: hdcp_1x_isr failed\n",
						__func__);
		}
	}

	/* Process CEC: */
	_sde_hdmi_cec_irq(sde_hdmi);
	_sde_hdmi_cec_irq(display);

	return IRQ_HANDLED;
}
@@ -1717,11 +1725,22 @@ static int _sde_hdmi_init_hdcp(struct sde_hdmi *hdmi_ctrl)
			kfree(hdcp_data);
			goto end;
		} else {
			hdmi_ctrl->hdcp_feature_data[SDE_HDCP_1x] = hdcp_data;
			hdmi_ctrl->hdcp_feat_data[SDE_HDCP_1x] = hdcp_data;
			SDE_HDMI_DEBUG("%s: HDCP 1.4 initialized\n", __func__);
		}
	}

	hdcp_data = sde_hdmi_hdcp2p2_init(&hdcp_init_data);

	if (IS_ERR_OR_NULL(hdcp_data)) {
		DEV_ERR("%s: hdcp 2.2 init failed\n", __func__);
		rc = -EINVAL;
		goto end;
	} else {
		hdmi_ctrl->hdcp_feat_data[SDE_HDCP_2P2] = hdcp_data;
		SDE_HDMI_DEBUG("%s: HDCP 2.2 initialized\n", __func__);
	}

end:
	return rc;
}
@@ -1905,8 +1924,11 @@ int sde_hdmi_dev_deinit(struct sde_hdmi *display)
		SDE_ERROR("Invalid params\n");
		return -EINVAL;
	}
	if (display->hdcp_feature_data[SDE_HDCP_1x])
		sde_hdcp_1x_deinit(display->hdcp_feature_data[SDE_HDCP_1x]);
	if (display->hdcp_feat_data[SDE_HDCP_1x])
		sde_hdcp_1x_deinit(display->hdcp_feat_data[SDE_HDCP_1x]);

	if (display->hdcp_feat_data[SDE_HDCP_2P2])
		sde_hdmi_hdcp2p2_deinit(display->hdcp_feat_data[SDE_HDCP_2P2]);

	return 0;
}
@@ -1993,6 +2015,8 @@ static int sde_hdmi_bind(struct device *dev, struct device *master, void *data)
	_sde_hdmi_map_regs(display, priv->hdmi);
	_sde_hdmi_init_ddc(display, priv->hdmi);

	display->enc_lvl = HDCP_STATE_AUTH_ENC_NONE;

	INIT_DELAYED_WORK(&display->hdcp_cb_work,
					  sde_hdmi_tx_hdcp_cb_work);
	mutex_init(&display->hdcp_mutex);
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ struct sde_hdmi {
	 */
	void *hdcp_data;
	/*hold hdcp init data*/
	void *hdcp_feature_data[2];
	void *hdcp_feat_data[2];
	struct sde_hdcp_ops *hdcp_ops;
	struct sde_hdmi_tx_ddc_ctrl ddc_ctrl;
	struct work_struct hpd_work;
Loading