From cf030d95bbf4a4bbd9049e5590953ea30a814cb5 Mon Sep 17 00:00:00 2001 From: Jon Mayo Date: Mon, 3 Jan 2011 17:26:25 -0800 Subject: [PATCH] [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 Tested-by: Jon Mayo Reviewed-by: Phillip Smith Reviewed-by: Yu-Huan Hsu Signed-off-by: Erik Gilling --- arch/arm/mach-tegra/include/mach/dc.h | 10 +- drivers/video/tegra/dc/Makefile | 3 +- drivers/video/tegra/dc/hdmi.c | 42 +- drivers/video/tegra/dc/hdmi.h | 6 + drivers/video/tegra/dc/hdmi_reg.h | 18 + drivers/video/tegra/dc/nvhdcp.c | 1230 +++++++++++++++++++++++++ drivers/video/tegra/dc/nvhdcp.h | 29 + include/video/nvhdcp.h | 91 ++ 8 files changed, 1421 insertions(+), 8 deletions(-) create mode 100644 drivers/video/tegra/dc/nvhdcp.c create mode 100644 drivers/video/tegra/dc/nvhdcp.h create mode 100644 include/video/nvhdcp.h diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h index f5a64cba61ae..9bd26194f0c9 100644 --- a/arch/arm/mach-tegra/include/mach/dc.h +++ b/arch/arm/mach-tegra/include/mach/dc.h @@ -73,9 +73,13 @@ struct tegra_dc_out { int (*disable)(void); }; -#define TEGRA_DC_OUT_HOTPLUG_HIGH (0 << 1) -#define TEGRA_DC_OUT_HOTPLUG_LOW (1 << 1) -#define TEGRA_DC_OUT_HOTPLUG_MASK (1 << 1) +/* bits for tegra_dc_out.flags */ +#define TEGRA_DC_OUT_HOTPLUG_HIGH (0 << 1) +#define TEGRA_DC_OUT_HOTPLUG_LOW (1 << 1) +#define TEGRA_DC_OUT_HOTPLUG_MASK (1 << 1) +#define TEGRA_DC_OUT_NVHDCP_POLICY_ALWAYS_ON (0 << 2) +#define TEGRA_DC_OUT_NVHDCP_POLICY_ON_DEMAND (1 << 2) +#define TEGRA_DC_OUT_NVHDCP_POLICY_MASK (1 << 2) #define TEGRA_DC_ALIGN_MSB 0 #define TEGRA_DC_ALIGN_LSB 1 diff --git a/drivers/video/tegra/dc/Makefile b/drivers/video/tegra/dc/Makefile index eb39d5d28e92..4567eba8cb93 100644 --- a/drivers/video/tegra/dc/Makefile +++ b/drivers/video/tegra/dc/Makefile @@ -1,4 +1,5 @@ obj-y += dc.o obj-y += rgb.o obj-y += hdmi.o -obj-y += edid.o \ No newline at end of file +obj-y += nvhdcp.o +obj-y += edid.o diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index cebcdc35d889..8b8afe22254d 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -31,11 +31,14 @@ #include #include +#include