Linux I2C notes

I2C has Master and Slave.

Master could be SoC I2C controller.

Slave could be EEPROM, LCD, Audio Codec.

 

So Linux should provide master driver and slave driver. 

Master driver: how to send cmd/data to slave device

Slave driver: how to access slave register, data.

 

borrow a picture from https://blog.csdn.net/wangpengqi/article/details/17711165

 

Linux I2C notes_第1张图片

In this picture, Client is slave, adaptor is master. Then everything is easy to understand.

To add Master/adaptor, you need add it in the device tree based on the SoC spec info.

To add Slave/client, you need add it in the device tree as subnode of master/adaptor node. 

你可能感兴趣的:(linux)