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,382件の閲覧回数
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,071件の閲覧回数
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,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 件の賞賛
返信
1,070件の閲覧回数
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 件の賞賛
返信