Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/dev/spidev2.1 cannot be used in UP Board #6

Open
pazeshun opened this issue Oct 18, 2019 · 1 comment
Open

/dev/spidev2.1 cannot be used in UP Board #6

pazeshun opened this issue Oct 18, 2019 · 1 comment

Comments

@pazeshun
Copy link

I want to use /dev/spidev2.1 in UP Board, which is written here.
However, this cannot be used because the chip-select pin doesn't work.
How can I make /dev/spidev2.1 work?

@pazeshun
Copy link
Author

Details

I installed Ubuntu 16.04 and kernel 4.15.0 for UP by following https://wiki.up-community.org/Ubuntu#Install_Ubuntu_kernel_4.15.0_for_UP_from_PPA_on_Ubuntu_16.04:

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
$ uname -a
Linux *** 4.15.0-37-generic #40~upboard03-Ubuntu SMP Wed Dec 12 16:21:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

However,

$ ls -l /dev/spidev2.1
ls: cannot access '/dev/spidev2.1': No such file or directory

I found that /dev/spidev2.1 is disabled unless the module parameter up_board.spidev1 is set at https://github.com/emutex/ubilinux-kernel/blob/upboard-4.9/drivers/platform/x86/up_board.c#L45-L47.
So I added up_board.spidev1=Y to the kernel command line (GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub) and got /dev/spidev2.1.
But communication via /dev/spidev2.1 failed due to the chip-selection pin (GPIO22) didn't become 0V.

I found old code modifies SPI module to work /dev/spidev2.1, but this code is lost in the latest kernel:
cb1756d
Instead, I found the following commit to support GPIO chip select (required for /dev/spidev2.1), but I couldn't understand how to use this feature:
99f499c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant