Git Product home page Git Product logo

rpi-touchscreen-mainline's Introduction

Raspberry Pi Official 7" Touchscreen on Mainline Linux Kernel

The mainline kernel includes a panel driver for the 7" touchscreen. A device tree diff to enable it exists. An overlay was planned, but it's still nowhere to be found. Plus, the touch input and backlight drivers are not included in the mainline kernel.

Turns out, it's really easy to compile the input/backlight drivers out of tree! They don't depend on anything that's not upstreamed.

This repo includes copies of these modules and a device tree.

Kernel Modules

Installation

make modules
sudo make install

Loading

sudo insmod /lib/modules/$(uname -r)/extra/rpi-ft5406.ko.gz
sudo insmod /lib/modules/$(uname -r)/extra/rpi_backlight.ko.gz

Flattened Device Tree

Recompilation

dtc -I dts -O dtb -o upstream.dtb upstream.dts

The included device tree is for the Pi 3 B, if you're on 2 or whatever, you'll need to make your own:

  • Decompile the upstream dtb for your Pi (dtc -I dtb -O dts ...)
  • Add labels:
    • firmware { -> firmware: firmware {
    • gpio@7e200000 { -> gpio: gpio@7e200000 {
    • dsi@7e700000 { -> dsi1: dsi@7e700000 {
  • Add the i2c_dsi: i2c section and modify the dsi1: dsi@7e700000 section (don't forget to remove status = "disabled";) like in that diff, using appropriate gpio numbers (they're shown there as &i2c_dsi blocks for various Pis' separate files, just take the gpio numbers and modify them inline in the i2c_dsi: i2c section)
  • Add the rpi_ft5406 and rpi_backlight sections from my upstream.dts
  • Finally, compile!

Look at the diff linked above, it has different numbers for different Pis.

Usage

Depends on your distro and way of booting.

For netbooting from U-Boot, something like this:

tftp ${kernel_addr_r} /Image
tftp ${fdt_addr_r} /upstream.dtb
tftp ${ramdisk_addr_r} /initramfs-linux.img
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}

For loading from the firmware, in config.txt:

device_tree=upstream.dtb

rpi-touchscreen-mainline's People

Contributors

valpackett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vianpl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.