ports/sysutils/read-edid/files/patch-get-edid_i2c.c
Alexey Dokuchaev 73966541c1 Add a port of read-edid utility, a pair of tools for reading the EDID from
a monitor.  It is mostly useful to read LCD matrix manufacturer and model.

WWW: http://www.polypux.org/projects/read-edid/

NB: TIMESTAMP line in distinfo should read as follows, but has to stay in
its current form due to a bug in the hook script:
TIMESTAMP (read-edid-3.0.2.tar.gz) = 1430271430
2016-08-20 18:43:29 +00:00

17 lines
433 B
C

--- get-edid/i2c.c.orig 2014-11-21 11:52:13 UTC
+++ get-edid/i2c.c
@@ -24,7 +24,13 @@ int open_i2c_dev(int i2cbus) {
char filename[16];
unsigned long funcs;
- sprintf(filename, "/dev/i2c-%d", i2cbus);
+ sprintf(filename,
+#if defined(__linux__)
+ "/dev/i2c-%d",
+#elif defined(__FreeBSD__)
+ "/dev/iic%d",
+#endif
+ i2cbus);
i2cfile = open(filename, O_RDWR);
if (i2cfile < 0 && errno == ENOENT) {