hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (C) Rockchip Electronics Co.Ltd
 * Author:
 *      Algea Cao <algea.cao@rock-chips.com>
 */
#ifndef DW_HDMI_QP_HDCP_H
#define DW_HDMI_QP_HDCP_H
 
#include <linux/miscdevice.h>
 
#define DW_HDCP_QP_DRIVER_NAME "dw-hdmi-qp-hdcp"
#define PRIVATE_KEY_SIZE    280
#define KEY_SHA_SIZE        20
 
#define KSV_LEN            5
#define BSTATUS_LEN        2
#define M0_LEN            8
#define SHAMAX            20
 
struct dw_hdmi_qp_hdcp_keys {
   u8 KSV[8];
   u8 devicekey[PRIVATE_KEY_SIZE];
   u8 sha1[KEY_SHA_SIZE];
};
 
struct dw_qp_hdcp {
   int retry_times;
   int remaining_times;
   char *seeds;
   int invalidkey;
   char *invalidkeys;
   int hdcp2_enable;
   int status;
   u32 reg_io_width;
 
   struct dw_hdmi_qp_hdcp_keys *keys;
   struct device *dev;
   struct dw_hdmi_qp *hdmi;
   void __iomem *regs;
 
   struct mutex mutex;
 
   struct work_struct work;
   struct workqueue_struct *workqueue;
 
   void (*write)(struct dw_hdmi_qp *hdmi, u32 val, int offset);
   u32 (*read)(struct dw_hdmi_qp *hdmi, int offset);
   void (*get_mem)(struct dw_hdmi_qp *hdmi, u8 *data, u32 len);
   int (*hdcp_start)(struct dw_qp_hdcp *hdcp);
   int (*hdcp_stop)(struct dw_qp_hdcp *hdcp);
   void (*hdcp_isr)(struct dw_qp_hdcp *hdcp, u32 avp_int, u32 hdcp_status);
};
 
#endif