why is gpiochip for I2C PCF8575 only created if present during boot

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

why is gpiochip for I2C PCF8575 only created if present during boot

跳至解决方案
1,383 次查看
bap3ball
Contributor III

imx6sx hardware platform.

Linux version 3.14.52-1.1.

We have a platform in which some of the I2C PCF8575 GPIO expander devices located on the I2C bus are not present until after the system is booted. All of the potential devices are listed in the device tree and entries for each potential devices does show up in the /sys/bus/i2c/devices subfolders. However, only the only devices which show up in the /sys/class/gpio folder as a gpiochip<number> are ones that are powered on when the kernel boots.

On a previous platform that uses an embedded PowerPC CPU, gpiochip<number> nodes are created for all potential devices specified in the device tree regardless if they are present during boot or not.

Does anyone know if this an architecture difference in how I2C GPIO expanders are handled?

What would be the proper method to add the missing chips as gpio controllers chips after boot?

标签 (2)
0 项奖励
回复
1 解答
1,072 次查看
bap3ball
Contributor III

Turns out this is just the way the kernel now creates gpiochip's in the sysfs; the chip has to be discovered and not just in the device tree. My PowerPC system used an older version of Linux that created the gpiochip's based on device tree and not what was discovered. My solution was to remove the 8575 from device tree and access them as simple I2C devices (not as GPIO)

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,073 次查看
bap3ball
Contributor III

Turns out this is just the way the kernel now creates gpiochip's in the sysfs; the chip has to be discovered and not just in the device tree. My PowerPC system used an older version of Linux that created the gpiochip's based on device tree and not what was discovered. My solution was to remove the 8575 from device tree and access them as simple I2C devices (not as GPIO)

0 项奖励
回复
1,071 次查看
b36401
NXP Employee
NXP Employee

I can suggest to try to perform early initialization of GPIO similar to UART early initialization.

Also you can refer this document regarding to early userspace support:

https://www.kernel.org/doc/readme/Documentation-early-userspace-README

Have a great day,                                                                                                                                                                  

Victor                                                                                                                                                                             

                                                                                                                                                                                   

-----------------------------------------------------------------------------------------------------------------------                                                            

Note: If this post answers your question, please click the Correct Answer button. Thank you!                                                                                       

-----------------------------------------------------------------------------------------------------------------------                                                            

0 项奖励
回复