Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/nvidia extract physical address from HDMI VDSB ...
details: https://anonhg.NetBSD.org/src/rev/8d09afb09a09
branches: trunk
changeset: 339629:8d09afb09a09
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Jul 31 23:07:14 2015 +0000
description:
extract physical address from HDMI VDSB and make it available as the "physical-address" device property
diffstat:
sys/arch/arm/nvidia/tegra_hdmi.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diffs (66 lines):
diff -r 976a53043020 -r 8d09afb09a09 sys/arch/arm/nvidia/tegra_hdmi.c
--- a/sys/arch/arm/nvidia/tegra_hdmi.c Fri Jul 31 15:00:07 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_hdmi.c Fri Jul 31 23:07:14 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_hdmi.c,v 1.8 2015/07/26 15:12:03 jmcneill Exp $ */
+/* $NetBSD: tegra_hdmi.c,v 1.9 2015/07/31 23:07:14 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "locators.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_hdmi.c,v 1.8 2015/07/26 15:12:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_hdmi.c,v 1.9 2015/07/31 23:07:14 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -47,6 +47,8 @@
#include <arm/nvidia/tegra_hdmireg.h>
#include <arm/nvidia/tegra_var.h>
+#define PROP_PHYSICAL_ADDRESS "physical-address"
+
static int tegra_hdmi_match(device_t, cfdata_t, void *);
static void tegra_hdmi_attach(device_t, device_t, void *);
@@ -243,6 +245,9 @@
static void
tegra_hdmi_disconnect(struct tegra_hdmi_softc *sc)
{
+ prop_dictionary_t cfg = device_properties(sc->sc_dev);
+
+ prop_dictionary_remove(cfg, PROP_PHYSICAL_ADDRESS);
}
static void
@@ -441,9 +446,11 @@
static bool
tegra_hdmi_is_hdmi(struct tegra_hdmi_softc *sc, const struct edid_info *ei)
{
+ prop_dictionary_t cfg = device_properties(sc->sc_dev);
char edid[128];
bool found_hdmi = false;
unsigned int n, p;
+ uint16_t phys_addr;
/*
* Scan through extension blocks, looking for a CEA-861-D v3
@@ -486,9 +493,15 @@
goto next_block;
/* HDMI 24-bit IEEE registration ID is 0x000C03 */
- if (memcmp(&edid[p + 1], "\x03\x0c\x00", 3) == 0)
+ if (memcmp(&edid[p + 1], "\x03\x0c\x00", 3) == 0) {
found_hdmi = true;
+ phys_addr = (edid[p + 4] << 8) | edid[p + 5];
+
+ prop_dictionary_set_uint16(cfg,
+ PROP_PHYSICAL_ADDRESS, phys_addr);
+ }
+
next_block:
p += (1 + blen);
}
Home |
Main Index |
Thread Index |
Old Index