首页 > 解决方案 > Where/How should I define my SPI driver pins if I pretend to load the driver manually as a module

问题描述

I am writing here because I am having some problems understanding some key concepts regarding kernel/drivers development. First, I am going to try to describe what I want to achieve: Develop a driver that uses the SPI to communicate receiving the payload from user space (I cannot use spidev because I pretend to transparently add some info to the payload before sending it). I want to load the module manually (insmod).

The problem I am seeing: I do not know where or how to specify my interface. If I define the interface within the device tree, is it mandatory to include the compatible field? I ask this because the driver will not be included within the kernel modules as it starts up... Maybe there is not a problem with it. In the examples, I found about spi they only speak about the BUS, Chip Select... but they do not mention MISO and MOSI, so I guess these must be defined by the device tree or maybe since you specify the bus the definition of the rest of the pins is straight forward... I would like to understand this.

Thanks in advance. Best regards, Fulgo.

标签: linuxdriverlinux-device-driverspidevice-tree

解决方案


推荐阅读