Skip to content

Instantly share code, notes, and snippets.

@fenrir-naru
Last active September 21, 2017 20:21
Show Gist options
  • Save fenrir-naru/95669cb8fcbf14c22e59 to your computer and use it in GitHub Desktop.
Save fenrir-naru/95669cb8fcbf14c22e59 to your computer and use it in GitHub Desktop.
How to install max310x driver for RasPi 3.12.26+
# modify Kconfig to change to tristate
# make driver
sudo make prepare
sudo make modules_prepare KERNELRELEASE=$(uname -r)
sudo make SUBDIRS=drivers/tty/serial modules
sudo make SUBDIRS=drivers/tty/serial modules_install
sudo mv /lib/modules/3.12.26/extra/* /lib/modules/3.12.26+/extra/
sudo rm -r /lib/modules/3.12.26
sudo depmod
# install driver
sudo modprobe max310x
sudo modprobe spi-config devices=bus=0:cs=0:modalias=max14830:speed=10000000:irq=0:force_release
# check gpio
cd /sys/class/gpio
echo 242 > export
echo out > gpio242/direction
for i in `seq 1 100`; do echo $(expr $i % 2) > gpio242/value && sleep 0.2; done
# check uart
sudo minicom -s
# /dev/ttyMAX0 Hardware/Software flow control: Off
# shutdown
sudo rmmod max310x
sudo rmmod spi-config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment