Skip to content

jakeday/surface-cameras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Surface Cameras

Support for the Surface Cameras under Linux.

Support

Device Front Camera Rear Camera
Surface Go IMX135 OV2740
Surface Go 2 IMX135 OV2740
Surface Laptop OV5693 OV8865
  • Rear Cameras have upstream drivers and need to be connected to the bridge.

Instructions

Compiling the Kernel from Source

  1. (Prep) Install the required packages for compiling the kernel:
sudo apt install build-essential binutils-dev libncurses5-dev libssl-dev ccache bison flex libelf-dev
  1. Clone the surface-cameras repo:
 git clone https://github.com/jakeday/surface-cameras.git ~/surface-cameras
  1. Clone the mainline stable kernel repo:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git ~/linux-stable
  1. Go into the linux-stable directory:
cd ~/linux-stable
  1. Checkout the version of the kernel you wish to target (replacing with your target version):
git checkout v5.y.z
  1. Apply the kernel patches from the surface-cameras repo:
for i in ~/surface-cameras/patches/[VERSION]/*.patch; do patch -p1 < $i; done
  1. Use config for kernel series (may need to manually change for your distro):
cp ~/surface-cameras/configs/[VERSION]/config .config
  1. Compile the kernel and headers (for ubuntu, refer to the build guide for your distro):
make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-linux-surface
  1. Install the headers, kernel and libc-dev:
sudo dpkg -i ../linux-headers-[VERSION].deb ../linux-image-[VERSION].deb ../linux-libc-dev-[VERSION].deb

Patching the Device DSDT

  1. (Prep) Install the required packages for patching the dsdt:
sudo apt install acpica-tools
  1. Create a working directory:
 mkdir ~/surface-dsdt
  1. Go into the working directory:
 cd ~/surface-dsdt
  1. Dump your current ACPI:
 sudo acpidump > acpidump.out
  1. Extract the ACPI parts:
 acpixtract acpidump.out
  1. Disassemble the DSDT:
 iasl -d DSDT.dat
  1. Patch the DSDT:
 patch -p1 < ~/surface-cameras/patches/dsdt/[DEVICE_FILE].patch
  1. Build the patched DSDT:
 iasl -tc DSDT.dsl
  1. Make a CPIO Archive to boot with patched DSDT
 mkdir -p kernel/firmware/acpi
 cp DSDT.aml kernel/firmware/acpi
 find kernel | cpio -H newc --create > acpi_override
 sudo cp acpi_override /boot
  1. Configure your bootloader to load the CPIO archive, normally by updating your grub config to add the path to the new acpi override.

Credits

kitakar5525

jhand2

drjscally

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published