aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-02-19 08:18:16 +0100
committerLubomir Rintel <lkundrak@v3.sk>2019-04-19 07:28:33 +0200
commitfa3fffed6ff4a8e2aad7fc67cd9065a2ff3fd0c8 (patch)
treede67beac0121eca2c7b4272d4dc20b5c70eaff71
parent2a2126bfd9a0fd89d78a0a4b048705433154ea58 (diff)
downloadopenfirmware-fa3fffed6ff4a8e2aad7fc67cd9065a2ff3fd0c8.tar.gz
olpc: link the /camera and /image-sensor into a device graph
This will tell the V4L drivers about how are the devices related, following the bindings/graph.txt binding.
-rw-r--r--cpu/arm/olpc/gpio-i2c.fth9
-rw-r--r--dev/olpc/mmp2camera/loadpkg.fth12
2 files changed, 21 insertions, 0 deletions
diff --git a/cpu/arm/olpc/gpio-i2c.fth b/cpu/arm/olpc/gpio-i2c.fth
index c5fd19fc..05c3201f 100644
--- a/cpu/arm/olpc/gpio-i2c.fth
+++ b/cpu/arm/olpc/gpio-i2c.fth
@@ -78,6 +78,15 @@ dev /
0 0 encode-bytes cam-pwr-gpio# 1 encode-gpio " powerdown-gpios" property
0 0 encode-bytes cam-rst-gpio# 1 encode-gpio " reset-gpios" property
+
+ new-device
+ " port" device-name
+ new-device
+ " endpoint" device-name
+ h# 1 " hsync-active" integer-property
+ h# 1 " vsync-active" integer-property
+ finish-device
+ finish-device
finish-device
finish-device
diff --git a/dev/olpc/mmp2camera/loadpkg.fth b/dev/olpc/mmp2camera/loadpkg.fth
index b5930c9d..17b321e5 100644
--- a/dev/olpc/mmp2camera/loadpkg.fth
+++ b/dev/olpc/mmp2camera/loadpkg.fth
@@ -62,7 +62,19 @@
warning !
fload ${BP}/dev/olpc/mmp2camera/ccic.fth
fload ${BP}/dev/olpc/cameratest.fth
+
+ new-device
+ " port" device-name
+ new-device
+ " endpoint" device-name
+ " /image-sensor/port/endpoint" encode-phandle " remote-endpoint" property
+ finish-device
+ finish-device
end-package
: probe-image-sensor ( -- )
" /camera" open-dev close-dev
;
+
+" /image-sensor/port/endpoint" find-device
+ " /camera/port/endpoint" encode-phandle " remote-endpoint" property
+device-end