I want to use SPIDEV (https://www.kernel.org/doc/Documentation/spi/spidev) via direct I/O access from the userland. I believe that I have the legal right to commercialize an application using SPIDEV run by the Linux Kernel without the need to disclose the source code of my application, thus keeping it private.

Would you please confirm my understanding is correct?

1 Answer 1


It is the Linux' community's understanding that userland code is not affected by the Kernel's GPL license. In particular:

  • interacting with the Kernel through syscalls is fine
  • by extension, interacting with the Kernel through special filesystem objects (device files, procfs, sysfs) is also fine

This understanding is codified in the Linux-syscall-note:

NOTE! This copyright does *not* cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does *not* fall under the heading of "derived work". […]

In that paragraph “this copyright” refers to the Linux Kernel copyright.

I have no particular understanding of what SPI is, but it seems that the SPIDEV driver merely exposes some virtual devices in the filesystem, with which your userland code can interact with syscalls such as read() or ioctl(). Thus, having a program that interacts with SPIDEV filesystem objects will have exactly the same GPL consequences as a program that interacts with /dev/tty or /dev/null fileystem objects – no compliance obligations whatsoever.

  • 4
    I agree with the answer, but an important distinction is that licenses of any userland libraries will affect your program. Accessing through raw ioctl calls is fine, but for example python-spidev and spidev-lib helper libraries are both GPL-licensed.
    – jpa
    Mar 25, 2022 at 14:50
  • 1
    @jpa briefly curious, it looks like python-spidev is actually MIT-licensed, though there's confusingly two projects which claim to represent it, PyPi's spidev looks fairly authoritative pypi.org/project/spidev and the latter is derived from the former a-la GitHub Fork github.com/doceme/py-spidev github.com/OnionIoT/python-spidev
    – ti7
    Mar 25, 2022 at 18:16
  • 1
    @ti7 Yeah, looks like python-spidev is GPL licensed and py-spidev is MIT licensed, and they share some common ancestry.
    – jpa
    Mar 26, 2022 at 7:51
  • Thank you all for the great comments. It is beneficial to read you all to navigate the world of open source and Linux in production.
    – Mickael T
    Mar 28, 2022 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.