|
@@ -84,7 +84,7 @@ struct hdmi_hdcp_ctrl {
|
|
|
bool max_dev_exceeded;
|
|
|
};
|
|
|
|
|
|
-static int hdmi_ddc_read(struct hdmi *hdmi, u16 addr, u8 offset,
|
|
|
+static int msm_hdmi_ddc_read(struct hdmi *hdmi, u16 addr, u8 offset,
|
|
|
u8 *data, u16 data_len)
|
|
|
{
|
|
|
int rc;
|
|
@@ -122,7 +122,7 @@ retry:
|
|
|
|
|
|
#define HDCP_DDC_WRITE_MAX_BYTE_NUM 32
|
|
|
|
|
|
-static int hdmi_ddc_write(struct hdmi *hdmi, u16 addr, u8 offset,
|
|
|
+static int msm_hdmi_ddc_write(struct hdmi *hdmi, u16 addr, u8 offset,
|
|
|
u8 *data, u16 data_len)
|
|
|
{
|
|
|
int rc;
|
|
@@ -162,7 +162,7 @@ retry:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg,
|
|
|
+static int msm_hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg,
|
|
|
u32 *pdata, u32 count)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
@@ -202,7 +202,7 @@ static int hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+void msm_hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 reg_val, hdcp_int_status;
|
|
@@ -247,7 +247,7 @@ void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev)
|
|
|
+static int msm_hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev)
|
|
|
{
|
|
|
int rc;
|
|
|
|
|
@@ -264,7 +264,7 @@ static int hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
|
|
@@ -287,7 +287,7 @@ static int hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 reg_val, failure, nack0;
|
|
@@ -337,7 +337,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
reg_val |= HDMI_DDC_CTRL_SW_STATUS_RESET;
|
|
|
hdmi_write(hdmi, REG_HDMI_DDC_CTRL, reg_val);
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
|
|
|
reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL);
|
|
|
reg_val &= ~HDMI_DDC_CTRL_SW_STATUS_RESET;
|
|
@@ -350,7 +350,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
|
|
|
/* If previous msleep is aborted, skip this msleep */
|
|
|
if (!rc)
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
|
|
|
reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL);
|
|
|
reg_val &= ~HDMI_DDC_CTRL_SOFT_RESET;
|
|
@@ -362,7 +362,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc;
|
|
|
u32 hdcp_ddc_status, ddc_hw_status;
|
|
@@ -394,7 +394,7 @@ static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
} while (1);
|
|
@@ -402,7 +402,7 @@ static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static void hdmi_hdcp_reauth_work(struct work_struct *work)
|
|
|
+static void msm_hdmi_hdcp_reauth_work(struct work_struct *work)
|
|
|
{
|
|
|
struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work,
|
|
|
struct hdmi_hdcp_ctrl, hdcp_reauth_work);
|
|
@@ -430,7 +430,7 @@ static void hdmi_hdcp_reauth_work(struct work_struct *work)
|
|
|
HDMI_HDCP_RESET_LINK0_DEAUTHENTICATE);
|
|
|
|
|
|
/* Wait to be clean on DDC HW engine */
|
|
|
- if (hdmi_hdcp_hw_ddc_clean(hdcp_ctrl)) {
|
|
|
+ if (msm_hdmi_hdcp_hw_ddc_clean(hdcp_ctrl)) {
|
|
|
pr_info("%s: reauth work aborted\n", __func__);
|
|
|
return;
|
|
|
}
|
|
@@ -461,7 +461,7 @@ static void hdmi_hdcp_reauth_work(struct work_struct *work)
|
|
|
queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work);
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 link0_status;
|
|
@@ -470,7 +470,7 @@ static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
int rc;
|
|
|
|
|
|
if (!hdcp_ctrl->aksv_valid) {
|
|
|
- rc = hdmi_hdcp_read_validate_aksv(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_read_validate_aksv(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: ASKV validation failed\n", __func__);
|
|
|
hdcp_ctrl->hdcp_state = HDCP_STATE_NO_AKSV;
|
|
@@ -538,12 +538,12 @@ static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
DBG("An not ready after enabling HDCP");
|
|
|
|
|
|
/* Clear any DDC failures from previous tries before enable HDCP*/
|
|
|
- rc = reset_hdcp_ddc_failures(hdcp_ctrl);
|
|
|
+ rc = msm_reset_hdcp_ddc_failures(hdcp_ctrl);
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static void hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static void msm_hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 reg_val;
|
|
@@ -561,7 +561,7 @@ static void hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
queue_work(hdmi->workq, &hdcp_ctrl->hdcp_reauth_work);
|
|
|
}
|
|
|
|
|
|
-static void hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static void msm_hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 reg_val;
|
|
@@ -596,7 +596,7 @@ static void hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
* Write An and AKSV to sink
|
|
|
* Read BKSV from sink and write into HDCP engine
|
|
|
*/
|
|
|
-static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc;
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
@@ -621,7 +621,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
} while (1);
|
|
@@ -643,7 +643,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
} while (1);
|
|
@@ -651,7 +651,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
@@ -676,7 +676,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
aksv[4] = link0_aksv_1 & 0xFF;
|
|
|
|
|
|
/* Write An to offset 0x18 */
|
|
|
- rc = hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x18, (u8 *)link0_an,
|
|
|
+ rc = msm_hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x18, (u8 *)link0_an,
|
|
|
(u16)sizeof(link0_an));
|
|
|
if (rc) {
|
|
|
pr_err("%s:An write failed\n", __func__);
|
|
@@ -685,7 +685,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
DBG("Link0-An=%08x%08x", link0_an[0], link0_an[1]);
|
|
|
|
|
|
/* Write AKSV to offset 0x10 */
|
|
|
- rc = hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x10, aksv, 5);
|
|
|
+ rc = msm_hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x10, aksv, 5);
|
|
|
if (rc) {
|
|
|
pr_err("%s:AKSV write failed\n", __func__);
|
|
|
return rc;
|
|
@@ -695,7 +695,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
@@ -703,7 +703,7 @@ static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
u32 reg[2], data[2];
|
|
|
|
|
|
/* Read BKSV at offset 0x00 */
|
|
|
- rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x00, bksv, 5);
|
|
|
+ rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x00, bksv, 5);
|
|
|
if (rc) {
|
|
|
pr_err("%s:BKSV read failed\n", __func__);
|
|
|
return rc;
|
|
@@ -728,19 +728,19 @@ static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
data[0] = hdcp_ctrl->bksv_lsb;
|
|
|
reg[1] = REG_HDMI_HDCP_RCVPORT_DATA1;
|
|
|
data[1] = hdcp_ctrl->bksv_msb;
|
|
|
- rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2);
|
|
|
+ rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2);
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 reg, data;
|
|
|
u8 bcaps;
|
|
|
|
|
|
- rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1);
|
|
|
+ rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1);
|
|
|
if (rc) {
|
|
|
pr_err("%s:BCAPS read failed\n", __func__);
|
|
|
return rc;
|
|
@@ -753,26 +753,26 @@ static int hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
/* Write BCAPS to the hardware */
|
|
|
reg = REG_HDMI_HDCP_RCVPORT_DATA12;
|
|
|
data = (u32)bcaps;
|
|
|
- rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1);
|
|
|
+ rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1);
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
unsigned long flags;
|
|
|
int rc;
|
|
|
|
|
|
/* Wait for AKSV key and An ready */
|
|
|
- rc = hdmi_hdcp_wait_key_an_ready(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_wait_key_an_ready(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: wait key and an ready failed\n", __func__);
|
|
|
return rc;
|
|
|
};
|
|
|
|
|
|
/* Read BCAPS and send to HDCP engine */
|
|
|
- rc = hdmi_hdcp_recv_bcaps(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_recv_bcaps(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: read bcaps error, abort\n", __func__);
|
|
|
return rc;
|
|
@@ -785,14 +785,14 @@ static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
hdmi_write(hdmi, REG_HDMI_HDCP_RCVPORT_DATA4, 0);
|
|
|
|
|
|
/* Send AKSV and An to sink */
|
|
|
- rc = hdmi_hdcp_send_aksv_an(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_send_aksv_an(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s:An/Aksv write failed\n", __func__);
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
/* Read BKSV and send to HDCP engine*/
|
|
|
- rc = hdmi_hdcp_recv_bksv(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_recv_bksv(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s:BKSV Process failed\n", __func__);
|
|
|
return rc;
|
|
@@ -812,7 +812,7 @@ static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
}
|
|
|
|
|
|
/* read R0' from sink and pass it to HDCP engine */
|
|
|
-static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
int rc = 0;
|
|
@@ -822,12 +822,12 @@ static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
* HDCP Compliance Test case 1A-01:
|
|
|
* Wait here at least 100ms before reading R0'
|
|
|
*/
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 125, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 125, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
|
|
|
/* Read R0' at offset 0x08 */
|
|
|
- rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x08, buf, 2);
|
|
|
+ rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x08, buf, 2);
|
|
|
if (rc) {
|
|
|
pr_err("%s:R0' read failed\n", __func__);
|
|
|
return rc;
|
|
@@ -842,14 +842,14 @@ static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
}
|
|
|
|
|
|
/* Wait for authenticating result: R0/R0' are matched or not */
|
|
|
-static int hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 link0_status;
|
|
|
int rc;
|
|
|
|
|
|
/* wait for hdcp irq, 10 sec should be long enough */
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 10000, AUTH_RESULT_RDY_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 10000, AUTH_RESULT_RDY_EV);
|
|
|
if (!rc) {
|
|
|
pr_err("%s: Wait Auth IRQ timeout\n", __func__);
|
|
|
return -ETIMEDOUT;
|
|
@@ -869,7 +869,7 @@ static int hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl,
|
|
|
+static int msm_hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl,
|
|
|
u16 *pbstatus)
|
|
|
{
|
|
|
int rc;
|
|
@@ -880,7 +880,7 @@ static int hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl,
|
|
|
u8 buf[2];
|
|
|
|
|
|
/* Read BSTATUS at offset 0x41 */
|
|
|
- rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x41, buf, 2);
|
|
|
+ rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x41, buf, 2);
|
|
|
if (rc) {
|
|
|
pr_err("%s: BSTATUS read failed\n", __func__);
|
|
|
goto error;
|
|
@@ -936,7 +936,7 @@ error:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(
|
|
|
+static int msm_hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(
|
|
|
struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc;
|
|
@@ -953,7 +953,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(
|
|
|
timeout_count = 100;
|
|
|
do {
|
|
|
/* Read BCAPS at offset 0x40 */
|
|
|
- rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1);
|
|
|
+ rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1);
|
|
|
if (rc) {
|
|
|
pr_err("%s: BCAPS read failed\n", __func__);
|
|
|
return rc;
|
|
@@ -968,12 +968,12 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(
|
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
} while (1);
|
|
|
|
|
|
- rc = hdmi_hdcp_recv_check_bstatus(hdcp_ctrl, &bstatus);
|
|
|
+ rc = msm_hdmi_hdcp_recv_check_bstatus(hdcp_ctrl, &bstatus);
|
|
|
if (rc) {
|
|
|
pr_err("%s: bstatus error\n", __func__);
|
|
|
return rc;
|
|
@@ -982,7 +982,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(
|
|
|
/* Write BSTATUS and BCAPS to HDCP registers */
|
|
|
reg = REG_HDMI_HDCP_RCVPORT_DATA12;
|
|
|
data = bcaps | (bstatus << 8);
|
|
|
- rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1);
|
|
|
+ rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1);
|
|
|
if (rc) {
|
|
|
pr_err("%s: BSTATUS write failed\n", __func__);
|
|
|
return rc;
|
|
@@ -997,7 +997,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(
|
|
|
* transfer V' from sink to HDCP engine
|
|
|
* reset SHA engine
|
|
|
*/
|
|
|
-static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
int rc = 0;
|
|
@@ -1016,7 +1016,7 @@ static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
|
|
|
for (i = 0; i < size; i++) {
|
|
|
rd = ®_data[i];
|
|
|
- rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR,
|
|
|
+ rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR,
|
|
|
rd->off, (u8 *)&data[i], (u16)sizeof(data[i]));
|
|
|
if (rc) {
|
|
|
pr_err("%s: Read %s failed\n", __func__, rd->name);
|
|
@@ -1027,13 +1027,13 @@ static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
reg[i] = reg_data[i].reg_id;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, size);
|
|
|
+ rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, size);
|
|
|
|
|
|
error:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc;
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
@@ -1041,7 +1041,7 @@ static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
|
|
|
ksv_bytes = 5 * hdcp_ctrl->dev_count;
|
|
|
|
|
|
- rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x43,
|
|
|
+ rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x43,
|
|
|
hdcp_ctrl->ksv_list, ksv_bytes);
|
|
|
if (rc)
|
|
|
pr_err("%s: KSV FIFO read failed\n", __func__);
|
|
@@ -1049,7 +1049,7 @@ static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
u32 reg[2], data[2];
|
|
|
u32 rc = 0;
|
|
@@ -1059,12 +1059,12 @@ static int hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
reg[1] = REG_HDMI_HDCP_SHA_CTRL;
|
|
|
data[1] = HDCP_REG_DISABLE;
|
|
|
|
|
|
- rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2);
|
|
|
+ rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2);
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_auth_part2_recv_ksv_fifo(
|
|
|
+static int msm_hdmi_hdcp_auth_part2_recv_ksv_fifo(
|
|
|
struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc;
|
|
@@ -1081,7 +1081,7 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo(
|
|
|
*/
|
|
|
timeout_count = 100;
|
|
|
do {
|
|
|
- rc = hdmi_hdcp_recv_ksv_fifo(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_recv_ksv_fifo(hdcp_ctrl);
|
|
|
if (!rc)
|
|
|
break;
|
|
|
|
|
@@ -1091,19 +1091,19 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo(
|
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 25, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 25, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
} while (1);
|
|
|
|
|
|
- rc = hdmi_hdcp_transfer_v_h(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_transfer_v_h(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: transfer V failed\n", __func__);
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
/* reset SHA engine before write ksv fifo */
|
|
|
- rc = hdmi_hdcp_reset_sha_engine(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_reset_sha_engine(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: fail to reset sha engine\n", __func__);
|
|
|
return rc;
|
|
@@ -1120,7 +1120,7 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo(
|
|
|
* If the last byte is written, we need to poll for
|
|
|
* HDCP_SHA_COMP_DONE to wait until HW finish
|
|
|
*/
|
|
|
-static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int i;
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
@@ -1169,7 +1169,7 @@ static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
|
|
|
reg = REG_HDMI_HDCP_SHA_DATA;
|
|
|
data = reg_val;
|
|
|
- rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1);
|
|
|
+ rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1);
|
|
|
|
|
|
if (rc)
|
|
|
return rc;
|
|
@@ -1184,7 +1184,7 @@ static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
}
|
|
|
|
|
|
/* write ksv fifo into HDCP engine */
|
|
|
-static int hdmi_hdcp_auth_part2_write_ksv_fifo(
|
|
|
+static int msm_hdmi_hdcp_auth_part2_write_ksv_fifo(
|
|
|
struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc;
|
|
@@ -1193,7 +1193,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo(
|
|
|
hdcp_ctrl->ksv_fifo_w_index = 0;
|
|
|
timeout_count = 100;
|
|
|
do {
|
|
|
- rc = hdmi_hdcp_write_ksv_fifo(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_write_ksv_fifo(hdcp_ctrl);
|
|
|
if (!rc)
|
|
|
break;
|
|
|
|
|
@@ -1206,7 +1206,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo(
|
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
} while (1);
|
|
@@ -1214,7 +1214,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo(
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+static int msm_hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
@@ -1232,7 +1232,7 @@ static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return -ETIMEDOUT;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
+ rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
} while (1);
|
|
@@ -1240,32 +1240,32 @@ static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static void hdmi_hdcp_auth_work(struct work_struct *work)
|
|
|
+static void msm_hdmi_hdcp_auth_work(struct work_struct *work)
|
|
|
{
|
|
|
struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work,
|
|
|
struct hdmi_hdcp_ctrl, hdcp_auth_work);
|
|
|
int rc;
|
|
|
|
|
|
- rc = hdmi_hdcp_auth_prepare(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_prepare(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: auth prepare failed %d\n", __func__, rc);
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
/* HDCP PartI */
|
|
|
- rc = hdmi_hdcp_auth_part1_key_exchange(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_part1_key_exchange(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: key exchange failed %d\n", __func__, rc);
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_auth_part1_recv_r0(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_part1_recv_r0(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: receive r0 failed %d\n", __func__, rc);
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_auth_part1_verify_r0(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_part1_verify_r0(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: verify r0 failed %d\n", __func__, rc);
|
|
|
goto end;
|
|
@@ -1275,25 +1275,25 @@ static void hdmi_hdcp_auth_work(struct work_struct *work)
|
|
|
goto end;
|
|
|
|
|
|
/* HDCP PartII */
|
|
|
- rc = hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: wait ksv fifo ready failed %d\n", __func__, rc);
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_auth_part2_recv_ksv_fifo(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_part2_recv_ksv_fifo(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: recv ksv fifo failed %d\n", __func__, rc);
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_auth_part2_write_ksv_fifo(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_part2_write_ksv_fifo(hdcp_ctrl);
|
|
|
if (rc) {
|
|
|
pr_err("%s: write ksv fifo failed %d\n", __func__, rc);
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
- rc = hdmi_hdcp_auth_part2_check_v_match(hdcp_ctrl);
|
|
|
+ rc = msm_hdmi_hdcp_auth_part2_check_v_match(hdcp_ctrl);
|
|
|
if (rc)
|
|
|
pr_err("%s: check v match failed %d\n", __func__, rc);
|
|
|
|
|
@@ -1304,13 +1304,13 @@ end:
|
|
|
pr_info("%s: hdcp is not supported\n", __func__);
|
|
|
} else if (rc) {
|
|
|
pr_err("%s: hdcp authentication failed\n", __func__);
|
|
|
- hdmi_hdcp_auth_fail(hdcp_ctrl);
|
|
|
+ msm_hdmi_hdcp_auth_fail(hdcp_ctrl);
|
|
|
} else {
|
|
|
- hdmi_hdcp_auth_done(hdcp_ctrl);
|
|
|
+ msm_hdmi_hdcp_auth_done(hdcp_ctrl);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+void msm_hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
u32 reg_val;
|
|
@@ -1335,7 +1335,7 @@ void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work);
|
|
|
}
|
|
|
|
|
|
-void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
+void msm_hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
{
|
|
|
struct hdmi *hdmi = hdcp_ctrl->hdmi;
|
|
|
unsigned long flags;
|
|
@@ -1399,7 +1399,7 @@ void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl)
|
|
|
DBG("HDCP: Off");
|
|
|
}
|
|
|
|
|
|
-struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi)
|
|
|
+struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi)
|
|
|
{
|
|
|
struct hdmi_hdcp_ctrl *hdcp_ctrl = NULL;
|
|
|
|
|
@@ -1413,8 +1413,8 @@ struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi)
|
|
|
if (!hdcp_ctrl)
|
|
|
return ERR_PTR(-ENOMEM);
|
|
|
|
|
|
- INIT_WORK(&hdcp_ctrl->hdcp_auth_work, hdmi_hdcp_auth_work);
|
|
|
- INIT_WORK(&hdcp_ctrl->hdcp_reauth_work, hdmi_hdcp_reauth_work);
|
|
|
+ INIT_WORK(&hdcp_ctrl->hdcp_auth_work, msm_hdmi_hdcp_auth_work);
|
|
|
+ INIT_WORK(&hdcp_ctrl->hdcp_reauth_work, msm_hdmi_hdcp_reauth_work);
|
|
|
init_waitqueue_head(&hdcp_ctrl->auth_event_queue);
|
|
|
hdcp_ctrl->hdmi = hdmi;
|
|
|
hdcp_ctrl->hdcp_state = HDCP_STATE_INACTIVE;
|
|
@@ -1428,7 +1428,7 @@ struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi)
|
|
|
return hdcp_ctrl;
|
|
|
}
|
|
|
|
|
|
-void hdmi_hdcp_destroy(struct hdmi *hdmi)
|
|
|
+void msm_hdmi_hdcp_destroy(struct hdmi *hdmi)
|
|
|
{
|
|
|
if (hdmi && hdmi->hdcp_ctrl) {
|
|
|
kfree(hdmi->hdcp_ctrl);
|