[igt-dev] [PATCH i-g-t v1 5/6] tests/i915/i915_pm_rpm.c: Add FreeBSD I/O iic header

Jake Freeland jake at technologyfriends.net
Fri Oct 7 23:27:56 UTC 2022


FreeBSD uses iic instead of i2c for I/O management.
This patch includes the FreeBSD iic header and uses
a macro substitution to convert the i2c addr member
into the iic slave member.

Signed-off-by: Jake Freeland <jfree at freebsd.org>
---
 tests/i915/i915_pm_rpm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index e95875dc..1ff69a06 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -40,8 +40,13 @@
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#if defined(__linux__)
 #include <linux/i2c.h>
 #include <linux/i2c-dev.h>
+#elif defined(__FreeBSD__)
+#include <dev/iicbus/iic.h>
+#define	addr	slave
+#endif
 
 #include <drm.h>
 
-- 
2.37.3



More information about the igt-dev mailing list