From 63158e2ee67a906d0868fad4c65d04207b4e0427 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 14 Aug 2017 15:06:55 -0700 Subject: [PATCH] st32mon: Define SPI_IOC_WR_MODE32 if it's missing On Goobuntu, the uapi copy of spidev.h doesnot contain SPI_IOC_WR_MODE32, however the kernel supports the IOCTL. To be able to build the tool outside of the ChromeOS chroot, define it if it's not available. Signed-off-by: Stefan Reinauer BRANCH=none TEST=make buildall -j outside of the chroot BUG=b:35567067 Change-Id: I04ec968e221c7d43f1bdb364a195d371370ec886 Reviewed-on: https://chromium-review.googlesource.com/614645 Commit-Ready: Stefan Reinauer Tested-by: Stefan Reinauer Reviewed-by: Martin Roth Reviewed-by: Vincent Palatin --- util/stm32mon.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/stm32mon.c b/util/stm32mon.c index 3448c88f75..116c115d2d 100644 --- a/util/stm32mon.c +++ b/util/stm32mon.c @@ -32,6 +32,14 @@ #include #include +/* + * Some Ubuntu versions do not export SPI_IOC_WR_MODE32 even though + * the kernel shipped on those supports it. + */ +#ifndef SPI_IOC_WR_MODE32 +#define SPI_IOC_WR_MODE32 _IOW(SPI_IOC_MAGIC, 5, __u32) +#endif + /* Monitor command set */ #define CMD_INIT 0x7f /* Starts the monitor */