iMX8 SoC codec - single driver addressing two I2C devices.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8 SoC codec - single driver addressing two I2C devices.

Jump to solution
407 Views
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 Kudos
1 Solution
393 Views
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..

View solution in original post

0 Kudos
1 Reply
394 Views
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 Kudos