julbouln / tinydrm_it8951

kernel module for Waveshare it8951 based eink kits
23 stars 14 forks source link

tinydrm kernel module for Waveshare it8951 based eink kits.

Tested on raspberry pi zero w with kernel 4.19, only 6" panel is supported.

Compile

cd tinydrm_it8951
make

you can test it with

sudo sh utils/load.sh

Enable display at boot

Raspberry Pi

Beaglebone

You can now reboot, the eink panel will be the screen by default

Kernel module options

You should change the VCOM value to match your panel, eg for -2.04V:

modprobe it8951 vcom=-2040

I successfully got 24Mhz SPI clock on beaglebone, you can change default frequency:

modprobe it8951 spi_freq=24000000

Finally, the driver include an automatic waveform selector, you can disable it at module load and set a predefined mode:

modprobe it8951 update_mode=2

Where update_mode can be one of:

#define IT8951_MODE_INIT  0
#define IT8951_MODE_DU    1
#define IT8951_MODE_GC16  2
#define IT8951_MODE_GL16  3
#define IT8951_MODE_GLR16 4
#define IT8951_MODE_GLD16 5

You can change the waveform at any moment with a /sys entry (eg on BBB):

cat /sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.0/update_mode
echo 2 > /sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.0/update_mode

You can also set the refresh rate for ghosting (number of refresh before full refresh):

cat /sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.0/ghosting_refresh
echo 50 > /sys/devices/platform/ocp/48030000.spi/spi_master/spi0/spi0.0/ghosting_refresh