This is an example demonstrating HID over I2C on HiKey Android reference board.
- Initialize your environment as described in http://source.android.com/source/initializing.html
- git clone https://android.googlesource.com/kernel/hikey-linaro
- cd hikey-linaro
- git checkout -b android-hikey-linaro-4.14 origin/android-hikey-linaro-4.14
- make ARCH=arm64 hikey_defconfig
- Enable HID over I2C by setting CONFIG_I2C_HID=y
- Copy device tree patch to kernel root directory and apply patch
- patch -p1 < ./android-hikey-linaro-4.14_hid-over-i2c.patch
- make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24
- Copy output to the AOSP hikey kernel directory (/kernel/hikey-linaro):
- Copy hi6220-hikey.dtb (arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb) to the hikey-kernel directory as file hi6220-hikey.dtb-4.14.
- Copy the Image file (arch/arm64/boot/Image.gz-dtb) to the hikey-kernel directory as file Image.gz-dtb-4.14.
- Compiling Android userspace image as described in https://source.android.com/setup/build/devices#620userspace