summaryrefslogtreecommitdiff
path: root/include/video
diff options
context:
space:
mode:
authorJon Mayo <jmayo@nvidia.com>2011-01-03 17:26:25 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:36:58 -0800
commitbb8cc88e13cda40985377c59a92e4a03c6647f9a (patch)
treea9a007199ce48df440aa7829ff7bcebf1b8fb2f9 /include/video
parent5b1432a6d8a49aa1fa47f3630f7eed8fd3916910 (diff)
[ARM] tegra: hdmi nvhdcp driver
Device /dev/nvhdcpX is used to manage NVHDCP on framebuffer /dev/fbX. These devices are created on hdmi driver initialition when it is attached to dc. Currently only one nvhdcp device may be created. An ioctl interface is in video/nvhdcp.h Check for repeaters and store repeater info. userspace application queries this status to authenticate the connection. When authentication fails, auto-renegotiate every 1.75 seconds. Give up after 5 failed attempts, reset after hotplug or policy change. use TEGRA_DC_OUT_NVHDCP_POLICY_ON_DEMAND in tegra_dc_out.flags in board panel configuration to select a different default policy at probe. Currently only TEGRA_DC_OUT_NVHDCP_POLICY_ALWAYS_ON is supported. Change-Id: I0db66fc86096b98d2604544061721d291523de75 Reviewed-by: Jon Mayo <jmayo@nvidia.com> Tested-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: Phillip Smith <psmith@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Signed-off-by: Erik Gilling <konkers@android.com>
Diffstat (limited to 'include/video')
-rw-r--r--include/video/nvhdcp.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/include/video/nvhdcp.h b/include/video/nvhdcp.h
new file mode 100644
index 000000000000..f282ff8caa99
--- /dev/null
+++ b/include/video/nvhdcp.h
@@ -0,0 +1,91 @@
+/*
+ * include/video/nvhdcp.h
+ *
+ * Copyright (c) 2010-2011, NVIDIA Corporation.
+ *
+ * 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 _LINUX_NVHDCP_H_
+#define _LINUX_NVHDCP_H_
+
+#include <linux/fb.h>
+#include <linux/types.h>
+#include <asm/ioctl.h>
+
+/* maximum receivers and repeaters connected at a time */
+#define TEGRA_NVHDCP_MAX_DEVS 127
+
+/* values for value_flags */
+#define TEGRA_NVHDCP_FLAG_AN 0x0001
+#define TEGRA_NVHDCP_FLAG_AKSV 0x0002
+#define TEGRA_NVHDCP_FLAG_BKSV 0x0004
+#define TEGRA_NVHDCP_FLAG_BSTATUS 0x0008 /* repeater status */
+#define TEGRA_NVHDCP_FLAG_CN 0x0010 /* c_n */
+#define TEGRA_NVHDCP_FLAG_CKSV 0x0020 /* c_ksv */
+#define TEGRA_NVHDCP_FLAG_DKSV 0x0040 /* d_ksv */
+#define TEGRA_NVHDCP_FLAG_KP 0x0080 /* k_prime */
+#define TEGRA_NVHDCP_FLAG_S 0x0100 /* hdcp_status */
+#define TEGRA_NVHDCP_FLAG_CS 0x0200 /* connection state */
+#define TEGRA_NVHDCP_FLAG_V 0x0400
+#define TEGRA_NVHDCP_FLAG_MP 0x0800
+#define TEGRA_NVHDCP_FLAG_BKSVLIST 0x1000
+
+/* values for packet_results */
+#define TEGRA_NVHDCP_RESULT_SUCCESS 0
+#define TEGRA_NVHDCP_RESULT_UNSUCCESSFUL 1
+#define TEGRA_NVHDCP_RESULT_PENDING 0x103
+#define TEGRA_NVHDCP_RESULT_LINK_FAILED 0xc0000013
+/* TODO: replace with -EINVAL */
+#define TEGRA_NVHDCP_RESULT_INVALID_PARAMETER 0xc000000d
+#define TEGRA_NVHDCP_RESULT_INVALID_PARAMETER_MIX 0xc0000030
+/* TODO: replace with -ENOMEM */
+#define TEGRA_NVHDCP_RESULT_NO_MEMORY 0xc0000017
+
+struct tegra_nvhdcp_packet {
+ __u32 value_flags; // (IN/OUT)
+ __u32 packet_results; // (OUT)
+
+ __u64 c_n; // (IN) upstream exchange number
+ __u64 c_ksv; // (IN)
+
+ __u32 b_status; // (OUT) link/repeater status
+ __u64 hdcp_status; // (OUT) READ_S
+ __u64 cs; // (OUT) Connection State
+
+ __u64 k_prime; // (OUT)
+ __u64 a_n; // (OUT)
+ __u64 a_ksv; // (OUT)
+ __u64 b_ksv; // (OUT)
+ __u64 d_ksv; // (OUT)
+ __u8 v_prime[20]; // (OUT) 160-bit
+ __u64 m_prime; // (OUT)
+
+ // (OUT) Valid KSVs in the bKsvList. Maximum is 127 devices
+ __u32 num_bksv_list;
+
+ // (OUT) Up to 127 receivers & repeaters
+ __u64 bksv_list[TEGRA_NVHDCP_MAX_DEVS];
+};
+
+/* parameters to TEGRAIO_NVHDCP_SET_POLICY */
+#define TEGRA_NVHDCP_POLICY_ON_DEMAND 0
+#define TEGRA_NVHDCP_POLICY_ALWAYS_ON 1
+
+/* ioctls */
+#define TEGRAIO_NVHDCP_ON _IO('F', 0x70)
+#define TEGRAIO_NVHDCP_OFF _IO('F', 0x71)
+#define TEGRAIO_NVHDCP_SET_POLICY _IOW('F', 0x72, __u32)
+#define TEGRAIO_NVHDCP_READ_M _IOWR('F', 0x73, struct tegra_nvhdcp_packet)
+#define TEGRAIO_NVHDCP_READ_S _IOWR('F', 0x74, struct tegra_nvhdcp_packet)
+#define TEGRAIO_NVHDCP_RENEGOTIATE _IO('F', 0x75)
+
+#endif