Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Aug 2014 06:29:30 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269702 - head/sys/arm/samsung/exynos
Message-ID:  <53e46e4a.2cb1.29e4e203@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Fri Aug  8 06:29:30 2014
New Revision: 269702
URL: http://svnweb.freebsd.org/changeset/base/269702

Log:
  Use OF_getencprop() in preference to OF_getprop() and manual byte-swapping.

Modified:
  head/sys/arm/samsung/exynos/chrome_kb.c
  head/sys/arm/samsung/exynos/exynos5_fimd.c
  head/sys/arm/samsung/exynos/exynos5_usb_phy.c

Modified: head/sys/arm/samsung/exynos/chrome_kb.c
==============================================================================
--- head/sys/arm/samsung/exynos/chrome_kb.c	Fri Aug  8 06:22:32 2014	(r269701)
+++ head/sys/arm/samsung/exynos/chrome_kb.c	Fri Aug  8 06:29:30 2014	(r269702)
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/mutex.h>
 #include <sys/gpio.h>
 
-#include <dev/fdt/fdt_common.h>
 #include <dev/ofw/openfirm.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
@@ -57,7 +56,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/kbio.h>
 
 #include <machine/bus.h>
-#include <machine/fdt.h>
 #include <machine/cpu.h>
 #include <machine/intr.h>
 
@@ -741,18 +739,18 @@ parse_dts(struct ckb_softc *sc)
 
 	if ((len = OF_getproplen(node, "google,key-rows")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "google,key-rows", &dts_value, len);
-	sc->rows = fdt32_to_cpu(dts_value);
+	OF_getencprop(node, "google,key-rows", &dts_value, len);
+	sc->rows = dts_value;
 
 	if ((len = OF_getproplen(node, "google,key-columns")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "google,key-columns", &dts_value, len);
-	sc->cols = fdt32_to_cpu(dts_value);
+	OF_getencprop(node, "google,key-columns", &dts_value, len);
+	sc->cols = dts_value;
 
 	if ((len = OF_getproplen(node, "freebsd,intr-gpio")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "freebsd,intr-gpio", &dts_value, len);
-	sc->gpio = fdt32_to_cpu(dts_value);
+	OF_getencprop(node, "freebsd,intr-gpio", &dts_value, len);
+	sc->gpio = dts_value;
 
 	if (OF_hasprop(node, "freebsd,keymap")) {
 		keymap_prop = "freebsd,keymap";

Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c
==============================================================================
--- head/sys/arm/samsung/exynos/exynos5_fimd.c	Fri Aug  8 06:22:32 2014	(r269701)
+++ head/sys/arm/samsung/exynos/exynos5_fimd.c	Fri Aug  8 06:29:30 2014	(r269702)
@@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm.h>
 #include <vm/vm_extern.h>
 #include <vm/vm_kern.h>
+#include <vm/pmap.h>
 
-#include <dev/fdt/fdt_common.h>
 #include <dev/ofw/openfirm.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
@@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$");
 #include "gpio_if.h"
 
 #include <machine/bus.h>
-#include <machine/fdt.h>
 #include <machine/cpu.h>
 #include <machine/intr.h>
 
@@ -213,37 +212,37 @@ get_panel_info(struct fimd_softc *sc, st
 	/* panel size */
 	if ((len = OF_getproplen(node, "panel-size")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "panel-size", &dts_value, len);
-	panel->width = fdt32_to_cpu(dts_value[0]);
-	panel->height = fdt32_to_cpu(dts_value[1]);
+	OF_getencprop(node, "panel-size", dts_value, len);
+	panel->width = dts_value[0];
+	panel->height = dts_value[1];
 
 	/* hsync */
 	if ((len = OF_getproplen(node, "panel-hsync")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "panel-hsync", &dts_value, len);
-	panel->h_back_porch = fdt32_to_cpu(dts_value[0]);
-	panel->h_pulse_width = fdt32_to_cpu(dts_value[1]);
-	panel->h_front_porch = fdt32_to_cpu(dts_value[2]);
+	OF_getencprop(node, "panel-hsync", dts_value, len);
+	panel->h_back_porch = dts_value[0];
+	panel->h_pulse_width = dts_value[1];
+	panel->h_front_porch = dts_value[2];
 
 	/* vsync */
 	if ((len = OF_getproplen(node, "panel-vsync")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "panel-vsync", &dts_value, len);
-	panel->v_back_porch = fdt32_to_cpu(dts_value[0]);
-	panel->v_pulse_width = fdt32_to_cpu(dts_value[1]);
-	panel->v_front_porch = fdt32_to_cpu(dts_value[2]);
+	OF_getencprop(node, "panel-vsync", dts_value, len);
+	panel->v_back_porch = dts_value[0];
+	panel->v_pulse_width = dts_value[1];
+	panel->v_front_porch = dts_value[2];
 
 	/* clk divider */
 	if ((len = OF_getproplen(node, "panel-clk-div")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "panel-clk-div", &dts_value, len);
-	panel->clk_div = fdt32_to_cpu(dts_value[0]);
+	OF_getencprop(node, "panel-clk-div", dts_value, len);
+	panel->clk_div = dts_value[0];
 
 	/* backlight pin */
 	if ((len = OF_getproplen(node, "panel-backlight-pin")) <= 0)
 		return (ENXIO);
-	OF_getprop(node, "panel-backlight-pin", &dts_value, len);
-	panel->backlight_pin = fdt32_to_cpu(dts_value[0]);
+	OF_getencprop(node, "panel-backlight-pin", dts_value, len);
+	panel->backlight_pin = dts_value[0];
 
 	return (0);
 }

Modified: head/sys/arm/samsung/exynos/exynos5_usb_phy.c
==============================================================================
--- head/sys/arm/samsung/exynos/exynos5_usb_phy.c	Fri Aug  8 06:22:32 2014	(r269701)
+++ head/sys/arm/samsung/exynos/exynos5_usb_phy.c	Fri Aug  8 06:29:30 2014	(r269702)
@@ -43,13 +43,11 @@ __FBSDID("$FreeBSD$");
 #include <sys/watchdog.h>
 #include <sys/gpio.h>
 
-#include <dev/fdt/fdt_common.h>
 #include <dev/ofw/openfirm.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
 #include <machine/bus.h>
-#include <machine/fdt.h>
 #include <machine/cpu.h>
 #include <machine/intr.h>
 
@@ -158,8 +156,8 @@ vbus_on(struct usb_phy_softc *sc)
 	/* Power pin */
 	if ((len = OF_getproplen(node, "vbus-supply")) <= 0)
 		return (-1);
-	OF_getprop(node, "vbus-supply", &dts_value, len);
-	pin = fdt32_to_cpu(dts_value[0]);
+	OF_getencprop(node, "vbus-supply", dts_value, len);
+	pin = dts_value[0];
 
 	gpio_dev = devclass_get_device(devclass_find("gpio"), 0);
 	if (gpio_dev == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e46e4a.2cb1.29e4e203>