hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
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
/*
 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
 * Author Huicong Xu <xhc@rock-chips.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
 
#ifndef DW_HDMI_HDCP_H
#define DW_HDMI_HDCP_H
 
#define DW_HDCP_DRIVER_NAME "dw-hdmi-hdcp"
#define HDCP_PRIVATE_KEY_SIZE   280
#define HDCP_KEY_SHA_SIZE       20
 
struct hdcp_keys {
   u8 KSV[8];
   u8 devicekey[HDCP_PRIVATE_KEY_SIZE];
   u8 sha1[HDCP_KEY_SHA_SIZE];
};
 
struct dw_hdcp {
   bool enable;
   int retry_times;
   int remaining_times;
   char *seeds;
   int invalidkey;
   char *invalidkeys;
   int hdcp2_enable;
   int status;
   u32 reg_io_width;
 
   struct miscdevice mdev;
   struct hdcp_keys *keys;
   struct device *dev;
   struct dw_hdmi *hdmi;
   void __iomem *regs;
 
   void (*write)(struct dw_hdmi *hdmi, u8 val, int offset);
   u8 (*read)(struct dw_hdmi *hdmi, int offset);
   int (*hdcp_start)(struct dw_hdcp *hdcp);
   int (*hdcp_stop)(struct dw_hdcp *hdcp);
   void (*hdcp_isr)(struct dw_hdcp *hdcp, int hdcp_int);
};
 
#endif