When is the best implementation of the I2C driver module on Linux?

I am currently dealing with two devices connected to the I2C bus in an embedded Linux system. I use the driver for the first device, the camera. For the second device, I successfully implemented a user space program that I can contact with the second device. So far, both devices seem to have coexisted successfully. However, almost all I2C devices have their own driver module. So, I am wondering what are the advantages of the driver module. I looked at the next thread ...

When should I write a Linux kernel module?

... but without a conclusion.

So what would be the advantage of writing an I2C driver module over user space implementation?

Regards, Stefan

+3
source share
1 answer

In your situation, you are probably not using the I2C driver module very well. If he did not break ....

The main reason I would like to enable the kernel module driver is when another kernel-mode driver is an I2C client or can be closely related to the kernel. One example of this is the WM8350 audio codec, which transmits audio data over the audio bus (I2S or AC97) and configuration (e.g., volume level) compared to the I2C.

The power management chip is another example of a chip that you want the core to be directly controlled.

, , I2C. (. /i 2c/summary.) I2C, , I2C. .

+2

Source: https://habr.com/ru/post/1740922/


All Articles