diff --git a/devel/v4l/patchwork//drivers/media/platform/vivid/vivid-tpg.h b/utils/v4l2-ctl/vivid-tpg.h
index 8ef3e52ba3be..76c373a7b4f1 100644
--- a/devel/v4l/patchwork//drivers/media/platform/vivid/vivid-tpg.h
+++ b/utils/v4l2-ctl/vivid-tpg.h
@@ -20,13 +20,48 @@
 #ifndef _VIVID_TPG_H_
 #define _VIVID_TPG_H_
 
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/random.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
 #include <linux/videodev2.h>
 
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+typedef __u32 u32;
+typedef __u16 u16;
+typedef __s16 s16;
+typedef __u8 u8;
+typedef __s8 s8;
+
+#define __packed __attribute__((packed))
+#define pr_info printf
+#define noinline
+
+static inline void vfree(void *p)
+{
+	free(p);
+}
+
+static inline void *vzalloc(unsigned long size)
+{
+	return calloc(1, size);
+}
+
+#define clamp(val, min, max) ({			\
+	typeof(val) __val = (val);		\
+	typeof(min) __min = (min);		\
+	typeof(max) __max = (max);		\
+	(void) (&__val == &__min);		\
+	(void) (&__val == &__max);		\
+	__val = __val < __min ? __min: __val;	\
+	__val > __max ? __max: __val; })
+
+static inline u32 prandom_u32_max(u32 ep_ro)
+{
+	return rand() % ep_ro;
+}
+
 #include "vivid-tpg-colors.h"
 
 enum tpg_pattern {
