iMX8 SoC codec - single driver addressing two I2C devices.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

iMX8 SoC codec - single driver addressing two I2C devices.

跳至解决方案
1,050 次查看
edwardtyrrell
Senior Contributor I

Hi,

We are developing a SAI codec driver based on the WN8523 and need to be able to address a second I2C device during wm8523_i2c_probe(). There are two codec chips connected in parallel to the one SAI port and both require a small I2C setup before use after which no more commands are sent.  

The function   wm8523_i2c_probe (struct i2c_client *i2c, const struct i2c_device_id *id)  only supplies one I2C device that being declared in the device tree; if a second I2C node was added would it be possible to address it within the probe function?

Thanks.

0 项奖励
回复
1 解答
1,036 次查看
edwardtyrrell
Senior Contributor I

Solved for now.. 

Use 2x GPIO to select I2C addresses (one per codec chip) inside init(). Select one device with GPIO connected to device h/w address pin and initialise. Repeat the process with the other GPIO address line for the other chip. One actual DTB address but initialising two chips..

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,037 次查看
edwardtyrrell
Senior Contributor I

Solved for now.. 

Use 2x GPIO to select I2C addresses (one per codec chip) inside init(). Select one device with GPIO connected to device h/w address pin and initialise. Repeat the process with the other GPIO address line for the other chip. One actual DTB address but initialising two chips..

0 项奖励
回复