Description: Skip the build if CONFIG_I2C is disabled
Author: Stephen Kitt <skitt@debian.org>

--- a/dkms.conf
+++ b/dkms.conf
@@ -14,3 +14,8 @@
   echo "BACKLIGHT_CLASS_DEVICE disabled in this kernel, not building module." >&2
   BUILD_EXCLUSIVE_ARCH="^do_not_build$"
 fi
+# Don't build module when I2C is disabled
+if ! grep -q "^CONFIG_I2C=[ym]$" "$kernel_source_dir/.config" 2>/dev/null ; then
+  echo "I2C disabled in this kernel, not building module." >&2
+  BUILD_EXCLUSIVE_ARCH="^do_not_build$"
+fi
